@bigbinary/neeto-editor 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import*as e from"react";import t,{createContext as n,useContext as r,useState as i,useEffect as o,forwardRef as s,cloneElement as a,useLayoutEffect as l,useRef as u,useCallback as c,useImperativeHandle as d}from"react";import*as p from"react-dom";import h,{createPortal as f,flushSync as m}from"react-dom";import g from"highlight.js/lib/languages/arduino";import y from"highlight.js/lib/languages/bash";import b from"highlight.js/lib/languages/c";import v from"highlight.js/lib/languages/cpp";import w from"highlight.js/lib/languages/csharp";import x from"highlight.js/lib/languages/css";import M from"highlight.js/lib/languages/diff";import D from"highlight.js/lib/languages/go";import k from"highlight.js/lib/languages/graphql";import E from"highlight.js/lib/languages/ini";import C from"highlight.js/lib/languages/java";import T from"highlight.js/lib/languages/javascript";import O from"highlight.js/lib/languages/json";import S from"highlight.js/lib/languages/kotlin";import A from"highlight.js/lib/languages/less";import N from"highlight.js/lib/languages/lua";import _ from"highlight.js/lib/languages/makefile";import j from"highlight.js/lib/languages/markdown";import I from"highlight.js/lib/languages/objectivec";import L from"highlight.js/lib/languages/perl";import z from"highlight.js/lib/languages/php";import P from"highlight.js/lib/languages/php-template";import F from"highlight.js/lib/languages/plaintext";import R from"highlight.js/lib/languages/python";import B from"highlight.js/lib/languages/python-repl";import U from"highlight.js/lib/languages/r";import H from"highlight.js/lib/languages/ruby";import $ from"highlight.js/lib/languages/rust";import V from"highlight.js/lib/languages/scss";import W from"highlight.js/lib/languages/shell";import q from"highlight.js/lib/languages/sql";import Y from"highlight.js/lib/languages/swift";import Q from"highlight.js/lib/languages/typescript";import K from"highlight.js/lib/languages/vbnet";import G from"highlight.js/lib/languages/wasm";import J from"highlight.js/lib/languages/xml";import X from"highlight.js/lib/languages/yaml";import Z from"highlight.js/lib/core";import ee from"highlight.js/lib/common";var te=[],ne=[];function re(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",i=!0===t.singleTag,o="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var s=te.indexOf(o);-1===s&&(s=te.push(o)-1,ne[s]={}),n=ne[s]&&ne[s][r]?ne[s][r]:ne[s][r]=a()}else n=a();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function a(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),i=0;i<n.length;i++)e.setAttribute(n[i],t.attributes[n[i]]);var s="prepend"===r?"afterbegin":"beforeend";return o.insertAdjacentElement(s,e),e}}function ie(){return ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ie.apply(this,arguments)}function oe(e){this.content=e}function se(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let e=0;i.text[e]==o.text[e];e++)n++;return n}if(i.content.size||o.content.size){let e=se(i.content,o.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function ae(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let e=ae(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}re('@charset "UTF-8";\n@import url("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/night-owl.min.css");\n/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n/* Document\n ========================================================================== */\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n/* Sections\n ========================================================================== */\n/**\n * Remove the margin in all browsers.\n */\nbody {\n margin: 0;\n}\n/**\n * Render the `main` element consistently in IE.\n */\nmain {\n display: block;\n}\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\n/* Grouping content\n ========================================================================== */\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n/* Text-level semantics\n ========================================================================== */\n/**\n * Remove the gray background on active links in IE 10.\n */\na {\n background-color: transparent;\n}\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted; /* 2 */\n}\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\nb,\nstrong {\n font-weight: bolder;\n}\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n/**\n * Add the correct font size in all browsers.\n */\nsmall {\n font-size: 80%;\n}\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * all browsers.\n */\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\nsub {\n bottom: -0.25em;\n}\nsup {\n top: -0.5em;\n}\n/* Embedded content\n ========================================================================== */\n/**\n * Remove the border on images inside links in IE 10.\n */\nimg {\n border-style: none;\n}\n/* Forms\n ========================================================================== */\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\nbutton,\ninput {\n /* 1 */\n overflow: visible;\n}\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\nbutton,\nselect {\n /* 1 */\n text-transform: none;\n}\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\nbutton,\n[type=button],\n[type=reset],\n[type=submit] {\n -webkit-appearance: button;\n}\n/**\n * Remove the inner border and padding in Firefox.\n */\nbutton::-moz-focus-inner,\n[type=button]::-moz-focus-inner,\n[type=reset]::-moz-focus-inner,\n[type=submit]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n/**\n * Restore the focus styles unset by the previous rule.\n */\nbutton:-moz-focusring,\n[type=button]:-moz-focusring,\n[type=reset]:-moz-focusring,\n[type=submit]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n/**\n * Correct the padding in Firefox.\n */\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * `fieldset` elements in all browsers.\n */\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\nprogress {\n vertical-align: baseline;\n}\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\ntextarea {\n overflow: auto;\n}\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n[type=checkbox],\n[type=radio] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n[type=number]::-webkit-inner-spin-button,\n[type=number]::-webkit-outer-spin-button {\n height: auto;\n}\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n[type=search] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n[type=search]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n/* Interactive\n ========================================================================== */\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\ndetails {\n display: block;\n}\n/*\n * Add the correct display in all browsers.\n */\nsummary {\n display: list-item;\n}\n/* Misc\n ========================================================================== */\n/**\n * Add the correct display in IE 10+.\n */\ntemplate {\n display: none;\n}\n/**\n * Add the correct display in IE 10.\n */\n[hidden] {\n display: none;\n}\nbutton {\n background-color: transparent;\n background-image: none;\n}\nbody {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.3;\n color: #222;\n}\nbody *,\nbody *::after,\nbody *::before {\n box-sizing: border-box;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n@-webkit-keyframes shake {\n 0% {\n transform: translateX(0);\n }\n 10% {\n transform: translateX(-4px);\n }\n 20% {\n transform: translateX(4px);\n }\n 30% {\n transform: translateX(-4px);\n }\n 40% {\n transform: translateX(4px);\n }\n 50% {\n transform: translateX(-4px);\n }\n 60% {\n transform: translateX(4px);\n }\n 70% {\n transform: translateX(-4px);\n }\n 80% {\n transform: translateX(4px);\n }\n 90% {\n transform: translateX(-4px);\n }\n 100% {\n transform: translateX(0);\n }\n}\n@keyframes shake {\n 0% {\n transform: translateX(0);\n }\n 10% {\n transform: translateX(-4px);\n }\n 20% {\n transform: translateX(4px);\n }\n 30% {\n transform: translateX(-4px);\n }\n 40% {\n transform: translateX(4px);\n }\n 50% {\n transform: translateX(-4px);\n }\n 60% {\n transform: translateX(4px);\n }\n 70% {\n transform: translateX(-4px);\n }\n 80% {\n transform: translateX(4px);\n }\n 90% {\n transform: translateX(-4px);\n }\n 100% {\n transform: translateX(0);\n }\n}\n@-webkit-keyframes fade-in {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes spin {\n 0% {\n transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.ne-dropdown__popup {\n width: auto;\n max-height: 445px;\n max-width: 360px;\n overflow-y: auto;\n background-color: #ffffff;\n border-radius: 2px;\n border: thin solid #f8f9f9;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n padding: 4px 0;\n z-index: 99999;\n}\n.ne-dropdown__popup li,\n.ne-dropdown__popup .ne-dropdown--item {\n display: flex;\n cursor: pointer;\n position: relative;\n white-space: nowrap;\n transition: all 0.3s ease-in-out;\n font-size: 14px;\n font-weight: 400;\n color: #2f3941;\n padding: 8px 40px 8px 16px;\n text-decoration: none;\n outline-color: transparent;\n}\n.ne-dropdown__popup li.disabled,\n.ne-dropdown__popup .ne-dropdown--item.disabled {\n cursor: not-allowed;\n color: #87929d;\n}\n.ne-dropdown__popup li:hover, .ne-dropdown__popup li:focus,\n.ne-dropdown__popup .ne-dropdown--item:hover,\n.ne-dropdown__popup .ne-dropdown--item:focus {\n background-color: #e9ebed;\n}\n.ne-dropdown__popup li.loading:not(.active):after,\n.ne-dropdown__popup .ne-dropdown--item.loading:not(.active):after {\n content: "";\n position: absolute;\n right: 16px;\n top: 0;\n bottom: 0;\n margin: auto;\n width: 16px;\n height: 16px;\n display: block;\n border-radius: 50%;\n border: solid 2px #e9ebed;\n border-top-color: #1b1f23;\n border-left-color: #1b1f23;\n -webkit-animation: theme("animation.spin");\n animation: theme("animation.spin");\n}\n.ne-dropdown__popup li.active,\n.ne-dropdown__popup .ne-dropdown--item.active {\n background-color: #2f3941;\n color: #ffffff;\n}\n.ne-avatar--container {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 2px;\n position: relative;\n}\n.ne-avatar--container.ne-avatar--container-round {\n border-radius: 999px;\n}\n.ne-avatar--container .ne-avatar__text {\n font-weight: 600;\n text-align: center;\n text-transform: capitalize;\n font-size: 10px;\n color: #68737d;\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-medium {\n font-size: 12px;\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-large {\n font-size: 18px;\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-xlarge {\n font-size: 24px;\n}\n.ne-avatar--container .ne-avatar__status {\n position: absolute;\n right: 0;\n top: 0;\n width: 0.4rem;\n height: 0.4rem;\n background-color: white;\n border: 0.5px solid white;\n border-radius: 999px;\n transform: translateX(-40%);\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-medium {\n width: 0.465rem;\n height: 0.465rem;\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-large {\n width: 0.563rem;\n height: 0.563rem;\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-xlarge {\n width: 0.75rem;\n height: 0.75rem;\n transform: translateX(-65%);\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-square {\n transform: translate(25%, -25%);\n}\n.ne-avatar--container .ne-avatar__status.online {\n background-color: #00ba88;\n}\n.ne-avatar--container .ne-avatar__status.idle {\n background-color: #f3cd82;\n}\n.ne-avatar--container .ne-avatar__status.offline {\n background-color: #d8dcde;\n}\n.ne-avatar--container .ne-avatar {\n display: inline-block;\n border-radius: 2px;\n height: 1.5rem;\n width: 1.5rem;\n}\n.ne-avatar--container .ne-avatar.hidden {\n display: none;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--medium {\n height: 2rem;\n width: 2rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--large {\n height: 2.5rem;\n width: 2.5rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--xlarge {\n height: 4rem;\n width: 4rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--round {\n border-radius: 999px;\n}\n.ne-tab__wrapper {\n width: 100%;\n border-bottom: 1px solid #d8dcde;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n}\n.ne-tab__wrapper--size-large .ne-tab {\n font-size: 20px;\n padding-left: 12px;\n padding-right: 12px;\n}\n.ne-tab__wrapper--underline-none {\n border-bottom: none;\n}\n.ne-tab__wrapper--underline-none .ne-tab::before {\n display: none;\n}\n.ne-tab {\n color: #87929d;\n font-weight: 600;\n font-size: 14px;\n line-height: 1;\n padding: 12px 8px;\n transition: all 0.3s ease-in-out;\n position: relative;\n cursor: pointer;\n text-decoration: none;\n outline: none;\n}\n.ne-tab:hover, .ne-tab:focus, .ne-tab:focus-visible, .ne-tab:active {\n text-decoration: none;\n outline: none;\n}\n.ne-tab__icon {\n margin-right: 12px;\n}\n.ne-tab svg {\n width: 16px;\n height: 16px;\n}\n.ne-tab:hover {\n color: #68737d;\n}\n.ne-tab:before {\n content: "";\n position: absolute;\n width: 100%;\n height: 1px;\n background-color: transparent;\n left: 0;\n right: 0;\n bottom: -1px;\n transition: all 0.3s ease-in-out;\n}\n.ne-tab.active {\n color: #2f3941;\n}\n.ne-tab.active:before {\n background-color: #2f3941;\n}\n.ne-btn {\n display: inline-flex;\n align-items: center;\n font-size: 14px;\n font-weight: 500;\n border-radius: 2px;\n line-height: 1.2;\n transition: all 0.3s ease-in-out;\n border: none;\n cursor: pointer;\n padding: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n padding: 4px 8px;\n min-height: 28px;\n letter-spacing: -0.15px;\n outline: none;\n}\n.ne-btn--icon-only {\n padding-left: 6px;\n padding-right: 6px;\n}\n.ne-btn:focus, .ne-btn:focus-visible {\n outline: none;\n}\n.ne-btn:hover {\n text-decoration: none;\n}\n.ne-btn.disabled {\n cursor: not-allowed;\n opacity: 0.4;\n}\n.ne-btn .ne-btn__icon:last-child:not(:first-child),\n.ne-btn .ne-btn__spinner:last-child:not(:first-child) {\n margin-left: 8px;\n}\n.ne-btn--icon-left {\n flex-direction: row-reverse;\n}\n.ne-btn--icon-left .ne-btn__icon:last-child:not(:first-child),\n.ne-btn--icon-left .ne-btn__spinner:last-child:not(:first-child) {\n margin-right: 8px;\n margin-left: 0;\n}\n.ne-btn__icon,\n.ne-btn__spinner,\n.ne-btn__spinner-wrapper {\n color: inherit;\n}\n.ne-btn__icon svg,\n.ne-btn__spinner svg,\n.ne-btn__spinner-wrapper svg {\n color: inherit !important;\n}\n.ne-btn--width-full {\n width: 100% !important;\n justify-content: center;\n}\n.ne-btn--size-large {\n font-size: 16px;\n padding: 6px 12px;\n min-height: 32px;\n}\n.ne-btn--size-large.ne-btn--icon-only {\n padding-left: 8px;\n padding-right: 8px;\n}\n.ne-btn--style-primary {\n color: #ffffff;\n background-color: #2f3941;\n}\n.ne-btn--style-primary:hover:not(:disabled), .ne-btn--style-primary:active {\n color: #ffffff;\n background-color: #49545c;\n}\n.ne-btn--style-primary:focus-visible {\n color: #ffffff;\n box-shadow: 0 0 0 3px #e5e5e5;\n}\n.ne-btn--style-secondary {\n color: #2f3941;\n background-color: #e9ebed;\n}\n.ne-btn--style-secondary:hover:not(:disabled), .ne-btn--style-secondary:active {\n color: #2f3941;\n background-color: #c2c8cc;\n}\n.ne-btn--style-secondary:focus-visible {\n color: #2f3941;\n box-shadow: 0 0 0 3px #e5e5e5;\n}\n.ne-btn--style-text {\n color: #2f3941;\n}\n.ne-btn--style-text:hover:not(:disabled), .ne-btn--style-text:active {\n color: #2f3941;\n background-color: #e9ebed;\n}\n.ne-btn--style-text:focus-visible {\n color: #2f3941;\n box-shadow: 0 0 0 3px #e5e5e5;\n}\n.ne-btn--style-link {\n color: #5e5ce6;\n min-height: initial;\n padding: 0;\n}\n.ne-btn--style-link:hover:not(:disabled), .ne-btn--style-link:active, .ne-btn--style-link:focus {\n opacity: 0.8;\n color: #5e5ce6;\n}\n.ne-btn--style-link:focus-visible {\n color: #1c1aa9;\n}\n.ne-btn--style-danger {\n color: #f56a58;\n background-color: #ffefed;\n}\n.ne-btn--style-danger:hover:not(:disabled), .ne-btn--style-danger:active {\n color: #f56a58;\n background-color: #ffe4e0;\n}\n.ne-btn--style-danger:focus-visible {\n color: #f56a58;\n box-shadow: 0 0 0 3px #ffe4e0;\n}\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0;\n}\n[data-tippy-root] {\n max-width: calc(100vw - 10px);\n}\n.tippy-box {\n position: relative;\n background-color: #2f3941;\n color: #ffffff;\n border-radius: 2px;\n font-size: 12px;\n line-height: 1.4;\n outline: 0;\n transition-property: transform, visibility, opacity;\n}\n.tippy-box[data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n.tippy-box[data-placement^=top] > .tippy-arrow:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top;\n}\n.tippy-box[data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n.tippy-box[data-placement^=bottom] > .tippy-arrow:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom;\n}\n.tippy-box[data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n.tippy-box[data-placement^=left] > .tippy-arrow:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left;\n}\n.tippy-box[data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n.tippy-box[data-placement^=right] > .tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right;\n}\n.tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);\n}\n.tippy-arrow {\n width: 16px;\n height: 16px;\n color: #2f3941;\n}\n.tippy-arrow:before {\n content: "";\n position: absolute;\n border-color: transparent;\n border-style: solid;\n}\n.tippy-content {\n position: relative;\n padding: 5px 9px;\n z-index: 1;\n}\n.tippy-box[data-placement^=top] > .tippy-svg-arrow {\n bottom: 0;\n}\n.tippy-box[data-placement^=top] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=top] > .tippy-svg-arrow > svg {\n top: 16px;\n transform: rotate(180deg);\n}\n.tippy-box[data-placement^=bottom] > .tippy-svg-arrow {\n top: 0;\n}\n.tippy-box[data-placement^=bottom] > .tippy-svg-arrow > svg {\n bottom: 16px;\n}\n.tippy-box[data-placement^=left] > .tippy-svg-arrow {\n right: 0;\n}\n.tippy-box[data-placement^=left] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=left] > .tippy-svg-arrow > svg {\n transform: rotate(90deg);\n top: calc(50% - 3px);\n left: 13px;\n}\n.tippy-box[data-placement^=right] > .tippy-svg-arrow {\n left: 0;\n}\n.tippy-box[data-placement^=right] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=right] > .tippy-svg-arrow > svg {\n transform: rotate(-90deg);\n top: calc(50% - 3px);\n right: 13px;\n}\n.tippy-svg-arrow {\n width: 16px;\n height: 16px;\n fill: #2f3941;\n text-align: initial;\n}\n.tippy-svg-arrow,\n.tippy-svg-arrow > svg {\n position: absolute;\n}\n.tippy-svg-arrow > svg > path {\n fill: #2f3941;\n}\n.tippy-box[data-theme~=light] .tippy-svg-arrow > svg > path {\n fill: #ffffff;\n}\n.tippy-box[data-theme~=light] {\n color: #2f3941;\n box-shadow: 0 0 20px 4px rgba(154, 161, 177, 0.15), 0 4px 80px -8px rgba(36, 40, 47, 0.25), 0 4px 4px -2px rgba(91, 94, 105, 0.15);\n background-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=top] > .tippy-arrow:before {\n border-top-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=bottom] > .tippy-arrow:before {\n border-bottom-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=left] > .tippy-arrow:before {\n border-left-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=right] > .tippy-arrow:before {\n border-right-color: #ffffff;\n}\n.tippy-box[data-theme~=light] > .tippy-backdrop {\n background-color: #ffffff;\n}\n.tippy-box[data-theme~=light] > .tippy-svg-arrow {\n fill: #ffffff;\n}\n.ne-input__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n flex-grow: 1;\n}\n.ne-input__wrapper .ne-label {\n margin-bottom: 4px;\n}\n.ne-input__wrapper .ne-input {\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n font-size: 14px;\n line-height: 1.6;\n transition: all 0.3s ease-in-out;\n border-radius: 2px;\n border: thin solid #c2c8cc;\n background-color: #ffffff;\n color: #2f3941;\n overflow: hidden;\n}\n.ne-input__wrapper .ne-input.ne-input--textarea {\n padding: 8px;\n}\n.ne-input__wrapper .ne-input input,\n.ne-input__wrapper .ne-input textarea {\n width: 100%;\n background-color: transparent;\n color: inherit;\n border: none;\n font-size: inherit;\n line-height: inherit;\n box-shadow: none;\n outline: none;\n}\n.ne-input__wrapper .ne-input input::-moz-placeholder, .ne-input__wrapper .ne-input textarea::-moz-placeholder {\n color: #c2c8cc;\n}\n.ne-input__wrapper .ne-input input::placeholder,\n.ne-input__wrapper .ne-input textarea::placeholder {\n color: #c2c8cc;\n}\n.ne-input__wrapper .ne-input input:focus,\n.ne-input__wrapper .ne-input textarea:focus {\n outline-color: transparent;\n}\n.ne-input__wrapper .ne-input input {\n padding: 8px;\n}\n.ne-input__wrapper .ne-input textarea {\n padding: 0;\n max-height: 224px;\n overflow-y: auto;\n}\n.ne-input__wrapper .ne-input:focus-within:not(.ne-input--naked, .ne-input--error) {\n border-color: #2f3941;\n box-shadow: 0px 0px 0px 3px #e9ebed;\n}\n.ne-input__wrapper .ne-input:hover:not(.ne-input--naked, .ne-input--error, .ne-input--disabled) {\n border-color: #49545c;\n}\n.ne-input__wrapper .ne-input.ne-input--error {\n border-color: #f56a58;\n}\n.ne-input__wrapper .ne-input.ne-input--error:focus-within:not(.ne-input--naked) {\n box-shadow: 0 0 0 3px #ffefed;\n}\n.ne-input__wrapper .ne-input.ne-input--error textarea {\n resize: none;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled {\n background-color: #f8f9f9;\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled input {\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled textarea {\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--small input {\n padding: 6px 8px;\n line-height: 1.3;\n}\n.ne-input__wrapper .ne-input.ne-input--naked {\n padding: 0;\n border: none;\n box-shadow: none;\n}\n.ne-input__wrapper .ne-input.ne-input--naked .ne-input__prefix {\n margin-left: 0;\n}\n.ne-input__wrapper .ne-input.ne-input--naked .ne-input__suffix {\n margin-right: 0;\n}\n.ne-input__wrapper .ne-input__prefix,\n.ne-input__wrapper .ne-input__suffix {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n font-size: 14px;\n color: #68737d;\n}\n.ne-input__wrapper .ne-input__prefix svg,\n.ne-input__wrapper .ne-input__suffix svg {\n width: 16px;\n height: 16px;\n}\n.ne-input__wrapper .ne-input__prefix {\n margin-left: 10px;\n}\n.ne-input__wrapper .ne-input__suffix {\n margin-right: 10px;\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__prefix,\n.ne-input__wrapper .ne-input--block-add-on .ne-input__suffix {\n margin: 0;\n padding: 8px 10px;\n background-color: #f8f9f9;\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__prefix {\n border-right: thin solid #d8dcde;\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__suffix {\n border-left: thin solid #d8dcde;\n}\n.ne-input__help-text {\n margin-top: 8px;\n font-size: 12px;\n color: #87929d;\n line-height: 1.6;\n}\n.ne-input__error {\n margin-top: 4px;\n font-size: 12px;\n color: #f56a58;\n}\n.ne-modal__backdrop {\n position: fixed;\n z-index: 99999;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n overflow: auto;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n transition: all 0.3s ease-in-out;\n background-color: rgba(135, 146, 157, 0.5);\n}\n.ne-modal__backdrop .ne-modal__wrapper {\n width: 50%;\n max-width: 100%;\n max-height: 100vh;\n overflow-y: auto;\n position: relative;\n background-color: #ffffff;\n border-radius: 2px;\n}\n.ne-modal__backdrop .ne-modal__wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.ne-modal__backdrop .ne-modal__wrapper::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.ne-modal__backdrop .ne-modal__wrapper::-webkit-scrollbar-track {\n background: "transparent";\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-modal__close {\n position: absolute;\n top: 12px;\n right: 12px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--xs {\n width: 320px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--sm {\n width: 480px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--md {\n width: 720px;\n}\n.ne-modal__backdrop .ne-icon__wrapper {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n margin-bottom: 32px;\n padding: 10px 0 0 2px;\n}\n.neeto-editor-loader {\n width: 100%;\n height: 32px;\n display: flex;\n align-items: center;\n text-align: center;\n}\n.neeto-editor-loader__spinner-icon {\n width: 16px;\n height: 16px;\n display: inline-block;\n border-radius: 999px;\n border: solid 2px #e9ebed;\n border-top-color: #2f3941;\n border-left-color: #2f3941;\n -webkit-animation: spin 600ms linear infinite;\n animation: spin 600ms linear infinite;\n margin: 1px auto;\n}\n.neeto-editor-slash-commands__wrapper {\n padding: 12px;\n overflow-y: auto;\n max-height: 384px;\n width: 320px;\n max-width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n gap: 4px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item {\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n padding: 8px 12px;\n gap: 12px;\n border-radius: 4px;\n transition: all 0.3s ease-in-out;\n cursor: pointer;\n color: #ffffff;\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item:hover, .neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item.active {\n background-color: #49545c;\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item .neeto-editor-slash-commands__item-content h5 {\n font-size: 14px;\n font-weight: 600;\n line-height: 1.5;\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item .neeto-editor-slash-commands__item-content p {\n font-size: 12px;\n color: #d8dcde;\n}\n.neeto-editor-mentions__wrapper {\n padding: 8px;\n width: 208px;\n max-height: 256px;\n overflow-y: auto;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n padding: 8px;\n transition: all 0.3s ease-in-out;\n cursor: pointer;\n font-size: 12px;\n color: #ffffff;\n border-radius: 4px;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item p {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item .ne-avatar--container {\n margin-right: 8px;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item:hover, .neeto-editor-mentions__wrapper .neeto-editor-mentions__item.active {\n background-color: #49545c;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item.neeto-editor-mentions__item--light {\n color: #2f3941;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item.neeto-editor-mentions__item--light:hover, .neeto-editor-mentions__wrapper .neeto-editor-mentions__item.neeto-editor-mentions__item--light.active {\n background-color: #e9ebed;\n}\n.neeto-editor-mentions__wrapper.neeto-editor-mentions__wrapper--small {\n width: 176px;\n padding: 0 4px;\n}\n.ProseMirror.slash-active p.is-empty:last-child::before {\n content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkwIiBoZWlnaHQ9IjIzIiB2aWV3Qm94PSIwIDAgMTkwIDIz IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmci Pgo8cmVjdCB4PSIzNCIgeT0iNCIgd2lkdGg9IjE5IiBoZWlnaHQ9IjE5IiByeD0i NCIgZmlsbD0iI0YzRjRGNiIvPgo8cGF0aCBkPSJNNDEuNTA3OCAxOS45NzY2SDQw LjAxNTZMNDQuNDkyMiA3LjYyNUg0NS45ODQ0TDQxLjUwNzggMTkuOTc2NloiIGZp bGw9IiM2QjcyODAiLz4KPHBhdGggZD0iTTguMDMyMjMgOS4xMjY5NUg0LjgzMzAx VjE4SDMuNTI3MzRWOS4xMjY5NUgwLjMzNDk2MVY4LjA0Njg4SDguMDMyMjNWOS4x MjY5NVpNMTEuMjM4MyAxNi4xNDc1TDEyLjk2MDkgMTAuNjAzNUgxNC4zMTQ1TDEx LjM0MDggMTkuMTQxNkMxMC44ODA1IDIwLjM3MjEgMTAuMTQ5MSAyMC45ODczIDku MTQ2NDggMjAuOTg3M0w4LjkwNzIzIDIwLjk2NjhMOC40MzU1NSAyMC44Nzc5VjE5 Ljg1MjVMOC43NzczNCAxOS44Nzk5QzkuMjA1NzMgMTkuODc5OSA5LjUzODQxIDE5 Ljc5MzMgOS43NzUzOSAxOS42MjAxQzEwLjAxNjkgMTkuNDQ2OSAxMC4yMTUyIDE5 LjEzMDIgMTAuMzcwMSAxOC42Njk5TDEwLjY1MDQgMTcuOTE4TDguMDExNzIgMTAu NjAzNUg5LjM5MjU4TDExLjIzODMgMTYuMTQ3NVpNMjEuNjk3MyAxNC4zODM4QzIx LjY5NzMgMTUuNTA5NCAyMS40Mzk4IDE2LjQxNjMgMjAuOTI0OCAxNy4xMDQ1QzIw LjQwOTggMTcuNzkyNiAxOS43MTI2IDE4LjEzNjcgMTguODMzIDE4LjEzNjdDMTcu OTM1MiAxOC4xMzY3IDE3LjIyODggMTcuODUxOSAxNi43MTM5IDE3LjI4MjJWMjAu ODQzOEgxNS40NDkyVjEwLjYwMzVIMTYuNjA0NUwxNi42NjYgMTEuNDIzOEMxNy4x ODEgMTAuNzg1OCAxNy44OTY1IDEwLjQ2NjggMTguODEyNSAxMC40NjY4QzE5Ljcw MTIgMTAuNDY2OCAyMC40MDMgMTAuODAxOCAyMC45MTggMTEuNDcxN0MyMS40Mzc1 IDEyLjE0MTYgMjEuNjk3MyAxMy4wNzM2IDIxLjY5NzMgMTQuMjY3NlYxNC4zODM4 Wk0yMC40MzI2IDE0LjI0MDJDMjAuNDMyNiAxMy40MDYyIDIwLjI1NDkgMTIuNzQ3 NyAxOS44OTk0IDEyLjI2NDZDMTkuNTQzOSAxMS43ODE2IDE5LjA1NjMgMTEuNTQg MTguNDM2NSAxMS41NEMxNy42NzA5IDExLjU0IDE3LjA5NjcgMTEuODc5NiAxNi43 MTM5IDEyLjU1ODZWMTYuMDkyOEMxNy4wOTIxIDE2Ljc2NzMgMTcuNjcwOSAxNy4x MDQ1IDE4LjQ1MDIgMTcuMTA0NUMxOS4wNTYzIDE3LjEwNDUgMTkuNTM3MSAxNi44 NjUyIDE5Ljg5MjYgMTYuMzg2N0MyMC4yNTI2IDE1LjkwMzYgMjAuNDMyNiAxNS4x ODgyIDIwLjQzMjYgMTQuMjQwMlpNMjYuMzc5OSAxOC4xMzY3QzI1LjM3NzMgMTgu MTM2NyAyNC41NjE1IDE3LjgwODYgMjMuOTMyNiAxNy4xNTIzQzIzLjMwMzcgMTYu NDkxNSAyMi45ODkzIDE1LjYwOTcgMjIuOTg5MyAxNC41MDY4VjE0LjI3NDRDMjIu OTg5MyAxMy41NDA3IDIzLjEyODMgMTIuODg2NyAyMy40MDYyIDEyLjMxMjVDMjMu Njg4OCAxMS43MzM3IDI0LjA4MDcgMTEuMjgyNiAyNC41ODIgMTAuOTU5QzI1LjA4 NzkgMTAuNjMwOSAyNS42MzQ4IDEwLjQ2NjggMjYuMjIyNyAxMC40NjY4QzI3LjE4 NDIgMTAuNDY2OCAyNy45MzE2IDEwLjc4MzUgMjguNDY0OCAxMS40MTdDMjguOTk4 IDEyLjA1MDUgMjkuMjY0NiAxMi45NTc0IDI5LjI2NDYgMTQuMTM3N1YxNC42NjQx SDI0LjI1MzlDMjQuMjcyMSAxNS4zOTMyIDI0LjQ4NCAxNS45ODM0IDI0Ljg4OTYg MTYuNDM0NkMyNS4yOTk4IDE2Ljg4MTIgMjUuODE5MyAxNy4xMDQ1IDI2LjQ0ODIg MTcuMTA0NUMyNi44OTQ5IDE3LjEwNDUgMjcuMjczMSAxNy4wMTMzIDI3LjU4MyAx Ni44MzExQzI3Ljg5MjkgMTYuNjQ4OCAyOC4xNjQxIDE2LjQwNzIgMjguMzk2NSAx Ni4xMDY0TDI5LjE2ODkgMTYuNzA4QzI4LjU0OTIgMTcuNjYwNSAyNy42MTk1IDE4 LjEzNjcgMjYuMzc5OSAxOC4xMzY3Wk0yNi4yMjI3IDExLjUwNTlDMjUuNzEyMiAx MS41MDU5IDI1LjI4MzkgMTEuNjkyNyAyNC45Mzc1IDEyLjA2NjRDMjQuNTkxMSAx Mi40MzU1IDI0LjM3NyAxMi45NTUxIDI0LjI5NDkgMTMuNjI1SDI4VjEzLjUyOTND MjcuOTYzNSAxMi44ODY3IDI3Ljc5MDQgMTIuMzkgMjcuNDgwNSAxMi4wMzkxQzI3 LjE3MDYgMTEuNjgzNiAyNi43NTEzIDExLjUwNTkgMjYuMjIyNyAxMS41MDU5WiIg ZmlsbD0iIzZCNzI4MCIvPgo8cGF0aCBkPSJNNTkuNjcyOSA4LjgxMjVWMTAuNjAz NUg2MS4wNTM3VjExLjU4MTFINTkuNjcyOVYxNi4xNjhDNTkuNjcyOSAxNi40NjQy IDU5LjczNDQgMTYuNjg3NSA1OS44NTc0IDE2LjgzNzlDNTkuOTgwNSAxNi45ODM3 IDYwLjE5MDEgMTcuMDU2NiA2MC40ODYzIDE3LjA1NjZDNjAuNjMyMiAxNy4wNTY2 IDYwLjgzMjcgMTcuMDI5MyA2MS4wODc5IDE2Ljk3NDZWMThDNjAuNzU1MiAxOC4w OTExIDYwLjQzMTYgMTguMTM2NyA2MC4xMTcyIDE4LjEzNjdDNTkuNTUyMSAxOC4x MzY3IDU5LjEyNiAxNy45NjU4IDU4LjgzODkgMTcuNjI0QzU4LjU1MTggMTcuMjgy MiA1OC40MDgyIDE2Ljc5NjkgNTguNDA4MiAxNi4xNjhWMTEuNTgxMUg1Ny4wNjE1 VjEwLjYwMzVINTguNDA4MlY4LjgxMjVINTkuNjcyOVpNNjIuMDY1NCAxNC4yMzM0 QzYyLjA2NTQgMTMuNTA4OCA2Mi4yMDY3IDEyLjg1NzEgNjIuNDg5MyAxMi4yNzgz QzYyLjc3NjQgMTEuNjk5NSA2My4xNzI5IDExLjI1MjkgNjMuNjc4NyAxMC45Mzg1 QzY0LjE4OTEgMTAuNjI0IDY0Ljc3MDIgMTAuNDY2OCA2NS40MjE5IDEwLjQ2NjhD NjYuNDI5IDEwLjQ2NjggNjcuMjQyNSAxMC44MTU0IDY3Ljg2MjMgMTEuNTEyN0M2 OC40ODY3IDEyLjIxIDY4Ljc5ODggMTMuMTM3NCA2OC43OTg4IDE0LjI5NDlWMTQu MzgzOEM2OC43OTg4IDE1LjEwMzggNjguNjU5OCAxNS43NTEgNjguMzgxOCAxNi4z MjUyQzY4LjEwODQgMTYuODk0OSA2Ny43MTQyIDE3LjMzOTIgNjcuMTk5MiAxNy42 NTgyQzY2LjY4ODggMTcuOTc3MiA2Ni4xMDA5IDE4LjEzNjcgNjUuNDM1NSAxOC4x MzY3QzY0LjQzMjkgMTguMTM2NyA2My42MTk1IDE3Ljc4ODEgNjIuOTk1MSAxNy4w OTA4QzYyLjM3NTMgMTYuMzkzNiA2Mi4wNjU0IDE1LjQ3MDcgNjIuMDY1NCAxNC4z MjIzVjE0LjIzMzRaTTYzLjMzNjkgMTQuMzgzOEM2My4zMzY5IDE1LjIwNDEgNjMu NTI2IDE1Ljg2MjYgNjMuOTA0MyAxNi4zNTk0QzY0LjI4NzEgMTYuODU2MSA2NC43 OTc1IDE3LjEwNDUgNjUuNDM1NSAxNy4xMDQ1QzY2LjA3ODEgMTcuMTA0NSA2Ni41 ODg1IDE2Ljg1MzggNjYuOTY2OCAxNi4zNTI1QzY3LjM0NTEgMTUuODQ2NyA2Ny41 MzQyIDE1LjE0MDMgNjcuNTM0MiAxNC4yMzM0QzY3LjUzNDIgMTMuNDIyMiA2Ny4z NDA1IDEyLjc2NiA2Ni45NTMxIDEyLjI2NDZDNjYuNTcwMyAxMS43NTg4IDY2LjA1 OTkgMTEuNTA1OSA2NS40MjE5IDExLjUwNTlDNjQuNzk3NSAxMS41MDU5IDY0LjI5 MzkgMTEuNzU0MiA2My45MTExIDEyLjI1MUM2My41MjgzIDEyLjc0NzcgNjMuMzM2 OSAxMy40NTg3IDYzLjMzNjkgMTQuMzgzOFpNNzYuODI0MiAxNy4xMDQ1Qzc3LjI3 NTQgMTcuMTA0NSA3Ny42Njk2IDE2Ljk2NzggNzguMDA2OCAxNi42OTQzQzc4LjM0 NDEgMTYuNDIwOSA3OC41MzA5IDE2LjA3OTEgNzguNTY3NCAxNS42Njg5SDc5Ljc2 MzdDNzkuNzQwOSAxNi4wOTI4IDc5LjU5NTEgMTYuNDk2MSA3OS4zMjYyIDE2Ljg3 ODlDNzkuMDU3MyAxNy4yNjE3IDc4LjY5NzMgMTcuNTY3MSA3OC4yNDYxIDE3Ljc5 NDlDNzcuNzk5NSAxOC4wMjI4IDc3LjMyNTUgMTguMTM2NyA3Ni44MjQyIDE4LjEz NjdDNzUuODE3MSAxOC4xMzY3IDc1LjAxNSAxNy44MDE4IDc0LjQxOCAxNy4xMzE4 QzczLjgyNTUgMTYuNDU3NCA3My41MjkzIDE1LjUzNjggNzMuNTI5MyAxNC4zNzAx VjE0LjE1ODJDNzMuNTI5MyAxMy40MzgyIDczLjY2MTUgMTIuNzk3OSA3My45MjU4 IDEyLjIzNzNDNzQuMTkwMSAxMS42NzY4IDc0LjU2ODQgMTEuMjQxNSA3NS4wNjA1 IDEwLjkzMTZDNzUuNTU3MyAxMC42MjE3IDc2LjE0MjkgMTAuNDY2OCA3Ni44MTc0 IDEwLjQ2NjhDNzcuNjQ2OCAxMC40NjY4IDc4LjMzNSAxMC43MTUyIDc4Ljg4MTgg MTEuMjExOUM3OS40MzMzIDExLjcwODcgNzkuNzI3MiAxMi4zNTM1IDc5Ljc2Mzcg MTMuMTQ2NUg3OC41Njc0Qzc4LjUzMDkgMTIuNjY4IDc4LjM0ODYgMTIuMjc2IDc4 LjAyMDUgMTEuOTcwN0M3Ny42OTY5IDExLjY2MDggNzcuMjk1OSAxMS41MDU5IDc2 LjgxNzQgMTEuNTA1OUM3Ni4xNzQ4IDExLjUwNTkgNzUuNjc1OCAxMS43MzgzIDc1 LjMyMDMgMTIuMjAzMUM3NC45Njk0IDEyLjY2MzQgNzQuNzkzOSAxMy4zMzExIDc0 Ljc5MzkgMTQuMjA2MVYxNC40NDUzQzc0Ljc5MzkgMTUuMjk3NSA3NC45Njk0IDE1 Ljk1MzggNzUuMzIwMyAxNi40MTQxQzc1LjY3MTIgMTYuODc0MyA3Ni4xNzI1IDE3 LjEwNDUgNzYuODI0MiAxNy4xMDQ1Wk04Mi40NTAyIDExLjQ5OUM4My4wMTA3IDEw LjgxMDkgODMuNzM5OSAxMC40NjY4IDg0LjYzNzcgMTAuNDY2OEM4Ni4yMDA4IDEw LjQ2NjggODYuOTg5MyAxMS4zNDg2IDg3LjAwMjkgMTMuMTEyM1YxOEg4NS43Mzgz VjEzLjEwNTVDODUuNzMzNyAxMi41NzIzIDg1LjYxMDcgMTIuMTc4MSA4NS4zNjkx IDExLjkyMjlDODUuMTMyMiAxMS42Njc2IDg0Ljc2MDcgMTEuNTQgODQuMjU0OSAx MS41NEM4My44NDQ3IDExLjU0IDgzLjQ4NDcgMTEuNjQ5NCA4My4xNzQ4IDExLjg2 ODJDODIuODY0OSAxMi4wODY5IDgyLjYyMzQgMTIuMzc0IDgyLjQ1MDIgMTIuNzI5 NVYxOEg4MS4xODU1VjcuNUg4Mi40NTAyVjExLjQ5OVpNOTMuNDYyOSAxOEM5My4z OSAxNy44NTQyIDkzLjMzMDcgMTcuNTk0NCA5My4yODUyIDE3LjIyMDdDOTIuNjk3 MyAxNy44MzE0IDkxLjk5NTQgMTguMTM2NyA5MS4xNzk3IDE4LjEzNjdDOTAuNDUw NSAxOC4xMzY3IDg5Ljg1MTIgMTcuOTMxNiA4OS4zODE4IDE3LjUyMTVDODguOTE3 IDE3LjEwNjggODguNjg0NiAxNi41ODI3IDg4LjY4NDYgMTUuOTQ5MkM4OC42ODQ2 IDE1LjE3OSA4OC45NzYyIDE0LjU4MiA4OS41NTk2IDE0LjE1ODJDOTAuMTQ3NSAx My43Mjk4IDkwLjk3MjMgMTMuNTE1NiA5Mi4wMzQyIDEzLjUxNTZIOTMuMjY0NlYx Mi45MzQ2QzkzLjI2NDYgMTIuNDkyNSA5My4xMzI1IDEyLjE0MTYgOTIuODY4MiAx MS44ODE4QzkyLjYwMzggMTEuNjE3NSA5Mi4yMTQyIDExLjQ4NTQgOTEuNjk5MiAx MS40ODU0QzkxLjI0OCAxMS40ODU0IDkwLjg2OTggMTEuNTk5MyA5MC41NjQ1IDEx LjgyNzFDOTAuMjU5MSAxMi4wNTUgOTAuMTA2NCAxMi4zMzA3IDkwLjEwNjQgMTIu NjU0M0g4OC44MzVDODguODM1IDEyLjI4NTIgODguOTY0OCAxMS45Mjk3IDg5LjIy NDYgMTEuNTg3OUM4OS40ODg5IDExLjI0MTUgODkuODQ0NCAxMC45NjgxIDkwLjI5 MSAxMC43Njc2QzkwLjc0MjIgMTAuNTY3MSA5MS4yMzY3IDEwLjQ2NjggOTEuNzc0 NCAxMC40NjY4QzkyLjYyNjYgMTAuNDY2OCA5My4yOTQzIDEwLjY4MSA5My43Nzcz IDExLjEwOTRDOTQuMjYwNCAxMS41MzMyIDk0LjUxMTEgMTIuMTE4OCA5NC41Mjkz IDEyLjg2NjJWMTYuMjcwNUM5NC41MjkzIDE2Ljk0OTUgOTQuNjE1OSAxNy40ODk2 IDk0Ljc4OTEgMTcuODkwNlYxOEg5My40NjI5Wk05MS4zNjQzIDE3LjAzNjFDOTEu NzYwNyAxNy4wMzYxIDkyLjEzNjcgMTYuOTMzNiA5Mi40OTIyIDE2LjcyODVDOTIu ODQ3NyAxNi41MjM0IDkzLjEwNTEgMTYuMjU2OCA5My4yNjQ2IDE1LjkyODdWMTQu NDExMUg5Mi4yNzM0QzkwLjcyNCAxNC40MTExIDg5Ljk0OTIgMTQuODY0NiA4OS45 NDkyIDE1Ljc3MTVDODkuOTQ5MiAxNi4xNjggOTAuMDgxNCAxNi40Nzc5IDkwLjM0 NTcgMTYuNzAxMkM5MC42MSAxNi45MjQ1IDkwLjk0OTUgMTcuMDM2MSA5MS4zNjQz IDE3LjAzNjFaTTk3LjcwOCAxMC42MDM1TDk3Ljc0OSAxMS41MzMyQzk4LjMxNDEg MTAuODIyMyA5OS4wNTI0IDEwLjQ2NjggOTkuOTYzOSAxMC40NjY4QzEwMS41Mjcg MTAuNDY2OCAxMDIuMzE1IDExLjM0ODYgMTAyLjMyOSAxMy4xMTIzVjE4SDEwMS4w NjRWMTMuMTA1NUMxMDEuMDYgMTIuNTcyMyAxMDAuOTM3IDEyLjE3ODEgMTAwLjY5 NSAxMS45MjI5QzEwMC40NTggMTEuNjY3NiAxMDAuMDg3IDExLjU0IDk5LjU4MTEg MTEuNTRDOTkuMTcwOSAxMS41NCA5OC44MTA5IDExLjY0OTQgOTguNTAxIDExLjg2 ODJDOTguMTkxMSAxMi4wODY5IDk3Ljk0OTUgMTIuMzc0IDk3Ljc3NjQgMTIuNzI5 NVYxOEg5Ni41MTE3VjEwLjYwMzVIOTcuNzA4Wk0xMDMuOTM2IDE0LjI0MDJDMTAz LjkzNiAxMy4wODcyIDEwNC4yMDIgMTIuMTcxMiAxMDQuNzM1IDExLjQ5MjJDMTA1 LjI2OSAxMC44MDg2IDEwNS45NzUgMTAuNDY2OCAxMDYuODU0IDEwLjQ2NjhDMTA3 Ljc1NyAxMC40NjY4IDEwOC40NjEgMTAuNzg1OCAxMDguOTY3IDExLjQyMzhMMTA5 LjAyOCAxMC42MDM1SDExMC4xODRWMTcuODIyM0MxMTAuMTg0IDE4Ljc3OTMgMTA5 Ljg5OSAxOS41MzM1IDEwOS4zMjkgMjAuMDg1QzEwOC43NjQgMjAuNjM2NCAxMDgu MDAzIDIwLjkxMjEgMTA3LjA0NiAyMC45MTIxQzEwNi41MTMgMjAuOTEyMSAxMDUu OTkxIDIwLjc5ODIgMTA1LjQ4IDIwLjU3MDNDMTA0Ljk3IDIwLjM0MjQgMTA0LjU4 IDIwLjAzMDMgMTA0LjMxMiAxOS42MzM4TDEwNC45NjggMTguODc1QzEwNS41MSAx OS41NDQ5IDEwNi4xNzMgMTkuODc5OSAxMDYuOTU3IDE5Ljg3OTlDMTA3LjU3MiAx OS44Nzk5IDEwOC4wNTEgMTkuNzA2NyAxMDguMzkzIDE5LjM2MDRDMTA4LjczOSAx OS4wMTQgMTA4LjkxMiAxOC41MjY0IDEwOC45MTIgMTcuODk3NVYxNy4yNjE3QzEw OC40MDYgMTcuODQ1MSAxMDcuNzE2IDE4LjEzNjcgMTA2Ljg0MSAxOC4xMzY3QzEw NS45NzUgMTguMTM2NyAxMDUuMjczIDE3Ljc4ODEgMTA0LjczNSAxNy4wOTA4QzEw NC4yMDIgMTYuMzkzNiAxMDMuOTM2IDE1LjQ0MzQgMTAzLjkzNiAxNC4yNDAyWk0x MDUuMjA3IDE0LjM4MzhDMTA1LjIwNyAxNS4yMTc4IDEwNS4zNzggMTUuODc0IDEw NS43MiAxNi4zNTI1QzEwNi4wNjIgMTYuODI2NSAxMDYuNTQgMTcuMDYzNSAxMDcu MTU1IDE3LjA2MzVDMTA3Ljk1MyAxNy4wNjM1IDEwOC41MzggMTYuNzAxMiAxMDgu OTEyIDE1Ljk3NjZWMTIuNTk5NkMxMDguNTI1IDExLjg5MzIgMTA3Ljk0NCAxMS41 NCAxMDcuMTY5IDExLjU0QzEwNi41NTQgMTEuNTQgMTA2LjA3MyAxMS43NzkzIDEw NS43MjcgMTIuMjU3OEMxMDUuMzggMTIuNzM2MyAxMDUuMjA3IDEzLjQ0NSAxMDUu MjA3IDE0LjM4MzhaTTExNS4xNjcgMTguMTM2N0MxMTQuMTY0IDE4LjEzNjcgMTEz LjM0OSAxNy44MDg2IDExMi43MiAxNy4xNTIzQzExMi4wOTEgMTYuNDkxNSAxMTEu Nzc2IDE1LjYwOTcgMTExLjc3NiAxNC41MDY4VjE0LjI3NDRDMTExLjc3NiAxMy41 NDA3IDExMS45MTUgMTIuODg2NyAxMTIuMTkzIDEyLjMxMjVDMTEyLjQ3NiAxMS43 MzM3IDExMi44NjggMTEuMjgyNiAxMTMuMzY5IDEwLjk1OUMxMTMuODc1IDEwLjYz MDkgMTE0LjQyMiAxMC40NjY4IDExNS4wMSAxMC40NjY4QzExNS45NzEgMTAuNDY2 OCAxMTYuNzE5IDEwLjc4MzUgMTE3LjI1MiAxMS40MTdDMTE3Ljc4NSAxMi4wNTA1 IDExOC4wNTIgMTIuOTU3NCAxMTguMDUyIDE0LjEzNzdWMTQuNjY0MUgxMTMuMDQx QzExMy4wNTkgMTUuMzkzMiAxMTMuMjcxIDE1Ljk4MzQgMTEzLjY3NyAxNi40MzQ2 QzExNC4wODcgMTYuODgxMiAxMTQuNjA2IDE3LjEwNDUgMTE1LjIzNSAxNy4xMDQ1 QzExNS42ODIgMTcuMTA0NSAxMTYuMDYgMTcuMDEzMyAxMTYuMzcgMTYuODMxMUMx MTYuNjggMTYuNjQ4OCAxMTYuOTUxIDE2LjQwNzIgMTE3LjE4NCAxNi4xMDY0TDEx Ny45NTYgMTYuNzA4QzExNy4zMzYgMTcuNjYwNSAxMTYuNDA3IDE4LjEzNjcgMTE1 LjE2NyAxOC4xMzY3Wk0xMTUuMDEgMTEuNTA1OUMxMTQuNDk5IDExLjUwNTkgMTE0 LjA3MSAxMS42OTI3IDExMy43MjUgMTIuMDY2NEMxMTMuMzc4IDEyLjQzNTUgMTEz LjE2NCAxMi45NTUxIDExMy4wODIgMTMuNjI1SDExNi43ODdWMTMuNTI5M0MxMTYu NzUxIDEyLjg4NjcgMTE2LjU3NyAxMi4zOSAxMTYuMjY4IDEyLjAzOTFDMTE1Ljk1 OCAxMS42ODM2IDExNS41MzggMTEuNTA1OSAxMTUuMDEgMTEuNTA1OVpNMTI5LjI1 NiAxNC4zODM4QzEyOS4yNTYgMTUuNTE0IDEyOC45OTYgMTYuNDIzMiAxMjguNDc3 IDE3LjExMTNDMTI3Ljk1NyAxNy43OTQ5IDEyNy4yNiAxOC4xMzY3IDEyNi4zODUg MTguMTM2N0MxMjUuNDUxIDE4LjEzNjcgMTI0LjcyOCAxNy44MDYzIDEyNC4yMTgg MTcuMTQ1NUwxMjQuMTU2IDE4SDEyMi45OTRWNy41SDEyNC4yNTlWMTEuNDE3QzEy NC43NjkgMTAuNzgzNSAxMjUuNDczIDEwLjQ2NjggMTI2LjM3MSAxMC40NjY4QzEy Ny4yNjkgMTAuNDY2OCAxMjcuOTczIDEwLjgwNjMgMTI4LjQ4MyAxMS40ODU0QzEy OC45OTggMTIuMTY0NCAxMjkuMjU2IDEzLjA5NDEgMTI5LjI1NiAxNC4yNzQ0VjE0 LjM4MzhaTTEyNy45OTEgMTQuMjQwMkMxMjcuOTkxIDEzLjM3ODkgMTI3LjgyNSAx Mi43MTM1IDEyNy40OTIgMTIuMjQ0MUMxMjcuMTYgMTEuNzc0NyAxMjYuNjgxIDEx LjU0IDEyNi4wNTcgMTEuNTRDMTI1LjIyMyAxMS41NCAxMjQuNjIzIDExLjkyNzQg MTI0LjI1OSAxMi43MDIxVjE1LjkwMTRDMTI0LjY0NiAxNi42NzYxIDEyNS4yNSAx Ny4wNjM1IDEyNi4wNyAxNy4wNjM1QzEyNi42NzYgMTcuMDYzNSAxMjcuMTQ4IDE2 LjgyODggMTI3LjQ4NSAxNi4zNTk0QzEyNy44MjMgMTUuODkgMTI3Ljk5MSAxNS4x ODM2IDEyNy45OTEgMTQuMjQwMlpNMTMyLjIyOSAxOEgxMzAuOTY1VjcuNUgxMzIu MjI5VjE4Wk0xMzMuOTI1IDE0LjIzMzRDMTMzLjkyNSAxMy41MDg4IDEzNC4wNjYg MTIuODU3MSAxMzQuMzQ5IDEyLjI3ODNDMTM0LjYzNiAxMS42OTk1IDEzNS4wMzIg MTEuMjUyOSAxMzUuNTM4IDEwLjkzODVDMTM2LjA0OSAxMC42MjQgMTM2LjYzIDEw LjQ2NjggMTM3LjI4MSAxMC40NjY4QzEzOC4yODggMTAuNDY2OCAxMzkuMTAyIDEw LjgxNTQgMTM5LjcyMiAxMS41MTI3QzE0MC4zNDYgMTIuMjEgMTQwLjY1OCAxMy4x Mzc0IDE0MC42NTggMTQuMjk0OVYxNC4zODM4QzE0MC42NTggMTUuMTAzOCAxNDAu NTE5IDE1Ljc1MSAxNDAuMjQxIDE2LjMyNTJDMTM5Ljk2OCAxNi44OTQ5IDEzOS41 NzQgMTcuMzM5MiAxMzkuMDU5IDE3LjY1ODJDMTM4LjU0OCAxNy45NzcyIDEzNy45 NiAxOC4xMzY3IDEzNy4yOTUgMTguMTM2N0MxMzYuMjkyIDE4LjEzNjcgMTM1LjQ3 OSAxNy43ODgxIDEzNC44NTQgMTcuMDkwOEMxMzQuMjM1IDE2LjM5MzYgMTMzLjky NSAxNS40NzA3IDEzMy45MjUgMTQuMzIyM1YxNC4yMzM0Wk0xMzUuMTk2IDE0LjM4 MzhDMTM1LjE5NiAxNS4yMDQxIDEzNS4zODUgMTUuODYyNiAxMzUuNzY0IDE2LjM1 OTRDMTM2LjE0NiAxNi44NTYxIDEzNi42NTcgMTcuMTA0NSAxMzcuMjk1IDE3LjEw NDVDMTM3LjkzOCAxNy4xMDQ1IDEzOC40NDggMTYuODUzOCAxMzguODI2IDE2LjM1 MjVDMTM5LjIwNCAxNS44NDY3IDEzOS4zOTQgMTUuMTQwMyAxMzkuMzk0IDE0LjIz MzRDMTM5LjM5NCAxMy40MjIyIDEzOS4yIDEyLjc2NiAxMzguODEyIDEyLjI2NDZD MTM4LjQzIDExLjc1ODggMTM3LjkxOSAxMS41MDU5IDEzNy4yODEgMTEuNTA1OUMx MzYuNjU3IDExLjUwNTkgMTM2LjE1MyAxMS43NTQyIDEzNS43NzEgMTIuMjUxQzEz NS4zODggMTIuNzQ3NyAxMzUuMTk2IDEzLjQ1ODcgMTM1LjE5NiAxNC4zODM4Wk0x NDUuMjExIDE3LjEwNDVDMTQ1LjY2MiAxNy4xMDQ1IDE0Ni4wNTYgMTYuOTY3OCAx NDYuMzk0IDE2LjY5NDNDMTQ2LjczMSAxNi40MjA5IDE0Ni45MTggMTYuMDc5MSAx NDYuOTU0IDE1LjY2ODlIMTQ4LjE1QzE0OC4xMjggMTYuMDkyOCAxNDcuOTgyIDE2 LjQ5NjEgMTQ3LjcxMyAxNi44Nzg5QzE0Ny40NDQgMTcuMjYxNyAxNDcuMDg0IDE3 LjU2NzEgMTQ2LjYzMyAxNy43OTQ5QzE0Ni4xODYgMTguMDIyOCAxNDUuNzEyIDE4 LjEzNjcgMTQ1LjIxMSAxOC4xMzY3QzE0NC4yMDQgMTguMTM2NyAxNDMuNDAyIDE3 LjgwMTggMTQyLjgwNSAxNy4xMzE4QzE0Mi4yMTIgMTYuNDU3NCAxNDEuOTE2IDE1 LjUzNjggMTQxLjkxNiAxNC4zNzAxVjE0LjE1ODJDMTQxLjkxNiAxMy40MzgyIDE0 Mi4wNDggMTIuNzk3OSAxNDIuMzEyIDEyLjIzNzNDMTQyLjU3NyAxMS42NzY4IDE0 Mi45NTUgMTEuMjQxNSAxNDMuNDQ3IDEwLjkzMTZDMTQzLjk0NCAxMC42MjE3IDE0 NC41MyAxMC40NjY4IDE0NS4yMDQgMTAuNDY2OEMxNDYuMDM0IDEwLjQ2NjggMTQ2 LjcyMiAxMC43MTUyIDE0Ny4yNjkgMTEuMjExOUMxNDcuODIgMTEuNzA4NyAxNDgu MTE0IDEyLjM1MzUgMTQ4LjE1IDEzLjE0NjVIMTQ2Ljk1NEMxNDYuOTE4IDEyLjY2 OCAxNDYuNzM1IDEyLjI3NiAxNDYuNDA3IDExLjk3MDdDMTQ2LjA4NCAxMS42NjA4 IDE0NS42ODMgMTEuNTA1OSAxNDUuMjA0IDExLjUwNTlDMTQ0LjU2MiAxMS41MDU5 IDE0NC4wNjIgMTEuNzM4MyAxNDMuNzA3IDEyLjIwMzFDMTQzLjM1NiAxMi42NjM0 IDE0My4xODEgMTMuMzMxMSAxNDMuMTgxIDE0LjIwNjFWMTQuNDQ1M0MxNDMuMTgx IDE1LjI5NzUgMTQzLjM1NiAxNS45NTM4IDE0My43MDcgMTYuNDE0MUMxNDQuMDU4 IDE2Ljg3NDMgMTQ0LjU1OSAxNy4xMDQ1IDE0NS4yMTEgMTcuMTA0NVpNMTUxLjYz NyAxNC41NzUyTDE1MC44NDQgMTUuNDAyM1YxOEgxNDkuNTc5VjcuNUgxNTAuODQ0 VjEzLjg1MDZMMTUxLjUyMSAxMy4wMzcxTDE1My44MjQgMTAuNjAzNUgxNTUuMzYy TDE1Mi40ODQgMTMuNjkzNEwxNTUuNjk3IDE4SDE1NC4yMTRMMTUxLjYzNyAxNC41 NzUyWk0xNjEuODU2IDguODEyNVYxMC42MDM1SDE2My4yMzdWMTEuNTgxMUgxNjEu ODU2VjE2LjE2OEMxNjEuODU2IDE2LjQ2NDIgMTYxLjkxOCAxNi42ODc1IDE2Mi4w NDEgMTYuODM3OUMxNjIuMTY0IDE2Ljk4MzcgMTYyLjM3NCAxNy4wNTY2IDE2Mi42 NyAxNy4wNTY2QzE2Mi44MTYgMTcuMDU2NiAxNjMuMDE2IDE3LjAyOTMgMTYzLjI3 MSAxNi45NzQ2VjE4QzE2Mi45MzkgMTguMDkxMSAxNjIuNjE1IDE4LjEzNjcgMTYy LjMwMSAxOC4xMzY3QzE2MS43MzYgMTguMTM2NyAxNjEuMzEgMTcuOTY1OCAxNjEu MDIyIDE3LjYyNEMxNjAuNzM1IDE3LjI4MjIgMTYwLjU5MiAxNi43OTY5IDE2MC41 OTIgMTYuMTY4VjExLjU4MTFIMTU5LjI0NVYxMC42MDM1SDE2MC41OTJWOC44MTI1 SDE2MS44NTZaTTE2Ny4xNDEgMTYuMTQ3NUwxNjguODYzIDEwLjYwMzVIMTcwLjIx N0wxNjcuMjQzIDE5LjE0MTZDMTY2Ljc4MyAyMC4zNzIxIDE2Ni4wNTEgMjAuOTg3 MyAxNjUuMDQ5IDIwLjk4NzNMMTY0LjgxIDIwLjk2NjhMMTY0LjMzOCAyMC44Nzc5 VjE5Ljg1MjVMMTY0LjY4IDE5Ljg3OTlDMTY1LjEwOCAxOS44Nzk5IDE2NS40NDEg MTkuNzkzMyAxNjUuNjc4IDE5LjYyMDFDMTY1LjkxOSAxOS40NDY5IDE2Ni4xMTgg MTkuMTMwMiAxNjYuMjcyIDE4LjY2OTlMMTY2LjU1MyAxNy45MThMMTYzLjkxNCAx MC42MDM1SDE2NS4yOTVMMTY3LjE0MSAxNi4xNDc1Wk0xNzcuNiAxNC4zODM4QzE3 Ny42IDE1LjUwOTQgMTc3LjM0MiAxNi40MTYzIDE3Ni44MjcgMTcuMTA0NUMxNzYu MzEyIDE3Ljc5MjYgMTc1LjYxNSAxOC4xMzY3IDE3NC43MzUgMTguMTM2N0MxNzMu ODM4IDE4LjEzNjcgMTczLjEzMSAxNy44NTE5IDE3Mi42MTYgMTcuMjgyMlYyMC44 NDM4SDE3MS4zNTJWMTAuNjAzNUgxNzIuNTA3TDE3Mi41NjggMTEuNDIzOEMxNzMu MDgzIDEwLjc4NTggMTczLjc5OSAxMC40NjY4IDE3NC43MTUgMTAuNDY2OEMxNzUu NjA0IDEwLjQ2NjggMTc2LjMwNSAxMC44MDE4IDE3Ni44MiAxMS40NzE3QzE3Ny4z NCAxMi4xNDE2IDE3Ny42IDEzLjA3MzYgMTc3LjYgMTQuMjY3NlYxNC4zODM4Wk0x NzYuMzM1IDE0LjI0MDJDMTc2LjMzNSAxMy40MDYyIDE3Ni4xNTcgMTIuNzQ3NyAx NzUuODAyIDEyLjI2NDZDMTc1LjQ0NiAxMS43ODE2IDE3NC45NTkgMTEuNTQgMTc0 LjMzOSAxMS41NEMxNzMuNTczIDExLjU0IDE3Mi45OTkgMTEuODc5NiAxNzIuNjE2 IDEyLjU1ODZWMTYuMDkyOEMxNzIuOTk0IDE2Ljc2NzMgMTczLjU3MyAxNy4xMDQ1 IDE3NC4zNTMgMTcuMTA0NUMxNzQuOTU5IDE3LjEwNDUgMTc1LjQzOSAxNi44NjUy IDE3NS43OTUgMTYuMzg2N0MxNzYuMTU1IDE1LjkwMzYgMTc2LjMzNSAxNS4xODgy IDE3Ni4zMzUgMTQuMjQwMlpNMTgyLjI4MiAxOC4xMzY3QzE4MS4yOCAxOC4xMzY3 IDE4MC40NjQgMTcuODA4NiAxNzkuODM1IDE3LjE1MjNDMTc5LjIwNiAxNi40OTE1 IDE3OC44OTIgMTUuNjA5NyAxNzguODkyIDE0LjUwNjhWMTQuMjc0NEMxNzguODky IDEzLjU0MDcgMTc5LjAzMSAxMi44ODY3IDE3OS4zMDkgMTIuMzEyNUMxNzkuNTkx IDExLjczMzcgMTc5Ljk4MyAxMS4yODI2IDE4MC40ODQgMTAuOTU5QzE4MC45OSAx MC42MzA5IDE4MS41MzcgMTAuNDY2OCAxODIuMTI1IDEwLjQ2NjhDMTgzLjA4NyAx MC40NjY4IDE4My44MzQgMTAuNzgzNSAxODQuMzY3IDExLjQxN0MxODQuOSAxMi4w NTA1IDE4NS4xNjcgMTIuOTU3NCAxODUuMTY3IDE0LjEzNzdWMTQuNjY0MUgxODAu MTU2QzE4MC4xNzQgMTUuMzkzMiAxODAuMzg2IDE1Ljk4MzQgMTgwLjc5MiAxNi40 MzQ2QzE4MS4yMDIgMTYuODgxMiAxODEuNzIyIDE3LjEwNDUgMTgyLjM1MSAxNy4x MDQ1QzE4Mi43OTcgMTcuMTA0NSAxODMuMTc1IDE3LjAxMzMgMTgzLjQ4NSAxNi44 MzExQzE4My43OTUgMTYuNjQ4OCAxODQuMDY2IDE2LjQwNzIgMTg0LjI5OSAxNi4x MDY0TDE4NS4wNzEgMTYuNzA4QzE4NC40NTEgMTcuNjYwNSAxODMuNTIyIDE4LjEz NjcgMTgyLjI4MiAxOC4xMzY3Wk0xODIuMTI1IDExLjUwNTlDMTgxLjYxNSAxMS41 MDU5IDE4MS4xODYgMTEuNjkyNyAxODAuODQgMTIuMDY2NEMxODAuNDkzIDEyLjQz NTUgMTgwLjI3OSAxMi45NTUxIDE4MC4xOTcgMTMuNjI1SDE4My45MDJWMTMuNTI5 M0MxODMuODY2IDEyLjg4NjcgMTgzLjY5MyAxMi4zOSAxODMuMzgzIDEyLjAzOTFD MTgzLjA3MyAxMS42ODM2IDE4Mi42NTQgMTEuNTA1OSAxODIuMTI1IDExLjUwNTla IiBmaWxsPSIjNkI3MjgwIi8+Cjwvc3ZnPgo=");\n position: absolute;\n top: -2px;\n height: 0;\n pointer-events: none;\n}\n.neeto-editor {\n max-width: 100% !important;\n border-radius: 2px;\n white-space: pre-wrap;\n padding: 12px;\n color: #2f3941;\n}\n.neeto-editor p {\n line-height: 1.625;\n margin-bottom: 16px;\n}\n.neeto-editor:focus {\n outline: none;\n}\n.neeto-editor a {\n pointer-events: none;\n}\n.neeto-editor mark {\n background: #c9e4cc;\n border-radius: 2px;\n padding: 0px 4px;\n color: inherit;\n}\n.neeto-editor [data-variable] {\n display: inline-flex;\n color: #49545c;\n background-color: rgba(233, 235, 237, 0.5);\n border-radius: 2px;\n line-height: 1;\n padding: 4px 6px;\n}\n.neeto-editor [data-mention] {\n opacity: 0.6;\n}\n.neeto-editor .ProseMirror-separator {\n display: none;\n}\n.neeto-editor.fixed-menu-active {\n border: thin solid #e9ebed;\n border-radius: 0px 0px 2px 2px;\n}\n.neeto-editor .is-empty {\n position: relative;\n}\n.neeto-editor.placeholder-active:not(.force-title) .is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title h1:first-child {\n position: relative;\n margin-bottom: 20px;\n}\n.neeto-editor.force-title .is-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title.placeholder-active .is-empty:nth-child(2):last-child:before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title.force-title--error .is-empty:first-child::after {\n position: absolute;\n content: "Title can\'t be blank";\n left: 0;\n bottom: -12px;\n color: #f56a58;\n pointer-events: none;\n font-size: 12px;\n}\n.neeto-editor hr {\n margin: 8px 0;\n}\n.neeto-editor .ProseMirror-selectednode {\n outline: 3px solid #eaf3fc;\n}\n.neeto-editor-character-count {\n padding: 4px;\n color: #68737d;\n font-size: 12px;\n text-align: right;\n}\n.neeto-editor-error {\n color: #f56a58;\n border-width: 1px;\n border-color: #f56a58;\n}\n.neeto-editor-error:focus-within {\n border-color: #f56a58;\n}\n.neeto-editor-content, .neeto-editor {\n white-space: pre-wrap;\n word-break: break-word;\n}\n.neeto-editor-content h1, .neeto-editor h1,\n.neeto-editor-content h2,\n.neeto-editor h2,\n.neeto-editor-content h3,\n.neeto-editor h3,\n.neeto-editor-content h4,\n.neeto-editor h4,\n.neeto-editor-content h5,\n.neeto-editor h5,\n.neeto-editor-content h6,\n.neeto-editor h6 {\n font-size: revert;\n}\n.neeto-editor-content p, .neeto-editor p {\n line-height: 1.625;\n margin-bottom: 16px;\n}\n.neeto-editor-content p:empty::after, .neeto-editor p:empty::after {\n content: " ";\n}\n.neeto-editor-content p:last-child, .neeto-editor p:last-child {\n margin-bottom: 0;\n}\n.neeto-editor-content code, .neeto-editor code {\n padding: 0.2em 0.4em;\n font-size: 85%;\n border-radius: 6px;\n background-color: rgba(175, 184, 193, 0.2);\n font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;\n}\n.neeto-editor-content pre, .neeto-editor pre {\n color: #ffffff;\n background-color: #1f2937;\n overflow-x: auto;\n font-size: 12px;\n line-height: 20px;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 2px;\n padding: 16px;\n}\n.neeto-editor-content pre > code, .neeto-editor pre > code {\n background-color: transparent;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-weight: 400;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n line-height: inherit;\n}\n.neeto-editor-content blockquote, .neeto-editor blockquote {\n font-weight: 500;\n color: #1b1f23;\n border-left-width: 4px;\n border-left-color: #e5e7eb;\n quotes: "“" "”" "‘" "’";\n margin: 8px 0;\n padding-left: 12px;\n}\n.neeto-editor-content blockquote > p::before, .neeto-editor blockquote > p::before {\n content: "" !important;\n}\n.neeto-editor-content blockquote > p::after, .neeto-editor blockquote > p::after {\n content: "" !important;\n}\n.neeto-editor-content ul, .neeto-editor ul,\n.neeto-editor-content ol,\n.neeto-editor ol {\n list-style: revert;\n margin: revert;\n padding: revert;\n}\n.neeto-editor-content ul > li > p, .neeto-editor ul > li > p,\n.neeto-editor-content ol > li > p,\n.neeto-editor ol > li > p {\n margin-top: 0 !important;\n margin-bottom: 0.375rem !important;\n}\n.neeto-editor-content ul li::before, .neeto-editor ul li::before,\n.neeto-editor-content ol li::before,\n.neeto-editor ol li::before {\n background-color: #1b1f23;\n}\n.neeto-editor-content a[href], .neeto-editor a[href] {\n color: #276ef1;\n}\n.neeto-editor-content .video-wrapper, .neeto-editor .video-wrapper {\n width: 560px;\n height: 315px;\n margin: auto;\n}\n.neeto-editor-content mark, .neeto-editor mark {\n background: #c9e4cc;\n border-radius: 2px;\n padding: 0px 4px;\n color: inherit;\n}\n.neeto-editor-content [data-variable], .neeto-editor [data-variable] {\n display: inline-flex;\n color: #49545c;\n background-color: rgba(233, 235, 237, 0.5);\n border-radius: 2px;\n line-height: 1;\n padding: 4px 6px;\n}\n.neeto-editor-content [data-mention], .neeto-editor [data-mention] {\n opacity: 0.6;\n}\n.neeto-editor-content--hidden {\n display: none;\n}\n.neeto-editor__image {\n display: inline-block;\n border: 1.5px solid #eaf3fc;\n margin: 0 12px;\n}\n.neeto-editor__image figure {\n margin: 16px 12px;\n outline: none;\n}\n.neeto-editor__image figure img {\n height: 100%;\n width: 100%;\n -webkit-user-select: auto;\n -moz-user-select: auto;\n user-select: auto;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.neeto-editor__image figure figcaption {\n color: #49545c;\n text-align: center;\n}\n.neeto-editor__image-defaults {\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n}\n.neeto-editor__image--none {\n display: flex;\n justify-content: center;\n}\n.neeto-editor__image--left {\n float: left;\n margin-left: 0;\n}\n.neeto-editor__image--right {\n float: right;\n margin-right: 0;\n}\n.neeto-editor__image--center {\n margin: 0 auto;\n}\n.neeto-editor-fixed-menu {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n overflow-x: auto;\n border-radius: 2px 2px 0px 0px;\n background-color: #e9ebed;\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 10px;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item:hover, .neeto-editor-fixed-menu .neeto-editor-fixed-menu__item:focus, .neeto-editor-fixed-menu .neeto-editor-fixed-menu__item:active, .neeto-editor-fixed-menu .neeto-editor-fixed-menu__item.active {\n background-color: #d8dcde;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item input[type=color] {\n visibility: hidden;\n height: 0;\n width: 0;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu-addons {\n display: flex;\n align-items: center;\n margin-left: auto;\n}\n.neeto-editor-variables-suggestion {\n padding: 4px 0;\n}\n.neeto-editor-variables-list {\n padding: 4px 8px;\n min-width: 184px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block:not(:last-child) {\n margin-bottom: 12px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block h6 {\n font-size: 12px;\n font-weight: 500;\n color: #68737d;\n margin-bottom: 4px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row .neeto-editor-variable {\n padding: 4px 6px;\n font-size: 12px;\n color: #49545c;\n line-height: 1;\n background-color: #eaf3fc;\n border-radius: 2px;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row .neeto-editor-variable:hover {\n background-color: #d4e6f9;\n}\n.neeto-editor-link-wrapper .ne-dropdown__popup {\n padding: 8px;\n width: 100%;\n max-width: 400px;\n}\n.neeto-editor-link-wrapper .ne-dropdown__popup .neeto-editor-link__item {\n display: flex !important;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n gap: 12px;\n}\n.neeto-editor-font-size-wrapper .ne-dropdown__popup {\n display: flex !important;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n gap: 8px;\n padding: 4px;\n}\n.neeto-editor-font-size-wrapper .ne-dropdown__popup li {\n padding: 6px 8px;\n}\n.neeto-editor-bubble-menu {\n position: relative;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n overflow: hidden;\n border-radius: 4px;\n background: #2f3941;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item {\n padding: 8px;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:hover, .neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:active, .neeto-editor-bubble-menu .neeto-editor-bubble-menu__item.active {\n background-color: #49545c;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link {\n display: flex;\n align-items: center;\n padding: 8px;\n gap: 8px;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input {\n background-color: transparent;\n outline: none;\n line-height: 20px;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input::-moz-placeholder {\n color: rgba(255, 255, 255, 0.4);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input::placeholder {\n color: rgba(255, 255, 255, 0.4);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .ne-btn--icon-only {\n padding: 0;\n min-height: 0;\n opacity: 0.8;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .ne-btn--icon-only:hover {\n opacity: 1;\n}\n.neeto-editor-bubble-menu-animate-shake {\n -webkit-animation: 1s linear infinite alternate both shake;\n animation: 1s linear infinite alternate both shake;\n}\n.neeto-editor-image-uploader {\n display: flex;\n flex-direction: column;\n min-height: 184px;\n}\n.neeto-editor-image-uploader .ne-tab__wrapper .ne-tab {\n min-width: 88px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__content {\n flex-grow: 1;\n display: flex;\n padding: 16px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n text-align: center;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress-title, .neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-label {\n color: #49545c;\n font-size: 14px;\n margin-bottom: 4px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress-file, .neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-note {\n color: #c2c8cc;\n font-size: 12px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n border: 1px dashed #c2c8cc;\n box-sizing: border-box;\n border-radius: 2px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-container {\n width: 100%;\n height: 100%;\n background-color: #ffffff;\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-container::-moz-focus-inner {\n border: 0;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-inner {\n display: flex;\n flex-direction: column;\n justify-content: center;\n line-height: 1.4;\n text-align: center;\n font-weight: 400;\n margin: 0;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-arrow {\n visibility: hidden;\n display: none;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop--isDraggingOver {\n background-color: #e9ebed;\n border: 2px dashed #5e5ce6;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-browse {\n color: #5e5ce6;\n font-size: 14px;\n font-weight: 600;\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd--error {\n color: #f56a58;\n font-size: 12px;\n margin-top: 12px;\n text-align: center;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper {\n width: 100%;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .ne-input__wrapper {\n width: 100%;\n flex-grow: 0;\n margin-bottom: 16px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container {\n max-height: 50vh;\n overflow-y: auto;\n overflow-x: hidden;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery {\n width: 100%;\n right: -8px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item {\n width: 33.3%;\n padding-right: 16px;\n padding-bottom: 16px;\n float: left;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder {\n width: 100%;\n position: relative;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner {\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: #f8f9f9;\n border-radius: 2px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner img {\n height: 100%;\n width: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n -webkit-animation: fade-in 1.2s 1s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n animation: fade-in 1.2s 1s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n border-radius: 2px;\n position: relative;\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner a {\n opacity: 0;\n position: absolute;\n left: 8px;\n bottom: 8px;\n margin: auto;\n color: #ffffff;\n font-size: 12px;\n font-weight: 400;\n line-height: 1;\n text-transform: capitalize;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner a:hover {\n text-decoration: underline;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner:hover a {\n opacity: 1;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__text {\n font-size: 12px;\n color: #2f3941;\n text-align: center;\n margin-top: 12px;\n}\n.neeto-editor-progress-bar__wrapper {\n width: 100%;\n max-width: 256px;\n margin-top: 10px;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__percent {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__percent p {\n font-size: 12px;\n color: #2f3941;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__indicator {\n position: relative;\n width: 100%;\n height: 6px;\n border-radius: 999px;\n overflow: hidden;\n background-color: rgba(94, 92, 230, 0.2);\n margin-top: 4px;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__indicator-inner {\n height: 100%;\n background-color: #5e5ce6;\n}\n.neeto-editor-url-form__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n padding: 0 24px;\n}\n.neeto-editor-url-form__wrapper .ne-input__wrapper {\n width: 100%;\n flex-grow: 0;\n margin-bottom: 16px;\n}\n.neeto-editor-emoji {\n font-family: apple color emoji, segoe ui emoji, noto color emoji, android emoji, emojisymbols, emojione mozilla, twemoji mozilla, segoe ui symbol;\n}\n.emoji-mart.emoji-mart-light {\n font-size: 14px;\n color: #2f3941;\n border: none;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor {\n color: #87929d;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor svg {\n margin: auto;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor .emoji-mart-anchor-bar {\n background-color: #2f3941 !important;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor.emoji-mart-anchor-selected {\n color: #2f3941 !important;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-search input {\n border-radius: 2px;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-category-label span {\n padding-top: 8px;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-emoji span {\n cursor: pointer;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-emoji:hover::before {\n background-color: #e9ebed;\n border-radius: 2px;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-scroll {\n height: 264px;\n padding-bottom: 0px;\n}\n.neeto-editor-emoji-suggestion {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n padding: 4px;\n gap: 2px;\n font-family: apple color emoji, segoe ui emoji, noto color emoji, android emoji, emojisymbols, emojione mozilla, twemoji mozilla, segoe ui symbol;\n}\n.neeto-editor-emoji-suggestion p {\n font-size: 12px;\n color: #2f3941;\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item {\n padding: 6px;\n font-size: 24px;\n transition: all 0.3s ease-in-out;\n border-radius: 2px;\n line-height: 1;\n cursor: pointer;\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item:hover {\n background-color: #e9ebed;\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item--selected {\n background-color: #e9ebed;\n}\n.neeto-editor-image-editor {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1.25rem;\n}\n.neeto-editor-image-editor figure {\n display: flex;\n flex-direction: column;\n justify-content: center;\n min-height: 208px;\n max-height: 400px;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n}\n.neeto-editor-image-editor figure img {\n height: 100%;\n width: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.neeto-editor-image-editor .ne-input__wrapper {\n width: 100%;\n}\n.neeto-editor-image-editor .neeto-editor-image-editor__footer {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 0.5rem;\n}\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;\n}\n.ProseMirror {\n overflow-y: auto;\n height: 100%;\n white-space: break-spaces;\n}\n.ProseMirror::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.ProseMirror::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.ProseMirror::-webkit-scrollbar-track {\n background: "transparent";\n}\n.ProseMirror:focus {\n outline: none;\n}',{}),oe.prototype={constructor:oe,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return-1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new oe(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new oe(n)},addToStart:function(e,t){return new oe([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new oe(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new oe(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=oe.from(e)).size?new oe(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=oe.from(e)).size?new oe(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=oe.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},oe.from=function(e){if(e instanceof oe)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new oe(t)};class le{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(e,a)-a,t-a),o=!n):s.isLeaf?(r?i+="function"==typeof r?r(s):r:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new le(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new le(n,r)}cutByIndex(e,t){return e==t?le.empty:0==e&&t==this.content.length?this:new le(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new le(r,i)}addToStart(e){return new le([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new le(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return se(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return ae(this,e,t,n)}findIndex(e,t=-1){if(0==e)return ce(0,e);if(e==this.size)return ce(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?ce(n+1,i):ce(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return le.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new le(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return le.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new le(t||e,n)}static from(e){if(!e)return le.empty;if(e instanceof le)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new le([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}le.empty=new le([],0);const ue={index:0,offset:0};function ce(e,t){return ue.index=e,ue.offset=t,ue}function de(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!de(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!de(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class pe{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&de(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return pe.none;if(e instanceof pe)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}pe.none=[];class he extends Error{}class fe{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=ge(this.content,e+this.openStart,t);return n&&new fe(n,this.openStart,this.openEnd)}removeBetween(e,t){return new fe(me(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return fe.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new fe(le.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new fe(e,n,r)}}function me(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(me(o.content,t-i-1,n-i-1)))}function ge(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=ge(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function ye(e,t,n){if(n.openStart>e.depth)throw new he("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new he("Inconsistent open depths");return be(e,t,n,0)}function be(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=be(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(le.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return De(o,ke(e,i,s,t,r))}{let r=e.parent,i=r.content;return De(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return De(o,Ee(e,t,r))}function ve(e,t){if(!t.type.compatibleContent(e.type))throw new he("Cannot join "+t.type.name+" onto "+e.type.name)}function we(e,t,n){let r=e.node(n);return ve(r,t.node(n)),r}function xe(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Me(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(xe(e.nodeAfter,r),o++));for(let e=o;e<s;e++)xe(i.child(e),r);t&&t.depth==n&&t.textOffset&&xe(t.nodeBefore,r)}function De(e,t){if(!e.type.validContent(t))throw new he("Invalid content for node "+e.type.name);return e.copy(t)}function ke(e,t,n,r,i){let o=e.depth>i&&we(e,t,i+1),s=r.depth>i&&we(n,r,i+1),a=[];return Me(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(ve(o,s),xe(De(o,ke(e,t,n,r,i+1)),a)):(o&&xe(De(o,Ee(e,t,i+1)),a),Me(t,n,i,a),s&&xe(De(s,Ee(n,r,i+1)),a)),Me(r,null,i,a),new le(a)}function Ee(e,t,n){let r=[];if(Me(null,e,n,r),e.depth>n){xe(De(we(e,t,n+1),Ee(e,t,n+1)),r)}return Me(t,null,n,r),new le(r)}fe.empty=new fe(le.empty,0,0);class Ce{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return pe.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ae(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s)break;if(t=t.child(e),t.isText)break;i=s-1,r+=o+1}return new Ce(t,n,i)}static resolveCached(e,t){for(let n=0;n<Te.length;n++){let r=Te[n];if(r.pos==t&&r.doc==e)return r}let n=Te[Oe]=Ce.resolve(e,t);return Oe=(Oe+1)%Se,n}}let Te=[],Oe=0,Se=12;class Ae{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Ne=Object.create(null);class _e{constructor(e,t,n,r=pe.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||le.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&de(this.attrs,t||e.defaultAttrs||Ne)&&pe.sameSet(this.marks,n||pe.none)}copy(e=null){return e==this.content?this:new _e(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new _e(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return fe.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.node(o).content.cut(r.pos-s,i.pos-s);return new fe(a,r.depth-o,i.depth-o)}replace(e,t,n){return ye(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Ce.resolveCached(this,e)}resolveNoCache(e){return Ce.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ie(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=le.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let e=pe.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!pe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=le.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}_e.prototype.text=void 0;class je extends _e{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ie(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new je(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new je(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ie(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Le{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new ze(e,t);if(null==n.next)return Le.empty;let r=Pe(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n($e(e,0));function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);$e(e,n).forEach((e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new Le(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(He);o.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return o}}(function(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach((e=>e.to=t))}function o(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(o(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),i(o(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return i(o(e.expr,t),s),i(o(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(o(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();i(o(e.expr,s),t),s=t}if(-1==e.max)i(o(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),i(o(e.expr,s),t),s=t}return[r(s)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=o(e.exprs[r],t);if(r==e.exprs.length-1)return s;i(s,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return le.from(s.map((e=>e.createAndFill())));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r})).join("\n")}}Le.empty=new Le(!0);class ze{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Pe(e){let t=[];do{t.push(Fe(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Fe(e){let t=[];do{t.push(Re(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Re(e){let t=function(e){if(e.eat("(")){let t=Pe(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&i.push(r)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(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("{"))break;t=Ue(e,t)}return t}function Be(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Ue(e,t){let n=Be(e),r=n;return e.eat(",")&&(r="}"!=e.next?Be(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function He(e,t){return t-e}function $e(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(He)}function Ve(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function We(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function qe(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Qe(e[n]);return t}class Ye{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=qe(n.attrs),this.defaultAttrs=Ve(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Le.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:We(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new _e(this,this.computeAttrs(e),le.from(t),pe.setFrom(n))}createChecked(e=null,t,n){if(t=le.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new _e(this,this.computeAttrs(e),t,pe.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=le.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(le.empty,!0);return i?new _e(this,e,t.append(i),pe.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:pe.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new Ye(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class Qe{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Ke{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=qe(r.attrs),this.excluded=null;let i=Ve(this.attrs);this.instance=i?new pe(this,i):null}create(e=null){return!e&&this.instance?this.instance:new pe(this,We(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new Ke(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class Ge{constructor(e){this.cached=Object.create(null),this.spec={nodes:oe.from(e.nodes),marks:oe.from(e.marks||{}),topNode:e.topNode},this.nodes=Ye.compile(this.spec.nodes,this),this.marks=Ke.compile(this.spec.marks,this);let t=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let n=this.nodes[e],r=n.spec.content||"",i=n.spec.marks;n.contentMatch=t[r]||(t[r]=Le.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==i?null:i?Je(this,i.split(" ")):""!=i&&n.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Je(this,n.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(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof Ye))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new je(n,n.defaultAttrs,e,pe.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return _e.fromJSON(this,e)}markFromJSON(e){return pe.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Je(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Xe{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new at(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new at(this,t,!0);return n.addAll(e,t.from,t.to),fe.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(lt(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ut(e)),e.mark=t}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ut(e)),e.node=t}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Xe(e,Xe.schemaRules(e)))}}const Ze={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},et={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},tt={ol:!0,ul:!0},nt=1,rt=2,it=4;function ot(e,t,n){return null!=t?(t?nt:0)|("full"===t?rt:0):e&&"pre"==e.whitespace?nt|rt:n&~it}class st{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=pe.none,this.stashMarks=[],this.match=o||(s&it?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(le.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&nt)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=le.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(le.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):ct(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ze.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class at{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,o=ot(null,t.preserveWhitespace,0)|(n?it:0);r=i?new st(i.type,i.attrs,pe.none,pe.none,!0,t.topMatch||i.type.contentMatch,o):new st(n?null:e.schema.topNodeType,null,pe.none,pe.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style"),n=t?this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(let e=0;e<n.length;e++)this.addPendingMark(n[e]);if(this.addElement(e),null!=n)for(let e=0;e<n.length;e++)this.removePendingMark(n[e],r)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(n.options&rt||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&nt)t=n.options&rt?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();tt.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&tt.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:et.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let t,n=this.top,o=this.needsBlock;if(Ze.hasOwnProperty(r))t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=o}else this.addElementByRule(e,i,!1===i.consuming?n:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=pe.none;e:for(let n=0;n<e.length;n+=2)for(let r;;){let i=this.parser.matchStyle(e[n],e[n+1],this,r);if(!i)continue e;if(i.ignore)return null;if(t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;r=i}return t}addElementByRule(e,t,n){let r,i,o;if(t.node)i=this.parser.schema.nodes[t.node],i.isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace);else{o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o)}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let e=0;e<t.length;e++)this.enterInner(t[e],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let o=ot(e,r,i.options);i.options&it&&0==i.content.length&&(o|=it),this.nodes.push(new st(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));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(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)){t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function lt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ut(e){let t={};for(let n in e)t[n]=e[n];return t}function ct(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(o.indexOf(i)<0&&s(i))return!0}};if(s(i.contentMatch))return!0}}class dt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=ht(t).createDocumentFragment());let r=n,i=[];return e.forEach((e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=dt.renderSpec(ht(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&dt.renderSpec(ht(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let i=l;i<t.length;i++){let o=t[i];if(0===o){if(i<t.length-1||i>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:i}=dt.renderSpec(e,o,n);if(s.appendChild(t),i){if(r)throw new RangeError("Multiple content holes");r=i}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new dt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=pt(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return pt(e.marks)}}function pt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ht(e){return e.document||window.document}const ft=65535,mt=Math.pow(2,16);function gt(e,t){return e+t*mt}function yt(e){return e&ft}const bt=1,vt=2,wt=4,xt=8;class Mt{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&xt)>0}get deletedBefore(){return(this.delInfo&(bt|wt))>0}get deletedAfter(){return(this.delInfo&(vt|wt))>0}get deletedAcross(){return(this.delInfo&wt)>0}}class Dt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Dt.empty)return Dt.empty}recover(e){let t=0,n=yt(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(e&ft))/mt}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+i],u=this.ranges[s+o],c=a+l;if(e<=c){let i=a+r+((l?e==a?-1:e==c?1:t:t)<0?0:u);if(n)return i;let o=e==(t<0?a:c)?null:gt(s/3,e-a),d=e==a?vt:e==c?bt:wt;return(t<0?e!=a:e!=c)&&(d|=xt),new Mt(i,d,o)}r+=u-l}return n?e+r:new Mt(e+r,0,null)}touches(e,t){let n=0,r=yt(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+i];if(e<=s+a&&t==3*r)return!0;n+=this.ranges[t+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+t],u=this.ranges[r+n];e(s,s+l,a,a+u),i+=u-l}}invert(){return new Dt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Dt.empty:new Dt(e<0?[0,-e,0]:[0,0,e])}}Dt.empty=new Dt([]);class kt{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new kt(this.maps,this.mirror,e,t)}copy(){return new kt(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new kt;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this.maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Mt(e,r,null)}}const Et=Object.create(null);class Ct{getMap(){return Dt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Et[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Et)throw new RangeError("Duplicate use of step JSON ID "+e);return Et[e]=t,t.prototype.jsonID=e,t}}class Tt{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Tt(e,null)}static fail(e){return new Tt(null,e)}static fromReplace(e,t,n,r){try{return Tt.ok(e.replace(t,n,r))}catch(e){if(e instanceof he)return Tt.fail(e.message);throw e}}}function Ot(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(Ot(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return le.fromArray(r)}class St extends Ct{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new fe(Ot(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Tt.fromReplace(e,this.from,this.to,i)}invert(){return new At(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new St(t.pos,n.pos,this.mark)}merge(e){return e instanceof St&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new St(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new St(t.from,t.to,e.markFromJSON(t.mark))}}Ct.jsonID("addMark",St);class At extends Ct{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new fe(Ot(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Tt.fromReplace(e,this.from,this.to,n)}invert(){return new St(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new At(t.pos,n.pos,this.mark)}merge(e){return e instanceof At&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new At(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new At(t.from,t.to,e.markFromJSON(t.mark))}}Ct.jsonID("removeMark",At);class Nt extends Ct{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&jt(e,this.from,this.to)?Tt.fail("Structure replace would overwrite content"):Tt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Dt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Nt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Nt(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof Nt)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?fe.empty:new fe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Nt(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?fe.empty:new fe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Nt(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Nt(t.from,t.to,fe.fromJSON(e,t.slice),!!t.structure)}}Ct.jsonID("replace",Nt);class _t extends Ct{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(jt(e,this.from,this.gapFrom)||jt(e,this.gapTo,this.to)))return Tt.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Tt.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Tt.fromReplace(e,this.from,this.to,n):Tt.fail("Content does not fit in gap")}getMap(){return new Dt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new _t(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new _t(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new _t(t.from,t.to,t.gapFrom,t.gapTo,fe.fromJSON(e,t.slice),t.insert,!!t.structure)}}function jt(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function It(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Lt(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!It(r,i,o))break}return null}function zt(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<i;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return o?i.map(Pt).concat({type:t,attrs:n}).concat(o.map(Pt)):null}function Pt(e){return{type:e,attrs:null}}function Ft(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=r&&r[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function Rt(e,t){let n=e.resolve(t),r=n.index();return function(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Bt(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(o,o,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Ut(e,t,n=t,r=fe.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return Ht(i,o,r)?new Nt(t,n,r):new $t(i,o,r).fit()}function Ht(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Ct.jsonID("replaceAround",_t);class $t{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=le.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=le.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new fe(i,o,s);return e>-1?new _t(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Nt(n.pos,r.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,r=null;t?(r=qt(this.unplaced.content,t-1).firstChild,n=r.content):n=this.unplaced.content;let i=n.firstChild;for(let n=this.depth;n>=0;n--){let o,{type:s,match:a}=this.frontier[n],l=null;if(1==e&&(i?a.matchType(i.type)||(l=a.fillBefore(le.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:t,frontierDepth:n,parent:r,inject:l};if(2==e&&i&&(o=a.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:n,parent:r,wrap:o};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=qt(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new fe(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=qt(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new fe(Vt(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new fe(Vt(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,l=0,u=[],{match:c,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)u.push(r.child(e));c=c.matchFragment(r)}let p=s.size+e-(o.content.size-o.openEnd);for(;l<s.childCount;){let e=s.child(l),t=c.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(c=t,u.push(Yt(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?p:-1)))}let h=l==s.childCount;h||(p=-1),this.placed=Wt(this.placed,t,le.from(u)),this.frontier[t].match=c,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<p;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=h?0==e?fe.empty:new fe(Vt(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new fe(Vt(o.content,e,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Qt(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=Qt(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Qt(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Wt(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Wt(this.placed,this.depth,le.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(le.empty,!0);e.childCount&&(this.placed=Wt(this.placed,this.frontier.length,e))}}function Vt(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Vt(e.firstChild.content,t-1,n)))}function Wt(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Wt(e.lastChild.content,t-1,n)))}function qt(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Yt(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Yt(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(le.empty,!0)))),e.copy(r)}function Qt(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function Kt(e){return e.spec.defining||e.spec.definingForContent}function Gt(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Gt(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(le.empty,!0))}return e}function Jt(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}let Xt=class extends Error{};Xt=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Xt.prototype=Object.create(Error.prototype)).constructor=Xt,Xt.prototype.name="TransformError";class Zt{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new kt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Xt(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=fe.empty){let r=Ut(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new fe(le.from(n),0,0))}delete(e,t){return this.replace(e,t,fe.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(Ht(i,o,r))return e.step(new Nt(t,n,r));let s=Jt(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:i.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),u=[],c=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(u.push(n),t==r.openStart)break;e=n.content}for(let e=c-1;e>=0;e--){let t=u[e].type,n=Kt(t);if(n&&i.node(l).type!=t)c=e;else if(n||!t.isTextblock)break}for(let t=r.openStart;t>=0;t--){let a=(t+c+1)%(r.openStart+1),d=u[a];if(d)for(let t=0;t<s.length;t++){let u=s[(t+l)%s.length],c=!0;u<0&&(c=!1,u=-u);let p=i.node(u-1),h=i.index(u-1);if(p.canReplaceWith(h,h,d.type,d.marks))return e.replace(i.before(u),c?o.after(u):n,new fe(Gt(r.content,0,r.openStart,a),a,r.openEnd))}}let d=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,r),!(e.steps.length>d));a--){let e=s[a];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}(e.doc,t,r.type);null!=i&&(t=n=i)}e.replaceRange(t,n,new fe(le.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=Jt(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o)return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,u=a,c=le.empty,d=0;for(let e=o,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,c=le.from(r.node(e).copy(c)),d++):l--;let p=le.empty,h=0;for(let e=o,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,p=le.from(i.node(e).copy(p)),h++):u++;e.step(new _t(l,u,s,a,new fe(c.append(p),d,h),c.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=new Nt(t-n,t+n,fe.empty,!0);e.step(r)}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=le.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=le.from(n[e].type.create(n[e].attrs,r))}let i=t.start,o=t.end;e.step(new _t(i,o,i,o,new fe(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),r)){e.clearIncompatible(e.mapping.slice(o).map(n,1),r);let s=e.mapping.slice(o),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new _t(a,l,a+1,l-1,new fe(le.from(r.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r=[]){return function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new _t(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new fe(le.from(s),0,0),1,!0))}(this,e,t,n,r),this}split(e,t=1,n){return function(e,t,n=1,r){let i=e.doc.resolve(t),o=le.empty,s=le.empty;for(let e=i.depth,t=i.depth-n,a=n-1;e>t;e--,a--){o=le.from(i.node(e).copy(o));let t=r&&r[a];s=le.from(t?t.type.create(t.attrs,s):i.node(e).copy(s))}e.step(new Nt(t,t,new fe(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,u)=>{if(!e.isInline)return;let c=e.marks;if(!r.isInSet(c)&&u.type.allowsMarkType(r.type)){let u=Math.max(l,t),d=Math.min(l+e.nodeSize,n),p=r.addToSet(c);for(let e=0;e<c.length;e++)c[e].isInSet(p)||(i&&i.to==u&&i.mark.eq(c[e])?i.to=d:s.push(i=new At(u,d,c[e])));o&&o.to==u?o.to=d:a.push(o=new St(u,d,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;o++;let a=null;if(r instanceof Ke){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&l.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=o):i.push({style:l,from:Math.max(s,t),to:r,step:o})}}})),i.forEach((t=>e.step(new At(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<i.childCount;t++){let a=i.child(t),l=s+a.nodeSize,u=r.matchType(a.type);if(u){r=u;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new At(s,l,a.marks[t]))}else o.push(new Nt(s,l,fe.empty));s=l}if(!r.validEnd){let t=r.fillBefore(le.empty,!0);e.replace(s,s,new fe(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}(this,e,t,n),this}}const en=Object.create(null);class tn{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new nn(e.min(t),e.max(t))]}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 e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=fe.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],u=e.mapping.slice(i);e.replaceRange(u.map(a.pos),u.map(l.pos),s?fe.empty:t),0==s&&hn(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=e.mapping.slice(n),l=a.map(o.pos),u=a.map(s.pos);i?e.deleteRange(l,u):(e.replaceRangeWith(l,u,t),hn(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new sn(e):pn(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?pn(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):pn(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new cn(e.node(0))}static atStart(e){return pn(e,e,0,0,1)||new cn(e)}static atEnd(e){return pn(e,e,e.content.size,e.childCount,-1)||new cn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=en[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in en)throw new RangeError("Duplicate use of selection JSON ID "+e);return en[e]=t,t.prototype.jsonID=e,t}getBookmark(){return sn.between(this.$anchor,this.$head).getBookmark()}}tn.prototype.visible=!0;class nn{constructor(e,t){this.$from=e,this.$to=t}}let rn=!1;function on(e){rn||e.parent.inlineContent||(rn=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class sn extends tn{constructor(e,t=e){on(e),on(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return tn.near(n);let r=e.resolve(t.map(this.anchor));return new sn(r.parent.inlineContent?r:n,n)}replace(e,t=fe.empty){if(super.replace(e,t),t==fe.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof sn&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new an(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new sn(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=tn.findFrom(t,n,!0)||tn.findFrom(t,-n,!0);if(!e)return tn.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(tn.findFrom(e,-n,!0)||tn.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new sn(e,t)}}tn.jsonID("text",sn);class an{constructor(e,t){this.anchor=e,this.head=t}map(e){return new an(e.map(this.anchor),e.map(this.head))}resolve(e){return sn.between(e.resolve(this.anchor),e.resolve(this.head))}}class ln extends tn{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?tn.near(i):new ln(i)}content(){return new fe(le.from(this.node),0,0)}eq(e){return e instanceof ln&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new un(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ln(e.resolve(t.anchor))}static create(e,t){return new ln(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}ln.prototype.visible=!1,tn.jsonID("node",ln);class un{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new an(n,n):new un(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&ln.isSelectable(n)?new ln(t):tn.near(t)}}class cn extends tn{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=fe.empty){if(t==fe.empty){e.delete(0,e.doc.content.size);let t=tn.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new cn(e)}map(e){return new cn(e)}eq(e){return e instanceof cn}getBookmark(){return dn}}tn.jsonID("all",cn);const dn={map(){return this},resolve:e=>new cn(e)};function pn(e,t,n,r,i,o=!1){if(t.inlineContent)return sn.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&ln.isSelectable(r))return ln.create(e,n-(i<0?r.nodeSize:0))}else{let t=pn(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function hn(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,o=e.steps[r];(o instanceof Nt||o instanceof _t)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(tn.near(e.doc.resolve(i),n)))}const fn=1,mn=2,gn=4;class yn extends Zt{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|fn)&~mn,this.storedMarks=null,this}get selectionSet(){return(this.updated&fn)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=mn,this}ensureMarks(e){return pe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&mn)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~mn,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||pe.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(tn.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=gn,this}get scrolledIntoView(){return(this.updated&gn)>0}}function bn(e,t){return t&&e?e.bind(t):e}class vn{constructor(e,t,n){this.name=e,this.init=bn(t.init,n),this.apply=bn(t.apply,n)}}const wn=[new vn("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new vn("selection",{init:(e,t)=>e.selection||tn.atStart(t.doc),apply:e=>e.selection}),new vn("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new vn("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class xn{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=wn.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new vn(e.key,e.spec.state,e))}))}}class Mn{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,u=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(u&&n.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(u),n=n.applyInner(u),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Mn(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new yn(this)}static create(e){let t=new xn(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Mn(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new xn(this.schema,e.plugins),n=t.fields,r=new Mn(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new xn(e.schema,e.plugins),i=new Mn(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=_e.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=tn.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=a.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function Dn(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=Dn(i,t,{})),n[r]=i}return n}class kn{constructor(e){this.spec=e,this.props={},e.props&&Dn(e.props,this,this.props),this.key=e.key?e.key.key:Cn("plugin")}getState(e){return e[this.key]}}const En=Object.create(null);function Cn(e){return e in En?e+"$"+ ++En[e]:(En[e]=0,e+"$")}class Tn{constructor(e="key"){this.key=Cn(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const On="undefined"!=typeof navigator?navigator:null,Sn="undefined"!=typeof document?document:null,An=On&&On.userAgent||"",Nn=/Edge\/(\d+)/.exec(An),_n=/MSIE \d/.exec(An),jn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(An),In=!!(_n||jn||Nn),Ln=_n?document.documentMode:jn?+jn[1]:Nn?+Nn[1]:0,zn=!In&&/gecko\/(\d+)/i.test(An);zn&&(/Firefox\/(\d+)/.exec(An)||[0,0])[1];const Pn=!In&&/Chrome\/(\d+)/.exec(An),Fn=!!Pn,Rn=Pn?+Pn[1]:0,Bn=!In&&!!On&&/Apple Computer/.test(On.vendor),Un=Bn&&(/Mobile\/\w+/.test(An)||!!On&&On.maxTouchPoints>2),Hn=Un||!!On&&/Mac/.test(On.platform),$n=/Android \d/.test(An),Vn=!!Sn&&"webkitFontSmoothing"in Sn.documentElement.style,Wn=Vn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,qn=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Yn=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let Qn=null;const Kn=function(e,t,n){let r=Qn||(Qn=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Gn=function(e,t,n,r){return n&&(Xn(e,t,n,r,-1)||Xn(e,t,n,r,1))},Jn=/^(img|br|input|textarea|hr)$/i;function Xn(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Zn(e))){let n=e.parentNode;if(!n||1!=n.nodeType||er(e)||Jn.test(e.nodeName)||"false"==e.contentEditable)return!1;t=qn(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?Zn(e):0}}}function Zn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function er(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const tr=function(e){let t=e.isCollapsed;return t&&Fn&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function nr(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function rr(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function ir(e,t){return"number"==typeof e?e:e[t]}function or(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function sr(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Yn(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?rr(o):or(e),l=0,u=0;if(t.top<a.top+ir(r,"top")?u=-(a.top-t.top+ir(i,"top")):t.bottom>a.bottom-ir(r,"bottom")&&(u=t.bottom-a.bottom+ir(i,"bottom")),t.left<a.left+ir(r,"left")?l=-(a.left-t.left+ir(i,"left")):t.right>a.right-ir(r,"right")&&(l=t.right-a.right+ir(i,"right")),l||u)if(n)o.defaultView.scrollBy(l,u);else{let n=e.scrollLeft,r=e.scrollTop;u&&(e.scrollTop+=u),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n)break}}function ar(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Yn(r));return t}function lr(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let ur=null;function cr(e,t){let n,r,i=2e8,o=0,s=t.top,a=t.top;for(let l=e.firstChild,u=0;l;l=l.nextSibling,u++){let e;if(1==l.nodeType)e=l.getClientRects();else{if(3!=l.nodeType)continue;e=Kn(l).getClientRects()}for(let c=0;c<e.length;c++){let d=e[c];if(d.top<=s&&d.bottom>=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let e=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(e<i){n=l,i=e,r=e&&3==n.nodeType?{left:d.right<t.left?d.right:d.left,top:t.top}:t,1==l.nodeType&&e&&(o=u+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=u+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=fr(r,1);if(n.top!=n.bottom&&dr(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:o}:cr(n,r)}function dr(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function pr(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(dr(t,i))return pr(n,t,i)}}if((o=(o+1)%r)==i)break}return e}function hr(e,t){let n,r=e.dom.ownerDocument,i=0;if(r.caretPositionFromPoint)try{let e=r.caretPositionFromPoint(t.left,t.top);e&&({offsetNode:n,offset:i}=e)}catch(e){}if(!n&&r.caretRangeFromPoint){let e=r.caretRangeFromPoint(t.left,t.top);e&&({startContainer:n,startOffset:i}=e)}let o,s=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top+1);if(!s||!e.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=e.dom.getBoundingClientRect();if(!dr(t,n))return null;if(s=pr(e.dom,t,n),!s)return null}if(Bn)for(let e=s;n&&e;e=Yn(e))e.draggable&&(n=void 0);if(s=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(s,t),n){if(zn&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(o=function(e,t,n,r){let i=-1;for(let n=t;n!=e.dom;){let t=e.docView.nearestDesc(n,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>r.left||e.top>r.top)i=t.posBefore;else{if(!(e.right<r.left||e.bottom<r.top))break;i=t.posAfter}}n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,1)}(e,n,i,t))}null==o&&(o=function(e,t,n){let{node:r,offset:i}=cr(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:o,inside:a?a.posAtStart-a.border:-1}}function fr(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const mr=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function gr(e,t,n){let{node:r,offset:i}=e.docView.domFromPos(t,n<0?-1:1),o=Vn||zn;if(3==r.nodeType){if(!o||!mr.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,yr(fr(Kn(r,e,t),o),o<0)}{let e=fr(Kn(r,i,i),n);if(zn&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=fr(Kn(r,i-1,i-1),-1);if(t.top==e.top){let n=fr(Kn(r,i,i+1),-1);if(n.top!=e.top)return yr(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(n<0||i==Zn(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return br(e.getBoundingClientRect(),!1)}if(i<Zn(r)){let e=r.childNodes[i];if(1==e.nodeType)return br(e.getBoundingClientRect(),!0)}return br(r.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==Zn(r))){let e=r.childNodes[i-1],t=3==e.nodeType?Kn(e,Zn(e)-(o?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return yr(fr(t,1),!1)}if(i<Zn(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Kn(e,0,o?0:1):1==e.nodeType?e:null:null;if(t)return yr(fr(t,-1),!0)}return yr(fr(3==r.nodeType?Kn(r):r,-n),n>=0)}function yr(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function br(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function vr(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const wr=/[\u0590-\u08ac]/;let xr=null,Mr=null,Dr=!1;function kr(e,t,n){return xr==t&&Mr==n?Dr:(xr=t,Mr=n,Dr="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return vr(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let r=gr(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=Kn(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return wr.test(r.parent.textContent)&&a.modify?vr(e,t,(()=>{let t=a.getRangeAt(0),i=a.focusNode,o=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||i==a.focusNode&&o==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?o:s}(e,t,n))}const Er=0,Cr=1,Tr=2,Or=3;class Sr{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Er,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>qn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0};let n,r=0,i=0;for(let t=0;r<this.children.length;r++){let n=this.children[r],o=t+n.size;if(o>e||n instanceof zr){i=e-t;break}t=o}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Ar&&n.side>=0;r--);if(t<=0){let e,n=!0;for(;e=r?this.children[r-1]:null,e&&e.dom.parentNode!=this.contentDOM;r--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?qn(e.dom)+1:0}}{let e,n=!0;for(;e=r<this.children.length?this.children[r]:null,e&&e.dom.parentNode!=this.contentDOM;r++,n=!1);return e&&n&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?qn(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==r&&e<=a){let i=o+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=qn(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=qn(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],u=a+l.size;if(i>a&&o<u)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=u}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),u=!1;if((zn||Bn)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(u=!(!t||"\n"!=e.nodeValue[t-1]),u&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(s=a={node:t.parentNode,offset:qn(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(zn&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let e=l.focusNode.childNodes[l.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||u&&Bn)&&Gn(s.node,s.offset,l.anchorNode,l.anchorOffset)&&Gn(a.node,a.offset,l.focusNode,l.focusOffset))return;let c=!1;if((l.extend||e==t)&&!u){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),c=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!c){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?Tr:Cr,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=Or);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?Or:Tr}n=o}this.dirty=Tr}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?Tr:Cr;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Ar extends Sr{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,(()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Er&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||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 Nr extends Sr{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class _r extends Sr{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=dt.renderSpec(document,t.type.spec.toDOM(t,n))),new _r(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return this.dirty&Or||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=Or&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Er){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=Er}}slice(e,t,n){let r=_r.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=Kr(i,t,o,n)),e>0&&(i=Kr(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}}class jr extends Sr{constructor(e,t,n,r,i,o,s,a,l){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s,o&&this.updateChildren(a,l)}static create(e,t,n,r,i,o){let s,a=i.nodeViews[t.type.name],l=a&&a(t,i,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),u=l&&l.dom,c=l&&l.contentDOM;if(t.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(t.text);else u||({dom:u,contentDOM:c}=dt.renderSpec(document,t.type.spec.toDOM(t)));c||t.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let d=u;return u=Vr(u,n,t),l?s=new Pr(e,t,n,r,u,c||null,d,l,i,o+1):t.isText?new Lr(e,t,n,r,u,d,i):new jr(e,t,n,r,u,c||null,d,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>le.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return this.dirty==Er&&e.eq(this.node)&&Wr(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new Yr(this,o&&o.node);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],l=null;for(let u=0;;){if(s<i.length&&i[s].to==o){let e,t=i[s++];for(;s<i.length&&i[s].to==o;)(e||(e=[t])).push(i[s++]);if(e){e.sort(Qr);for(let t=0;t<e.length;t++)n(e[t],u,!!l)}else n(t,u,!!l)}let c,d;if(l)d=-1,c=l,l=null;else{if(!(u<e.childCount))break;d=u,c=e.child(u++)}for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let p=o+c.nodeSize;if(c.isText){let e=p;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<p&&(l=c.cut(e-o),c=c.cut(0,e-o),p=e,d=-1)}let h=c.isInline&&!c.isLeaf?a.filter((e=>!e.inline)):a.slice();r(c,h,t.forChild(o,c),d),o=p}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?pe.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,l,u)=>{let c;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,l,u)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(c=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,l,c,e)||a.updateNextNode(t,o,l,e,u)||a.addNode(t,o,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Tr)&&(o&&this.protectLocalComposition(e,o),Fr(this.contentDOM,this.children,e),Un&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof sn)||n<t||r>t+this.node.content.size)return null;let i=e.domSelection(),o=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=Zn(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(i.focusNode,i.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;l+=t.text}if(o>=n){let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;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 o=new Nr(this,i,t,r);e.input.compositionNodes.push(o),this.children=Kr(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(this.dirty==Or||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Er}updateOuterDeco(e){if(Wr(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Hr(this.dom,this.nodeDOM,Ur(this.outerDeco,this.node,t),Ur(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Ir(e,t,n,r,i){return Vr(r,t,e),new jr(void 0,e,t,n,r,r,r,i,0)}class Lr extends jr{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(this.dirty==Or||this.dirty!=Er&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==Er&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Er,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new Lr(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=Or)}get domAtom(){return!1}}class zr extends Sr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Er&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Pr extends jr{constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r,i,o,s,l,u),this.spec=a}update(e,t,n,r){if(this.dirty==Or)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Fr(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=qr(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof _r){let t=r?r.previousSibling:e.lastChild;Fr(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=qr(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Rr=function(e){e&&(this.nodeName=e)};Rr.prototype=Object.create(null);const Br=[new Rr];function Ur(e,t,n){if(0==e.length)return Br;let r=n?Br[0]:new Rr,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Rr(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new Rr(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}}return i}function Hr(e,t,n,r){if(n==Br&&r==Br)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||(t=document.createElement(o.nodeName),t.pmIsDeco=!0,t.appendChild(i),s=Br[0]),i=t}$r(i,s||Br[0],o)}return i}function $r(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function Vr(e,t,n){return Hr(e,e,Br,Ur(t,n,1!=e.nodeType))}function Wr(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function qr(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Yr{constructor(e,t){this.lock=t,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof _r)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,i=this.stack.length>>1,o=Math.min(i,e.length);for(;r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=Er,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++)if(this.top.children[t].matchesMark(e[i])){r=t;break}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=_r.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let r=this.index,i=Math.min(this.top.children.length,r+5);r<i;r++){let i=this.top.children[r];if(i.matchesNode(e,t,n)&&!this.preMatch.matched.has(i)){o=r;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return o.dirty==Or&&o.dom==o.contentDOM&&(o.dirty=Tr),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index=r+1,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,i){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof jr){let a=this.preMatch.matched.get(s);if(null!=a&&a!=i)return!1;let l=s.dom;if(!(this.lock&&(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Or&&Wr(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(e,t,n,r,i){this.top.children.splice(this.index++,0,jr.create(this.top,e,t,n,r,i)),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new Ar(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof _r;)t=e,e=t.children[t.children.length-1];e&&e instanceof Lr&&!/\n$/.test(e.node.text)||((Bn||Fn)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new zr(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}function Qr(e,t){return e.type.side-t.type.side}function Kr(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],u=a,c=a+=l.size;u>=n||c<=t?o.push(l):(u<t&&o.push(l.slice(0,t-u,r)),i&&(o.push(i),i=void 0),c>n&&o.push(l.slice(n-u,l.size,r)))}return o}function Gr(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,u=r.resolve(s);if(tr(n)){for(a=u;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&ln.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==Zn(e);r||i;){if(e==n)return!0;let t=qn(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==Zn(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new ln(s==e?u:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=oi(e,a,u,"pointer"==t||e.state.selection.head<u.pos&&!o?1:-1)}return l}function Jr(e){return e.editable?e.hasFocus():ai(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Xr(e,t=!1){let n=e.state.selection;if(ri(e,n),Jr(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Fn){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Gn(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,qn(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&In&&Ln<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,i,{anchor:o,head:s}=n;!Zr||n instanceof sn||(n.$from.parent.inlineContent||(r=ei(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=ei(e,n.to))),e.docView.setSelection(o,s,e.root,t),Zr&&(r&&ni(r),i&&ni(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Jr(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Zr=Bn||Fn&&Rn<63;function ei(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Bn&&i&&"false"==i.contentEditable)return ti(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return ti(i);if(o)return ti(o)}}function ti(e){return e.contentEditable="true",Bn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function ni(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function ri(e,t){if(t instanceof ln){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(ii(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else ii(e)}function ii(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function oi(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||sn.between(t,n,r)}function si(e){return(!e.editable||e.root.activeElement==e.dom)&&ai(e)}function ai(e){let t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function li(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&tn.findFrom(o,t)}function ui(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function ci(e,t,n){let r=e.state.selection;if(!(r instanceof sn)){if(r instanceof ln&&r.node.isInline)return ui(e,new sn(t>0?r.$to:r.$from));{let n=li(e.state,t);return!!n&&ui(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=li(e.state,t);return!!(n&&n instanceof ln)&&ui(e,n)}if(!(Hn&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(ln.isSelectable(o)?ui(e,new ln(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!Vn&&ui(e,new sn(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function di(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function pi(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function hi(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(zn&&1==n.nodeType&&r<di(n)&&pi(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(pi(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(mi(n))break;{let t=n.previousSibling;for(;t&&pi(t);)i=n.parentNode,o=qn(t),t=t.previousSibling;if(t)n=t,r=di(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?gi(e,t,n,r):i&&gi(e,t,i,o)}function fi(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=di(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!pi(n.childNodes[r]))break;i=n,o=++r}else{if(mi(n))break;{let t=n.nextSibling;for(;t&&pi(t);)i=t.parentNode,o=qn(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=di(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&gi(e,t,i,o)}function mi(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function gi(e,t,n,r){if(tr(t)){let e=document.createRange();e.setEnd(n,r),e.setStart(n,r),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&Xr(e)}),50)}function yi(e,t,n){let r=e.state.selection;if(r instanceof sn&&!r.empty||n.indexOf("s")>-1)return!1;if(Hn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=li(e.state,t);if(n&&n instanceof ln)return ui(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof cn?tn.near(n,t):tn.findFrom(n,t);return!!s&&ui(e,s)}return!1}function bi(e,t){if(!(e.state.selection instanceof sn))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function vi(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function wi(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||Hn&&72==n&&"c"==r?bi(e,-1)||hi(e):46==n||Hn&&68==n&&"c"==r?bi(e,1)||fi(e):13==n||27==n||(37==n||Hn&&66==n&&"c"==r?ci(e,-1,r)||hi(e):39==n||Hn&&70==n&&"c"==r?ci(e,1,r)||fi(e):38==n||Hn&&80==n&&"c"==r?yi(e,-1,r)||hi(e):40==n||Hn&&78==n&&"c"==r?function(e){if(!Bn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;vi(e,n,"true"),setTimeout((()=>vi(e,n,"false")),20)}return!1}(e)||yi(e,1,r)||fi(e):r==(Hn?"m":"c")&&(66==n||73==n||89==n||90==n))}function xi(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||dt.fromSchema(e.state.schema),a=Ni(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&1==c.nodeType&&(u=Si[c.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=a.createElement(u[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}c=l.firstChild}c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n");return{dom:l,text:p}}function Mi(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new fe(le.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):fe.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=dt.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Ni().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&Si[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=e,n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),Vn&&function(e){let t=e.querySelectorAll(Fn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let e=+c[3];e>0&&o.firstChild;e--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Xe.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!c),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Di.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(c)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=le.from(t.create(n[e+1],i)),o++,s++}return new fe(i,o,s)}(Oi(s,+c[1],+c[2]),c[4]);else if(s=fe.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&Ei(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Ci(o[o.length-1],r.length));let t=ki(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return le.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Oi(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const Di=/^(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 ki(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,le.from(e));return e}function Ei(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=Ei(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(le.from(ki(n,e,i+1))))}}function Ci(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Ci(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(le.empty,!0);return e.copy(n.append(r))}function Ti(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return i<r-1&&(a=Ti(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(le.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Oi(e,t,n){return t<e.openStart&&(e=new fe(Ti(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new fe(Ti(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Si={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Ai=null;function Ni(){return Ai||(Ai=document.implementation.createHTMLDocument("title"))}const _i={};let ji={};class Ii{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.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Li(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function zi(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Pi(e,t))}))}function Pi(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Fi(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Ri(e){return{left:e.clientX,top:e.clientY}}function Bi(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,(t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1))))return!0;return!1}function Ui(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Hi(e,t,n,r,i){return Bi(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof ln&&(n=i.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(ln.isSelectable(t)){r=n&&i.$from.depth>0&&e>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(e);break}}return null!=r&&(Ui(e,ln.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&ln.isSelectable(r))&&(Ui(e,new ln(n),"pointer"),!0)}(e,n))}function $i(e,t,n,r){return Bi(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Vi(e,t,n,r){return Bi(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Ui(e,sn.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)Ui(e,sn.create(r,o+1,o+1+n.content.size),"pointer");else{if(!ln.isSelectable(n))continue;Ui(e,ln.create(r,o),"pointer")}return!0}}(e,n,r)}function Wi(e){return Xi(e)}ji.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Qi(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!$n||!Fn||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Un||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||wi(e,n)?n.preventDefault():Li(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,nr(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},ji.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},ji.keypress=(e,t)=>{let n=t;if(Qi(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Hn&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof sn&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const qi=Hn?"metaKey":"ctrlKey";_i.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Wi(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[qi]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(Ri(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Yi(e,s,n,!!r)):("doubleClick"==o?$i:Vi)(e,s.pos,s.inside,n)?n.preventDefault():Li(e,"pointer"))};class Yi{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[qi],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof ln&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!zn||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()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Li(e,"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((()=>Xr(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Ri(e))),this.allowDefault||!t?Li(this.view,"pointer"):Hi(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Bn&&this.mightDrag&&!this.mightDrag.node.isAtom||Fn&&!(this.view.state.selection instanceof sn)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ui(this.view,tn.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Li(this.view,"pointer")}move(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),Li(this.view,"pointer"),0==e.buttons&&this.done()}}function Qi(e,t){return!!e.composing||!!(Bn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}_i.touchdown=e=>{Wi(e),Li(e,"pointer")},_i.contextmenu=e=>Wi(e);const Ki=$n?5e3:-1;function Gi(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Xi(e)),t))}function Ji(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Xi(e,t=!1){if(!($n&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Ji(e),t||e.docView&&e.docView.dirty){let t=Gr(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}ji.compositionstart=ji.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),Xi(e,!0),e.markCursor=null;else if(Xi(e),zn&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}Gi(e,Ki)},ji.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Gi(e,20))};const Zi=In&&Ln<15||Un&&Wn<604;function eo(e,t,n,r){let i=Mi(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||fe.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}_i.copy=ji.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=Zi?null:n.clipboardData,s=r.content(),{dom:a,text:l}=xi(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},ji.paste=(e,t)=>{let n=t;if(e.composing&&!$n)return;let r=Zi?null:n.clipboardData;r&&eo(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?eo(e,r.value,null,t):eo(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class to{constructor(e,t){this.slice=e,this.move=t}}const no=Hn?"altKey":"ctrlKey";_i.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Ri(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof ln?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(ln.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(ln.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=xi(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Zi?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Zi||n.dataTransfer.setData("text/plain",l),e.dragging=new to(s,!n[no])},_i.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},ji.dragover=ji.dragenter=(e,t)=>t.preventDefault(),ji.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Ri(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Mi(e,n.dataTransfer.getData(Zi?"Text":"text/plain"),Zi?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[no]);if(e.someProp("handleDrop",(t=>t(e,n,s||fe.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?Bt(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let u=e.state.tr;a&&u.deleteSelection();let c=u.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(p))return;let h=u.doc.resolve(c);if(d&&ln.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new ln(h));else{let t=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),u.setSelection(oi(e,h,u.doc.resolve(t)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))},_i.focus=e=>{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.domSelection())&&Xr(e)}),20))},_i.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},_i.beforeinput=(e,t)=>{if(Fn&&$n&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,nr(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in ji)_i[e]=ji[e];function ro(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class io{constructor(e,t){this.toDOM=e,this.spec=t||uo,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new ao(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof io&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ro(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class oo{constructor(e,t){this.attrs=e,this.spec=t||uo}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new ao(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof oo&&ro(this.attrs,e.attrs)&&ro(this.spec,e.spec)}static is(e){return e.type instanceof oo}destroy(){}}class so{constructor(e,t){this.attrs=e,this.spec=t||uo}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new ao(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof so&&ro(this.attrs,e.attrs)&&ro(this.spec,e.spec)}destroy(){}}class ao{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new ao(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new ao(e,e,new io(t,n))}static inline(e,t,n,r){return new ao(e,t,new oo(n,r))}static node(e,t,n,r){return new ao(e,t,new so(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof oo}}const lo=[],uo={};class co{constructor(e,t){this.local=e.length?e:lo,this.children=t.length?t:lo}static create(e,t){return t.length?yo(t,e,0,uo):po}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==po||0==e.maps.length?this:this.mapInner(e,t,0,0,n||uo)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice(),l=(e,t,n,r)=>{for(let s=0;s<a.length;s+=3){let l,u=a[s+1];if(u<0||e>u+o)continue;let c=a[s]+o;t>=c?a[s+1]=e<=c?-2:-1:n>=i&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l)}};for(let e=0;e<n.maps.length;e++)n.maps[e].forEach(l);let u=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){u=!0,a[t+1]=-1;continue}let l=n.map(e[t]+o),c=l-i;if(c<0||c>=r.content.size){u=!0;continue}let d=n.map(e[t+1]+o,-1)-i,{index:p,offset:h}=r.content.findIndex(c),f=r.maybeChild(p);if(f&&h==c&&h+f.nodeSize==d){let r=a[t+2].mapInner(n,f,l+1,e[t]+o+1,s);r!=po?(a[t]=c,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,u=!0)}else u=!0}if(u){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(r,i,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+o+1);return n}(a,e,t,n,i,o,s),u=yo(l,r,0,s);t=u.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<u.children.length;e+=3){let n=u.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,u.children[e],u.children[e+1],u.children[e+2])}}return new co(t.sort(bo),a)}(this.children,o||[],e,t,n,r,i):o?new co(o.sort(bo),lo):po}add(e,t){return t.length?this==po?co.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,a=o+n;if(s=mo(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,a+1):r.splice(i,0,o,o+e.nodeSize,yo(s,e,a+1,uo)),i+=3}}));let o=fo(i?go(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new co(o.length?this.local.concat(o).sort(bo):this.local,r||this.children)}remove(e){return 0==e.length||this==po?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(i||(i=[])).push(t));if(!i)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(i,o+1);a!=po?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,i=0;i<e.length;i++)if(n=e[i])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new co(r,n):po}forChild(e,t){if(this==po)return this;if(t.isLeaf)return co.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof oo){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new co(r.sort(bo),lo);return n?new ho([e,n]):e}return n||po}eq(e){if(this==e)return!0;if(!(e instanceof co)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return vo(this.localsInner(e))}localsInner(e){if(this==po)return lo;if(e.inlineContent||!this.local.some(oo.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof oo||t.push(this.local[e]);return t}}co.empty=new co([],[]),co.removeOverlap=vo;const po=co.empty;class ho{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,uo)));return ho.from(n)}forChild(e,t){if(t.isLeaf)return co.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=po&&(i instanceof ho?n=n.concat(i.members):n.push(i))}return ho.from(n)}eq(e){if(!(e instanceof ho)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?vo(n?t:t.sort(bo)):lo}static from(e){switch(e.length){case 0:return po;case 1:return e[0];default:return new ho(e)}}}function fo(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new ao(i.from+t,i.to+t,i.type))}return n}function mo(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t,o=0;o<e.length;o++)(t=e[o])&&t.from>n&&t.to<r&&((i||(i=[])).push(t),e[o]=null);return i}function go(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function yo(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=mo(e,t,s+n);if(a){o=!0;let e=yo(a,t,n+s+1,r);e!=po&&i.push(s,s+t.nodeSize,e)}}));let s=fo(o?go(e):e,-n).sort(bo);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new co(s,i):po}function bo(e,t){return e.from-t.from||e.to-t.to}function vo(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),wo(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),wo(t,i+1,o.copy(r.to,o.to)))}}return t}function wo(e,t,n){for(;t<e.length&&bo(n,e[t])>0;)t++;e.splice(t,0,n)}function xo(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=po&&t.push(r)})),e.cursorWrapper&&t.push(co.create(e.state.doc,[e.cursorWrapper.deco])),ho.from(t)}const Mo={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Do=In&&Ln<=11;class ko{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Eo{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ko,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);In&&Ln<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),Do&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.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.observe(this.view.dom,Mo),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.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(si(this.view)){if(this.suppressingSelectionUpdates)return Xr(this.view);if(In&&Ln<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&Gn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&si(this.view)&&!this.ignoreSelectionChange(t),r=-1,i=-1,o=!1,s=[];if(this.view.editable)for(let t=0;t<e.length;t++){let n=this.registerMutation(e[t],s);n&&(r=r<0?n.from:Math.min(n.from,r),i=i<0?n.to:Math.max(n.to,i),n.typeOver&&(o=!0))}if(zn&&s.length>1){let e=s.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,i),function(e){if(Co)return;Co=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&console["warn"]("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,i,o,s),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||Xr(this.view),this.currentSelection.set(t))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(In&&Ln<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==e.target?qn(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?qn(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let Co=!1;function To(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Bn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Bn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function Oo(e,t,n,r,i){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Gr(e,t);if(n&&!e.state.selection.eq(n)){let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let a=e.state.selection,l=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),u=e.domSelection(),c=u.anchorNode;if(c&&e.dom.contains(1==c.nodeType?c:c.parentNode)&&(r=[{node:c,offset:u.anchorOffset}],tr(u)||r.push({node:u.focusNode,offset:u.focusOffset})),Fn&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let d=e.state.doc,p=e.someProp("domParser")||Xe.fromSchema(e.state.schema),h=d.resolve(a),f=null,m=p.parse(i,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:To,context:h});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n);if(Fn&&e.cursorWrapper&&l.sel&&l.sel.anchor==e.cursorWrapper.deco.from){let t=e.cursorWrapper.deco.type.toDOM.nextSibling,n=t&&t.nodeValue?t.nodeValue.length:1;l.sel={anchor:l.sel.anchor+n,head:l.sel.anchor+n}}let u,c,d=e.state.doc,p=d.slice(l.from,l.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(u=e.state.selection.to,c="end"):(u=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let h=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){r-=s+Math.max(0,o-Math.min(s,a))-o}if(s<o&&e.size<t.size){o-=r<=o&&r>=s?o-r:0,a=o+(a-s),s=o}else if(a<o){o-=r<=o&&r>=a?o-r:0,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(p.content,l.doc.content,l.from,u,c);if((Un&&e.input.lastIOSEnter>Date.now()-225||$n)&&i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",(t=>t(e,nr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!h){if(!(r&&a instanceof sn&&!a.empty&&a.$head.sameParent(a.$anchor))||e.composing||l.sel&&l.sel.anchor!=l.sel.head){if(l.sel){let t=So(e,e.state.doc,l.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}h={start:a.from,endA:a.to,endB:a.to}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&h.start==h.endB&&e.state.selection instanceof sn&&(h.start>e.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?h.start=e.state.selection.from:h.endA<e.state.selection.to&&h.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),In&&Ln<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>l.from&&"  "==l.doc.textBetween(h.start-l.from-1,h.start-l.from+1)&&(h.start--,h.endA--,h.endB--);let f,m=l.doc.resolveNoCache(h.start-l.from),g=l.doc.resolveNoCache(h.endB-l.from),y=d.resolve(h.start),b=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=h.endA;if((Un&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!b&&m.pos<l.doc.content.size&&(f=tn.findFrom(l.doc.resolve(m.pos+1),1,!0))&&f.head==g.pos)&&e.someProp("handleKeyDown",(t=>t(e,nr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>h.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||Ao(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(Ao(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Ao(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(d,h.start,h.endA,m,g)&&e.someProp("handleKeyDown",(t=>t(e,nr(8,"Backspace")))))return void($n&&Fn&&e.domObserver.suppressSelectionUpdates());Fn&&$n&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),$n&&!b&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==h.endA&&(h.endB-=2,g=l.doc.resolveNoCache(h.endB-l.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,nr(13,"Enter"))}))}),20));let v,w,x,M=h.start,D=h.endA;if(b)if(m.pos==g.pos)In&&Ln<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Xr(e)),20)),v=e.state.tr.delete(M,D),w=d.resolve(h.start).marksAcross(d.resolve(h.endA));else if(h.endA==h.endB&&(x=function(e,t){let n,r,i,o=e.firstChild.marks,s=t.firstChild.marks,a=o,l=s;for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);for(let e=0;e<o.length;e++)l=o[e].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let u=[];for(let e=0;e<t.childCount;e++)u.push(i(t.child(e)));if(le.from(u).eq(e))return{mark:r,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,h.endA-y.start()))))v=e.state.tr,"add"==x.type?v.addMark(M,D,x.mark):v.removeMark(M,D,x.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,M,D,t))))return;v=e.state.tr.insertText(t,M,D)}if(v||(v=e.state.tr.replace(M,D,l.doc.slice(h.start-l.from,h.endB-l.from))),l.sel){let t=So(e,v.doc,l.sel);t&&!(Fn&&$n&&e.composing&&t.empty&&(h.start!=h.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==M||t.head==v.mapping.map(D)-1)||In&&t.empty&&t.head==M)&&v.setSelection(t)}w&&v.ensureMarks(w),e.dispatch(v.scrollIntoView())}function So(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:oi(e,t.resolve(n.anchor),t.resolve(n.head))}function Ao(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class No{constructor(e,t){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 Ii,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(zo),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Io(this),jo(this),this.nodeViews=Lo(this),this.docView=Ir(this.state.doc,_o(this),xo(this),this.dom,this),this.domObserver=new Eo(this,((e,t,n,r)=>Oo(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in _i){let n=_i[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Fi(e,t)||Pi(e,t)||!e.editable&&t.type in ji||n(e,t)})}Bn&&e.dom.addEventListener("input",(()=>null)),zi(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&zi(this),this._props=e,e.plugins&&(e.plugins.forEach(zo),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;if(e.storedMarks&&this.composing&&(Ji(this),i=!0),this.state=e,t){let e=Lo(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,r=!0),zi(this)}this.editable=Io(this),jo(this);let o=xo(this),s=_o(this),a=t?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",l=r||!this.docView.matchesNode(e.doc,s,o);!l&&e.selection.eq(n.selection)||(i=!0);let u="preserve"==a&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:ar(e.dom)}}(this);if(i){this.domObserver.stop();let t=l&&(In||Fn)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(l){let n=Fn?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(e.doc,s,o,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Ir(e.doc,s,o,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return Gn(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Xr(this,t):(ri(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(n),"reset"==a)this.dom.scrollTop=0;else if("to selection"==a){let t=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(e.selection instanceof ln){let n=this.docView.domAfterPos(e.selection.from);1==n.nodeType&&sr(this,n.getBoundingClientRect(),t)}else sr(this,this.coordsAtPos(e.selection.head,1),t)}else u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;lr(n,0==r?0:r-t)}(u)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let i=this.directPlugins[r].props[e];if(null!=i&&(n=t?t(i):i))return n}let i=this.state.plugins;if(i)for(let r=0;r<i.length;r++){let o=i[r].props[e];if(null!=o&&(n=t?t(o):o))return n}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(ur)return e.focus(ur);let t=ar(e);e.focus(null==ur?{get preventScroll(){return ur={preventScroll:!0},!0}}:void 0),ur||(ur=!1,lr(t,0))}(this.dom),Xr(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}posAtCoords(e){return hr(this,e)}coordsAtPos(e,t=1){return gr(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return kr(this,t||this.state,e)}destroy(){this.docView&&(!function(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)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],xo(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Pi(e,t)||!_i[t.type]||!e.editable&&t.type in ji||_i[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function _o(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e&&(t.class+=" "+n[e]),"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),[ao.node(0,e.state.doc.content.size,t)]}function jo(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:ao.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Io(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Lo(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function zo(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")}for(var Po={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Fo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ro="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Bo="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Uo="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Ho="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),$o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Vo=Ro&&(Ho||+Ro[1]<57)||Uo&&Ho,Wo=0;Wo<10;Wo++)Po[48+Wo]=Po[96+Wo]=String(Wo);for(Wo=1;Wo<=24;Wo++)Po[Wo+111]="F"+Wo;for(Wo=65;Wo<=90;Wo++)Po[Wo]=String.fromCharCode(Wo+32),Fo[Wo]=String.fromCharCode(Wo);for(var qo in Po)Fo.hasOwnProperty(qo)||(Fo[qo]=Po[qo]);const Yo="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Qo(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);Yo?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Ko(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function Go(e){let t=function(e){let t=Object.create(null);for(let n in e)t[Qo(n)]=e[n];return t}(e);return function(e,n){let r,i=function(e){var t=!(Vo&&(e.ctrlKey||e.altKey||e.metaKey)||(Bo||$o)&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Fo:Po)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),o=1==i.length&&" "!=i,s=t[Ko(i,n,!o)];if(s&&s(e.state,e.dispatch,e))return!0;if(o&&(n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=Po[n.keyCode])&&r!=i){let i=t[Ko(r,n,!0)];if(i&&i(e.state,e.dispatch,e))return!0}else if(o&&n.shiftKey){let r=t[Ko(i,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}function Jo(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function Xo(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 Zo(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function es(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function ts(e,t,n){let r,i,o=t.nodeBefore,s=t.nodeAfter;if(o.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!i.isTextblock&&!Rt(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(r[0]||s.type).validEnd){if(n){let i=t.pos+s.nodeSize,a=le.empty;for(let e=r.length-1;e>=0;e--)a=le.from(r[e].create(null,a));a=le.from(o.copy(a));let l=e.tr.step(new _t(t.pos-1,i,t.pos,i,new fe(a,1,0),r.length,!0)),u=i+2*r.length;Rt(l.doc,u)&&l.join(u),n(l.scrollIntoView())}return!0}let l=tn.findFrom(t,1),u=l&&l.$from.blockRange(l.$to),c=u&&Lt(u);if(null!=c&&c>=t.depth)return n&&n(e.tr.lift(u,c).scrollIntoView()),!0;if(a&&Jo(s,"start",!0)&&Jo(o,"end")){let r=o,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=le.empty;for(let e=i.length-1;e>=0;e--)r=le.from(i[e].copy(r));n(e.tr.step(new _t(t.pos-i.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new fe(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ns(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(sn.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const rs=ns(-1),is=ns(1);function ss(e,t=null){return function(n,r){let{from:i,to:o}=n.selection,s=!1;return n.doc.nodesBetween(i,o,((r,i)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(i),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0)}}function as(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);l=new Ae(e,e,s.depth),s.endIndex<s.parent.childCount&&(s=new Ae(i,n.doc.resolve(o.end(s.depth)),s.depth)),a=!0}let u=zt(l,e,t,s);return!!u&&(r&&r(function(e,t,n,r,i){let o=le.empty;for(let e=n.length-1;e>=0;e--)o=le.from(n[e].type.create(n[e].attrs,o));e.step(new _t(t.start-(r?2:0),t.end,t.start,t.end,new fe(o,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==i&&(s=e+1);let a=n.length-s,l=t.start+n.length-(r?2:0),u=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&Ft(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=u.child(n).nodeSize;return e}(n.tr,s,u,a,e).scrollIntoView()),!0)}}function ls(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));return!!o&&(!n||(r.node(o.depth-1).type==e?function(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new _t(o-1,s,o,s,new fe(le.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ae(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));return t(i.lift(r,Lt(r)).scrollIntoView()),!0}(t,n,e,o):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,o=n.startIndex;t>o;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?le.empty:le.from(i))))return!1;let d=o.pos,p=d+s.nodeSize;return r.step(new _t(d-(a?1:0),p+(l?1:0),d+1,p-1,new fe((a?le.empty:le.from(i.copy(le.empty))).append(l?le.empty:le.from(i.copy(le.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,o)))}}function us(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class cs{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,l=e||i.tr,u={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return s.push(i),u}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(l),s.every((e=>!0===e)))};return u}createCan(e){const{rawCommands:t,state:n}=this,r=void 0,i=e||n.tr,o=this.buildProps(i,r),s=Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:r})])));return{...s,chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r;i.storedMarks&&e.setStoredMarks(i.storedMarks);const s={tr:e,editor:r,view:o,state:us({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(s)])))}};return s}}function ds(e,t,n){if(void 0===e.config[t]&&e.parent)return ds(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?ds(e.parent,t,n):null})}return e.config[t]}function ps(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function hs(e){const t=[],{nodeExtensions:n,markExtensions:r}=ps(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=ds(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=ds(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...o,...r};r.isRequired&&void 0===r.default&&delete i.default,t.push({type:e.name,name:n,attribute:i})}))})),t}function fs(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function ms(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]="class"===e?[n[e],t].join(" "):"style"===e?[n[e],t].join("; "):t:n[e]=t})),n}),{})}function gs(e,t){return t.filter((e=>e.attribute.rendered)).map((t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]})).reduce(((e,t)=>ms(e,t)),{})}function ys(e){return"function"==typeof e}function bs(e,t=void 0,...n){return ys(e)?t?e.bind(t)(...n):e(...n):e}function vs(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function ws(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function xs(e,t){return t.nodes[e]||t.marks[e]||null}function Ms(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function Ds(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class ks{constructor(e){this.find=e.find,this.handler=e.handler}}function Es(e){var t;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(null===(t=u.nodeBefore||u.nodeAfter)||void 0===t?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let c=!1;const d=((e,t=500)=>{let n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,((t,r,i,o)=>{var s,a,l;n+=(null===(a=(s=t.type.spec).toText)||void 0===a?void 0:a.call(s,{node:t,pos:r,parent:i,index:o}))||(null===(l=e.nodeBefore)||void 0===l?void 0:l.text)||"%leaf%"})),n})(u)+o;return s.forEach((e=>{if(c)return;const t=((e,t)=>{if(Ds(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[];return r.push(n.text),r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(d,e.find);if(!t)return;const s=l.state.tr,u=us({state:l.state,transaction:s}),p={from:r-(t[0].length-o.length),to:i},{commands:h,chain:f,can:m}=new cs({editor:n,state:u});null!==e.handler({state:u,range:p,match:t,commands:h,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:i,text:o}),l.dispatch(s),c=!0)})),c}function Cs(e){const{editor:t,rules:n}=e,r=new kn({state:{init:()=>null,apply(e,t){const n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(e,i,o,s)=>Es({editor:t,from:i,to:o,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&Es({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:o}=e.state.selection;return!!o&&Es({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class Ts{constructor(e){this.find=e.find,this.handler=e.handler}}function Os(e){const{editor:t,state:n,from:r,to:i,rule:o}=e,{commands:s,chain:a,can:l}=new cs({editor:t,state:n}),u=[];n.doc.nodesBetween(r,i,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const c=Math.max(r,t),d=Math.min(i,t+e.content.size),p=((e,t)=>{if(Ds(t))return[...e.matchAll(t)];const n=t(e);return n?n.map((t=>{const n=[];return n.push(t.text),n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]})(e.textBetween(c-t,d-t,void 0,""),o.find);p.forEach((e=>{if(void 0===e.index)return;const t=c+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},d=o.handler({state:n,range:i,match:e,commands:s,chain:a,can:l});u.push(d)}))}));return u.every((e=>null!==e))}function Ss(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1;return n.map((e=>new kn({view(e){const t=t=>{var n;r=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:e=>(o=r===e.dom.parentElement,!1),paste:(e,t)=>{var n;const r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!i,u="drop"===a.getMeta("uiEvent")&&!o;if(!l&&!u)return;const c=r.doc.content.findDiffStart(s.doc.content),d=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof c||!d||c===d.b)return;const p=s.tr,h=us({state:s,transaction:p});return Os({editor:t,state:h,from:Math.max(c-1,0),to:d.b,rule:e})&&p.steps.length?p:void 0}})))}class As{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=As.resolve(e),this.schema=function(e){var t;const n=hs(e),{nodeExtensions:r,markExtensions:i}=ps(e),o=null===(t=r.find((e=>ds(e,"topNode"))))||void 0===t?void 0:t.name,s=Object.fromEntries(r.map((t=>{const r=n.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage},o=e.reduce(((e,n)=>{const r=ds(n,"extendNodeSchema",i);return{...e,...r?r(t):{}}}),{}),s=ws({...o,content:bs(ds(t,"content",i)),marks:bs(ds(t,"marks",i)),group:bs(ds(t,"group",i)),inline:bs(ds(t,"inline",i)),atom:bs(ds(t,"atom",i)),selectable:bs(ds(t,"selectable",i)),draggable:bs(ds(t,"draggable",i)),code:bs(ds(t,"code",i)),defining:bs(ds(t,"defining",i)),isolating:bs(ds(t,"isolating",i)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=bs(ds(t,"parseHTML",i));a&&(s.parseDOM=a.map((e=>vs(e,r))));const l=ds(t,"renderHTML",i);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:gs(e,r)}));const u=ds(t,"renderText",i);return u&&(s.toText=u),[t.name,s]}))),a=Object.fromEntries(i.map((t=>{const r=n.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage},o=e.reduce(((e,n)=>{const r=ds(n,"extendMarkSchema",i);return{...e,...r?r(t):{}}}),{}),s=ws({...o,inclusive:bs(ds(t,"inclusive",i)),excludes:bs(ds(t,"excludes",i)),group:bs(ds(t,"group",i)),spanning:bs(ds(t,"spanning",i)),code:bs(ds(t,"code",i)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=bs(ds(t,"parseHTML",i));a&&(s.parseDOM=a.map((e=>vs(e,r))));const l=ds(t,"renderHTML",i);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:gs(e,r)})),[t.name,s]})));return new Ge({topNode:o,nodes:s,marks:a})}(this.extensions),this.extensions.forEach((e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:xs(e.name,this.schema)};if("mark"===e.type){(null===(t=bs(ds(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const r=ds(e,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const i=ds(e,"onCreate",n);i&&this.editor.on("create",i);const o=ds(e,"onUpdate",n);o&&this.editor.on("update",o);const s=ds(e,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=ds(e,"onTransaction",n);a&&this.editor.on("transaction",a);const l=ds(e,"onFocus",n);l&&this.editor.on("focus",l);const u=ds(e,"onBlur",n);u&&this.editor.on("blur",u);const c=ds(e,"onDestroy",n);c&&this.editor.on("destroy",c)}))}static resolve(e){const t=As.sort(As.flatten(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return[...new Set(t)]}(t.map((e=>e.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e=>`'${e}'`)).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map((e=>{const t=ds(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e})).flat(10)}static sort(e){const t=100;return e.sort(((e,n)=>{const r=ds(e,"priority")||t,i=ds(n,"priority")||t;return r>i?-1:r<i?1:0}))}get commands(){return this.extensions.reduce(((e,t)=>{const n=ds(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:xs(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=As.sort([...this.extensions].reverse()),n=[],r=[],i=t.map((t=>{const i={name:t.name,options:t.options,storage:t.storage,editor:e,type:xs(t.name,this.schema)},o=[],s=ds(t,"addKeyboardShortcuts",i);if(s){const t=function(e){return new kn({props:{handleKeyDown:Go(e)}})}(Object.fromEntries(Object.entries(s()).map((([t,n])=>[t,()=>n({editor:e})]))));o.push(t)}const a=ds(t,"addInputRules",i);Ms(t,e.options.enableInputRules)&&a&&n.push(...a());const l=ds(t,"addPasteRules",i);Ms(t,e.options.enablePasteRules)&&l&&r.push(...l());const u=ds(t,"addProseMirrorPlugins",i);if(u){const e=u();o.push(...e)}return o})).flat();return[Cs({editor:e,rules:n}),...Ss({editor:e,rules:r}),...i]}get attributes(){return hs(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=ps(this.extensions);return Object.fromEntries(t.filter((e=>!!ds(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:fs(t.name,this.schema)},i=ds(t,"addNodeView",r);if(!i)return[];return[t.name,(r,o,s,a)=>{const l=gs(r,n);return i()({editor:e,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:t})}]})))}}function Ns(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function _s(e,t){const n={...e};return Ns(e)&&Ns(t)&&Object.keys(t).forEach((r=>{Ns(t[r])?r in e?n[r]=_s(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})})),n}class js{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=bs(ds(this,"addOptions",{name:this.name}))),this.storage=bs(ds(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new js(e)}configure(e={}){const t=this.extend();return t.options=_s(this.options,e),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new js(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=bs(ds(t,"addOptions",{name:t.name})),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}}function Is(e,t,n){const{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return e.nodesBetween(r,i,((e,n,u,c)=>{var d;const p=null==s?void 0:s[e.type.name];p?(e.isBlock&&!l&&(a+=o,l=!0),u&&(a+=p({node:e,pos:n,parent:u,index:c,range:t}))):e.isText?(a+=null===(d=null==e?void 0:e.text)||void 0===d?void 0:d.slice(Math.max(r,n)-n,i-n),l=!1):e.isBlock&&!l&&(a+=o,l=!0)})),a}function Ls(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}const zs=js.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new kn({key:new Tn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map((e=>e.$from.pos))),a=Math.max(...o.map((e=>e.$to.pos)));return Is(r,{from:s,to:a},{textSerializers:Ls(n)})}}})]}});function Ps(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:Ds(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Fs(e,t,n={}){return e.find((e=>e.type===t&&Ps(e.attrs,n)))}function Rs(e,t,n={}){return!!Fs(e,t,n)}function Bs(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=Fs([...r.node.marks],t,n);if(!i)return;let o=r.index,s=e.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(Fs([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,s-=e.parent.child(o).nodeSize;for(;a<e.parent.childCount&&Rs([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Us(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function Hs(e){return e&&"object"==typeof e&&!Array.isArray(e)&&!function(e){var t;return"class"===(null===(t=e.constructor)||void 0===t?void 0:t.toString().substring(0,5))}(e)}function $s(e){return Hs(e)&&e instanceof sn}function Vs(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Ws(e,t=null){if(!t)return null;const n=tn.atStart(e),r=tn.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const i=n.from,o=r.to;return"all"===t?sn.create(e,Vs(0,i,o),Vs(e.content.size,i,o)):sn.create(e,Vs(t,i,o),Vs(t,i,o))}function qs(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ys(e){const t=`<body>${e}</body>`;return(new window.DOMParser).parseFromString(t,"text/html").body}function Qs(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)?le.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Qs("",t,n)}if("string"==typeof e){const r=Xe.fromSchema(t);return n.slice?r.parseSlice(Ys(e),n.parseOptions).content:r.parse(Ys(e),n.parseOptions)}return Qs("",t,n)}function Ks(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Gs(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,s=t?fs(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:o})}));const l=i-r,u=a.filter((e=>!s||s.name===e.node.type.name)).filter((e=>Ps(e.node.attrs,n,{strict:!1})));if(o)return!!u.length;return u.reduce(((e,t)=>e+t.to-t.from),0)>=l}function Js(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Xs(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}function Zs(e,t,n={}){return Qs(e,t,{slice:!1,parseOptions:n})}function ea(e,t){const n=Us(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function ta(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}function na(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}function ra(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function ia(e,t){const{nodeExtensions:n}=ps(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=bs(ds(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}const oa=(e,t)=>{const n=ra((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!Rt(e.doc,n.pos)||(e.join(n.pos),!0)},sa=(e,t)=>{const n=ra((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!Rt(e.doc,r)||(e.join(r),!0)};function aa(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Us(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!o||o.name===e.type.name)).find((e=>Ps(e.attrs,n,{strict:!1})));let s=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);s+=o-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:o}))))}))})),0===s)return!1;const l=a.filter((e=>!o||o.name===e.mark.type.name)).filter((e=>Ps(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),u=a.filter((e=>!o||e.mark.type!==o&&e.mark.type.excludes(o))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+u:l)>=s}var la=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return!n||(i.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),a=o.blockRange(s);if(!a)return;const l=Lt(a);if(e.type.isTextblock){const{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof cn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=es(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(sn.create(s.doc,n+1)),t(s.scrollIntoView())}return!0})(e,t),deleteNode:e=>({tr:t,state:n,dispatch:r})=>{const i=fs(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1){if(o.node(e).type===i){if(r){const n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},deleteSelection:()=>({state:e,dispatch:t})=>((e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0))(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=es(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(tn.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0})(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Us(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const e=Bs(l,o,t);if(e&&e.from<=u&&e.to>=c){const t=sn.create(s,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},focus:(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{qs()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(o&&null===e&&!$s(n.state.selection))return s(),!0;const a=Ws(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const i=Qs(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===i.toString())return!0;let{from:s,to:a}="number"==typeof e?{from:e,to:e}:e,l=!0,u=!0;if((i.toString().startsWith("<")?i:[i]).forEach((e=>{e.check(),l=!!l&&(e.isText&&0===e.marks.length),u=!!u&&e.isBlock})),s===a&&u){const{parent:e}=r.doc.resolve(s);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(s-=1,a+=1)}l?r.insertText(t,s,a):r.replaceWith(s,a,i),n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Nt||i instanceof _t))return;const o=e.mapping.maps[r];let s=0;o.forEach(((e,t,n,r)=>{0===s&&(s=r)})),e.setSelection(tn.near(e.doc.resolve(s),n))}(r,r.steps.length-1,-1)}return!0},joinBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=Xo(r);if(!i){let n=r.blockRange(),i=n&&Lt(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&ts(e,i,t))return!0;if(0==r.parent.content.size&&(Jo(o,"end")||ln.isSelectable(o))){let n=Ut(e.doc,r.before(),r.after(),fe.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Jo(o,"end")?tn.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):ln.create(r.doc,i.pos-o.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),0))})(e,t),joinForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;let i=Zo(r);if(!i)return!1;let o=i.nodeAfter;if(ts(e,i,t))return!0;if(0==r.parent.content.size&&(Jo(o,"start")||ln.isSelectable(o))){let n=Ut(e.doc,r.before(),r.after(),fe.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Jo(o,"start")?tn.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):ln.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),0))})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=function(e){const t=e.split(/-(?!$)/);let n,r,i,o,s=t[t.length-1];"Space"===s&&(s=" ");for(let e=0;e<t.length-1;e+=1){const s=t[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);qs()||Ks()?o=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),o&&(s=`Meta-${s}`),i&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=o.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:r})=>!!Gs(n,fs(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Lt(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:e,dispatch:t})=>((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Ft(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Lt(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)})(e,t),liftListItem:e=>({state:t,dispatch:n})=>ls(fs(e,t.schema))(t,n),newlineInCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))})(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Js("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=fs(e,r.schema)),"mark"===a&&(s=Us(e,r.schema)),i&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,Xs(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((i=>{s===i.type&&n.addMark(r,r+e.nodeSize,s.create(Xs(i.attrs,t)))}))}))})),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),selectNodeBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=Xo(r)}let s=o&&o.nodeBefore;return!(!s||!ln.isSelectable(s)||(t&&t(e.tr.setSelection(ln.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),0))})(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=Zo(r)}let s=o&&o.nodeAfter;return!(!s||!ln.isSelectable(s)||(t&&t(e.tr.setSelection(ln.create(e.doc,o.pos)).scrollIntoView()),0))})(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:i}=e.selection,o=r.sharedDepth(i);return 0!=o&&(n=r.before(o),t&&t(e.tr.setSelection(ln.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>is(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>rs(e,t),setContent:(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,a=Zs(e,i.schema,n);return o&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Us(e,r.schema);if(i)if(s){const e=ea(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,((e,r)=>{const s=Math.max(r,i),a=Math.min(r+e.nodeSize,o);e.marks.find((e=>e.type===l))?e.marks.forEach((e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))})):n.addMark(s,a,l.create(t))}))}));return!0},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=fs(e,n.schema);return o.isTextblock?i().command((({commands:e})=>!!ss(o,t)(n)||e.clearNodes())).command((({state:e})=>ss(o,t)(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=tn.atStart(n).from,i=tn.atEnd(n).to,o=Vs(e,r,i),s=ln.create(n,o);t.setSelection(s)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=sn.atStart(n).from,s=sn.atEnd(n).to,a=Vs(r,o,s),l=Vs(i,o,s),u=sn.create(n,a,l);t.setSelection(u)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const r=fs(e,t.schema);return(i=r,function(e,t){let{$from:n,$to:r}=e.selection,o=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==i));if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=i)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,r=le.from(n?i.create():null),s=new fe(le.from(i.create(null,le.from(a.type.create(null,r)))),n?3:1,0),u=o.start,c=o.end;t(e.tr.step(new _t(u-(n?3:1),c,u,c,s,1,!0)).scrollIntoView())}return!0})(t,n);var i},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=t,{$from:a,$to:l}=o,u=ta(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(o instanceof ln&&o.node.isBlock)return!(!a.parentOffset||!Ft(s,a.pos))&&(r&&(e&&na(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;o instanceof sn&&t.deleteSelection();const s=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let c=r&&s?[{type:s,attrs:u}]:void 0,d=Ft(t.doc,t.mapping.map(a.pos),1,c);if(c||d||!Ft(t.doc,t.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(d=!0,c=s?[{type:s,attrs:u}]:void 0),d&&(t.split(t.mapping.map(a.pos),1,c),s&&!r&&!a.parentOffset&&a.parent.type!==s)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&t.setNodeMarkup(t.mapping.map(a.before()),s)}e&&na(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},splitListItem:e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const s=fs(e,n.schema),{$from:a,$to:l}=n.selection,u=n.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const d=i.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let e=le.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-n;t>=a.depth-3;t-=1)e=le.from(a.node(t).copy(e));const r=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,i=ta(d,a.node().type.name,a.node().attrs),l=(null===(o=s.contentMatch.defaultType)||void 0===o?void 0:o.createAndFill(i))||void 0;e=e.append(le.from(s.createAndFill(null,l)||void 0));const u=a.before(a.depth-(n-1));t.replace(u,a.after(-r),new fe(e,4-n,0));let c=-1;t.doc.nodesBetween(u,t.doc.content.size,((e,t)=>{if(c>-1)return!1;e.isTextblock&&0===e.content.size&&(c=t+1)})),c>-1&&t.setSelection(sn.near(t.doc.resolve(c))),t.scrollIntoView()}return!0}const p=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,h=ta(d,c.type.name,c.attrs),f=ta(d,a.node().type.name,a.node().attrs);t.delete(a.pos,l.pos);const m=p?[{type:s,attrs:h},{type:p,attrs:f}]:[{type:s,attrs:h}];return!!Ft(t.doc,a.pos,2)&&(r&&t.split(a.pos,2,m).scrollIntoView(),!0)},toggleList:(e,t)=>({editor:n,tr:r,state:i,dispatch:o,chain:s,commands:a,can:l})=>{const{extensions:u}=n.extensionManager,c=fs(e,i.schema),d=fs(t,i.schema),{selection:p}=i,{$from:h,$to:f}=p,m=h.blockRange(f);if(!m)return!1;const g=ra((e=>ia(e.type.name,u)))(p);if(m.depth>=1&&g&&m.depth-g.depth<=1){if(g.node.type===c)return a.liftListItem(d);if(ia(g.node.type.name,u)&&c.validContent(g.node.content)&&o)return s().command((()=>(r.setNodeMarkup(g.pos,c),!0))).command((()=>oa(r,c))).command((()=>sa(r,c))).run()}return s().command((()=>!!l().wrapInList(c)||a.clearNodes())).wrapInList(c).command((()=>oa(r,c))).command((()=>sa(r,c))).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Us(e,r.schema);return aa(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=fs(e,r.schema),s=fs(t,r.schema);return Gs(r,o,n)?i.setNode(s):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=fs(e,n.schema);return Gs(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const t=e.tr,n=o.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(o.text){const n=t.doc.resolve(o.from).marks();t.replaceWith(o.from,o.to,e.schema.text(o.text,n))}else t.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=Us(e,r.schema),{$from:u,empty:c,ranges:d}=a;if(!i)return!0;if(c&&s){let{from:e,to:t}=a;const r=null===(o=u.marks().find((e=>e.type===l)))||void 0===o?void 0:o.attrs,i=Bs(u,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else d.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Js("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=fs(e,r.schema)),"mark"===a&&(s=Us(e,r.schema)),i&&n.selection.ranges.forEach((e=>{const i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach((o=>{if(s===o.type){const l=Math.max(r,i),u=Math.min(r+e.nodeSize,a);n.addMark(l,u,s.create({...o.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&zt(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(fs(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>as(fs(e,n.schema),t)(n,r)});const ua=js.create({name:"commands",addCommands:()=>({...la})}),ca=js.create({name:"editable",addProseMirrorPlugins(){return[new kn({key:new Tn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),da=js.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new kn({key:new Tn("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),pa=js.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:a}=o,l=tn.atStart(r).from===s;return!(!(i&&l&&a.type.isTextblock)||a.textContent.length)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>e.joinForward(),()=>e.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return qs()||Ks()?i:r},addProseMirrorPlugins(){return[new kn({key:new Tn("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:r,from:i,to:o}=t.selection,s=tn.atStart(t.doc).from,a=tn.atEnd(t.doc).to,l=i===s&&o===a,u=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(r||!l||!u)return;const c=n.tr,d=us({state:n,transaction:c}),{commands:p}=new cs({editor:this.editor,state:d});return p.clearNodes(),c.steps.length?c:void 0}})]}}),ha=js.create({name:"tabindex",addProseMirrorPlugins(){return[new kn({key:new Tn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var fa=Object.freeze({__proto__:null,ClipboardTextSerializer:zs,Commands:ua,Editable:ca,FocusEvents:da,Keymap:pa,Tabindex:ha});function ma(e,t){const n=Js("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=fs(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,(e=>{o.push(e)}));const s=o.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?ea(e,t):{}}const ga=`.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}`;function ya(e,t){const n=[];return e.descendants(((e,r)=>{t(e)&&n.push({node:e,pos:r})})),n}function ba(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.some((t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}))}function va(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const i=Bs(n.resolve(e-1),t.type);i&&r.push({mark:t,...i})})):n.nodesBetween(e,t,((e,t)=>{r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function wa(e,t,n){const r=0,i=e.state.doc.content.size,o=Vs(t,r,i),s=Vs(n,r,i),a=e.coordsAtPos(o),l=e.coordsAtPos(s,-1),u=Math.min(a.top,l.top),c=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),p=Math.max(a.right,l.right),h={top:u,bottom:c,left:d,right:p,width:p-d,height:c-u,x:d,y:u};return{...h,toJSON:()=>h}}function xa(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length,d=va(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>u));if(d.length)return null;c<n.to&&o.delete(c,n.to),u>n.from&&o.delete(n.from+r,u),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function Ma(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let a=n.to;if(r[1]){let t=s+r[0].lastIndexOf(r[1]);t>a?t=a:a=t+r[1].length;const n=r[0][r[0].length-1];o.insertText(n,s+r[0].length-1),o.replaceWith(t,a,e.type.create(i))}else r[0]&&o.replaceWith(s,a,e.type.create(i))}})}function Da(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=bs(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function ka(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,o=n.from;const s=n.to;if(r[1]){const e=r[0].lastIndexOf(r[1]);i+=r[0].slice(e+r[1].length),o+=e;const t=o-s;t>0&&(i=r[0].slice(e-t,e)+i,o=s)}t.tr.insertText(i,o,s)}})}function Ea(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),a=s&&zt(s,e.type,i);if(!a)return null;o.wrap(s,a);const l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Rt(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)}})}class Ca{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=bs(ds(this,"addOptions",{name:this.name}))),this.storage=bs(ds(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ca(e)}configure(e={}){const t=this.extend();return t.options=_s(this.options,e),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ca(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=bs(ds(t,"addOptions",{name:t.name})),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}}class Ta{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=bs(ds(this,"addOptions",{name:this.name}))),this.storage=bs(ds(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ta(e)}configure(e={}){const t=this.extend();return t.options=_s(this.options,e),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ta(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=bs(ds(t,"addOptions",{name:t.name})),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}}function Oa(e){return new Ts({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length,d=va(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>u));if(d.length)return null;c<n.to&&o.delete(c,n.to),u>n.from&&o.delete(n.from+r,u),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}var Sa="top",Aa="bottom",Na="right",_a="left",ja="auto",Ia=[Sa,Aa,Na,_a],La="start",za="end",Pa="clippingParents",Fa="viewport",Ra="popper",Ba="reference",Ua=Ia.reduce((function(e,t){return e.concat([t+"-"+La,t+"-"+za])}),[]),Ha=[].concat(Ia,[ja]).reduce((function(e,t){return e.concat([t,t+"-"+La,t+"-"+za])}),[]),$a=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Va(e){return e?(e.nodeName||"").toLowerCase():null}function Wa(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function qa(e){return e instanceof Wa(e).Element||e instanceof Element}function Ya(e){return e instanceof Wa(e).HTMLElement||e instanceof HTMLElement}function Qa(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Wa(e).ShadowRoot||e instanceof ShadowRoot)}var Ka={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];Ya(i)&&Va(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});Ya(r)&&Va(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Ga(e){return e.split("-")[0]}var Ja=Math.max,Xa=Math.min,Za=Math.round;function el(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(Ya(e)&&t){var o=e.offsetHeight,s=e.offsetWidth;s>0&&(r=Za(n.width)/s||1),o>0&&(i=Za(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function tl(e){var t=el(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function nl(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Qa(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function rl(e){return Wa(e).getComputedStyle(e)}function il(e){return["table","td","th"].indexOf(Va(e))>=0}function ol(e){return((qa(e)?e.ownerDocument:e.document)||window.document).documentElement}function sl(e){return"html"===Va(e)?e:e.assignedSlot||e.parentNode||(Qa(e)?e.host:null)||ol(e)}function al(e){return Ya(e)&&"fixed"!==rl(e).position?e.offsetParent:null}function ll(e){for(var t=Wa(e),n=al(e);n&&il(n)&&"static"===rl(n).position;)n=al(n);return n&&("html"===Va(n)||"body"===Va(n)&&"static"===rl(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&Ya(e)&&"fixed"===rl(e).position)return null;var n=sl(e);for(Qa(n)&&(n=n.host);Ya(n)&&["html","body"].indexOf(Va(n))<0;){var r=rl(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function ul(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function cl(e,t,n){return Ja(e,Xa(t,n))}function dl(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function pl(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var hl={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ga(n.placement),l=ul(a),u=[_a,Na].indexOf(a)>=0?"height":"width";if(o&&s){var c=function(e,t){return dl("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:pl(e,Ia))}(i.padding,n),d=tl(o),p="y"===l?Sa:_a,h="y"===l?Aa:Na,f=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],g=ll(o),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=f/2-m/2,v=c[p],w=y-d[u]-c[h],x=y/2-d[u]/2+b,M=cl(v,x,w),D=l;n.modifiersData[r]=((t={})[D]=M,t.centerOffset=M-x,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&nl(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fl(e){return e.split("-")[1]}var ml={top:"auto",right:"auto",bottom:"auto",left:"auto"};function gl(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,p=s.x,h=void 0===p?0:p,f=s.y,m=void 0===f?0:f,g="function"==typeof c?c({x:h,y:m}):{x:h,y:m};h=g.x,m=g.y;var y=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),v=_a,w=Sa,x=window;if(u){var M=ll(n),D="clientHeight",k="clientWidth";if(M===Wa(n)&&"static"!==rl(M=ol(n)).position&&"absolute"===a&&(D="scrollHeight",k="scrollWidth"),i===Sa||(i===_a||i===Na)&&o===za)w=Aa,m-=(d&&M===x&&x.visualViewport?x.visualViewport.height:M[D])-r.height,m*=l?1:-1;if(i===_a||(i===Sa||i===Aa)&&o===za)v=Na,h-=(d&&M===x&&x.visualViewport?x.visualViewport.width:M[k])-r.width,h*=l?1:-1}var E,C=Object.assign({position:a},u&&ml),T=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Za(t*r)/r||0,y:Za(n*r)/r||0}}({x:h,y:m}):{x:h,y:m};return h=T.x,m=T.y,l?Object.assign({},C,((E={})[w]=b?"0":"",E[v]=y?"0":"",E.transform=(x.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",E)):Object.assign({},C,((t={})[w]=b?m+"px":"",t[v]=y?h+"px":"",t.transform="",t))}var yl={passive:!0};var bl={left:"right",right:"left",bottom:"top",top:"bottom"};function vl(e){return e.replace(/left|right|bottom|top/g,(function(e){return bl[e]}))}var wl={start:"end",end:"start"};function xl(e){return e.replace(/start|end/g,(function(e){return wl[e]}))}function Ml(e){var t=Wa(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Dl(e){return el(ol(e)).left+Ml(e).scrollLeft}function kl(e){var t=rl(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function El(e){return["html","body","#document"].indexOf(Va(e))>=0?e.ownerDocument.body:Ya(e)&&kl(e)?e:El(sl(e))}function Cl(e,t){var n;void 0===t&&(t=[]);var r=El(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=Wa(r),s=i?[o].concat(o.visualViewport||[],kl(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(Cl(sl(s)))}function Tl(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ol(e,t){return t===Fa?Tl(function(e){var t=Wa(e),n=ol(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,s=0,a=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:i,height:o,x:s+Dl(e),y:a}}(e)):qa(t)?function(e){var t=el(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):Tl(function(e){var t,n=ol(e),r=Ml(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Ja(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ja(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Dl(e),l=-r.scrollTop;return"rtl"===rl(i||n).direction&&(a+=Ja(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(ol(e)))}function Sl(e,t,n){var r="clippingParents"===t?function(e){var t=Cl(sl(e)),n=["absolute","fixed"].indexOf(rl(e).position)>=0&&Ya(e)?ll(e):e;return qa(n)?t.filter((function(e){return qa(e)&&nl(e,n)&&"body"!==Va(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],s=i.reduce((function(t,n){var r=Ol(e,n);return t.top=Ja(r.top,t.top),t.right=Xa(r.right,t.right),t.bottom=Xa(r.bottom,t.bottom),t.left=Ja(r.left,t.left),t}),Ol(e,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Al(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Ga(i):null,s=i?fl(i):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case Sa:t={x:a,y:n.y-r.height};break;case Aa:t={x:a,y:n.y+n.height};break;case Na:t={x:n.x+n.width,y:l};break;case _a:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=o?ul(o):null;if(null!=u){var c="y"===u?"height":"width";switch(s){case La:t[u]=t[u]-(n[c]/2-r[c]/2);break;case za:t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}function Nl(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,s=void 0===o?Pa:o,a=n.rootBoundary,l=void 0===a?Fa:a,u=n.elementContext,c=void 0===u?Ra:u,d=n.altBoundary,p=void 0!==d&&d,h=n.padding,f=void 0===h?0:h,m=dl("number"!=typeof f?f:pl(f,Ia)),g=c===Ra?Ba:Ra,y=e.rects.popper,b=e.elements[p?g:c],v=Sl(qa(b)?b:b.contextElement||ol(e.elements.popper),s,l),w=el(e.elements.reference),x=Al({reference:w,element:y,strategy:"absolute",placement:i}),M=Tl(Object.assign({},y,x)),D=c===Ra?M:w,k={top:v.top-D.top+m.top,bottom:D.bottom-v.bottom+m.bottom,left:v.left-D.left+m.left,right:D.right-v.right+m.right},E=e.modifiersData.offset;if(c===Ra&&E){var C=E[i];Object.keys(k).forEach((function(e){var t=[Na,Aa].indexOf(e)>=0?1:-1,n=[Sa,Aa].indexOf(e)>=0?"y":"x";k[e]+=C[n]*t}))}return k}function _l(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?Ha:l,c=fl(r),d=c?a?Ua:Ua.filter((function(e){return fl(e)===c})):Ia,p=d.filter((function(e){return u.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=Nl(e,{placement:n,boundary:i,rootBoundary:o,padding:s})[Ga(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var jl={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,g=t.options.placement,y=Ga(g),b=l||(y===g||!f?[vl(g)]:function(e){if(Ga(e)===ja)return[];var t=vl(e);return[xl(e),t,xl(t)]}(g)),v=[g].concat(b).reduce((function(e,n){return e.concat(Ga(n)===ja?_l(t,{placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,x=t.rects.popper,M=new Map,D=!0,k=v[0],E=0;E<v.length;E++){var C=v[E],T=Ga(C),O=fl(C)===La,S=[Sa,Aa].indexOf(T)>=0,A=S?"width":"height",N=Nl(t,{placement:C,boundary:c,rootBoundary:d,altBoundary:p,padding:u}),_=S?O?Na:_a:O?Aa:Sa;w[A]>x[A]&&(_=vl(_));var j=vl(_),I=[];if(o&&I.push(N[T]<=0),a&&I.push(N[_]<=0,N[j]<=0),I.every((function(e){return e}))){k=C,D=!1;break}M.set(C,I)}if(D)for(var L=function(e){var t=v.find((function(t){var n=M.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},z=f?3:1;z>0;z--){if("break"===L(z))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Il(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Ll(e){return[Sa,Na,Aa,_a].some((function(t){return e[t]>=0}))}var zl={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,s=Ha.reduce((function(e,n){return e[n]=function(e,t,n){var r=Ga(e),i=[_a,Sa].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[_a,Na].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,o),e}),{}),a=s[t.placement],l=a.x,u=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}};var Pl={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,p=n.tether,h=void 0===p||p,f=n.tetherOffset,m=void 0===f?0:f,g=Nl(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),y=Ga(t.placement),b=fl(t.placement),v=!b,w=ul(y),x="x"===w?"y":"x",M=t.modifiersData.popperOffsets,D=t.rects.reference,k=t.rects.popper,E="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,C="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(M){if(o){var S,A="y"===w?Sa:_a,N="y"===w?Aa:Na,_="y"===w?"height":"width",j=M[w],I=j+g[A],L=j-g[N],z=h?-k[_]/2:0,P=b===La?D[_]:k[_],F=b===La?-k[_]:-D[_],R=t.elements.arrow,B=h&&R?tl(R):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},H=U[A],$=U[N],V=cl(0,D[_],B[_]),W=v?D[_]/2-z-V-H-C.mainAxis:P-V-H-C.mainAxis,q=v?-D[_]/2+z+V+$+C.mainAxis:F+V+$+C.mainAxis,Y=t.elements.arrow&&ll(t.elements.arrow),Q=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,K=null!=(S=null==T?void 0:T[w])?S:0,G=j+q-K,J=cl(h?Xa(I,j+W-K-Q):I,j,h?Ja(L,G):L);M[w]=J,O[w]=J-j}if(a){var X,Z="x"===w?Sa:_a,ee="x"===w?Aa:Na,te=M[x],ne="y"===x?"height":"width",re=te+g[Z],ie=te-g[ee],oe=-1!==[Sa,_a].indexOf(y),se=null!=(X=null==T?void 0:T[x])?X:0,ae=oe?re:te-D[ne]-k[ne]-se+C.altAxis,le=oe?te+D[ne]+k[ne]-se-C.altAxis:ie,ue=h&&oe?function(e,t,n){var r=cl(e,t,n);return r>n?n:r}(ae,te,le):cl(h?ae:re,te,h?le:ie);M[x]=ue,O[x]=ue-te}t.modifiersData[r]=O}},requiresIfExists:["offset"]};function Fl(e,t,n){void 0===n&&(n=!1);var r,i,o=Ya(t),s=Ya(t)&&function(e){var t=e.getBoundingClientRect(),n=Za(t.width)/e.offsetWidth||1,r=Za(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=ol(t),l=el(e,s),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==Va(t)||kl(a))&&(u=(r=t)!==Wa(r)&&Ya(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:Ml(r)),Ya(t)?((c=el(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=Dl(a))),{x:l.left+u.scrollLeft-c.x,y:l.top+u.scrollTop-c.y,width:l.width,height:l.height}}function Rl(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var Bl={placement:"bottom",modifiers:[],strategy:"absolute"};function Ul(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Hl(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?Bl:i;return function(e,t,n){void 0===n&&(n=o);var i,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Bl,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],u=!1,c={state:a,setOptions:function(n){var i="function"==typeof n?n(a.options):n;d(),a.options=Object.assign({},o,a.options,i),a.scrollParents={reference:qa(e)?Cl(e):e.contextElement?Cl(e.contextElement):[],popper:Cl(t)};var s=function(e){var t=Rl(e);return $a.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,a.options.modifiers)));return a.orderedModifiers=s.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:a,name:t,instance:c,options:r}),s=function(){};l.push(o||s)}})),c.update()},forceUpdate:function(){if(!u){var e=a.elements,t=e.reference,n=e.popper;if(Ul(t,n)){a.rects={reference:Fl(t,ll(n),"fixed"===a.options.strategy),popper:tl(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],o=i.fn,s=i.options,l=void 0===s?{}:s,d=i.name;"function"==typeof o&&(a=o({state:a,options:l,name:d,instance:c})||a)}else a.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){c.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){d(),u=!0}};if(!Ul(e,t))return c;function d(){l.forEach((function(e){return e()})),l=[]}return c.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),c}}var $l=Hl({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,s=r.resize,a=void 0===s||s,l=Wa(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach((function(e){e.addEventListener("scroll",n.update,yl)})),a&&l.addEventListener("resize",n.update,yl),function(){o&&u.forEach((function(e){e.removeEventListener("scroll",n.update,yl)})),a&&l.removeEventListener("resize",n.update,yl)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Al({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,u={placement:Ga(t.placement),variation:fl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,gl(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,gl(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Ka,zl,jl,Pl,hl,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=Nl(t,{elementContext:"reference"}),a=Nl(t,{altBoundary:!0}),l=Il(s,r),u=Il(a,i,o),c=Ll(l),d=Ll(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}}]}),Vl='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',Wl="tippy-box",ql="tippy-content",Yl="tippy-backdrop",Ql="tippy-arrow",Kl="tippy-svg-arrow",Gl={passive:!0,capture:!0},Jl=function(){return document.body};function Xl(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Zl(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function eu(e,t){return"function"==typeof e?e.apply(void 0,t):e}function tu(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function nu(e){return[].concat(e)}function ru(e,t){-1===e.indexOf(t)&&e.push(t)}function iu(e){return[].slice.call(e)}function ou(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function su(){return document.createElement("div")}function au(e){return["Element","Fragment"].some((function(t){return Zl(e,t)}))}function lu(e){return Zl(e,"MouseEvent")}function uu(e){return au(e)?[e]:function(e){return Zl(e,"NodeList")}(e)?iu(e):Array.isArray(e)?e:iu(document.querySelectorAll(e))}function cu(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function du(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function pu(e){var t,n=nu(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function hu(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function fu(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var mu={isTouch:!1},gu=0;function yu(){mu.isTouch||(mu.isTouch=!0,window.performance&&document.addEventListener("mousemove",bu))}function bu(){var e=performance.now();e-gu<20&&(mu.isTouch=!1,document.removeEventListener("mousemove",bu)),gu=e}function vu(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var wu=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,xu=Object.assign({appendTo:Jl,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Mu=Object.keys(xu);function Du(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=xu[i])?r:o);return t}),{});return Object.assign({},e,t)}function ku(e,t){var n=Object.assign({},t,{content:eu(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Du(Object.assign({},xu,{plugins:t}))):Mu).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},xu.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function Eu(e,t){e["innerHTML"]=t}function Cu(e){var t=su();return!0===e?t.className=Ql:(t.className=Kl,au(e)?t.appendChild(e):Eu(t,e)),t}function Tu(e,t){au(t.content)?(Eu(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Eu(e,t.content):e.textContent=t.content)}function Ou(e){var t=e.firstElementChild,n=iu(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(ql)})),arrow:n.find((function(e){return e.classList.contains(Ql)||e.classList.contains(Kl)})),backdrop:n.find((function(e){return e.classList.contains(Yl)}))}}function Su(e){var t=su(),n=su();n.className=Wl,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=su();function i(n,r){var i=Ou(t),o=i.box,s=i.content,a=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Tu(s,e.props),r.arrow?a?n.arrow!==r.arrow&&(o.removeChild(a),o.appendChild(Cu(r.arrow))):o.appendChild(Cu(r.arrow)):a&&o.removeChild(a)}return r.className=ql,r.setAttribute("data-state","hidden"),Tu(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}Su.$$tippy=!0;var Au=1,Nu=[],_u=[];function ju(e,t){var n,r,i,o,s,a,l,u,c=ku(e,Object.assign({},xu,Du(ou(t)))),d=!1,p=!1,h=!1,f=!1,m=[],g=tu(Y,c.interactiveDebounce),y=Au++,b=(u=c.plugins).filter((function(e,t){return u.indexOf(e)===t})),v={id:y,reference:e,popper:su(),popperInstance:null,props:c,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){if(v.state.isDestroyed)return;j("onBeforeUpdate",[v,t]),W();var n=v.props,r=ku(e,Object.assign({},n,ou(t),{ignoreAttributes:!0}));v.props=r,V(),n.interactiveDebounce!==r.interactiveDebounce&&(z(),g=tu(Y,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?nu(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");L(),_(),M&&M(n,r);v.popperInstance&&(J(),Z().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));j("onAfterUpdate",[v,t])},setContent:function(e){v.setProps({content:e})},show:function(){var e=v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=mu.isTouch&&!v.props.touch,i=Xl(v.props.duration,0,xu.duration);if(e||t||n||r)return;if(O().hasAttribute("disabled"))return;if(j("onShow",[v],!1),!1===v.props.onShow(v))return;v.state.isVisible=!0,T()&&(x.style.visibility="visible");_(),B(),v.state.isMounted||(x.style.transition="none");if(T()){var o=A(),s=o.box,l=o.content;cu([s,l],0)}a=function(){var e;if(v.state.isVisible&&!f){if(f=!0,x.offsetHeight,x.style.transition=v.props.moveTransition,T()&&v.props.animation){var t=A(),n=t.box,r=t.content;cu([n,r],i),du([n,r],"visible")}I(),L(),ru(_u,v),null==(e=v.popperInstance)||e.forceUpdate(),j("onMount",[v]),v.props.animation&&T()&&function(e,t){H(e,t)}(i,(function(){v.state.isShown=!0,j("onShown",[v])}))}},function(){var e,t=v.props.appendTo,n=O();e=v.props.interactive&&t===Jl||"parent"===t?n.parentNode:eu(t,[n]);e.contains(x)||e.appendChild(x);v.state.isMounted=!0,J()}()},hide:function(){var e=!v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=Xl(v.props.duration,1,xu.duration);if(e||t||n)return;if(j("onHide",[v],!1),!1===v.props.onHide(v))return;v.state.isVisible=!1,v.state.isShown=!1,f=!1,d=!1,T()&&(x.style.visibility="hidden");if(z(),U(),_(!0),T()){var i=A(),o=i.box,s=i.content;v.props.animation&&(cu([o,s],r),du([o,s],"hidden"))}I(),L(),v.props.animation?T()&&function(e,t){H(e,(function(){!v.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,v.unmount):v.unmount()},hideWithInteractivity:function(e){S().addEventListener("mousemove",g),ru(Nu,g),g(e)},enable:function(){v.state.isEnabled=!0},disable:function(){v.hide(),v.state.isEnabled=!1},unmount:function(){v.state.isVisible&&v.hide();if(!v.state.isMounted)return;X(),Z().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);_u=_u.filter((function(e){return e!==v})),v.state.isMounted=!1,j("onHidden",[v])},destroy:function(){if(v.state.isDestroyed)return;v.clearDelayTimeouts(),v.unmount(),W(),delete e._tippy,v.state.isDestroyed=!0,j("onDestroy",[v])}};if(!c.render)return v;var w=c.render(v),x=w.popper,M=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+v.id,v.popper=x,e._tippy=v,x._tippy=v;var D=b.map((function(e){return e.fn(v)})),k=e.hasAttribute("aria-expanded");return V(),L(),_(),j("onCreate",[v]),c.showOnCreate&&ee(),x.addEventListener("mouseenter",(function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&S().addEventListener("mousemove",g)})),v;function E(){var e=v.props.touch;return Array.isArray(e)?e:[e,0]}function C(){return"hold"===E()[0]}function T(){var e;return!(null==(e=v.props.render)||!e.$$tippy)}function O(){return l||e}function S(){var e=O().parentNode;return e?pu(e):document}function A(){return Ou(x)}function N(e){return v.state.isMounted&&!v.state.isVisible||mu.isTouch||o&&"focus"===o.type?0:Xl(v.props.delay,e?0:1,xu.delay)}function _(e){void 0===e&&(e=!1),x.style.pointerEvents=v.props.interactive&&!e?"":"none",x.style.zIndex=""+v.props.zIndex}function j(e,t,n){var r;(void 0===n&&(n=!0),D.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=v.props)[e].apply(r,t)}function I(){var t=v.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;nu(v.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(v.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function L(){!k&&v.props.aria.expanded&&nu(v.props.triggerTarget||e).forEach((function(e){v.props.interactive?e.setAttribute("aria-expanded",v.state.isVisible&&e===O()?"true":"false"):e.removeAttribute("aria-expanded")}))}function z(){S().removeEventListener("mousemove",g),Nu=Nu.filter((function(e){return e!==g}))}function P(t){if(!mu.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!v.props.interactive||!fu(x,n)){if(nu(v.props.triggerTarget||e).some((function(e){return fu(e,n)}))){if(mu.isTouch)return;if(v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[v,t]);!0===v.props.hideOnClick&&(v.clearDelayTimeouts(),v.hide(),p=!0,setTimeout((function(){p=!1})),v.state.isMounted||U())}}}function F(){h=!0}function R(){h=!1}function B(){var e=S();e.addEventListener("mousedown",P,!0),e.addEventListener("touchend",P,Gl),e.addEventListener("touchstart",R,Gl),e.addEventListener("touchmove",F,Gl)}function U(){var e=S();e.removeEventListener("mousedown",P,!0),e.removeEventListener("touchend",P,Gl),e.removeEventListener("touchstart",R,Gl),e.removeEventListener("touchmove",F,Gl)}function H(e,t){var n=A().box;function r(e){e.target===n&&(hu(n,"remove",r),t())}if(0===e)return t();hu(n,"remove",s),hu(n,"add",r),s=r}function $(t,n,r){void 0===r&&(r=!1),nu(v.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),m.push({node:e,eventType:t,handler:n,options:r})}))}function V(){var e;C()&&($("touchstart",q,{passive:!0}),$("touchend",Q,{passive:!0})),(e=v.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch($(e,q),e){case"mouseenter":$("mouseleave",Q);break;case"focus":$(wu?"focusout":"blur",K);break;case"focusin":$("focusout",K)}}))}function W(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),m=[]}function q(e){var t,n=!1;if(v.state.isEnabled&&!G(e)&&!p){var r="focus"===(null==(t=o)?void 0:t.type);o=e,l=e.currentTarget,L(),!v.state.isVisible&&lu(e)&&Nu.forEach((function(t){return t(e)})),"click"===e.type&&(v.props.trigger.indexOf("mouseenter")<0||d)&&!1!==v.props.hideOnClick&&v.state.isVisible?n=!0:ee(e),"click"===e.type&&(d=!n),n&&!r&&te(e)}}function Y(e){var t=e.target,n=O().contains(t)||x.contains(t);if("mousemove"!==e.type||!n){var r=Z().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:c}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,s=i.placement.split("-")[0],a=i.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,u="top"===s?a.bottom.y:0,c="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=t.top-r+l>o,h=r-t.bottom-u>o,f=t.left-n+c>o,m=n-t.right-d>o;return p||h||f||m}))})(r,e)&&(z(),te(e))}}function Q(e){G(e)||v.props.trigger.indexOf("click")>=0&&d||(v.props.interactive?v.hideWithInteractivity(e):te(e))}function K(e){v.props.trigger.indexOf("focusin")<0&&e.target!==O()||v.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function G(e){return!!mu.isTouch&&C()!==e.type.indexOf("touch")>=0}function J(){X();var t=v.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,s=t.moveTransition,l=T()?Ou(x).arrow:null,u=o?{getBoundingClientRect:o,contextElement:o.contextElement||O()}:e,c={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(T()){var n=A().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},d=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},c];T()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),v.popperInstance=$l(u,x,Object.assign({},n,{placement:r,onFirstUpdate:a,modifiers:d}))}function X(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Z(){return iu(x.querySelectorAll("[data-tippy-root]"))}function ee(e){v.clearDelayTimeouts(),e&&j("onTrigger",[v,e]),B();var t=N(!0),r=E(),i=r[0],o=r[1];mu.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){v.show()}),t):v.show()}function te(e){if(v.clearDelayTimeouts(),j("onUntrigger",[v,e]),v.state.isVisible){if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=N(!1);t?r=setTimeout((function(){v.state.isVisible&&v.hide()}),t):i=requestAnimationFrame((function(){v.hide()}))}}else U()}}function Iu(e,t){void 0===t&&(t={});var n=xu.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",yu,Gl),window.addEventListener("blur",vu);var r=Object.assign({},t,{plugins:n}),i=uu(e).reduce((function(e,t){var n=t&&ju(t,r);return n&&e.push(n),e}),[]);return au(e)?i[0]:i}Iu.defaultProps=xu,Iu.setDefaultProps=function(e){Object.keys(e).forEach((function(t){xu[t]=e[t]}))},Iu.currentInput=mu,Object.assign({},Ka,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});var Lu={clientX:0,clientY:0},zu=[];function Pu(e){var t=e.clientX,n=e.clientY;Lu={clientX:t,clientY:n}}var Fu={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=pu(e.props.triggerTarget||t),r=!1,i=!1,o=!0,s=e.props;function a(){return"initial"===e.props.followCursor&&e.state.isVisible}function l(){n.addEventListener("mousemove",d)}function u(){n.removeEventListener("mousemove",d)}function c(){r=!0,e.setProps({getReferenceClientRect:null}),r=!1}function d(n){var r=!n.target||t.contains(n.target),i=e.props.followCursor,o=n.clientX,s=n.clientY,a=t.getBoundingClientRect(),l=o-a.left,u=s-a.top;!r&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=o,r=s;"initial"===i&&(n=e.left+l,r=e.top+u);var a="horizontal"===i?e.top:r,c="vertical"===i?e.right:n,d="horizontal"===i?e.bottom:r,p="vertical"===i?e.left:n;return{width:c-p,height:d-a,top:a,right:c,bottom:d,left:p}}})}function p(){e.props.followCursor&&(zu.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",Pu)}(n))}function h(){zu=zu.filter((function(t){return t.instance!==e})),0===zu.filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",Pu)}(n)}return{onCreate:p,onDestroy:h,onBeforeUpdate:function(){s=e.props},onAfterUpdate:function(t,n){var o=n.followCursor;r||void 0!==o&&s.followCursor!==o&&(h(),o?(p(),!e.state.isMounted||i||a()||l()):(u(),c()))},onMount:function(){e.props.followCursor&&!i&&(o&&(d(Lu),o=!1),a()||l())},onTrigger:function(e,t){lu(t)&&(Lu={clientX:t.clientX,clientY:t.clientY}),i="focus"===t.type},onHidden:function(){e.props.followCursor&&(c(),u(),o=!0)}}}};Iu.setDefaultProps({render:Su});class Ru{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:r})=>{const{doc:i,selection:o}=t,{empty:s}=o,a=!i.textBetween(n,r).length&&$s(t.selection);return!(!e.hasFocus()||s||a)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=Iu(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,r,i;const{state:o,composing:s}=e,{doc:a,selection:l}=o,u=t&&t.doc.eq(a)&&t.selection.eq(l);if(s||u)return;this.createTooltip();const{ranges:c}=l,d=Math.min(...c.map((e=>e.$from.pos))),p=Math.max(...c.map((e=>e.$to.pos)));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:o,oldState:t,from:d,to:p}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(i=this.tippyOptions)||void 0===i?void 0:i.getReferenceClientRect)||(()=>{if(Hs(t=o.selection)&&t instanceof ln){const t=e.nodeDOM(d);if(t)return t.getBoundingClientRect()}var t;return wa(e,d,p)})}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Bu=e=>new kn({key:"string"==typeof e.pluginKey?new Tn(e.pluginKey):e.pluginKey,view:t=>new Ru({view:t,...e})});js.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[Bu({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class Uu{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{const{selection:n}=t,{$anchor:r,empty:i}=n,o=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;return!!(e.hasFocus()&&i&&o&&s)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=Iu(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,r,i;const{state:o}=e,{doc:s,selection:a}=o,{from:l,to:u}=a;if(t&&t.doc.eq(s)&&t.selection.eq(a))return;this.createTooltip();(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:o,oldState:t}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(i=this.tippyOptions)||void 0===i?void 0:i.getReferenceClientRect)||(()=>wa(e,l,u))}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}js.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[(e={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow},new kn({key:"string"==typeof e.pluginKey?new Tn(e.pluginKey):e.pluginKey,view:t=>new Uu({view:t,...e})}))]:[];var e}});const Hu=e=>{const[n,r]=i(null);return o((()=>{if(!n)return;if(e.editor.isDestroyed)return;const{pluginKey:t="bubbleMenu",editor:r,tippyOptions:i={},shouldShow:o=null}=e,s=Bu({pluginKey:t,editor:r,element:n,tippyOptions:i,shouldShow:o});return r.registerPlugin(s),()=>r.unregisterPlugin(t)}),[e.editor,n]),t.createElement("div",{ref:r,className:e.className,style:{visibility:"hidden"}},e.children)};class $u extends class extends class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(e,t){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}(ga,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e){this.setOptions({editable:e})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=ys(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(e){if(this.isDestroyed)return;const t="string"==typeof e?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((e=>!e.key.startsWith(t)))});this.view.updateState(n)}createExtensionManager(){const e=[...this.options.enableCoreExtensions?Object.values(fa):[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new As(e,this)}createCommandManager(){this.commandManager=new cs({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Zs(this.options.content,this.schema,this.options.parseOptions),t=Ws(e,this.options.autofocus);this.view=new No(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Mn.create({doc:e,selection:t||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews();this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null===(t=this.capturedTransaction)||void 0===t?void 0:t.step(e)})):void(this.capturedTransaction=e);const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const r=e.getMeta("focus"),i=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return ma(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return Gs(e,null,n)||aa(e,null,n);const r=Js(t,e.schema);return"node"===r?Gs(e,t,n):"mark"===r&&aa(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(e,t){const n=dt.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return Is(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...n,...Ls(this.schema)}})}get isEmpty(){return function(e){var t;const n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}{constructor(){super(...arguments),this.contentComponent=null}}const Vu=({renderers:e})=>t.createElement(t.Fragment,null,Array.from(e).map((([e,t])=>h.createPortal(t.reactElement,t.element,e))));class Wu extends t.Component{constructor(e){super(e),this.editorContentRef=t.createRef(),this.state={renderers:new Map}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews()}}componentWillUnmount(){const{editor:e}=this.props;if(!e)return;if(e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild)return;const t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){const{editor:e,...n}=this.props;return t.createElement(t.Fragment,null,t.createElement("div",{ref:this.editorContentRef,...n}),t.createElement(Vu,{renderers:this.state.renderers}))}}const qu=t.memo(Wu),Yu=n({onDragStart:void 0}),Qu=()=>r(Yu),Ku=e=>{const n=e.as||"div",{nodeViewContentRef:r}=Qu();return t.createElement(n,{...e,ref:r,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style}})},Gu=t.forwardRef(((e,n)=>{const{onDragStart:r}=Qu(),i=e.as||"div";return t.createElement(i,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})}));class Ju{constructor(e,{editor:t,props:n={},as:r="div",className:i=""}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.render()}render(){var e;const n=this.component,r=this.props;(function(e){return!("function"!=typeof e||!e.prototype||!e.prototype.isReactComponent)}(n)||function(e){var t;return!("object"!=typeof e||"Symbol(react.forward_ref)"!==(null===(t=e.$$typeof)||void 0===t?void 0:t.toString()))}(n))&&(r.ref=e=>{this.ref=e}),this.reactElement=t.createElement(n,{...r}),(null===(e=this.editor)||void 0===e?void 0:e.contentComponent)&&this.editor.contentComponent.setState({renderers:this.editor.contentComponent.state.renderers.set(this.id,this)})}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;if(null===(e=this.editor)||void 0===e?void 0:e.contentComponent){const{renderers:e}=this.editor.contentComponent.state;e.delete(this.id),this.editor.contentComponent.setState({renderers:e})}}}class Xu extends class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,a;const{view:l}=this.editor,u=e.target,c=3===u.nodeType?null===(t=u.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(u))||!c)return;let d=0,p=0;if(this.dom!==c){const t=this.dom.getBoundingClientRect(),n=c.getBoundingClientRect(),a=null!==(r=e.offsetX)&&void 0!==r?r:null===(i=e.nativeEvent)||void 0===i?void 0:i.offsetX,l=null!==(o=e.offsetY)&&void 0!==o?o:null===(s=e.nativeEvent)||void 0===s?void 0:s.offsetY;d=n.x-t.x+a,p=n.y-t.y+l}null===(a=e.dataTransfer)||void 0===a||a.setDragImage(this.dom,d,p);const h=ln.create(l.state.doc,this.getPos()),f=l.state.tr.setSelection(h);l.dispatch(f)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(n))))return!1;const r="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!r)return!0;const{isEditable:i}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,a=ln.isSelectable(this.node),l="copy"===e.type,u="paste"===e.type,c="cut"===e.type,d="mousedown"===e.type,p=e.type.startsWith("drag");if(!s&&a&&p&&e.preventDefault(),s&&p&&!o)return e.preventDefault(),!1;if(s&&i&&!o&&d){const e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(()=>{this.isDragging=!1}),{once:!0}))}return!(o||r||l||u||c||d&&a)}ignoreMutation(e){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:e});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&qs()&&this.editor.isFocused){if([...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every((e=>e.isContentEditable)))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command((({tr:t})=>{const n=this.getPos();return t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0}))}deleteNode(){const e=this.getPos(),t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}const n=e=>{const n=this.component,r=this.onDragStart.bind(this);return t.createElement(Yu.Provider,{value:{onDragStart:r,nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&e.appendChild(this.contentDOMElement)}}},t.createElement(n,{...e}))};n.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let r=this.node.isInline?"span":"div";this.options.as&&(r=this.options.as);const{className:i=""}=this.options;this.renderer=new Ju(n,{editor:this.editor,props:e,as:r,className:`node-${this.node.type.name} ${i}`.trim()})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null===(e=this.renderer.element.firstElementChild)||void 0===e?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,t){const n=e=>{this.renderer.updateProps(e)};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){const r=this.node,i=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:r,oldDecorations:i,newNode:e,newDecorations:t,updateProps:()=>n({node:e,decorations:t})})}return e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,n({node:e,decorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function Zu(e,t){return n=>n.editor.contentComponent?new Xu(e,n,t):{}}const ec=(e={},t=[])=>{const[n,r]=i(null),s=function(){const[,e]=i(0);return()=>e((e=>e+1))}();return o((()=>{let t=!0;const n=new $u(e);return r(n),n.on("transaction",(()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t&&s()}))}))})),()=>{n.destroy(),t=!1}}),t),n};var tc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function nc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function rc(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var ic,oc={exports:{}};
1
+ import*as e from"react";import t,{createContext as n,useContext as r,useState as i,useEffect as o,forwardRef as s,cloneElement as a,useLayoutEffect as l,useRef as u,useCallback as c,useImperativeHandle as d}from"react";import*as p from"react-dom";import h,{createPortal as f,flushSync as m}from"react-dom";import g from"highlight.js/lib/languages/arduino";import y from"highlight.js/lib/languages/bash";import b from"highlight.js/lib/languages/c";import v from"highlight.js/lib/languages/cpp";import w from"highlight.js/lib/languages/csharp";import x from"highlight.js/lib/languages/css";import M from"highlight.js/lib/languages/diff";import D from"highlight.js/lib/languages/go";import k from"highlight.js/lib/languages/graphql";import E from"highlight.js/lib/languages/ini";import C from"highlight.js/lib/languages/java";import T from"highlight.js/lib/languages/javascript";import O from"highlight.js/lib/languages/json";import S from"highlight.js/lib/languages/kotlin";import A from"highlight.js/lib/languages/less";import N from"highlight.js/lib/languages/lua";import _ from"highlight.js/lib/languages/makefile";import j from"highlight.js/lib/languages/markdown";import I from"highlight.js/lib/languages/objectivec";import L from"highlight.js/lib/languages/perl";import z from"highlight.js/lib/languages/php";import P from"highlight.js/lib/languages/php-template";import F from"highlight.js/lib/languages/plaintext";import R from"highlight.js/lib/languages/python";import B from"highlight.js/lib/languages/python-repl";import U from"highlight.js/lib/languages/r";import H from"highlight.js/lib/languages/ruby";import $ from"highlight.js/lib/languages/rust";import V from"highlight.js/lib/languages/scss";import W from"highlight.js/lib/languages/shell";import q from"highlight.js/lib/languages/sql";import Y from"highlight.js/lib/languages/swift";import Q from"highlight.js/lib/languages/typescript";import K from"highlight.js/lib/languages/vbnet";import G from"highlight.js/lib/languages/wasm";import J from"highlight.js/lib/languages/xml";import X from"highlight.js/lib/languages/yaml";import Z from"highlight.js/lib/core";import ee from"highlight.js/lib/common";var te=[],ne=[];function re(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",i=!0===t.singleTag,o="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var s=te.indexOf(o);-1===s&&(s=te.push(o)-1,ne[s]={}),n=ne[s]&&ne[s][r]?ne[s][r]:ne[s][r]=a()}else n=a();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function a(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),i=0;i<n.length;i++)e.setAttribute(n[i],t.attributes[n[i]]);var s="prepend"===r?"afterbegin":"beforeend";return o.insertAdjacentElement(s,e),e}}function ie(){return ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ie.apply(this,arguments)}function oe(e){this.content=e}function se(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let e=0;i.text[e]==o.text[e];e++)n++;return n}if(i.content.size||o.content.size){let e=se(i.content,o.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function ae(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let e=ae(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}re('@charset "UTF-8";\n@import url("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/night-owl.min.css");\n/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n/* Document\n ========================================================================== */\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n/* Sections\n ========================================================================== */\n/**\n * Remove the margin in all browsers.\n */\nbody {\n margin: 0;\n}\n/**\n * Render the `main` element consistently in IE.\n */\nmain {\n display: block;\n}\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\n/* Grouping content\n ========================================================================== */\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n/* Text-level semantics\n ========================================================================== */\n/**\n * Remove the gray background on active links in IE 10.\n */\na {\n background-color: transparent;\n}\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted; /* 2 */\n}\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\nb,\nstrong {\n font-weight: bolder;\n}\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n/**\n * Add the correct font size in all browsers.\n */\nsmall {\n font-size: 80%;\n}\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * all browsers.\n */\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\nsub {\n bottom: -0.25em;\n}\nsup {\n top: -0.5em;\n}\n/* Embedded content\n ========================================================================== */\n/**\n * Remove the border on images inside links in IE 10.\n */\nimg {\n border-style: none;\n}\n/* Forms\n ========================================================================== */\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\nbutton,\ninput {\n /* 1 */\n overflow: visible;\n}\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\nbutton,\nselect {\n /* 1 */\n text-transform: none;\n}\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\nbutton,\n[type=button],\n[type=reset],\n[type=submit] {\n -webkit-appearance: button;\n}\n/**\n * Remove the inner border and padding in Firefox.\n */\nbutton::-moz-focus-inner,\n[type=button]::-moz-focus-inner,\n[type=reset]::-moz-focus-inner,\n[type=submit]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n/**\n * Restore the focus styles unset by the previous rule.\n */\nbutton:-moz-focusring,\n[type=button]:-moz-focusring,\n[type=reset]:-moz-focusring,\n[type=submit]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n/**\n * Correct the padding in Firefox.\n */\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * `fieldset` elements in all browsers.\n */\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\nprogress {\n vertical-align: baseline;\n}\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\ntextarea {\n overflow: auto;\n}\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n[type=checkbox],\n[type=radio] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n[type=number]::-webkit-inner-spin-button,\n[type=number]::-webkit-outer-spin-button {\n height: auto;\n}\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n[type=search] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n[type=search]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n/* Interactive\n ========================================================================== */\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\ndetails {\n display: block;\n}\n/*\n * Add the correct display in all browsers.\n */\nsummary {\n display: list-item;\n}\n/* Misc\n ========================================================================== */\n/**\n * Add the correct display in IE 10+.\n */\ntemplate {\n display: none;\n}\n/**\n * Add the correct display in IE 10.\n */\n[hidden] {\n display: none;\n}\nbutton {\n background-color: transparent;\n background-image: none;\n}\nbody {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.3;\n color: #222;\n}\nbody *,\nbody *::after,\nbody *::before {\n box-sizing: border-box;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n@-webkit-keyframes shake {\n 0% {\n transform: translateX(0);\n }\n 10% {\n transform: translateX(-4px);\n }\n 20% {\n transform: translateX(4px);\n }\n 30% {\n transform: translateX(-4px);\n }\n 40% {\n transform: translateX(4px);\n }\n 50% {\n transform: translateX(-4px);\n }\n 60% {\n transform: translateX(4px);\n }\n 70% {\n transform: translateX(-4px);\n }\n 80% {\n transform: translateX(4px);\n }\n 90% {\n transform: translateX(-4px);\n }\n 100% {\n transform: translateX(0);\n }\n}\n@keyframes shake {\n 0% {\n transform: translateX(0);\n }\n 10% {\n transform: translateX(-4px);\n }\n 20% {\n transform: translateX(4px);\n }\n 30% {\n transform: translateX(-4px);\n }\n 40% {\n transform: translateX(4px);\n }\n 50% {\n transform: translateX(-4px);\n }\n 60% {\n transform: translateX(4px);\n }\n 70% {\n transform: translateX(-4px);\n }\n 80% {\n transform: translateX(4px);\n }\n 90% {\n transform: translateX(-4px);\n }\n 100% {\n transform: translateX(0);\n }\n}\n@-webkit-keyframes fade-in {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes spin {\n 0% {\n transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.ne-dropdown__popup {\n width: auto;\n max-height: 445px;\n max-width: 360px;\n overflow-y: auto;\n background-color: #ffffff;\n border-radius: 2px;\n border: thin solid #f8f9f9;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n padding: 4px 0;\n z-index: 99999;\n}\n.ne-dropdown__popup li,\n.ne-dropdown__popup .ne-dropdown--item {\n display: flex;\n cursor: pointer;\n position: relative;\n white-space: nowrap;\n transition: all 0.3s ease-in-out;\n font-size: 14px;\n font-weight: 400;\n color: #2f3941;\n padding: 8px 40px 8px 16px;\n text-decoration: none;\n outline-color: transparent;\n}\n.ne-dropdown__popup li.disabled,\n.ne-dropdown__popup .ne-dropdown--item.disabled {\n cursor: not-allowed;\n color: #87929d;\n}\n.ne-dropdown__popup li:hover, .ne-dropdown__popup li:focus,\n.ne-dropdown__popup .ne-dropdown--item:hover,\n.ne-dropdown__popup .ne-dropdown--item:focus {\n background-color: #e9ebed;\n}\n.ne-dropdown__popup li.loading:not(.active):after,\n.ne-dropdown__popup .ne-dropdown--item.loading:not(.active):after {\n content: "";\n position: absolute;\n right: 16px;\n top: 0;\n bottom: 0;\n margin: auto;\n width: 16px;\n height: 16px;\n display: block;\n border-radius: 50%;\n border: solid 2px #e9ebed;\n border-top-color: #1b1f23;\n border-left-color: #1b1f23;\n -webkit-animation: theme("animation.spin");\n animation: theme("animation.spin");\n}\n.ne-dropdown__popup li.active,\n.ne-dropdown__popup .ne-dropdown--item.active {\n background-color: #2f3941;\n color: #ffffff;\n}\n.ne-avatar--container {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 2px;\n position: relative;\n}\n.ne-avatar--container.ne-avatar--container-round {\n border-radius: 999px;\n}\n.ne-avatar--container .ne-avatar__text {\n font-weight: 600;\n text-align: center;\n text-transform: capitalize;\n font-size: 10px;\n color: #68737d;\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-medium {\n font-size: 12px;\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-large {\n font-size: 18px;\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-xlarge {\n font-size: 24px;\n}\n.ne-avatar--container .ne-avatar__status {\n position: absolute;\n right: 0;\n top: 0;\n width: 0.4rem;\n height: 0.4rem;\n background-color: white;\n border: 0.5px solid white;\n border-radius: 999px;\n transform: translateX(-40%);\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-medium {\n width: 0.465rem;\n height: 0.465rem;\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-large {\n width: 0.563rem;\n height: 0.563rem;\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-xlarge {\n width: 0.75rem;\n height: 0.75rem;\n transform: translateX(-65%);\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-square {\n transform: translate(25%, -25%);\n}\n.ne-avatar--container .ne-avatar__status.online {\n background-color: #00ba88;\n}\n.ne-avatar--container .ne-avatar__status.idle {\n background-color: #f3cd82;\n}\n.ne-avatar--container .ne-avatar__status.offline {\n background-color: #d8dcde;\n}\n.ne-avatar--container .ne-avatar {\n display: inline-block;\n border-radius: 2px;\n height: 1.5rem;\n width: 1.5rem;\n}\n.ne-avatar--container .ne-avatar.hidden {\n display: none;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--medium {\n height: 2rem;\n width: 2rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--large {\n height: 2.5rem;\n width: 2.5rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--xlarge {\n height: 4rem;\n width: 4rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--round {\n border-radius: 999px;\n}\n.ne-tab__wrapper {\n width: 100%;\n border-bottom: 1px solid #d8dcde;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n}\n.ne-tab__wrapper--size-large .ne-tab {\n font-size: 20px;\n padding-left: 12px;\n padding-right: 12px;\n}\n.ne-tab__wrapper--underline-none {\n border-bottom: none;\n}\n.ne-tab__wrapper--underline-none .ne-tab::before {\n display: none;\n}\n.ne-tab {\n color: #87929d;\n font-weight: 600;\n font-size: 14px;\n line-height: 1;\n padding: 12px 8px;\n transition: all 0.3s ease-in-out;\n position: relative;\n cursor: pointer;\n text-decoration: none;\n outline: none;\n}\n.ne-tab:hover, .ne-tab:focus, .ne-tab:focus-visible, .ne-tab:active {\n text-decoration: none;\n outline: none;\n}\n.ne-tab__icon {\n margin-right: 12px;\n}\n.ne-tab svg {\n width: 16px;\n height: 16px;\n}\n.ne-tab:hover {\n color: #68737d;\n}\n.ne-tab:before {\n content: "";\n position: absolute;\n width: 100%;\n height: 1px;\n background-color: transparent;\n left: 0;\n right: 0;\n bottom: -1px;\n transition: all 0.3s ease-in-out;\n}\n.ne-tab.active {\n color: #2f3941;\n}\n.ne-tab.active:before {\n background-color: #2f3941;\n}\n.ne-btn {\n display: inline-flex;\n align-items: center;\n font-size: 14px;\n font-weight: 500;\n border-radius: 2px;\n line-height: 1.2;\n transition: all 0.3s ease-in-out;\n border: none;\n cursor: pointer;\n padding: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n padding: 4px 8px;\n min-height: 28px;\n letter-spacing: -0.15px;\n outline: none;\n}\n.ne-btn--icon-only {\n padding-left: 6px;\n padding-right: 6px;\n}\n.ne-btn:focus, .ne-btn:focus-visible {\n outline: none;\n}\n.ne-btn:hover {\n text-decoration: none;\n}\n.ne-btn.disabled {\n cursor: not-allowed;\n opacity: 0.4;\n}\n.ne-btn .ne-btn__icon:last-child:not(:first-child),\n.ne-btn .ne-btn__spinner:last-child:not(:first-child) {\n margin-left: 8px;\n}\n.ne-btn--icon-left {\n flex-direction: row-reverse;\n}\n.ne-btn--icon-left .ne-btn__icon:last-child:not(:first-child),\n.ne-btn--icon-left .ne-btn__spinner:last-child:not(:first-child) {\n margin-right: 8px;\n margin-left: 0;\n}\n.ne-btn__icon,\n.ne-btn__spinner,\n.ne-btn__spinner-wrapper {\n color: inherit;\n}\n.ne-btn__icon svg,\n.ne-btn__spinner svg,\n.ne-btn__spinner-wrapper svg {\n color: inherit !important;\n}\n.ne-btn--width-full {\n width: 100% !important;\n justify-content: center;\n}\n.ne-btn--size-large {\n font-size: 16px;\n padding: 6px 12px;\n min-height: 32px;\n}\n.ne-btn--size-large.ne-btn--icon-only {\n padding-left: 8px;\n padding-right: 8px;\n}\n.ne-btn--style-primary {\n color: #ffffff;\n background-color: #2f3941;\n}\n.ne-btn--style-primary:hover:not(:disabled), .ne-btn--style-primary:active {\n color: #ffffff;\n background-color: #49545c;\n}\n.ne-btn--style-primary:focus-visible {\n color: #ffffff;\n box-shadow: 0 0 0 3px #e5e5e5;\n}\n.ne-btn--style-secondary {\n color: #2f3941;\n background-color: #e9ebed;\n}\n.ne-btn--style-secondary:hover:not(:disabled), .ne-btn--style-secondary:active {\n color: #2f3941;\n background-color: #c2c8cc;\n}\n.ne-btn--style-secondary:focus-visible {\n color: #2f3941;\n box-shadow: 0 0 0 3px #e5e5e5;\n}\n.ne-btn--style-text {\n color: #2f3941;\n}\n.ne-btn--style-text:hover:not(:disabled), .ne-btn--style-text:active {\n color: #2f3941;\n background-color: #e9ebed;\n}\n.ne-btn--style-text:focus-visible {\n color: #2f3941;\n box-shadow: 0 0 0 3px #e5e5e5;\n}\n.ne-btn--style-link {\n color: #5e5ce6;\n min-height: initial;\n padding: 0;\n}\n.ne-btn--style-link:hover:not(:disabled), .ne-btn--style-link:active, .ne-btn--style-link:focus {\n opacity: 0.8;\n color: #5e5ce6;\n}\n.ne-btn--style-link:focus-visible {\n color: #1c1aa9;\n}\n.ne-btn--style-danger {\n color: #f56a58;\n background-color: #ffefed;\n}\n.ne-btn--style-danger:hover:not(:disabled), .ne-btn--style-danger:active {\n color: #f56a58;\n background-color: #ffe4e0;\n}\n.ne-btn--style-danger:focus-visible {\n color: #f56a58;\n box-shadow: 0 0 0 3px #ffe4e0;\n}\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0;\n}\n[data-tippy-root] {\n max-width: calc(100vw - 10px);\n}\n.tippy-box {\n position: relative;\n background-color: #2f3941;\n color: #ffffff;\n border-radius: 2px;\n font-size: 12px;\n line-height: 1.4;\n outline: 0;\n transition-property: transform, visibility, opacity;\n}\n.tippy-box[data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n.tippy-box[data-placement^=top] > .tippy-arrow:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top;\n}\n.tippy-box[data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n.tippy-box[data-placement^=bottom] > .tippy-arrow:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom;\n}\n.tippy-box[data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n.tippy-box[data-placement^=left] > .tippy-arrow:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left;\n}\n.tippy-box[data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n.tippy-box[data-placement^=right] > .tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right;\n}\n.tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);\n}\n.tippy-arrow {\n width: 16px;\n height: 16px;\n color: #2f3941;\n}\n.tippy-arrow:before {\n content: "";\n position: absolute;\n border-color: transparent;\n border-style: solid;\n}\n.tippy-content {\n position: relative;\n padding: 5px 9px;\n z-index: 1;\n}\n.tippy-box[data-placement^=top] > .tippy-svg-arrow {\n bottom: 0;\n}\n.tippy-box[data-placement^=top] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=top] > .tippy-svg-arrow > svg {\n top: 16px;\n transform: rotate(180deg);\n}\n.tippy-box[data-placement^=bottom] > .tippy-svg-arrow {\n top: 0;\n}\n.tippy-box[data-placement^=bottom] > .tippy-svg-arrow > svg {\n bottom: 16px;\n}\n.tippy-box[data-placement^=left] > .tippy-svg-arrow {\n right: 0;\n}\n.tippy-box[data-placement^=left] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=left] > .tippy-svg-arrow > svg {\n transform: rotate(90deg);\n top: calc(50% - 3px);\n left: 13px;\n}\n.tippy-box[data-placement^=right] > .tippy-svg-arrow {\n left: 0;\n}\n.tippy-box[data-placement^=right] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=right] > .tippy-svg-arrow > svg {\n transform: rotate(-90deg);\n top: calc(50% - 3px);\n right: 13px;\n}\n.tippy-svg-arrow {\n width: 16px;\n height: 16px;\n fill: #2f3941;\n text-align: initial;\n}\n.tippy-svg-arrow,\n.tippy-svg-arrow > svg {\n position: absolute;\n}\n.tippy-svg-arrow > svg > path {\n fill: #2f3941;\n}\n.tippy-box[data-theme~=light] .tippy-svg-arrow > svg > path {\n fill: #ffffff;\n}\n.tippy-box[data-theme~=light] {\n color: #2f3941;\n box-shadow: 0 0 20px 4px rgba(154, 161, 177, 0.15), 0 4px 80px -8px rgba(36, 40, 47, 0.25), 0 4px 4px -2px rgba(91, 94, 105, 0.15);\n background-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=top] > .tippy-arrow:before {\n border-top-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=bottom] > .tippy-arrow:before {\n border-bottom-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=left] > .tippy-arrow:before {\n border-left-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=right] > .tippy-arrow:before {\n border-right-color: #ffffff;\n}\n.tippy-box[data-theme~=light] > .tippy-backdrop {\n background-color: #ffffff;\n}\n.tippy-box[data-theme~=light] > .tippy-svg-arrow {\n fill: #ffffff;\n}\n.ne-input__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n flex-grow: 1;\n}\n.ne-input__wrapper .ne-label {\n margin-bottom: 4px;\n}\n.ne-input__wrapper .ne-input {\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n font-size: 14px;\n line-height: 1.6;\n transition: all 0.3s ease-in-out;\n border-radius: 2px;\n border: thin solid #c2c8cc;\n background-color: #ffffff;\n color: #2f3941;\n overflow: hidden;\n}\n.ne-input__wrapper .ne-input.ne-input--textarea {\n padding: 8px;\n}\n.ne-input__wrapper .ne-input input,\n.ne-input__wrapper .ne-input textarea {\n width: 100%;\n background-color: transparent;\n color: inherit;\n border: none;\n font-size: inherit;\n line-height: inherit;\n box-shadow: none;\n outline: none;\n}\n.ne-input__wrapper .ne-input input::-moz-placeholder, .ne-input__wrapper .ne-input textarea::-moz-placeholder {\n color: #c2c8cc;\n}\n.ne-input__wrapper .ne-input input::placeholder,\n.ne-input__wrapper .ne-input textarea::placeholder {\n color: #c2c8cc;\n}\n.ne-input__wrapper .ne-input input:focus,\n.ne-input__wrapper .ne-input textarea:focus {\n outline-color: transparent;\n}\n.ne-input__wrapper .ne-input input {\n padding: 8px;\n}\n.ne-input__wrapper .ne-input textarea {\n padding: 0;\n max-height: 224px;\n overflow-y: auto;\n}\n.ne-input__wrapper .ne-input:focus-within:not(.ne-input--naked, .ne-input--error) {\n border-color: #2f3941;\n box-shadow: 0px 0px 0px 3px #e9ebed;\n}\n.ne-input__wrapper .ne-input:hover:not(.ne-input--naked, .ne-input--error, .ne-input--disabled) {\n border-color: #49545c;\n}\n.ne-input__wrapper .ne-input.ne-input--error {\n border-color: #f56a58;\n}\n.ne-input__wrapper .ne-input.ne-input--error:focus-within:not(.ne-input--naked) {\n box-shadow: 0 0 0 3px #ffefed;\n}\n.ne-input__wrapper .ne-input.ne-input--error textarea {\n resize: none;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled {\n background-color: #f8f9f9;\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled input {\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled textarea {\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--small input {\n padding: 6px 8px;\n line-height: 1.3;\n}\n.ne-input__wrapper .ne-input.ne-input--naked {\n padding: 0;\n border: none;\n box-shadow: none;\n}\n.ne-input__wrapper .ne-input.ne-input--naked .ne-input__prefix {\n margin-left: 0;\n}\n.ne-input__wrapper .ne-input.ne-input--naked .ne-input__suffix {\n margin-right: 0;\n}\n.ne-input__wrapper .ne-input__prefix,\n.ne-input__wrapper .ne-input__suffix {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n font-size: 14px;\n color: #68737d;\n}\n.ne-input__wrapper .ne-input__prefix svg,\n.ne-input__wrapper .ne-input__suffix svg {\n width: 16px;\n height: 16px;\n}\n.ne-input__wrapper .ne-input__prefix {\n margin-left: 10px;\n}\n.ne-input__wrapper .ne-input__suffix {\n margin-right: 10px;\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__prefix,\n.ne-input__wrapper .ne-input--block-add-on .ne-input__suffix {\n margin: 0;\n padding: 8px 10px;\n background-color: #f8f9f9;\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__prefix {\n border-right: thin solid #d8dcde;\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__suffix {\n border-left: thin solid #d8dcde;\n}\n.ne-input__help-text {\n margin-top: 8px;\n font-size: 12px;\n color: #87929d;\n line-height: 1.6;\n}\n.ne-input__error {\n margin-top: 4px;\n font-size: 12px;\n color: #f56a58;\n}\n.ne-modal__backdrop {\n position: fixed;\n z-index: 99999;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n overflow: auto;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n transition: all 0.3s ease-in-out;\n background-color: rgba(135, 146, 157, 0.5);\n}\n.ne-modal__backdrop .ne-modal__wrapper {\n width: 50%;\n max-width: 100%;\n max-height: 100vh;\n overflow-y: auto;\n position: relative;\n background-color: #ffffff;\n border-radius: 2px;\n}\n.ne-modal__backdrop .ne-modal__wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.ne-modal__backdrop .ne-modal__wrapper::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.ne-modal__backdrop .ne-modal__wrapper::-webkit-scrollbar-track {\n background: "transparent";\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-modal__close {\n position: absolute;\n top: 12px;\n right: 12px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--xs {\n width: 320px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--sm {\n width: 480px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--md {\n width: 720px;\n}\n.ne-modal__backdrop .ne-icon__wrapper {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n margin-bottom: 32px;\n padding: 10px 0 0 2px;\n}\n.neeto-editor-loader {\n width: 100%;\n height: 32px;\n display: flex;\n align-items: center;\n text-align: center;\n}\n.neeto-editor-loader__spinner-icon {\n width: 16px;\n height: 16px;\n display: inline-block;\n border-radius: 999px;\n border: solid 2px #e9ebed;\n border-top-color: #2f3941;\n border-left-color: #2f3941;\n -webkit-animation: spin 600ms linear infinite;\n animation: spin 600ms linear infinite;\n margin: 1px auto;\n}\n.neeto-editor-slash-commands__wrapper {\n padding: 12px;\n overflow-y: auto;\n max-height: 384px;\n width: 320px;\n max-width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n gap: 4px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item {\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n padding: 8px 12px;\n gap: 12px;\n border-radius: 4px;\n transition: all 0.3s ease-in-out;\n cursor: pointer;\n color: #ffffff;\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item:hover, .neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item.active {\n background-color: #49545c;\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item .neeto-editor-slash-commands__item-content h5 {\n font-size: 14px;\n font-weight: 600;\n line-height: 1.5;\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item .neeto-editor-slash-commands__item-content p {\n font-size: 12px;\n color: #d8dcde;\n}\n.neeto-editor-mentions__wrapper {\n padding: 8px;\n width: 208px;\n max-height: 256px;\n overflow-y: auto;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n padding: 8px;\n transition: all 0.3s ease-in-out;\n cursor: pointer;\n font-size: 12px;\n color: #ffffff;\n border-radius: 4px;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item p {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item .ne-avatar--container {\n margin-right: 8px;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item:hover, .neeto-editor-mentions__wrapper .neeto-editor-mentions__item.active {\n background-color: #49545c;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item.neeto-editor-mentions__item--light {\n color: #2f3941;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item.neeto-editor-mentions__item--light:hover, .neeto-editor-mentions__wrapper .neeto-editor-mentions__item.neeto-editor-mentions__item--light.active {\n background-color: #e9ebed;\n}\n.neeto-editor-mentions__wrapper.neeto-editor-mentions__wrapper--small {\n width: 176px;\n padding: 0 4px;\n}\n.ProseMirror.slash-active p.is-empty:last-child::before {\n content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkwIiBoZWlnaHQ9IjIzIiB2aWV3Qm94PSIwIDAgMTkwIDIz IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmci Pgo8cmVjdCB4PSIzNCIgeT0iNCIgd2lkdGg9IjE5IiBoZWlnaHQ9IjE5IiByeD0i NCIgZmlsbD0iI0YzRjRGNiIvPgo8cGF0aCBkPSJNNDEuNTA3OCAxOS45NzY2SDQw LjAxNTZMNDQuNDkyMiA3LjYyNUg0NS45ODQ0TDQxLjUwNzggMTkuOTc2NloiIGZp bGw9IiM2QjcyODAiLz4KPHBhdGggZD0iTTguMDMyMjMgOS4xMjY5NUg0LjgzMzAx VjE4SDMuNTI3MzRWOS4xMjY5NUgwLjMzNDk2MVY4LjA0Njg4SDguMDMyMjNWOS4x MjY5NVpNMTEuMjM4MyAxNi4xNDc1TDEyLjk2MDkgMTAuNjAzNUgxNC4zMTQ1TDEx LjM0MDggMTkuMTQxNkMxMC44ODA1IDIwLjM3MjEgMTAuMTQ5MSAyMC45ODczIDku MTQ2NDggMjAuOTg3M0w4LjkwNzIzIDIwLjk2NjhMOC40MzU1NSAyMC44Nzc5VjE5 Ljg1MjVMOC43NzczNCAxOS44Nzk5QzkuMjA1NzMgMTkuODc5OSA5LjUzODQxIDE5 Ljc5MzMgOS43NzUzOSAxOS42MjAxQzEwLjAxNjkgMTkuNDQ2OSAxMC4yMTUyIDE5 LjEzMDIgMTAuMzcwMSAxOC42Njk5TDEwLjY1MDQgMTcuOTE4TDguMDExNzIgMTAu NjAzNUg5LjM5MjU4TDExLjIzODMgMTYuMTQ3NVpNMjEuNjk3MyAxNC4zODM4QzIx LjY5NzMgMTUuNTA5NCAyMS40Mzk4IDE2LjQxNjMgMjAuOTI0OCAxNy4xMDQ1QzIw LjQwOTggMTcuNzkyNiAxOS43MTI2IDE4LjEzNjcgMTguODMzIDE4LjEzNjdDMTcu OTM1MiAxOC4xMzY3IDE3LjIyODggMTcuODUxOSAxNi43MTM5IDE3LjI4MjJWMjAu ODQzOEgxNS40NDkyVjEwLjYwMzVIMTYuNjA0NUwxNi42NjYgMTEuNDIzOEMxNy4x ODEgMTAuNzg1OCAxNy44OTY1IDEwLjQ2NjggMTguODEyNSAxMC40NjY4QzE5Ljcw MTIgMTAuNDY2OCAyMC40MDMgMTAuODAxOCAyMC45MTggMTEuNDcxN0MyMS40Mzc1 IDEyLjE0MTYgMjEuNjk3MyAxMy4wNzM2IDIxLjY5NzMgMTQuMjY3NlYxNC4zODM4 Wk0yMC40MzI2IDE0LjI0MDJDMjAuNDMyNiAxMy40MDYyIDIwLjI1NDkgMTIuNzQ3 NyAxOS44OTk0IDEyLjI2NDZDMTkuNTQzOSAxMS43ODE2IDE5LjA1NjMgMTEuNTQg MTguNDM2NSAxMS41NEMxNy42NzA5IDExLjU0IDE3LjA5NjcgMTEuODc5NiAxNi43 MTM5IDEyLjU1ODZWMTYuMDkyOEMxNy4wOTIxIDE2Ljc2NzMgMTcuNjcwOSAxNy4x MDQ1IDE4LjQ1MDIgMTcuMTA0NUMxOS4wNTYzIDE3LjEwNDUgMTkuNTM3MSAxNi44 NjUyIDE5Ljg5MjYgMTYuMzg2N0MyMC4yNTI2IDE1LjkwMzYgMjAuNDMyNiAxNS4x ODgyIDIwLjQzMjYgMTQuMjQwMlpNMjYuMzc5OSAxOC4xMzY3QzI1LjM3NzMgMTgu MTM2NyAyNC41NjE1IDE3LjgwODYgMjMuOTMyNiAxNy4xNTIzQzIzLjMwMzcgMTYu NDkxNSAyMi45ODkzIDE1LjYwOTcgMjIuOTg5MyAxNC41MDY4VjE0LjI3NDRDMjIu OTg5MyAxMy41NDA3IDIzLjEyODMgMTIuODg2NyAyMy40MDYyIDEyLjMxMjVDMjMu Njg4OCAxMS43MzM3IDI0LjA4MDcgMTEuMjgyNiAyNC41ODIgMTAuOTU5QzI1LjA4 NzkgMTAuNjMwOSAyNS42MzQ4IDEwLjQ2NjggMjYuMjIyNyAxMC40NjY4QzI3LjE4 NDIgMTAuNDY2OCAyNy45MzE2IDEwLjc4MzUgMjguNDY0OCAxMS40MTdDMjguOTk4 IDEyLjA1MDUgMjkuMjY0NiAxMi45NTc0IDI5LjI2NDYgMTQuMTM3N1YxNC42NjQx SDI0LjI1MzlDMjQuMjcyMSAxNS4zOTMyIDI0LjQ4NCAxNS45ODM0IDI0Ljg4OTYg MTYuNDM0NkMyNS4yOTk4IDE2Ljg4MTIgMjUuODE5MyAxNy4xMDQ1IDI2LjQ0ODIg MTcuMTA0NUMyNi44OTQ5IDE3LjEwNDUgMjcuMjczMSAxNy4wMTMzIDI3LjU4MyAx Ni44MzExQzI3Ljg5MjkgMTYuNjQ4OCAyOC4xNjQxIDE2LjQwNzIgMjguMzk2NSAx Ni4xMDY0TDI5LjE2ODkgMTYuNzA4QzI4LjU0OTIgMTcuNjYwNSAyNy42MTk1IDE4 LjEzNjcgMjYuMzc5OSAxOC4xMzY3Wk0yNi4yMjI3IDExLjUwNTlDMjUuNzEyMiAx MS41MDU5IDI1LjI4MzkgMTEuNjkyNyAyNC45Mzc1IDEyLjA2NjRDMjQuNTkxMSAx Mi40MzU1IDI0LjM3NyAxMi45NTUxIDI0LjI5NDkgMTMuNjI1SDI4VjEzLjUyOTND MjcuOTYzNSAxMi44ODY3IDI3Ljc5MDQgMTIuMzkgMjcuNDgwNSAxMi4wMzkxQzI3 LjE3MDYgMTEuNjgzNiAyNi43NTEzIDExLjUwNTkgMjYuMjIyNyAxMS41MDU5WiIg ZmlsbD0iIzZCNzI4MCIvPgo8cGF0aCBkPSJNNTkuNjcyOSA4LjgxMjVWMTAuNjAz NUg2MS4wNTM3VjExLjU4MTFINTkuNjcyOVYxNi4xNjhDNTkuNjcyOSAxNi40NjQy IDU5LjczNDQgMTYuNjg3NSA1OS44NTc0IDE2LjgzNzlDNTkuOTgwNSAxNi45ODM3 IDYwLjE5MDEgMTcuMDU2NiA2MC40ODYzIDE3LjA1NjZDNjAuNjMyMiAxNy4wNTY2 IDYwLjgzMjcgMTcuMDI5MyA2MS4wODc5IDE2Ljk3NDZWMThDNjAuNzU1MiAxOC4w OTExIDYwLjQzMTYgMTguMTM2NyA2MC4xMTcyIDE4LjEzNjdDNTkuNTUyMSAxOC4x MzY3IDU5LjEyNiAxNy45NjU4IDU4LjgzODkgMTcuNjI0QzU4LjU1MTggMTcuMjgy MiA1OC40MDgyIDE2Ljc5NjkgNTguNDA4MiAxNi4xNjhWMTEuNTgxMUg1Ny4wNjE1 VjEwLjYwMzVINTguNDA4MlY4LjgxMjVINTkuNjcyOVpNNjIuMDY1NCAxNC4yMzM0 QzYyLjA2NTQgMTMuNTA4OCA2Mi4yMDY3IDEyLjg1NzEgNjIuNDg5MyAxMi4yNzgz QzYyLjc3NjQgMTEuNjk5NSA2My4xNzI5IDExLjI1MjkgNjMuNjc4NyAxMC45Mzg1 QzY0LjE4OTEgMTAuNjI0IDY0Ljc3MDIgMTAuNDY2OCA2NS40MjE5IDEwLjQ2NjhD NjYuNDI5IDEwLjQ2NjggNjcuMjQyNSAxMC44MTU0IDY3Ljg2MjMgMTEuNTEyN0M2 OC40ODY3IDEyLjIxIDY4Ljc5ODggMTMuMTM3NCA2OC43OTg4IDE0LjI5NDlWMTQu MzgzOEM2OC43OTg4IDE1LjEwMzggNjguNjU5OCAxNS43NTEgNjguMzgxOCAxNi4z MjUyQzY4LjEwODQgMTYuODk0OSA2Ny43MTQyIDE3LjMzOTIgNjcuMTk5MiAxNy42 NTgyQzY2LjY4ODggMTcuOTc3MiA2Ni4xMDA5IDE4LjEzNjcgNjUuNDM1NSAxOC4x MzY3QzY0LjQzMjkgMTguMTM2NyA2My42MTk1IDE3Ljc4ODEgNjIuOTk1MSAxNy4w OTA4QzYyLjM3NTMgMTYuMzkzNiA2Mi4wNjU0IDE1LjQ3MDcgNjIuMDY1NCAxNC4z MjIzVjE0LjIzMzRaTTYzLjMzNjkgMTQuMzgzOEM2My4zMzY5IDE1LjIwNDEgNjMu NTI2IDE1Ljg2MjYgNjMuOTA0MyAxNi4zNTk0QzY0LjI4NzEgMTYuODU2MSA2NC43 OTc1IDE3LjEwNDUgNjUuNDM1NSAxNy4xMDQ1QzY2LjA3ODEgMTcuMTA0NSA2Ni41 ODg1IDE2Ljg1MzggNjYuOTY2OCAxNi4zNTI1QzY3LjM0NTEgMTUuODQ2NyA2Ny41 MzQyIDE1LjE0MDMgNjcuNTM0MiAxNC4yMzM0QzY3LjUzNDIgMTMuNDIyMiA2Ny4z NDA1IDEyLjc2NiA2Ni45NTMxIDEyLjI2NDZDNjYuNTcwMyAxMS43NTg4IDY2LjA1 OTkgMTEuNTA1OSA2NS40MjE5IDExLjUwNTlDNjQuNzk3NSAxMS41MDU5IDY0LjI5 MzkgMTEuNzU0MiA2My45MTExIDEyLjI1MUM2My41MjgzIDEyLjc0NzcgNjMuMzM2 OSAxMy40NTg3IDYzLjMzNjkgMTQuMzgzOFpNNzYuODI0MiAxNy4xMDQ1Qzc3LjI3 NTQgMTcuMTA0NSA3Ny42Njk2IDE2Ljk2NzggNzguMDA2OCAxNi42OTQzQzc4LjM0 NDEgMTYuNDIwOSA3OC41MzA5IDE2LjA3OTEgNzguNTY3NCAxNS42Njg5SDc5Ljc2 MzdDNzkuNzQwOSAxNi4wOTI4IDc5LjU5NTEgMTYuNDk2MSA3OS4zMjYyIDE2Ljg3 ODlDNzkuMDU3MyAxNy4yNjE3IDc4LjY5NzMgMTcuNTY3MSA3OC4yNDYxIDE3Ljc5 NDlDNzcuNzk5NSAxOC4wMjI4IDc3LjMyNTUgMTguMTM2NyA3Ni44MjQyIDE4LjEz NjdDNzUuODE3MSAxOC4xMzY3IDc1LjAxNSAxNy44MDE4IDc0LjQxOCAxNy4xMzE4 QzczLjgyNTUgMTYuNDU3NCA3My41MjkzIDE1LjUzNjggNzMuNTI5MyAxNC4zNzAx VjE0LjE1ODJDNzMuNTI5MyAxMy40MzgyIDczLjY2MTUgMTIuNzk3OSA3My45MjU4 IDEyLjIzNzNDNzQuMTkwMSAxMS42NzY4IDc0LjU2ODQgMTEuMjQxNSA3NS4wNjA1 IDEwLjkzMTZDNzUuNTU3MyAxMC42MjE3IDc2LjE0MjkgMTAuNDY2OCA3Ni44MTc0 IDEwLjQ2NjhDNzcuNjQ2OCAxMC40NjY4IDc4LjMzNSAxMC43MTUyIDc4Ljg4MTgg MTEuMjExOUM3OS40MzMzIDExLjcwODcgNzkuNzI3MiAxMi4zNTM1IDc5Ljc2Mzcg MTMuMTQ2NUg3OC41Njc0Qzc4LjUzMDkgMTIuNjY4IDc4LjM0ODYgMTIuMjc2IDc4 LjAyMDUgMTEuOTcwN0M3Ny42OTY5IDExLjY2MDggNzcuMjk1OSAxMS41MDU5IDc2 LjgxNzQgMTEuNTA1OUM3Ni4xNzQ4IDExLjUwNTkgNzUuNjc1OCAxMS43MzgzIDc1 LjMyMDMgMTIuMjAzMUM3NC45Njk0IDEyLjY2MzQgNzQuNzkzOSAxMy4zMzExIDc0 Ljc5MzkgMTQuMjA2MVYxNC40NDUzQzc0Ljc5MzkgMTUuMjk3NSA3NC45Njk0IDE1 Ljk1MzggNzUuMzIwMyAxNi40MTQxQzc1LjY3MTIgMTYuODc0MyA3Ni4xNzI1IDE3 LjEwNDUgNzYuODI0MiAxNy4xMDQ1Wk04Mi40NTAyIDExLjQ5OUM4My4wMTA3IDEw LjgxMDkgODMuNzM5OSAxMC40NjY4IDg0LjYzNzcgMTAuNDY2OEM4Ni4yMDA4IDEw LjQ2NjggODYuOTg5MyAxMS4zNDg2IDg3LjAwMjkgMTMuMTEyM1YxOEg4NS43Mzgz VjEzLjEwNTVDODUuNzMzNyAxMi41NzIzIDg1LjYxMDcgMTIuMTc4MSA4NS4zNjkx IDExLjkyMjlDODUuMTMyMiAxMS42Njc2IDg0Ljc2MDcgMTEuNTQgODQuMjU0OSAx MS41NEM4My44NDQ3IDExLjU0IDgzLjQ4NDcgMTEuNjQ5NCA4My4xNzQ4IDExLjg2 ODJDODIuODY0OSAxMi4wODY5IDgyLjYyMzQgMTIuMzc0IDgyLjQ1MDIgMTIuNzI5 NVYxOEg4MS4xODU1VjcuNUg4Mi40NTAyVjExLjQ5OVpNOTMuNDYyOSAxOEM5My4z OSAxNy44NTQyIDkzLjMzMDcgMTcuNTk0NCA5My4yODUyIDE3LjIyMDdDOTIuNjk3 MyAxNy44MzE0IDkxLjk5NTQgMTguMTM2NyA5MS4xNzk3IDE4LjEzNjdDOTAuNDUw NSAxOC4xMzY3IDg5Ljg1MTIgMTcuOTMxNiA4OS4zODE4IDE3LjUyMTVDODguOTE3 IDE3LjEwNjggODguNjg0NiAxNi41ODI3IDg4LjY4NDYgMTUuOTQ5MkM4OC42ODQ2 IDE1LjE3OSA4OC45NzYyIDE0LjU4MiA4OS41NTk2IDE0LjE1ODJDOTAuMTQ3NSAx My43Mjk4IDkwLjk3MjMgMTMuNTE1NiA5Mi4wMzQyIDEzLjUxNTZIOTMuMjY0NlYx Mi45MzQ2QzkzLjI2NDYgMTIuNDkyNSA5My4xMzI1IDEyLjE0MTYgOTIuODY4MiAx MS44ODE4QzkyLjYwMzggMTEuNjE3NSA5Mi4yMTQyIDExLjQ4NTQgOTEuNjk5MiAx MS40ODU0QzkxLjI0OCAxMS40ODU0IDkwLjg2OTggMTEuNTk5MyA5MC41NjQ1IDEx LjgyNzFDOTAuMjU5MSAxMi4wNTUgOTAuMTA2NCAxMi4zMzA3IDkwLjEwNjQgMTIu NjU0M0g4OC44MzVDODguODM1IDEyLjI4NTIgODguOTY0OCAxMS45Mjk3IDg5LjIy NDYgMTEuNTg3OUM4OS40ODg5IDExLjI0MTUgODkuODQ0NCAxMC45NjgxIDkwLjI5 MSAxMC43Njc2QzkwLjc0MjIgMTAuNTY3MSA5MS4yMzY3IDEwLjQ2NjggOTEuNzc0 NCAxMC40NjY4QzkyLjYyNjYgMTAuNDY2OCA5My4yOTQzIDEwLjY4MSA5My43Nzcz IDExLjEwOTRDOTQuMjYwNCAxMS41MzMyIDk0LjUxMTEgMTIuMTE4OCA5NC41Mjkz IDEyLjg2NjJWMTYuMjcwNUM5NC41MjkzIDE2Ljk0OTUgOTQuNjE1OSAxNy40ODk2 IDk0Ljc4OTEgMTcuODkwNlYxOEg5My40NjI5Wk05MS4zNjQzIDE3LjAzNjFDOTEu NzYwNyAxNy4wMzYxIDkyLjEzNjcgMTYuOTMzNiA5Mi40OTIyIDE2LjcyODVDOTIu ODQ3NyAxNi41MjM0IDkzLjEwNTEgMTYuMjU2OCA5My4yNjQ2IDE1LjkyODdWMTQu NDExMUg5Mi4yNzM0QzkwLjcyNCAxNC40MTExIDg5Ljk0OTIgMTQuODY0NiA4OS45 NDkyIDE1Ljc3MTVDODkuOTQ5MiAxNi4xNjggOTAuMDgxNCAxNi40Nzc5IDkwLjM0 NTcgMTYuNzAxMkM5MC42MSAxNi45MjQ1IDkwLjk0OTUgMTcuMDM2MSA5MS4zNjQz IDE3LjAzNjFaTTk3LjcwOCAxMC42MDM1TDk3Ljc0OSAxMS41MzMyQzk4LjMxNDEg MTAuODIyMyA5OS4wNTI0IDEwLjQ2NjggOTkuOTYzOSAxMC40NjY4QzEwMS41Mjcg MTAuNDY2OCAxMDIuMzE1IDExLjM0ODYgMTAyLjMyOSAxMy4xMTIzVjE4SDEwMS4w NjRWMTMuMTA1NUMxMDEuMDYgMTIuNTcyMyAxMDAuOTM3IDEyLjE3ODEgMTAwLjY5 NSAxMS45MjI5QzEwMC40NTggMTEuNjY3NiAxMDAuMDg3IDExLjU0IDk5LjU4MTEg MTEuNTRDOTkuMTcwOSAxMS41NCA5OC44MTA5IDExLjY0OTQgOTguNTAxIDExLjg2 ODJDOTguMTkxMSAxMi4wODY5IDk3Ljk0OTUgMTIuMzc0IDk3Ljc3NjQgMTIuNzI5 NVYxOEg5Ni41MTE3VjEwLjYwMzVIOTcuNzA4Wk0xMDMuOTM2IDE0LjI0MDJDMTAz LjkzNiAxMy4wODcyIDEwNC4yMDIgMTIuMTcxMiAxMDQuNzM1IDExLjQ5MjJDMTA1 LjI2OSAxMC44MDg2IDEwNS45NzUgMTAuNDY2OCAxMDYuODU0IDEwLjQ2NjhDMTA3 Ljc1NyAxMC40NjY4IDEwOC40NjEgMTAuNzg1OCAxMDguOTY3IDExLjQyMzhMMTA5 LjAyOCAxMC42MDM1SDExMC4xODRWMTcuODIyM0MxMTAuMTg0IDE4Ljc3OTMgMTA5 Ljg5OSAxOS41MzM1IDEwOS4zMjkgMjAuMDg1QzEwOC43NjQgMjAuNjM2NCAxMDgu MDAzIDIwLjkxMjEgMTA3LjA0NiAyMC45MTIxQzEwNi41MTMgMjAuOTEyMSAxMDUu OTkxIDIwLjc5ODIgMTA1LjQ4IDIwLjU3MDNDMTA0Ljk3IDIwLjM0MjQgMTA0LjU4 IDIwLjAzMDMgMTA0LjMxMiAxOS42MzM4TDEwNC45NjggMTguODc1QzEwNS41MSAx OS41NDQ5IDEwNi4xNzMgMTkuODc5OSAxMDYuOTU3IDE5Ljg3OTlDMTA3LjU3MiAx OS44Nzk5IDEwOC4wNTEgMTkuNzA2NyAxMDguMzkzIDE5LjM2MDRDMTA4LjczOSAx OS4wMTQgMTA4LjkxMiAxOC41MjY0IDEwOC45MTIgMTcuODk3NVYxNy4yNjE3QzEw OC40MDYgMTcuODQ1MSAxMDcuNzE2IDE4LjEzNjcgMTA2Ljg0MSAxOC4xMzY3QzEw NS45NzUgMTguMTM2NyAxMDUuMjczIDE3Ljc4ODEgMTA0LjczNSAxNy4wOTA4QzEw NC4yMDIgMTYuMzkzNiAxMDMuOTM2IDE1LjQ0MzQgMTAzLjkzNiAxNC4yNDAyWk0x MDUuMjA3IDE0LjM4MzhDMTA1LjIwNyAxNS4yMTc4IDEwNS4zNzggMTUuODc0IDEw NS43MiAxNi4zNTI1QzEwNi4wNjIgMTYuODI2NSAxMDYuNTQgMTcuMDYzNSAxMDcu MTU1IDE3LjA2MzVDMTA3Ljk1MyAxNy4wNjM1IDEwOC41MzggMTYuNzAxMiAxMDgu OTEyIDE1Ljk3NjZWMTIuNTk5NkMxMDguNTI1IDExLjg5MzIgMTA3Ljk0NCAxMS41 NCAxMDcuMTY5IDExLjU0QzEwNi41NTQgMTEuNTQgMTA2LjA3MyAxMS43NzkzIDEw NS43MjcgMTIuMjU3OEMxMDUuMzggMTIuNzM2MyAxMDUuMjA3IDEzLjQ0NSAxMDUu MjA3IDE0LjM4MzhaTTExNS4xNjcgMTguMTM2N0MxMTQuMTY0IDE4LjEzNjcgMTEz LjM0OSAxNy44MDg2IDExMi43MiAxNy4xNTIzQzExMi4wOTEgMTYuNDkxNSAxMTEu Nzc2IDE1LjYwOTcgMTExLjc3NiAxNC41MDY4VjE0LjI3NDRDMTExLjc3NiAxMy41 NDA3IDExMS45MTUgMTIuODg2NyAxMTIuMTkzIDEyLjMxMjVDMTEyLjQ3NiAxMS43 MzM3IDExMi44NjggMTEuMjgyNiAxMTMuMzY5IDEwLjk1OUMxMTMuODc1IDEwLjYz MDkgMTE0LjQyMiAxMC40NjY4IDExNS4wMSAxMC40NjY4QzExNS45NzEgMTAuNDY2 OCAxMTYuNzE5IDEwLjc4MzUgMTE3LjI1MiAxMS40MTdDMTE3Ljc4NSAxMi4wNTA1 IDExOC4wNTIgMTIuOTU3NCAxMTguMDUyIDE0LjEzNzdWMTQuNjY0MUgxMTMuMDQx QzExMy4wNTkgMTUuMzkzMiAxMTMuMjcxIDE1Ljk4MzQgMTEzLjY3NyAxNi40MzQ2 QzExNC4wODcgMTYuODgxMiAxMTQuNjA2IDE3LjEwNDUgMTE1LjIzNSAxNy4xMDQ1 QzExNS42ODIgMTcuMTA0NSAxMTYuMDYgMTcuMDEzMyAxMTYuMzcgMTYuODMxMUMx MTYuNjggMTYuNjQ4OCAxMTYuOTUxIDE2LjQwNzIgMTE3LjE4NCAxNi4xMDY0TDEx Ny45NTYgMTYuNzA4QzExNy4zMzYgMTcuNjYwNSAxMTYuNDA3IDE4LjEzNjcgMTE1 LjE2NyAxOC4xMzY3Wk0xMTUuMDEgMTEuNTA1OUMxMTQuNDk5IDExLjUwNTkgMTE0 LjA3MSAxMS42OTI3IDExMy43MjUgMTIuMDY2NEMxMTMuMzc4IDEyLjQzNTUgMTEz LjE2NCAxMi45NTUxIDExMy4wODIgMTMuNjI1SDExNi43ODdWMTMuNTI5M0MxMTYu NzUxIDEyLjg4NjcgMTE2LjU3NyAxMi4zOSAxMTYuMjY4IDEyLjAzOTFDMTE1Ljk1 OCAxMS42ODM2IDExNS41MzggMTEuNTA1OSAxMTUuMDEgMTEuNTA1OVpNMTI5LjI1 NiAxNC4zODM4QzEyOS4yNTYgMTUuNTE0IDEyOC45OTYgMTYuNDIzMiAxMjguNDc3 IDE3LjExMTNDMTI3Ljk1NyAxNy43OTQ5IDEyNy4yNiAxOC4xMzY3IDEyNi4zODUg MTguMTM2N0MxMjUuNDUxIDE4LjEzNjcgMTI0LjcyOCAxNy44MDYzIDEyNC4yMTgg MTcuMTQ1NUwxMjQuMTU2IDE4SDEyMi45OTRWNy41SDEyNC4yNTlWMTEuNDE3QzEy NC43NjkgMTAuNzgzNSAxMjUuNDczIDEwLjQ2NjggMTI2LjM3MSAxMC40NjY4QzEy Ny4yNjkgMTAuNDY2OCAxMjcuOTczIDEwLjgwNjMgMTI4LjQ4MyAxMS40ODU0QzEy OC45OTggMTIuMTY0NCAxMjkuMjU2IDEzLjA5NDEgMTI5LjI1NiAxNC4yNzQ0VjE0 LjM4MzhaTTEyNy45OTEgMTQuMjQwMkMxMjcuOTkxIDEzLjM3ODkgMTI3LjgyNSAx Mi43MTM1IDEyNy40OTIgMTIuMjQ0MUMxMjcuMTYgMTEuNzc0NyAxMjYuNjgxIDEx LjU0IDEyNi4wNTcgMTEuNTRDMTI1LjIyMyAxMS41NCAxMjQuNjIzIDExLjkyNzQg MTI0LjI1OSAxMi43MDIxVjE1LjkwMTRDMTI0LjY0NiAxNi42NzYxIDEyNS4yNSAx Ny4wNjM1IDEyNi4wNyAxNy4wNjM1QzEyNi42NzYgMTcuMDYzNSAxMjcuMTQ4IDE2 LjgyODggMTI3LjQ4NSAxNi4zNTk0QzEyNy44MjMgMTUuODkgMTI3Ljk5MSAxNS4x ODM2IDEyNy45OTEgMTQuMjQwMlpNMTMyLjIyOSAxOEgxMzAuOTY1VjcuNUgxMzIu MjI5VjE4Wk0xMzMuOTI1IDE0LjIzMzRDMTMzLjkyNSAxMy41MDg4IDEzNC4wNjYg MTIuODU3MSAxMzQuMzQ5IDEyLjI3ODNDMTM0LjYzNiAxMS42OTk1IDEzNS4wMzIg MTEuMjUyOSAxMzUuNTM4IDEwLjkzODVDMTM2LjA0OSAxMC42MjQgMTM2LjYzIDEw LjQ2NjggMTM3LjI4MSAxMC40NjY4QzEzOC4yODggMTAuNDY2OCAxMzkuMTAyIDEw LjgxNTQgMTM5LjcyMiAxMS41MTI3QzE0MC4zNDYgMTIuMjEgMTQwLjY1OCAxMy4x Mzc0IDE0MC42NTggMTQuMjk0OVYxNC4zODM4QzE0MC42NTggMTUuMTAzOCAxNDAu NTE5IDE1Ljc1MSAxNDAuMjQxIDE2LjMyNTJDMTM5Ljk2OCAxNi44OTQ5IDEzOS41 NzQgMTcuMzM5MiAxMzkuMDU5IDE3LjY1ODJDMTM4LjU0OCAxNy45NzcyIDEzNy45 NiAxOC4xMzY3IDEzNy4yOTUgMTguMTM2N0MxMzYuMjkyIDE4LjEzNjcgMTM1LjQ3 OSAxNy43ODgxIDEzNC44NTQgMTcuMDkwOEMxMzQuMjM1IDE2LjM5MzYgMTMzLjky NSAxNS40NzA3IDEzMy45MjUgMTQuMzIyM1YxNC4yMzM0Wk0xMzUuMTk2IDE0LjM4 MzhDMTM1LjE5NiAxNS4yMDQxIDEzNS4zODUgMTUuODYyNiAxMzUuNzY0IDE2LjM1 OTRDMTM2LjE0NiAxNi44NTYxIDEzNi42NTcgMTcuMTA0NSAxMzcuMjk1IDE3LjEw NDVDMTM3LjkzOCAxNy4xMDQ1IDEzOC40NDggMTYuODUzOCAxMzguODI2IDE2LjM1 MjVDMTM5LjIwNCAxNS44NDY3IDEzOS4zOTQgMTUuMTQwMyAxMzkuMzk0IDE0LjIz MzRDMTM5LjM5NCAxMy40MjIyIDEzOS4yIDEyLjc2NiAxMzguODEyIDEyLjI2NDZD MTM4LjQzIDExLjc1ODggMTM3LjkxOSAxMS41MDU5IDEzNy4yODEgMTEuNTA1OUMx MzYuNjU3IDExLjUwNTkgMTM2LjE1MyAxMS43NTQyIDEzNS43NzEgMTIuMjUxQzEz NS4zODggMTIuNzQ3NyAxMzUuMTk2IDEzLjQ1ODcgMTM1LjE5NiAxNC4zODM4Wk0x NDUuMjExIDE3LjEwNDVDMTQ1LjY2MiAxNy4xMDQ1IDE0Ni4wNTYgMTYuOTY3OCAx NDYuMzk0IDE2LjY5NDNDMTQ2LjczMSAxNi40MjA5IDE0Ni45MTggMTYuMDc5MSAx NDYuOTU0IDE1LjY2ODlIMTQ4LjE1QzE0OC4xMjggMTYuMDkyOCAxNDcuOTgyIDE2 LjQ5NjEgMTQ3LjcxMyAxNi44Nzg5QzE0Ny40NDQgMTcuMjYxNyAxNDcuMDg0IDE3 LjU2NzEgMTQ2LjYzMyAxNy43OTQ5QzE0Ni4xODYgMTguMDIyOCAxNDUuNzEyIDE4 LjEzNjcgMTQ1LjIxMSAxOC4xMzY3QzE0NC4yMDQgMTguMTM2NyAxNDMuNDAyIDE3 LjgwMTggMTQyLjgwNSAxNy4xMzE4QzE0Mi4yMTIgMTYuNDU3NCAxNDEuOTE2IDE1 LjUzNjggMTQxLjkxNiAxNC4zNzAxVjE0LjE1ODJDMTQxLjkxNiAxMy40MzgyIDE0 Mi4wNDggMTIuNzk3OSAxNDIuMzEyIDEyLjIzNzNDMTQyLjU3NyAxMS42NzY4IDE0 Mi45NTUgMTEuMjQxNSAxNDMuNDQ3IDEwLjkzMTZDMTQzLjk0NCAxMC42MjE3IDE0 NC41MyAxMC40NjY4IDE0NS4yMDQgMTAuNDY2OEMxNDYuMDM0IDEwLjQ2NjggMTQ2 LjcyMiAxMC43MTUyIDE0Ny4yNjkgMTEuMjExOUMxNDcuODIgMTEuNzA4NyAxNDgu MTE0IDEyLjM1MzUgMTQ4LjE1IDEzLjE0NjVIMTQ2Ljk1NEMxNDYuOTE4IDEyLjY2 OCAxNDYuNzM1IDEyLjI3NiAxNDYuNDA3IDExLjk3MDdDMTQ2LjA4NCAxMS42NjA4 IDE0NS42ODMgMTEuNTA1OSAxNDUuMjA0IDExLjUwNTlDMTQ0LjU2MiAxMS41MDU5 IDE0NC4wNjIgMTEuNzM4MyAxNDMuNzA3IDEyLjIwMzFDMTQzLjM1NiAxMi42NjM0 IDE0My4xODEgMTMuMzMxMSAxNDMuMTgxIDE0LjIwNjFWMTQuNDQ1M0MxNDMuMTgx IDE1LjI5NzUgMTQzLjM1NiAxNS45NTM4IDE0My43MDcgMTYuNDE0MUMxNDQuMDU4 IDE2Ljg3NDMgMTQ0LjU1OSAxNy4xMDQ1IDE0NS4yMTEgMTcuMTA0NVpNMTUxLjYz NyAxNC41NzUyTDE1MC44NDQgMTUuNDAyM1YxOEgxNDkuNTc5VjcuNUgxNTAuODQ0 VjEzLjg1MDZMMTUxLjUyMSAxMy4wMzcxTDE1My44MjQgMTAuNjAzNUgxNTUuMzYy TDE1Mi40ODQgMTMuNjkzNEwxNTUuNjk3IDE4SDE1NC4yMTRMMTUxLjYzNyAxNC41 NzUyWk0xNjEuODU2IDguODEyNVYxMC42MDM1SDE2My4yMzdWMTEuNTgxMUgxNjEu ODU2VjE2LjE2OEMxNjEuODU2IDE2LjQ2NDIgMTYxLjkxOCAxNi42ODc1IDE2Mi4w NDEgMTYuODM3OUMxNjIuMTY0IDE2Ljk4MzcgMTYyLjM3NCAxNy4wNTY2IDE2Mi42 NyAxNy4wNTY2QzE2Mi44MTYgMTcuMDU2NiAxNjMuMDE2IDE3LjAyOTMgMTYzLjI3 MSAxNi45NzQ2VjE4QzE2Mi45MzkgMTguMDkxMSAxNjIuNjE1IDE4LjEzNjcgMTYy LjMwMSAxOC4xMzY3QzE2MS43MzYgMTguMTM2NyAxNjEuMzEgMTcuOTY1OCAxNjEu MDIyIDE3LjYyNEMxNjAuNzM1IDE3LjI4MjIgMTYwLjU5MiAxNi43OTY5IDE2MC41 OTIgMTYuMTY4VjExLjU4MTFIMTU5LjI0NVYxMC42MDM1SDE2MC41OTJWOC44MTI1 SDE2MS44NTZaTTE2Ny4xNDEgMTYuMTQ3NUwxNjguODYzIDEwLjYwMzVIMTcwLjIx N0wxNjcuMjQzIDE5LjE0MTZDMTY2Ljc4MyAyMC4zNzIxIDE2Ni4wNTEgMjAuOTg3 MyAxNjUuMDQ5IDIwLjk4NzNMMTY0LjgxIDIwLjk2NjhMMTY0LjMzOCAyMC44Nzc5 VjE5Ljg1MjVMMTY0LjY4IDE5Ljg3OTlDMTY1LjEwOCAxOS44Nzk5IDE2NS40NDEg MTkuNzkzMyAxNjUuNjc4IDE5LjYyMDFDMTY1LjkxOSAxOS40NDY5IDE2Ni4xMTgg MTkuMTMwMiAxNjYuMjcyIDE4LjY2OTlMMTY2LjU1MyAxNy45MThMMTYzLjkxNCAx MC42MDM1SDE2NS4yOTVMMTY3LjE0MSAxNi4xNDc1Wk0xNzcuNiAxNC4zODM4QzE3 Ny42IDE1LjUwOTQgMTc3LjM0MiAxNi40MTYzIDE3Ni44MjcgMTcuMTA0NUMxNzYu MzEyIDE3Ljc5MjYgMTc1LjYxNSAxOC4xMzY3IDE3NC43MzUgMTguMTM2N0MxNzMu ODM4IDE4LjEzNjcgMTczLjEzMSAxNy44NTE5IDE3Mi42MTYgMTcuMjgyMlYyMC44 NDM4SDE3MS4zNTJWMTAuNjAzNUgxNzIuNTA3TDE3Mi41NjggMTEuNDIzOEMxNzMu MDgzIDEwLjc4NTggMTczLjc5OSAxMC40NjY4IDE3NC43MTUgMTAuNDY2OEMxNzUu NjA0IDEwLjQ2NjggMTc2LjMwNSAxMC44MDE4IDE3Ni44MiAxMS40NzE3QzE3Ny4z NCAxMi4xNDE2IDE3Ny42IDEzLjA3MzYgMTc3LjYgMTQuMjY3NlYxNC4zODM4Wk0x NzYuMzM1IDE0LjI0MDJDMTc2LjMzNSAxMy40MDYyIDE3Ni4xNTcgMTIuNzQ3NyAx NzUuODAyIDEyLjI2NDZDMTc1LjQ0NiAxMS43ODE2IDE3NC45NTkgMTEuNTQgMTc0 LjMzOSAxMS41NEMxNzMuNTczIDExLjU0IDE3Mi45OTkgMTEuODc5NiAxNzIuNjE2 IDEyLjU1ODZWMTYuMDkyOEMxNzIuOTk0IDE2Ljc2NzMgMTczLjU3MyAxNy4xMDQ1 IDE3NC4zNTMgMTcuMTA0NUMxNzQuOTU5IDE3LjEwNDUgMTc1LjQzOSAxNi44NjUy IDE3NS43OTUgMTYuMzg2N0MxNzYuMTU1IDE1LjkwMzYgMTc2LjMzNSAxNS4xODgy IDE3Ni4zMzUgMTQuMjQwMlpNMTgyLjI4MiAxOC4xMzY3QzE4MS4yOCAxOC4xMzY3 IDE4MC40NjQgMTcuODA4NiAxNzkuODM1IDE3LjE1MjNDMTc5LjIwNiAxNi40OTE1 IDE3OC44OTIgMTUuNjA5NyAxNzguODkyIDE0LjUwNjhWMTQuMjc0NEMxNzguODky IDEzLjU0MDcgMTc5LjAzMSAxMi44ODY3IDE3OS4zMDkgMTIuMzEyNUMxNzkuNTkx IDExLjczMzcgMTc5Ljk4MyAxMS4yODI2IDE4MC40ODQgMTAuOTU5QzE4MC45OSAx MC42MzA5IDE4MS41MzcgMTAuNDY2OCAxODIuMTI1IDEwLjQ2NjhDMTgzLjA4NyAx MC40NjY4IDE4My44MzQgMTAuNzgzNSAxODQuMzY3IDExLjQxN0MxODQuOSAxMi4w NTA1IDE4NS4xNjcgMTIuOTU3NCAxODUuMTY3IDE0LjEzNzdWMTQuNjY0MUgxODAu MTU2QzE4MC4xNzQgMTUuMzkzMiAxODAuMzg2IDE1Ljk4MzQgMTgwLjc5MiAxNi40 MzQ2QzE4MS4yMDIgMTYuODgxMiAxODEuNzIyIDE3LjEwNDUgMTgyLjM1MSAxNy4x MDQ1QzE4Mi43OTcgMTcuMTA0NSAxODMuMTc1IDE3LjAxMzMgMTgzLjQ4NSAxNi44 MzExQzE4My43OTUgMTYuNjQ4OCAxODQuMDY2IDE2LjQwNzIgMTg0LjI5OSAxNi4x MDY0TDE4NS4wNzEgMTYuNzA4QzE4NC40NTEgMTcuNjYwNSAxODMuNTIyIDE4LjEz NjcgMTgyLjI4MiAxOC4xMzY3Wk0xODIuMTI1IDExLjUwNTlDMTgxLjYxNSAxMS41 MDU5IDE4MS4xODYgMTEuNjkyNyAxODAuODQgMTIuMDY2NEMxODAuNDkzIDEyLjQz NTUgMTgwLjI3OSAxMi45NTUxIDE4MC4xOTcgMTMuNjI1SDE4My45MDJWMTMuNTI5 M0MxODMuODY2IDEyLjg4NjcgMTgzLjY5MyAxMi4zOSAxODMuMzgzIDEyLjAzOTFD MTgzLjA3MyAxMS42ODM2IDE4Mi42NTQgMTEuNTA1OSAxODIuMTI1IDExLjUwNTla IiBmaWxsPSIjNkI3MjgwIi8+Cjwvc3ZnPgo=");\n position: absolute;\n top: -2px;\n height: 0;\n pointer-events: none;\n}\n.neeto-editor {\n max-width: 100% !important;\n border-radius: 2px;\n white-space: pre-wrap;\n padding: 12px;\n color: #2f3941;\n}\n.neeto-editor p {\n line-height: 1.625;\n margin-bottom: 16px;\n}\n.neeto-editor:focus {\n outline: none;\n}\n.neeto-editor a {\n pointer-events: none;\n}\n.neeto-editor mark {\n background: #c9e4cc;\n border-radius: 2px;\n padding: 0px 4px;\n color: inherit;\n}\n.neeto-editor [data-variable] {\n display: inline-flex;\n color: #49545c;\n background-color: rgba(233, 235, 237, 0.5);\n border-radius: 2px;\n line-height: 1;\n padding: 4px 6px;\n}\n.neeto-editor [data-mention] {\n opacity: 0.6;\n}\n.neeto-editor .ProseMirror-separator {\n display: none;\n}\n.neeto-editor.fixed-menu-active {\n border: thin solid #e9ebed;\n border-radius: 0px 0px 2px 2px;\n}\n.neeto-editor .is-empty {\n position: relative;\n}\n.neeto-editor.placeholder-active:not(.force-title) .is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title h1:first-child {\n position: relative;\n margin-bottom: 20px;\n}\n.neeto-editor.force-title .is-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title.placeholder-active .is-empty:nth-child(2):last-child:before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title.force-title--error .is-empty:first-child::after {\n position: absolute;\n content: "Title can\'t be blank";\n left: 0;\n bottom: -12px;\n color: #f56a58;\n pointer-events: none;\n font-size: 12px;\n}\n.neeto-editor hr {\n margin: 8px 0;\n}\n.neeto-editor .ProseMirror-selectednode {\n outline: 3px solid #eaf3fc;\n}\n.neeto-editor-character-count {\n padding: 4px;\n color: #68737d;\n font-size: 12px;\n text-align: right;\n}\n.neeto-editor-error {\n color: #f56a58;\n border-width: 1px;\n border-color: #f56a58;\n}\n.neeto-editor-error:focus-within {\n border-color: #f56a58;\n}\n.neeto-editor-content, .neeto-editor {\n white-space: pre-wrap;\n word-break: break-word;\n}\n.neeto-editor-content h1, .neeto-editor h1,\n.neeto-editor-content h2,\n.neeto-editor h2,\n.neeto-editor-content h3,\n.neeto-editor h3,\n.neeto-editor-content h4,\n.neeto-editor h4,\n.neeto-editor-content h5,\n.neeto-editor h5,\n.neeto-editor-content h6,\n.neeto-editor h6 {\n font-size: revert;\n}\n.neeto-editor-content p, .neeto-editor p {\n line-height: 1.625;\n margin-bottom: 16px;\n}\n.neeto-editor-content p:empty::after, .neeto-editor p:empty::after {\n content: " ";\n}\n.neeto-editor-content p:last-child, .neeto-editor p:last-child {\n margin-bottom: 0;\n}\n.neeto-editor-content code, .neeto-editor code {\n padding: 0.2em 0.4em;\n font-size: 85%;\n border-radius: 6px;\n background-color: rgba(175, 184, 193, 0.2);\n font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;\n}\n.neeto-editor-content pre, .neeto-editor pre {\n color: #ffffff;\n background-color: #1f2937;\n overflow-x: auto;\n font-size: 12px;\n line-height: 20px;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 2px;\n padding: 16px;\n}\n.neeto-editor-content pre > code, .neeto-editor pre > code {\n background-color: transparent;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-weight: 400;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n line-height: inherit;\n}\n.neeto-editor-content blockquote, .neeto-editor blockquote {\n font-weight: 500;\n color: #1b1f23;\n border-left-width: 4px;\n border-left-color: #e5e7eb;\n quotes: "“" "”" "‘" "’";\n margin: 8px 0;\n padding-left: 12px;\n}\n.neeto-editor-content blockquote > p::before, .neeto-editor blockquote > p::before {\n content: "" !important;\n}\n.neeto-editor-content blockquote > p::after, .neeto-editor blockquote > p::after {\n content: "" !important;\n}\n.neeto-editor-content ul, .neeto-editor ul,\n.neeto-editor-content ol,\n.neeto-editor ol {\n list-style: revert;\n margin: revert;\n padding: revert;\n}\n.neeto-editor-content ul > li > p, .neeto-editor ul > li > p,\n.neeto-editor-content ol > li > p,\n.neeto-editor ol > li > p {\n margin-top: 0 !important;\n margin-bottom: 0.375rem !important;\n}\n.neeto-editor-content ul li::before, .neeto-editor ul li::before,\n.neeto-editor-content ol li::before,\n.neeto-editor ol li::before {\n background-color: #1b1f23;\n}\n.neeto-editor-content a[href], .neeto-editor a[href] {\n color: #276ef1;\n}\n.neeto-editor-content .video-wrapper, .neeto-editor .video-wrapper {\n width: 560px;\n height: 315px;\n margin: auto;\n}\n.neeto-editor-content mark, .neeto-editor mark {\n background: #c9e4cc;\n border-radius: 2px;\n padding: 0px 4px;\n color: inherit;\n}\n.neeto-editor-content [data-variable], .neeto-editor [data-variable] {\n display: inline-flex;\n color: #49545c;\n background-color: rgba(233, 235, 237, 0.5);\n border-radius: 2px;\n line-height: 1;\n padding: 4px 6px;\n}\n.neeto-editor-content [data-mention], .neeto-editor [data-mention] {\n opacity: 0.6;\n}\n.neeto-editor-content--hidden {\n display: none;\n}\n.neeto-editor__image {\n display: inline-block;\n border: 1.5px solid #eaf3fc;\n margin: 0 12px;\n}\n.neeto-editor__image figure {\n margin: 16px 12px;\n outline: none;\n}\n.neeto-editor__image figure img {\n height: 100%;\n width: 100%;\n -webkit-user-select: auto;\n -moz-user-select: auto;\n user-select: auto;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.neeto-editor__image figure figcaption {\n color: #49545c;\n text-align: center;\n}\n.neeto-editor__image-defaults {\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n}\n.neeto-editor__image--none {\n display: flex;\n justify-content: center;\n}\n.neeto-editor__image--left {\n float: left;\n margin-left: 0;\n}\n.neeto-editor__image--right {\n float: right;\n margin-right: 0;\n}\n.neeto-editor__image--center {\n margin: 0 auto;\n}\n.neeto-editor-fixed-menu {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n overflow-x: auto;\n border-radius: 2px 2px 0px 0px;\n background-color: #e9ebed;\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 10px;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item:hover, .neeto-editor-fixed-menu .neeto-editor-fixed-menu__item:focus, .neeto-editor-fixed-menu .neeto-editor-fixed-menu__item:active, .neeto-editor-fixed-menu .neeto-editor-fixed-menu__item.active {\n background-color: #d8dcde;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item input[type=color] {\n visibility: hidden;\n height: 0;\n width: 0;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu-addons {\n display: flex;\n align-items: center;\n margin-left: auto;\n}\n.neeto-editor-variables-suggestion {\n padding: 4px 0;\n}\n.neeto-editor-variables-list {\n padding: 4px 8px;\n min-width: 184px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block:not(:last-child) {\n margin-bottom: 12px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block h6 {\n font-size: 12px;\n font-weight: 500;\n color: #68737d;\n margin-bottom: 4px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row .neeto-editor-variable {\n padding: 4px 6px;\n font-size: 12px;\n color: #49545c;\n line-height: 1;\n background-color: #eaf3fc;\n border-radius: 2px;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row .neeto-editor-variable:hover {\n background-color: #d4e6f9;\n}\n.neeto-editor-link-wrapper .ne-dropdown__popup {\n padding: 8px;\n width: 100%;\n max-width: 400px;\n}\n.neeto-editor-link-wrapper .ne-dropdown__popup .neeto-editor-link__item {\n display: flex !important;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n gap: 12px;\n}\n.neeto-editor-font-size-wrapper .ne-dropdown__popup {\n display: flex !important;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n gap: 8px;\n padding: 4px;\n}\n.neeto-editor-font-size-wrapper .ne-dropdown__popup li {\n padding: 6px 8px;\n}\n.neeto-editor-bubble-menu {\n position: relative;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n overflow: hidden;\n border-radius: 4px;\n background: #2f3941;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item {\n padding: 8px;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:hover, .neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:active, .neeto-editor-bubble-menu .neeto-editor-bubble-menu__item.active {\n background-color: #49545c;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link {\n display: flex;\n align-items: center;\n padding: 8px;\n gap: 8px;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input {\n background-color: transparent;\n outline: none;\n line-height: 20px;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input::-moz-placeholder {\n color: rgba(255, 255, 255, 0.4);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input::placeholder {\n color: rgba(255, 255, 255, 0.4);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .ne-btn--icon-only {\n padding: 0;\n min-height: 0;\n opacity: 0.8;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .ne-btn--icon-only:hover {\n opacity: 1;\n}\n.neeto-editor-bubble-menu-animate-shake {\n -webkit-animation: 1s linear infinite alternate both shake;\n animation: 1s linear infinite alternate both shake;\n}\n.neeto-editor-image-uploader {\n display: flex;\n flex-direction: column;\n min-height: 184px;\n}\n.neeto-editor-image-uploader .ne-tab__wrapper .ne-tab {\n min-width: 88px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__content {\n flex-grow: 1;\n display: flex;\n padding: 16px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n text-align: center;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress-title, .neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-label {\n color: #49545c;\n font-size: 14px;\n margin-bottom: 4px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress-file, .neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-note {\n color: #c2c8cc;\n font-size: 12px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n border: 1px dashed #c2c8cc;\n box-sizing: border-box;\n border-radius: 2px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-Root {\n width: 100%;\n height: 100%;\n background-color: #ffffff;\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-Root::-moz-focus-inner {\n border: 0;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-inner {\n display: flex;\n flex-direction: column;\n justify-content: center;\n line-height: 1.4;\n text-align: center;\n font-weight: 400;\n margin: 0;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-arrow {\n visibility: hidden;\n display: none;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop--isDraggingOver {\n background-color: #e9ebed;\n border: 2px dashed #5e5ce6;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-browse {\n color: #5e5ce6;\n font-size: 14px;\n font-weight: 600;\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd--error {\n color: #f56a58;\n font-size: 12px;\n margin-top: 12px;\n text-align: center;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper {\n width: 100%;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .ne-input__wrapper {\n width: 100%;\n flex-grow: 0;\n margin-bottom: 16px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container {\n max-height: 50vh;\n overflow-y: auto;\n overflow-x: hidden;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery {\n width: 100%;\n right: -8px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item {\n width: 33.3%;\n padding-right: 16px;\n padding-bottom: 16px;\n float: left;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder {\n width: 100%;\n position: relative;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner {\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: #f8f9f9;\n border-radius: 2px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner img {\n height: 100%;\n width: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n -webkit-animation: fade-in 1.2s 1s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n animation: fade-in 1.2s 1s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n border-radius: 2px;\n position: relative;\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner a {\n opacity: 0;\n position: absolute;\n left: 8px;\n bottom: 8px;\n margin: auto;\n color: #ffffff;\n font-size: 12px;\n font-weight: 400;\n line-height: 1;\n text-transform: capitalize;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner a:hover {\n text-decoration: underline;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner:hover a {\n opacity: 1;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__text {\n font-size: 12px;\n color: #2f3941;\n text-align: center;\n margin-top: 12px;\n}\n.neeto-editor-progress-bar__wrapper {\n width: 100%;\n max-width: 256px;\n margin-top: 10px;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__percent {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__percent p {\n font-size: 12px;\n color: #2f3941;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__indicator {\n position: relative;\n width: 100%;\n height: 6px;\n border-radius: 999px;\n overflow: hidden;\n background-color: rgba(94, 92, 230, 0.2);\n margin-top: 4px;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__indicator-inner {\n height: 100%;\n background-color: #5e5ce6;\n}\n.neeto-editor-url-form__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n padding: 0 24px;\n}\n.neeto-editor-url-form__wrapper .ne-input__wrapper {\n width: 100%;\n flex-grow: 0;\n margin-bottom: 16px;\n}\n.neeto-editor-emoji {\n font-family: apple color emoji, segoe ui emoji, noto color emoji, android emoji, emojisymbols, emojione mozilla, twemoji mozilla, segoe ui symbol;\n}\n.emoji-mart.emoji-mart-light {\n font-size: 14px;\n color: #2f3941;\n border: none;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor {\n color: #87929d;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor svg {\n margin: auto;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor .emoji-mart-anchor-bar {\n background-color: #2f3941 !important;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor.emoji-mart-anchor-selected {\n color: #2f3941 !important;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-search input {\n border-radius: 2px;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-category-label span {\n padding-top: 8px;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-emoji span {\n cursor: pointer;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-emoji:hover::before {\n background-color: #e9ebed;\n border-radius: 2px;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-scroll {\n height: 264px;\n padding-bottom: 0px;\n}\n.neeto-editor-emoji-suggestion {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n padding: 4px;\n gap: 2px;\n font-family: apple color emoji, segoe ui emoji, noto color emoji, android emoji, emojisymbols, emojione mozilla, twemoji mozilla, segoe ui symbol;\n}\n.neeto-editor-emoji-suggestion p {\n font-size: 12px;\n color: #2f3941;\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item {\n padding: 6px;\n font-size: 24px;\n transition: all 0.3s ease-in-out;\n border-radius: 2px;\n line-height: 1;\n cursor: pointer;\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item:hover {\n background-color: #e9ebed;\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item--selected {\n background-color: #e9ebed;\n}\n.neeto-editor-image-editor {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1.25rem;\n}\n.neeto-editor-image-editor figure {\n display: flex;\n flex-direction: column;\n justify-content: center;\n min-height: 208px;\n max-height: 400px;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n}\n.neeto-editor-image-editor figure img {\n height: 100%;\n width: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.neeto-editor-image-editor .ne-input__wrapper {\n width: 100%;\n}\n.neeto-editor-image-editor .neeto-editor-image-editor__footer {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 0.5rem;\n}\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;\n}\n.ProseMirror {\n overflow-y: auto;\n height: 100%;\n white-space: break-spaces;\n}\n.ProseMirror::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.ProseMirror::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.ProseMirror::-webkit-scrollbar-track {\n background: "transparent";\n}\n.ProseMirror:focus {\n outline: none;\n}',{}),oe.prototype={constructor:oe,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return-1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new oe(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new oe(n)},addToStart:function(e,t){return new oe([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new oe(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new oe(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=oe.from(e)).size?new oe(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=oe.from(e)).size?new oe(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=oe.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},oe.from=function(e){if(e instanceof oe)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new oe(t)};class le{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(e,a)-a,t-a),o=!n):s.isLeaf?(r?i+="function"==typeof r?r(s):r:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new le(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new le(n,r)}cutByIndex(e,t){return e==t?le.empty:0==e&&t==this.content.length?this:new le(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new le(r,i)}addToStart(e){return new le([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new le(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return se(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return ae(this,e,t,n)}findIndex(e,t=-1){if(0==e)return ce(0,e);if(e==this.size)return ce(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?ce(n+1,i):ce(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return le.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new le(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return le.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new le(t||e,n)}static from(e){if(!e)return le.empty;if(e instanceof le)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new le([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}le.empty=new le([],0);const ue={index:0,offset:0};function ce(e,t){return ue.index=e,ue.offset=t,ue}function de(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!de(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!de(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class pe{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&de(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return pe.none;if(e instanceof pe)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}pe.none=[];class he extends Error{}class fe{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=ge(this.content,e+this.openStart,t);return n&&new fe(n,this.openStart,this.openEnd)}removeBetween(e,t){return new fe(me(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return fe.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new fe(le.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new fe(e,n,r)}}function me(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(me(o.content,t-i-1,n-i-1)))}function ge(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=ge(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function ye(e,t,n){if(n.openStart>e.depth)throw new he("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new he("Inconsistent open depths");return be(e,t,n,0)}function be(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=be(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(le.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return De(o,ke(e,i,s,t,r))}{let r=e.parent,i=r.content;return De(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return De(o,Ee(e,t,r))}function ve(e,t){if(!t.type.compatibleContent(e.type))throw new he("Cannot join "+t.type.name+" onto "+e.type.name)}function we(e,t,n){let r=e.node(n);return ve(r,t.node(n)),r}function xe(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Me(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(xe(e.nodeAfter,r),o++));for(let e=o;e<s;e++)xe(i.child(e),r);t&&t.depth==n&&t.textOffset&&xe(t.nodeBefore,r)}function De(e,t){if(!e.type.validContent(t))throw new he("Invalid content for node "+e.type.name);return e.copy(t)}function ke(e,t,n,r,i){let o=e.depth>i&&we(e,t,i+1),s=r.depth>i&&we(n,r,i+1),a=[];return Me(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(ve(o,s),xe(De(o,ke(e,t,n,r,i+1)),a)):(o&&xe(De(o,Ee(e,t,i+1)),a),Me(t,n,i,a),s&&xe(De(s,Ee(n,r,i+1)),a)),Me(r,null,i,a),new le(a)}function Ee(e,t,n){let r=[];if(Me(null,e,n,r),e.depth>n){xe(De(we(e,t,n+1),Ee(e,t,n+1)),r)}return Me(t,null,n,r),new le(r)}fe.empty=new fe(le.empty,0,0);class Ce{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return pe.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ae(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s)break;if(t=t.child(e),t.isText)break;i=s-1,r+=o+1}return new Ce(t,n,i)}static resolveCached(e,t){for(let n=0;n<Te.length;n++){let r=Te[n];if(r.pos==t&&r.doc==e)return r}let n=Te[Oe]=Ce.resolve(e,t);return Oe=(Oe+1)%Se,n}}let Te=[],Oe=0,Se=12;class Ae{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Ne=Object.create(null);class _e{constructor(e,t,n,r=pe.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||le.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&de(this.attrs,t||e.defaultAttrs||Ne)&&pe.sameSet(this.marks,n||pe.none)}copy(e=null){return e==this.content?this:new _e(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new _e(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return fe.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.node(o).content.cut(r.pos-s,i.pos-s);return new fe(a,r.depth-o,i.depth-o)}replace(e,t,n){return ye(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Ce.resolveCached(this,e)}resolveNoCache(e){return Ce.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ie(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=le.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let e=pe.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!pe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=le.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}_e.prototype.text=void 0;class je extends _e{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ie(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new je(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new je(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ie(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Le{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new ze(e,t);if(null==n.next)return Le.empty;let r=Pe(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n($e(e,0));function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);$e(e,n).forEach((e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new Le(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(He);o.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return o}}(function(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach((e=>e.to=t))}function o(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(o(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),i(o(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return i(o(e.expr,t),s),i(o(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(o(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();i(o(e.expr,s),t),s=t}if(-1==e.max)i(o(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),i(o(e.expr,s),t),s=t}return[r(s)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=o(e.exprs[r],t);if(r==e.exprs.length-1)return s;i(s,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return le.from(s.map((e=>e.createAndFill())));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r})).join("\n")}}Le.empty=new Le(!0);class ze{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Pe(e){let t=[];do{t.push(Fe(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Fe(e){let t=[];do{t.push(Re(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Re(e){let t=function(e){if(e.eat("(")){let t=Pe(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&i.push(r)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(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("{"))break;t=Ue(e,t)}return t}function Be(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Ue(e,t){let n=Be(e),r=n;return e.eat(",")&&(r="}"!=e.next?Be(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function He(e,t){return t-e}function $e(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(He)}function Ve(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function We(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function qe(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Qe(e[n]);return t}class Ye{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=qe(n.attrs),this.defaultAttrs=Ve(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Le.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:We(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new _e(this,this.computeAttrs(e),le.from(t),pe.setFrom(n))}createChecked(e=null,t,n){if(t=le.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new _e(this,this.computeAttrs(e),t,pe.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=le.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(le.empty,!0);return i?new _e(this,e,t.append(i),pe.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:pe.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new Ye(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class Qe{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Ke{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=qe(r.attrs),this.excluded=null;let i=Ve(this.attrs);this.instance=i?new pe(this,i):null}create(e=null){return!e&&this.instance?this.instance:new pe(this,We(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new Ke(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class Ge{constructor(e){this.cached=Object.create(null),this.spec={nodes:oe.from(e.nodes),marks:oe.from(e.marks||{}),topNode:e.topNode},this.nodes=Ye.compile(this.spec.nodes,this),this.marks=Ke.compile(this.spec.marks,this);let t=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let n=this.nodes[e],r=n.spec.content||"",i=n.spec.marks;n.contentMatch=t[r]||(t[r]=Le.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==i?null:i?Je(this,i.split(" ")):""!=i&&n.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Je(this,n.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(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof Ye))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new je(n,n.defaultAttrs,e,pe.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return _e.fromJSON(this,e)}markFromJSON(e){return pe.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Je(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Xe{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new at(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new at(this,t,!0);return n.addAll(e,t.from,t.to),fe.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(lt(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ut(e)),e.mark=t}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ut(e)),e.node=t}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Xe(e,Xe.schemaRules(e)))}}const Ze={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},et={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},tt={ol:!0,ul:!0},nt=1,rt=2,it=4;function ot(e,t,n){return null!=t?(t?nt:0)|("full"===t?rt:0):e&&"pre"==e.whitespace?nt|rt:n&~it}class st{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=pe.none,this.stashMarks=[],this.match=o||(s&it?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(le.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&nt)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=le.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(le.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):ct(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ze.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class at{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,o=ot(null,t.preserveWhitespace,0)|(n?it:0);r=i?new st(i.type,i.attrs,pe.none,pe.none,!0,t.topMatch||i.type.contentMatch,o):new st(n?null:e.schema.topNodeType,null,pe.none,pe.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style"),n=t?this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(let e=0;e<n.length;e++)this.addPendingMark(n[e]);if(this.addElement(e),null!=n)for(let e=0;e<n.length;e++)this.removePendingMark(n[e],r)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(n.options&rt||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&nt)t=n.options&rt?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();tt.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&tt.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:et.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let t,n=this.top,o=this.needsBlock;if(Ze.hasOwnProperty(r))t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=o}else this.addElementByRule(e,i,!1===i.consuming?n:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=pe.none;e:for(let n=0;n<e.length;n+=2)for(let r;;){let i=this.parser.matchStyle(e[n],e[n+1],this,r);if(!i)continue e;if(i.ignore)return null;if(t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;r=i}return t}addElementByRule(e,t,n){let r,i,o;if(t.node)i=this.parser.schema.nodes[t.node],i.isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace);else{o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o)}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let e=0;e<t.length;e++)this.enterInner(t[e],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let o=ot(e,r,i.options);i.options&it&&0==i.content.length&&(o|=it),this.nodes.push(new st(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));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(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)){t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function lt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ut(e){let t={};for(let n in e)t[n]=e[n];return t}function ct(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(o.indexOf(i)<0&&s(i))return!0}};if(s(i.contentMatch))return!0}}class dt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=ht(t).createDocumentFragment());let r=n,i=[];return e.forEach((e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=dt.renderSpec(ht(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&dt.renderSpec(ht(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let i=l;i<t.length;i++){let o=t[i];if(0===o){if(i<t.length-1||i>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:i}=dt.renderSpec(e,o,n);if(s.appendChild(t),i){if(r)throw new RangeError("Multiple content holes");r=i}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new dt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=pt(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return pt(e.marks)}}function pt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ht(e){return e.document||window.document}const ft=65535,mt=Math.pow(2,16);function gt(e,t){return e+t*mt}function yt(e){return e&ft}const bt=1,vt=2,wt=4,xt=8;class Mt{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&xt)>0}get deletedBefore(){return(this.delInfo&(bt|wt))>0}get deletedAfter(){return(this.delInfo&(vt|wt))>0}get deletedAcross(){return(this.delInfo&wt)>0}}class Dt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Dt.empty)return Dt.empty}recover(e){let t=0,n=yt(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(e&ft))/mt}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+i],u=this.ranges[s+o],c=a+l;if(e<=c){let i=a+r+((l?e==a?-1:e==c?1:t:t)<0?0:u);if(n)return i;let o=e==(t<0?a:c)?null:gt(s/3,e-a),d=e==a?vt:e==c?bt:wt;return(t<0?e!=a:e!=c)&&(d|=xt),new Mt(i,d,o)}r+=u-l}return n?e+r:new Mt(e+r,0,null)}touches(e,t){let n=0,r=yt(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+i];if(e<=s+a&&t==3*r)return!0;n+=this.ranges[t+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+t],u=this.ranges[r+n];e(s,s+l,a,a+u),i+=u-l}}invert(){return new Dt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Dt.empty:new Dt(e<0?[0,-e,0]:[0,0,e])}}Dt.empty=new Dt([]);class kt{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new kt(this.maps,this.mirror,e,t)}copy(){return new kt(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new kt;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this.maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Mt(e,r,null)}}const Et=Object.create(null);class Ct{getMap(){return Dt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Et[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Et)throw new RangeError("Duplicate use of step JSON ID "+e);return Et[e]=t,t.prototype.jsonID=e,t}}class Tt{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Tt(e,null)}static fail(e){return new Tt(null,e)}static fromReplace(e,t,n,r){try{return Tt.ok(e.replace(t,n,r))}catch(e){if(e instanceof he)return Tt.fail(e.message);throw e}}}function Ot(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(Ot(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return le.fromArray(r)}class St extends Ct{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new fe(Ot(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Tt.fromReplace(e,this.from,this.to,i)}invert(){return new At(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new St(t.pos,n.pos,this.mark)}merge(e){return e instanceof St&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new St(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new St(t.from,t.to,e.markFromJSON(t.mark))}}Ct.jsonID("addMark",St);class At extends Ct{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new fe(Ot(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Tt.fromReplace(e,this.from,this.to,n)}invert(){return new St(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new At(t.pos,n.pos,this.mark)}merge(e){return e instanceof At&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new At(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new At(t.from,t.to,e.markFromJSON(t.mark))}}Ct.jsonID("removeMark",At);class Nt extends Ct{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&jt(e,this.from,this.to)?Tt.fail("Structure replace would overwrite content"):Tt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Dt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Nt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Nt(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof Nt)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?fe.empty:new fe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Nt(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?fe.empty:new fe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Nt(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Nt(t.from,t.to,fe.fromJSON(e,t.slice),!!t.structure)}}Ct.jsonID("replace",Nt);class _t extends Ct{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(jt(e,this.from,this.gapFrom)||jt(e,this.gapTo,this.to)))return Tt.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Tt.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Tt.fromReplace(e,this.from,this.to,n):Tt.fail("Content does not fit in gap")}getMap(){return new Dt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new _t(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new _t(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new _t(t.from,t.to,t.gapFrom,t.gapTo,fe.fromJSON(e,t.slice),t.insert,!!t.structure)}}function jt(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function It(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Lt(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!It(r,i,o))break}return null}function zt(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<i;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return o?i.map(Pt).concat({type:t,attrs:n}).concat(o.map(Pt)):null}function Pt(e){return{type:e,attrs:null}}function Ft(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=r&&r[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function Rt(e,t){let n=e.resolve(t),r=n.index();return function(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Bt(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(o,o,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Ut(e,t,n=t,r=fe.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return Ht(i,o,r)?new Nt(t,n,r):new $t(i,o,r).fit()}function Ht(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Ct.jsonID("replaceAround",_t);class $t{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=le.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=le.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new fe(i,o,s);return e>-1?new _t(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Nt(n.pos,r.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,r=null;t?(r=qt(this.unplaced.content,t-1).firstChild,n=r.content):n=this.unplaced.content;let i=n.firstChild;for(let n=this.depth;n>=0;n--){let o,{type:s,match:a}=this.frontier[n],l=null;if(1==e&&(i?a.matchType(i.type)||(l=a.fillBefore(le.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:t,frontierDepth:n,parent:r,inject:l};if(2==e&&i&&(o=a.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:n,parent:r,wrap:o};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=qt(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new fe(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=qt(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new fe(Vt(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new fe(Vt(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,l=0,u=[],{match:c,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)u.push(r.child(e));c=c.matchFragment(r)}let p=s.size+e-(o.content.size-o.openEnd);for(;l<s.childCount;){let e=s.child(l),t=c.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(c=t,u.push(Yt(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?p:-1)))}let h=l==s.childCount;h||(p=-1),this.placed=Wt(this.placed,t,le.from(u)),this.frontier[t].match=c,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<p;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=h?0==e?fe.empty:new fe(Vt(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new fe(Vt(o.content,e,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Qt(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=Qt(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Qt(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Wt(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Wt(this.placed,this.depth,le.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(le.empty,!0);e.childCount&&(this.placed=Wt(this.placed,this.frontier.length,e))}}function Vt(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Vt(e.firstChild.content,t-1,n)))}function Wt(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Wt(e.lastChild.content,t-1,n)))}function qt(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Yt(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Yt(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(le.empty,!0)))),e.copy(r)}function Qt(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function Kt(e){return e.spec.defining||e.spec.definingForContent}function Gt(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Gt(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(le.empty,!0))}return e}function Jt(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}let Xt=class extends Error{};Xt=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Xt.prototype=Object.create(Error.prototype)).constructor=Xt,Xt.prototype.name="TransformError";class Zt{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new kt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Xt(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=fe.empty){let r=Ut(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new fe(le.from(n),0,0))}delete(e,t){return this.replace(e,t,fe.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(Ht(i,o,r))return e.step(new Nt(t,n,r));let s=Jt(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:i.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),u=[],c=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(u.push(n),t==r.openStart)break;e=n.content}for(let e=c-1;e>=0;e--){let t=u[e].type,n=Kt(t);if(n&&i.node(l).type!=t)c=e;else if(n||!t.isTextblock)break}for(let t=r.openStart;t>=0;t--){let a=(t+c+1)%(r.openStart+1),d=u[a];if(d)for(let t=0;t<s.length;t++){let u=s[(t+l)%s.length],c=!0;u<0&&(c=!1,u=-u);let p=i.node(u-1),h=i.index(u-1);if(p.canReplaceWith(h,h,d.type,d.marks))return e.replace(i.before(u),c?o.after(u):n,new fe(Gt(r.content,0,r.openStart,a),a,r.openEnd))}}let d=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,r),!(e.steps.length>d));a--){let e=s[a];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}(e.doc,t,r.type);null!=i&&(t=n=i)}e.replaceRange(t,n,new fe(le.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=Jt(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o)return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,u=a,c=le.empty,d=0;for(let e=o,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,c=le.from(r.node(e).copy(c)),d++):l--;let p=le.empty,h=0;for(let e=o,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,p=le.from(i.node(e).copy(p)),h++):u++;e.step(new _t(l,u,s,a,new fe(c.append(p),d,h),c.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=new Nt(t-n,t+n,fe.empty,!0);e.step(r)}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=le.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=le.from(n[e].type.create(n[e].attrs,r))}let i=t.start,o=t.end;e.step(new _t(i,o,i,o,new fe(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),r)){e.clearIncompatible(e.mapping.slice(o).map(n,1),r);let s=e.mapping.slice(o),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new _t(a,l,a+1,l-1,new fe(le.from(r.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r=[]){return function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new _t(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new fe(le.from(s),0,0),1,!0))}(this,e,t,n,r),this}split(e,t=1,n){return function(e,t,n=1,r){let i=e.doc.resolve(t),o=le.empty,s=le.empty;for(let e=i.depth,t=i.depth-n,a=n-1;e>t;e--,a--){o=le.from(i.node(e).copy(o));let t=r&&r[a];s=le.from(t?t.type.create(t.attrs,s):i.node(e).copy(s))}e.step(new Nt(t,t,new fe(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,u)=>{if(!e.isInline)return;let c=e.marks;if(!r.isInSet(c)&&u.type.allowsMarkType(r.type)){let u=Math.max(l,t),d=Math.min(l+e.nodeSize,n),p=r.addToSet(c);for(let e=0;e<c.length;e++)c[e].isInSet(p)||(i&&i.to==u&&i.mark.eq(c[e])?i.to=d:s.push(i=new At(u,d,c[e])));o&&o.to==u?o.to=d:a.push(o=new St(u,d,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;o++;let a=null;if(r instanceof Ke){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&l.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=o):i.push({style:l,from:Math.max(s,t),to:r,step:o})}}})),i.forEach((t=>e.step(new At(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<i.childCount;t++){let a=i.child(t),l=s+a.nodeSize,u=r.matchType(a.type);if(u){r=u;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new At(s,l,a.marks[t]))}else o.push(new Nt(s,l,fe.empty));s=l}if(!r.validEnd){let t=r.fillBefore(le.empty,!0);e.replace(s,s,new fe(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}(this,e,t,n),this}}const en=Object.create(null);class tn{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new nn(e.min(t),e.max(t))]}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 e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=fe.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],u=e.mapping.slice(i);e.replaceRange(u.map(a.pos),u.map(l.pos),s?fe.empty:t),0==s&&hn(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=e.mapping.slice(n),l=a.map(o.pos),u=a.map(s.pos);i?e.deleteRange(l,u):(e.replaceRangeWith(l,u,t),hn(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new sn(e):pn(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?pn(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):pn(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new cn(e.node(0))}static atStart(e){return pn(e,e,0,0,1)||new cn(e)}static atEnd(e){return pn(e,e,e.content.size,e.childCount,-1)||new cn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=en[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in en)throw new RangeError("Duplicate use of selection JSON ID "+e);return en[e]=t,t.prototype.jsonID=e,t}getBookmark(){return sn.between(this.$anchor,this.$head).getBookmark()}}tn.prototype.visible=!0;class nn{constructor(e,t){this.$from=e,this.$to=t}}let rn=!1;function on(e){rn||e.parent.inlineContent||(rn=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class sn extends tn{constructor(e,t=e){on(e),on(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return tn.near(n);let r=e.resolve(t.map(this.anchor));return new sn(r.parent.inlineContent?r:n,n)}replace(e,t=fe.empty){if(super.replace(e,t),t==fe.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof sn&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new an(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new sn(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=tn.findFrom(t,n,!0)||tn.findFrom(t,-n,!0);if(!e)return tn.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(tn.findFrom(e,-n,!0)||tn.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new sn(e,t)}}tn.jsonID("text",sn);class an{constructor(e,t){this.anchor=e,this.head=t}map(e){return new an(e.map(this.anchor),e.map(this.head))}resolve(e){return sn.between(e.resolve(this.anchor),e.resolve(this.head))}}class ln extends tn{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?tn.near(i):new ln(i)}content(){return new fe(le.from(this.node),0,0)}eq(e){return e instanceof ln&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new un(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ln(e.resolve(t.anchor))}static create(e,t){return new ln(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}ln.prototype.visible=!1,tn.jsonID("node",ln);class un{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new an(n,n):new un(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&ln.isSelectable(n)?new ln(t):tn.near(t)}}class cn extends tn{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=fe.empty){if(t==fe.empty){e.delete(0,e.doc.content.size);let t=tn.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new cn(e)}map(e){return new cn(e)}eq(e){return e instanceof cn}getBookmark(){return dn}}tn.jsonID("all",cn);const dn={map(){return this},resolve:e=>new cn(e)};function pn(e,t,n,r,i,o=!1){if(t.inlineContent)return sn.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&ln.isSelectable(r))return ln.create(e,n-(i<0?r.nodeSize:0))}else{let t=pn(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function hn(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,o=e.steps[r];(o instanceof Nt||o instanceof _t)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(tn.near(e.doc.resolve(i),n)))}const fn=1,mn=2,gn=4;class yn extends Zt{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|fn)&~mn,this.storedMarks=null,this}get selectionSet(){return(this.updated&fn)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=mn,this}ensureMarks(e){return pe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&mn)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~mn,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||pe.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(tn.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=gn,this}get scrolledIntoView(){return(this.updated&gn)>0}}function bn(e,t){return t&&e?e.bind(t):e}class vn{constructor(e,t,n){this.name=e,this.init=bn(t.init,n),this.apply=bn(t.apply,n)}}const wn=[new vn("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new vn("selection",{init:(e,t)=>e.selection||tn.atStart(t.doc),apply:e=>e.selection}),new vn("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new vn("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class xn{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=wn.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new vn(e.key,e.spec.state,e))}))}}class Mn{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,u=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(u&&n.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(u),n=n.applyInner(u),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Mn(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new yn(this)}static create(e){let t=new xn(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Mn(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new xn(this.schema,e.plugins),n=t.fields,r=new Mn(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new xn(e.schema,e.plugins),i=new Mn(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=_e.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=tn.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=a.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function Dn(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=Dn(i,t,{})),n[r]=i}return n}class kn{constructor(e){this.spec=e,this.props={},e.props&&Dn(e.props,this,this.props),this.key=e.key?e.key.key:Cn("plugin")}getState(e){return e[this.key]}}const En=Object.create(null);function Cn(e){return e in En?e+"$"+ ++En[e]:(En[e]=0,e+"$")}class Tn{constructor(e="key"){this.key=Cn(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const On="undefined"!=typeof navigator?navigator:null,Sn="undefined"!=typeof document?document:null,An=On&&On.userAgent||"",Nn=/Edge\/(\d+)/.exec(An),_n=/MSIE \d/.exec(An),jn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(An),In=!!(_n||jn||Nn),Ln=_n?document.documentMode:jn?+jn[1]:Nn?+Nn[1]:0,zn=!In&&/gecko\/(\d+)/i.test(An);zn&&(/Firefox\/(\d+)/.exec(An)||[0,0])[1];const Pn=!In&&/Chrome\/(\d+)/.exec(An),Fn=!!Pn,Rn=Pn?+Pn[1]:0,Bn=!In&&!!On&&/Apple Computer/.test(On.vendor),Un=Bn&&(/Mobile\/\w+/.test(An)||!!On&&On.maxTouchPoints>2),Hn=Un||!!On&&/Mac/.test(On.platform),$n=/Android \d/.test(An),Vn=!!Sn&&"webkitFontSmoothing"in Sn.documentElement.style,Wn=Vn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,qn=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Yn=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let Qn=null;const Kn=function(e,t,n){let r=Qn||(Qn=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Gn=function(e,t,n,r){return n&&(Xn(e,t,n,r,-1)||Xn(e,t,n,r,1))},Jn=/^(img|br|input|textarea|hr)$/i;function Xn(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Zn(e))){let n=e.parentNode;if(!n||1!=n.nodeType||er(e)||Jn.test(e.nodeName)||"false"==e.contentEditable)return!1;t=qn(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?Zn(e):0}}}function Zn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function er(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const tr=function(e){let t=e.isCollapsed;return t&&Fn&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function nr(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function rr(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function ir(e,t){return"number"==typeof e?e:e[t]}function or(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function sr(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Yn(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?rr(o):or(e),l=0,u=0;if(t.top<a.top+ir(r,"top")?u=-(a.top-t.top+ir(i,"top")):t.bottom>a.bottom-ir(r,"bottom")&&(u=t.bottom-a.bottom+ir(i,"bottom")),t.left<a.left+ir(r,"left")?l=-(a.left-t.left+ir(i,"left")):t.right>a.right-ir(r,"right")&&(l=t.right-a.right+ir(i,"right")),l||u)if(n)o.defaultView.scrollBy(l,u);else{let n=e.scrollLeft,r=e.scrollTop;u&&(e.scrollTop+=u),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n)break}}function ar(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Yn(r));return t}function lr(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let ur=null;function cr(e,t){let n,r,i=2e8,o=0,s=t.top,a=t.top;for(let l=e.firstChild,u=0;l;l=l.nextSibling,u++){let e;if(1==l.nodeType)e=l.getClientRects();else{if(3!=l.nodeType)continue;e=Kn(l).getClientRects()}for(let c=0;c<e.length;c++){let d=e[c];if(d.top<=s&&d.bottom>=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let e=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(e<i){n=l,i=e,r=e&&3==n.nodeType?{left:d.right<t.left?d.right:d.left,top:t.top}:t,1==l.nodeType&&e&&(o=u+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=u+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=fr(r,1);if(n.top!=n.bottom&&dr(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:o}:cr(n,r)}function dr(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function pr(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(dr(t,i))return pr(n,t,i)}}if((o=(o+1)%r)==i)break}return e}function hr(e,t){let n,r=e.dom.ownerDocument,i=0;if(r.caretPositionFromPoint)try{let e=r.caretPositionFromPoint(t.left,t.top);e&&({offsetNode:n,offset:i}=e)}catch(e){}if(!n&&r.caretRangeFromPoint){let e=r.caretRangeFromPoint(t.left,t.top);e&&({startContainer:n,startOffset:i}=e)}let o,s=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top+1);if(!s||!e.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=e.dom.getBoundingClientRect();if(!dr(t,n))return null;if(s=pr(e.dom,t,n),!s)return null}if(Bn)for(let e=s;n&&e;e=Yn(e))e.draggable&&(n=void 0);if(s=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(s,t),n){if(zn&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(o=function(e,t,n,r){let i=-1;for(let n=t;n!=e.dom;){let t=e.docView.nearestDesc(n,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>r.left||e.top>r.top)i=t.posBefore;else{if(!(e.right<r.left||e.bottom<r.top))break;i=t.posAfter}}n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,1)}(e,n,i,t))}null==o&&(o=function(e,t,n){let{node:r,offset:i}=cr(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:o,inside:a?a.posAtStart-a.border:-1}}function fr(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const mr=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function gr(e,t,n){let{node:r,offset:i}=e.docView.domFromPos(t,n<0?-1:1),o=Vn||zn;if(3==r.nodeType){if(!o||!mr.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,yr(fr(Kn(r,e,t),o),o<0)}{let e=fr(Kn(r,i,i),n);if(zn&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=fr(Kn(r,i-1,i-1),-1);if(t.top==e.top){let n=fr(Kn(r,i,i+1),-1);if(n.top!=e.top)return yr(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(n<0||i==Zn(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return br(e.getBoundingClientRect(),!1)}if(i<Zn(r)){let e=r.childNodes[i];if(1==e.nodeType)return br(e.getBoundingClientRect(),!0)}return br(r.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==Zn(r))){let e=r.childNodes[i-1],t=3==e.nodeType?Kn(e,Zn(e)-(o?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return yr(fr(t,1),!1)}if(i<Zn(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Kn(e,0,o?0:1):1==e.nodeType?e:null:null;if(t)return yr(fr(t,-1),!0)}return yr(fr(3==r.nodeType?Kn(r):r,-n),n>=0)}function yr(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function br(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function vr(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const wr=/[\u0590-\u08ac]/;let xr=null,Mr=null,Dr=!1;function kr(e,t,n){return xr==t&&Mr==n?Dr:(xr=t,Mr=n,Dr="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return vr(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let r=gr(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=Kn(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return wr.test(r.parent.textContent)&&a.modify?vr(e,t,(()=>{let t=a.getRangeAt(0),i=a.focusNode,o=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||i==a.focusNode&&o==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?o:s}(e,t,n))}const Er=0,Cr=1,Tr=2,Or=3;class Sr{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Er,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>qn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0};let n,r=0,i=0;for(let t=0;r<this.children.length;r++){let n=this.children[r],o=t+n.size;if(o>e||n instanceof zr){i=e-t;break}t=o}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Ar&&n.side>=0;r--);if(t<=0){let e,n=!0;for(;e=r?this.children[r-1]:null,e&&e.dom.parentNode!=this.contentDOM;r--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?qn(e.dom)+1:0}}{let e,n=!0;for(;e=r<this.children.length?this.children[r]:null,e&&e.dom.parentNode!=this.contentDOM;r++,n=!1);return e&&n&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?qn(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==r&&e<=a){let i=o+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=qn(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=qn(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],u=a+l.size;if(i>a&&o<u)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=u}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),u=!1;if((zn||Bn)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(u=!(!t||"\n"!=e.nodeValue[t-1]),u&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(s=a={node:t.parentNode,offset:qn(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(zn&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let e=l.focusNode.childNodes[l.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||u&&Bn)&&Gn(s.node,s.offset,l.anchorNode,l.anchorOffset)&&Gn(a.node,a.offset,l.focusNode,l.focusOffset))return;let c=!1;if((l.extend||e==t)&&!u){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),c=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!c){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?Tr:Cr,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=Or);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?Or:Tr}n=o}this.dirty=Tr}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?Tr:Cr;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Ar extends Sr{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,(()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Er&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||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 Nr extends Sr{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class _r extends Sr{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=dt.renderSpec(document,t.type.spec.toDOM(t,n))),new _r(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return this.dirty&Or||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=Or&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Er){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=Er}}slice(e,t,n){let r=_r.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=Kr(i,t,o,n)),e>0&&(i=Kr(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}}class jr extends Sr{constructor(e,t,n,r,i,o,s,a,l){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s,o&&this.updateChildren(a,l)}static create(e,t,n,r,i,o){let s,a=i.nodeViews[t.type.name],l=a&&a(t,i,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),u=l&&l.dom,c=l&&l.contentDOM;if(t.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(t.text);else u||({dom:u,contentDOM:c}=dt.renderSpec(document,t.type.spec.toDOM(t)));c||t.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let d=u;return u=Vr(u,n,t),l?s=new Pr(e,t,n,r,u,c||null,d,l,i,o+1):t.isText?new Lr(e,t,n,r,u,d,i):new jr(e,t,n,r,u,c||null,d,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>le.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return this.dirty==Er&&e.eq(this.node)&&Wr(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new Yr(this,o&&o.node);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],l=null;for(let u=0;;){if(s<i.length&&i[s].to==o){let e,t=i[s++];for(;s<i.length&&i[s].to==o;)(e||(e=[t])).push(i[s++]);if(e){e.sort(Qr);for(let t=0;t<e.length;t++)n(e[t],u,!!l)}else n(t,u,!!l)}let c,d;if(l)d=-1,c=l,l=null;else{if(!(u<e.childCount))break;d=u,c=e.child(u++)}for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let p=o+c.nodeSize;if(c.isText){let e=p;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<p&&(l=c.cut(e-o),c=c.cut(0,e-o),p=e,d=-1)}let h=c.isInline&&!c.isLeaf?a.filter((e=>!e.inline)):a.slice();r(c,h,t.forChild(o,c),d),o=p}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?pe.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,l,u)=>{let c;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,l,u)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(c=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,l,c,e)||a.updateNextNode(t,o,l,e,u)||a.addNode(t,o,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Tr)&&(o&&this.protectLocalComposition(e,o),Fr(this.contentDOM,this.children,e),Un&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof sn)||n<t||r>t+this.node.content.size)return null;let i=e.domSelection(),o=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=Zn(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(i.focusNode,i.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;l+=t.text}if(o>=n){let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;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 o=new Nr(this,i,t,r);e.input.compositionNodes.push(o),this.children=Kr(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(this.dirty==Or||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Er}updateOuterDeco(e){if(Wr(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Hr(this.dom,this.nodeDOM,Ur(this.outerDeco,this.node,t),Ur(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Ir(e,t,n,r,i){return Vr(r,t,e),new jr(void 0,e,t,n,r,r,r,i,0)}class Lr extends jr{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(this.dirty==Or||this.dirty!=Er&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==Er&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Er,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new Lr(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=Or)}get domAtom(){return!1}}class zr extends Sr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Er&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Pr extends jr{constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r,i,o,s,l,u),this.spec=a}update(e,t,n,r){if(this.dirty==Or)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Fr(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=qr(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof _r){let t=r?r.previousSibling:e.lastChild;Fr(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=qr(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Rr=function(e){e&&(this.nodeName=e)};Rr.prototype=Object.create(null);const Br=[new Rr];function Ur(e,t,n){if(0==e.length)return Br;let r=n?Br[0]:new Rr,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Rr(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new Rr(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}}return i}function Hr(e,t,n,r){if(n==Br&&r==Br)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||(t=document.createElement(o.nodeName),t.pmIsDeco=!0,t.appendChild(i),s=Br[0]),i=t}$r(i,s||Br[0],o)}return i}function $r(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function Vr(e,t,n){return Hr(e,e,Br,Ur(t,n,1!=e.nodeType))}function Wr(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function qr(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Yr{constructor(e,t){this.lock=t,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof _r)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,i=this.stack.length>>1,o=Math.min(i,e.length);for(;r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=Er,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++)if(this.top.children[t].matchesMark(e[i])){r=t;break}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=_r.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let r=this.index,i=Math.min(this.top.children.length,r+5);r<i;r++){let i=this.top.children[r];if(i.matchesNode(e,t,n)&&!this.preMatch.matched.has(i)){o=r;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return o.dirty==Or&&o.dom==o.contentDOM&&(o.dirty=Tr),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index=r+1,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,i){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof jr){let a=this.preMatch.matched.get(s);if(null!=a&&a!=i)return!1;let l=s.dom;if(!(this.lock&&(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Or&&Wr(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(e,t,n,r,i){this.top.children.splice(this.index++,0,jr.create(this.top,e,t,n,r,i)),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new Ar(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof _r;)t=e,e=t.children[t.children.length-1];e&&e instanceof Lr&&!/\n$/.test(e.node.text)||((Bn||Fn)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new zr(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}function Qr(e,t){return e.type.side-t.type.side}function Kr(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],u=a,c=a+=l.size;u>=n||c<=t?o.push(l):(u<t&&o.push(l.slice(0,t-u,r)),i&&(o.push(i),i=void 0),c>n&&o.push(l.slice(n-u,l.size,r)))}return o}function Gr(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,u=r.resolve(s);if(tr(n)){for(a=u;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&ln.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==Zn(e);r||i;){if(e==n)return!0;let t=qn(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==Zn(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new ln(s==e?u:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=oi(e,a,u,"pointer"==t||e.state.selection.head<u.pos&&!o?1:-1)}return l}function Jr(e){return e.editable?e.hasFocus():ai(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Xr(e,t=!1){let n=e.state.selection;if(ri(e,n),Jr(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Fn){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Gn(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,qn(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&In&&Ln<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,i,{anchor:o,head:s}=n;!Zr||n instanceof sn||(n.$from.parent.inlineContent||(r=ei(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=ei(e,n.to))),e.docView.setSelection(o,s,e.root,t),Zr&&(r&&ni(r),i&&ni(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Jr(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Zr=Bn||Fn&&Rn<63;function ei(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Bn&&i&&"false"==i.contentEditable)return ti(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return ti(i);if(o)return ti(o)}}function ti(e){return e.contentEditable="true",Bn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function ni(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function ri(e,t){if(t instanceof ln){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(ii(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else ii(e)}function ii(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function oi(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||sn.between(t,n,r)}function si(e){return(!e.editable||e.root.activeElement==e.dom)&&ai(e)}function ai(e){let t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function li(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&tn.findFrom(o,t)}function ui(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function ci(e,t,n){let r=e.state.selection;if(!(r instanceof sn)){if(r instanceof ln&&r.node.isInline)return ui(e,new sn(t>0?r.$to:r.$from));{let n=li(e.state,t);return!!n&&ui(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=li(e.state,t);return!!(n&&n instanceof ln)&&ui(e,n)}if(!(Hn&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(ln.isSelectable(o)?ui(e,new ln(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!Vn&&ui(e,new sn(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function di(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function pi(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function hi(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(zn&&1==n.nodeType&&r<di(n)&&pi(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(pi(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(mi(n))break;{let t=n.previousSibling;for(;t&&pi(t);)i=n.parentNode,o=qn(t),t=t.previousSibling;if(t)n=t,r=di(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?gi(e,t,n,r):i&&gi(e,t,i,o)}function fi(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=di(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!pi(n.childNodes[r]))break;i=n,o=++r}else{if(mi(n))break;{let t=n.nextSibling;for(;t&&pi(t);)i=t.parentNode,o=qn(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=di(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&gi(e,t,i,o)}function mi(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function gi(e,t,n,r){if(tr(t)){let e=document.createRange();e.setEnd(n,r),e.setStart(n,r),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&Xr(e)}),50)}function yi(e,t,n){let r=e.state.selection;if(r instanceof sn&&!r.empty||n.indexOf("s")>-1)return!1;if(Hn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=li(e.state,t);if(n&&n instanceof ln)return ui(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof cn?tn.near(n,t):tn.findFrom(n,t);return!!s&&ui(e,s)}return!1}function bi(e,t){if(!(e.state.selection instanceof sn))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function vi(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function wi(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||Hn&&72==n&&"c"==r?bi(e,-1)||hi(e):46==n||Hn&&68==n&&"c"==r?bi(e,1)||fi(e):13==n||27==n||(37==n||Hn&&66==n&&"c"==r?ci(e,-1,r)||hi(e):39==n||Hn&&70==n&&"c"==r?ci(e,1,r)||fi(e):38==n||Hn&&80==n&&"c"==r?yi(e,-1,r)||hi(e):40==n||Hn&&78==n&&"c"==r?function(e){if(!Bn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;vi(e,n,"true"),setTimeout((()=>vi(e,n,"false")),20)}return!1}(e)||yi(e,1,r)||fi(e):r==(Hn?"m":"c")&&(66==n||73==n||89==n||90==n))}function xi(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||dt.fromSchema(e.state.schema),a=Ni(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&1==c.nodeType&&(u=Si[c.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=a.createElement(u[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}c=l.firstChild}c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n");return{dom:l,text:p}}function Mi(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new fe(le.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):fe.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=dt.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Ni().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&Si[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=e,n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),Vn&&function(e){let t=e.querySelectorAll(Fn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let e=+c[3];e>0&&o.firstChild;e--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Xe.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!c),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Di.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(c)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=le.from(t.create(n[e+1],i)),o++,s++}return new fe(i,o,s)}(Oi(s,+c[1],+c[2]),c[4]);else if(s=fe.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&Ei(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Ci(o[o.length-1],r.length));let t=ki(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return le.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Oi(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const Di=/^(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 ki(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,le.from(e));return e}function Ei(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=Ei(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(le.from(ki(n,e,i+1))))}}function Ci(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Ci(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(le.empty,!0);return e.copy(n.append(r))}function Ti(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return i<r-1&&(a=Ti(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(le.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Oi(e,t,n){return t<e.openStart&&(e=new fe(Ti(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new fe(Ti(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Si={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Ai=null;function Ni(){return Ai||(Ai=document.implementation.createHTMLDocument("title"))}const _i={};let ji={};class Ii{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.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Li(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function zi(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Pi(e,t))}))}function Pi(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Fi(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Ri(e){return{left:e.clientX,top:e.clientY}}function Bi(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,(t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1))))return!0;return!1}function Ui(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Hi(e,t,n,r,i){return Bi(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof ln&&(n=i.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(ln.isSelectable(t)){r=n&&i.$from.depth>0&&e>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(e);break}}return null!=r&&(Ui(e,ln.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&ln.isSelectable(r))&&(Ui(e,new ln(n),"pointer"),!0)}(e,n))}function $i(e,t,n,r){return Bi(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Vi(e,t,n,r){return Bi(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Ui(e,sn.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)Ui(e,sn.create(r,o+1,o+1+n.content.size),"pointer");else{if(!ln.isSelectable(n))continue;Ui(e,ln.create(r,o),"pointer")}return!0}}(e,n,r)}function Wi(e){return Xi(e)}ji.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Qi(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!$n||!Fn||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Un||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||wi(e,n)?n.preventDefault():Li(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,nr(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},ji.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},ji.keypress=(e,t)=>{let n=t;if(Qi(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Hn&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof sn&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const qi=Hn?"metaKey":"ctrlKey";_i.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Wi(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[qi]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(Ri(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Yi(e,s,n,!!r)):("doubleClick"==o?$i:Vi)(e,s.pos,s.inside,n)?n.preventDefault():Li(e,"pointer"))};class Yi{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[qi],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof ln&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!zn||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()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Li(e,"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((()=>Xr(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Ri(e))),this.allowDefault||!t?Li(this.view,"pointer"):Hi(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Bn&&this.mightDrag&&!this.mightDrag.node.isAtom||Fn&&!(this.view.state.selection instanceof sn)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ui(this.view,tn.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Li(this.view,"pointer")}move(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),Li(this.view,"pointer"),0==e.buttons&&this.done()}}function Qi(e,t){return!!e.composing||!!(Bn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}_i.touchdown=e=>{Wi(e),Li(e,"pointer")},_i.contextmenu=e=>Wi(e);const Ki=$n?5e3:-1;function Gi(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Xi(e)),t))}function Ji(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Xi(e,t=!1){if(!($n&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Ji(e),t||e.docView&&e.docView.dirty){let t=Gr(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}ji.compositionstart=ji.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),Xi(e,!0),e.markCursor=null;else if(Xi(e),zn&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}Gi(e,Ki)},ji.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Gi(e,20))};const Zi=In&&Ln<15||Un&&Wn<604;function eo(e,t,n,r){let i=Mi(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||fe.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}_i.copy=ji.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=Zi?null:n.clipboardData,s=r.content(),{dom:a,text:l}=xi(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},ji.paste=(e,t)=>{let n=t;if(e.composing&&!$n)return;let r=Zi?null:n.clipboardData;r&&eo(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?eo(e,r.value,null,t):eo(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class to{constructor(e,t){this.slice=e,this.move=t}}const no=Hn?"altKey":"ctrlKey";_i.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Ri(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof ln?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(ln.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(ln.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=xi(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Zi?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Zi||n.dataTransfer.setData("text/plain",l),e.dragging=new to(s,!n[no])},_i.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},ji.dragover=ji.dragenter=(e,t)=>t.preventDefault(),ji.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Ri(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Mi(e,n.dataTransfer.getData(Zi?"Text":"text/plain"),Zi?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[no]);if(e.someProp("handleDrop",(t=>t(e,n,s||fe.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?Bt(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let u=e.state.tr;a&&u.deleteSelection();let c=u.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(p))return;let h=u.doc.resolve(c);if(d&&ln.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new ln(h));else{let t=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),u.setSelection(oi(e,h,u.doc.resolve(t)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))},_i.focus=e=>{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.domSelection())&&Xr(e)}),20))},_i.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},_i.beforeinput=(e,t)=>{if(Fn&&$n&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,nr(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in ji)_i[e]=ji[e];function ro(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class io{constructor(e,t){this.toDOM=e,this.spec=t||uo,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new ao(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof io&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ro(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class oo{constructor(e,t){this.attrs=e,this.spec=t||uo}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new ao(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof oo&&ro(this.attrs,e.attrs)&&ro(this.spec,e.spec)}static is(e){return e.type instanceof oo}destroy(){}}class so{constructor(e,t){this.attrs=e,this.spec=t||uo}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new ao(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof so&&ro(this.attrs,e.attrs)&&ro(this.spec,e.spec)}destroy(){}}class ao{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new ao(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new ao(e,e,new io(t,n))}static inline(e,t,n,r){return new ao(e,t,new oo(n,r))}static node(e,t,n,r){return new ao(e,t,new so(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof oo}}const lo=[],uo={};class co{constructor(e,t){this.local=e.length?e:lo,this.children=t.length?t:lo}static create(e,t){return t.length?yo(t,e,0,uo):po}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==po||0==e.maps.length?this:this.mapInner(e,t,0,0,n||uo)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice(),l=(e,t,n,r)=>{for(let s=0;s<a.length;s+=3){let l,u=a[s+1];if(u<0||e>u+o)continue;let c=a[s]+o;t>=c?a[s+1]=e<=c?-2:-1:n>=i&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l)}};for(let e=0;e<n.maps.length;e++)n.maps[e].forEach(l);let u=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){u=!0,a[t+1]=-1;continue}let l=n.map(e[t]+o),c=l-i;if(c<0||c>=r.content.size){u=!0;continue}let d=n.map(e[t+1]+o,-1)-i,{index:p,offset:h}=r.content.findIndex(c),f=r.maybeChild(p);if(f&&h==c&&h+f.nodeSize==d){let r=a[t+2].mapInner(n,f,l+1,e[t]+o+1,s);r!=po?(a[t]=c,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,u=!0)}else u=!0}if(u){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(r,i,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+o+1);return n}(a,e,t,n,i,o,s),u=yo(l,r,0,s);t=u.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<u.children.length;e+=3){let n=u.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,u.children[e],u.children[e+1],u.children[e+2])}}return new co(t.sort(bo),a)}(this.children,o||[],e,t,n,r,i):o?new co(o.sort(bo),lo):po}add(e,t){return t.length?this==po?co.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,a=o+n;if(s=mo(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,a+1):r.splice(i,0,o,o+e.nodeSize,yo(s,e,a+1,uo)),i+=3}}));let o=fo(i?go(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new co(o.length?this.local.concat(o).sort(bo):this.local,r||this.children)}remove(e){return 0==e.length||this==po?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(i||(i=[])).push(t));if(!i)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(i,o+1);a!=po?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,i=0;i<e.length;i++)if(n=e[i])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new co(r,n):po}forChild(e,t){if(this==po)return this;if(t.isLeaf)return co.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof oo){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new co(r.sort(bo),lo);return n?new ho([e,n]):e}return n||po}eq(e){if(this==e)return!0;if(!(e instanceof co)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return vo(this.localsInner(e))}localsInner(e){if(this==po)return lo;if(e.inlineContent||!this.local.some(oo.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof oo||t.push(this.local[e]);return t}}co.empty=new co([],[]),co.removeOverlap=vo;const po=co.empty;class ho{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,uo)));return ho.from(n)}forChild(e,t){if(t.isLeaf)return co.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=po&&(i instanceof ho?n=n.concat(i.members):n.push(i))}return ho.from(n)}eq(e){if(!(e instanceof ho)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?vo(n?t:t.sort(bo)):lo}static from(e){switch(e.length){case 0:return po;case 1:return e[0];default:return new ho(e)}}}function fo(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new ao(i.from+t,i.to+t,i.type))}return n}function mo(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t,o=0;o<e.length;o++)(t=e[o])&&t.from>n&&t.to<r&&((i||(i=[])).push(t),e[o]=null);return i}function go(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function yo(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=mo(e,t,s+n);if(a){o=!0;let e=yo(a,t,n+s+1,r);e!=po&&i.push(s,s+t.nodeSize,e)}}));let s=fo(o?go(e):e,-n).sort(bo);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new co(s,i):po}function bo(e,t){return e.from-t.from||e.to-t.to}function vo(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),wo(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),wo(t,i+1,o.copy(r.to,o.to)))}}return t}function wo(e,t,n){for(;t<e.length&&bo(n,e[t])>0;)t++;e.splice(t,0,n)}function xo(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=po&&t.push(r)})),e.cursorWrapper&&t.push(co.create(e.state.doc,[e.cursorWrapper.deco])),ho.from(t)}const Mo={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Do=In&&Ln<=11;class ko{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Eo{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ko,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);In&&Ln<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),Do&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.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.observe(this.view.dom,Mo),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.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(si(this.view)){if(this.suppressingSelectionUpdates)return Xr(this.view);if(In&&Ln<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&Gn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&si(this.view)&&!this.ignoreSelectionChange(t),r=-1,i=-1,o=!1,s=[];if(this.view.editable)for(let t=0;t<e.length;t++){let n=this.registerMutation(e[t],s);n&&(r=r<0?n.from:Math.min(n.from,r),i=i<0?n.to:Math.max(n.to,i),n.typeOver&&(o=!0))}if(zn&&s.length>1){let e=s.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,i),function(e){if(Co)return;Co=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&console["warn"]("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,i,o,s),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||Xr(this.view),this.currentSelection.set(t))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(In&&Ln<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==e.target?qn(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?qn(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let Co=!1;function To(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Bn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Bn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function Oo(e,t,n,r,i){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Gr(e,t);if(n&&!e.state.selection.eq(n)){let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let a=e.state.selection,l=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),u=e.domSelection(),c=u.anchorNode;if(c&&e.dom.contains(1==c.nodeType?c:c.parentNode)&&(r=[{node:c,offset:u.anchorOffset}],tr(u)||r.push({node:u.focusNode,offset:u.focusOffset})),Fn&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let d=e.state.doc,p=e.someProp("domParser")||Xe.fromSchema(e.state.schema),h=d.resolve(a),f=null,m=p.parse(i,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:To,context:h});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n);if(Fn&&e.cursorWrapper&&l.sel&&l.sel.anchor==e.cursorWrapper.deco.from){let t=e.cursorWrapper.deco.type.toDOM.nextSibling,n=t&&t.nodeValue?t.nodeValue.length:1;l.sel={anchor:l.sel.anchor+n,head:l.sel.anchor+n}}let u,c,d=e.state.doc,p=d.slice(l.from,l.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(u=e.state.selection.to,c="end"):(u=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let h=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){r-=s+Math.max(0,o-Math.min(s,a))-o}if(s<o&&e.size<t.size){o-=r<=o&&r>=s?o-r:0,a=o+(a-s),s=o}else if(a<o){o-=r<=o&&r>=a?o-r:0,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(p.content,l.doc.content,l.from,u,c);if((Un&&e.input.lastIOSEnter>Date.now()-225||$n)&&i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",(t=>t(e,nr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!h){if(!(r&&a instanceof sn&&!a.empty&&a.$head.sameParent(a.$anchor))||e.composing||l.sel&&l.sel.anchor!=l.sel.head){if(l.sel){let t=So(e,e.state.doc,l.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}h={start:a.from,endA:a.to,endB:a.to}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&h.start==h.endB&&e.state.selection instanceof sn&&(h.start>e.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?h.start=e.state.selection.from:h.endA<e.state.selection.to&&h.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),In&&Ln<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>l.from&&"  "==l.doc.textBetween(h.start-l.from-1,h.start-l.from+1)&&(h.start--,h.endA--,h.endB--);let f,m=l.doc.resolveNoCache(h.start-l.from),g=l.doc.resolveNoCache(h.endB-l.from),y=d.resolve(h.start),b=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=h.endA;if((Un&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!b&&m.pos<l.doc.content.size&&(f=tn.findFrom(l.doc.resolve(m.pos+1),1,!0))&&f.head==g.pos)&&e.someProp("handleKeyDown",(t=>t(e,nr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>h.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||Ao(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(Ao(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Ao(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(d,h.start,h.endA,m,g)&&e.someProp("handleKeyDown",(t=>t(e,nr(8,"Backspace")))))return void($n&&Fn&&e.domObserver.suppressSelectionUpdates());Fn&&$n&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),$n&&!b&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==h.endA&&(h.endB-=2,g=l.doc.resolveNoCache(h.endB-l.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,nr(13,"Enter"))}))}),20));let v,w,x,M=h.start,D=h.endA;if(b)if(m.pos==g.pos)In&&Ln<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Xr(e)),20)),v=e.state.tr.delete(M,D),w=d.resolve(h.start).marksAcross(d.resolve(h.endA));else if(h.endA==h.endB&&(x=function(e,t){let n,r,i,o=e.firstChild.marks,s=t.firstChild.marks,a=o,l=s;for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);for(let e=0;e<o.length;e++)l=o[e].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let u=[];for(let e=0;e<t.childCount;e++)u.push(i(t.child(e)));if(le.from(u).eq(e))return{mark:r,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,h.endA-y.start()))))v=e.state.tr,"add"==x.type?v.addMark(M,D,x.mark):v.removeMark(M,D,x.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,M,D,t))))return;v=e.state.tr.insertText(t,M,D)}if(v||(v=e.state.tr.replace(M,D,l.doc.slice(h.start-l.from,h.endB-l.from))),l.sel){let t=So(e,v.doc,l.sel);t&&!(Fn&&$n&&e.composing&&t.empty&&(h.start!=h.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==M||t.head==v.mapping.map(D)-1)||In&&t.empty&&t.head==M)&&v.setSelection(t)}w&&v.ensureMarks(w),e.dispatch(v.scrollIntoView())}function So(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:oi(e,t.resolve(n.anchor),t.resolve(n.head))}function Ao(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class No{constructor(e,t){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 Ii,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(zo),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Io(this),jo(this),this.nodeViews=Lo(this),this.docView=Ir(this.state.doc,_o(this),xo(this),this.dom,this),this.domObserver=new Eo(this,((e,t,n,r)=>Oo(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in _i){let n=_i[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Fi(e,t)||Pi(e,t)||!e.editable&&t.type in ji||n(e,t)})}Bn&&e.dom.addEventListener("input",(()=>null)),zi(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&zi(this),this._props=e,e.plugins&&(e.plugins.forEach(zo),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;if(e.storedMarks&&this.composing&&(Ji(this),i=!0),this.state=e,t){let e=Lo(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,r=!0),zi(this)}this.editable=Io(this),jo(this);let o=xo(this),s=_o(this),a=t?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",l=r||!this.docView.matchesNode(e.doc,s,o);!l&&e.selection.eq(n.selection)||(i=!0);let u="preserve"==a&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:ar(e.dom)}}(this);if(i){this.domObserver.stop();let t=l&&(In||Fn)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(l){let n=Fn?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(e.doc,s,o,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Ir(e.doc,s,o,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return Gn(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Xr(this,t):(ri(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(n),"reset"==a)this.dom.scrollTop=0;else if("to selection"==a){let t=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(e.selection instanceof ln){let n=this.docView.domAfterPos(e.selection.from);1==n.nodeType&&sr(this,n.getBoundingClientRect(),t)}else sr(this,this.coordsAtPos(e.selection.head,1),t)}else u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;lr(n,0==r?0:r-t)}(u)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let i=this.directPlugins[r].props[e];if(null!=i&&(n=t?t(i):i))return n}let i=this.state.plugins;if(i)for(let r=0;r<i.length;r++){let o=i[r].props[e];if(null!=o&&(n=t?t(o):o))return n}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(ur)return e.focus(ur);let t=ar(e);e.focus(null==ur?{get preventScroll(){return ur={preventScroll:!0},!0}}:void 0),ur||(ur=!1,lr(t,0))}(this.dom),Xr(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}posAtCoords(e){return hr(this,e)}coordsAtPos(e,t=1){return gr(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return kr(this,t||this.state,e)}destroy(){this.docView&&(!function(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)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],xo(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Pi(e,t)||!_i[t.type]||!e.editable&&t.type in ji||_i[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function _o(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e&&(t.class+=" "+n[e]),"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),[ao.node(0,e.state.doc.content.size,t)]}function jo(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:ao.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Io(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Lo(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function zo(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")}for(var Po={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Fo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ro="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Bo="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Uo="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Ho="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),$o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Vo=Ro&&(Ho||+Ro[1]<57)||Uo&&Ho,Wo=0;Wo<10;Wo++)Po[48+Wo]=Po[96+Wo]=String(Wo);for(Wo=1;Wo<=24;Wo++)Po[Wo+111]="F"+Wo;for(Wo=65;Wo<=90;Wo++)Po[Wo]=String.fromCharCode(Wo+32),Fo[Wo]=String.fromCharCode(Wo);for(var qo in Po)Fo.hasOwnProperty(qo)||(Fo[qo]=Po[qo]);const Yo="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Qo(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);Yo?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Ko(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function Go(e){let t=function(e){let t=Object.create(null);for(let n in e)t[Qo(n)]=e[n];return t}(e);return function(e,n){let r,i=function(e){var t=!(Vo&&(e.ctrlKey||e.altKey||e.metaKey)||(Bo||$o)&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Fo:Po)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),o=1==i.length&&" "!=i,s=t[Ko(i,n,!o)];if(s&&s(e.state,e.dispatch,e))return!0;if(o&&(n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=Po[n.keyCode])&&r!=i){let i=t[Ko(r,n,!0)];if(i&&i(e.state,e.dispatch,e))return!0}else if(o&&n.shiftKey){let r=t[Ko(i,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}function Jo(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function Xo(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 Zo(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function es(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function ts(e,t,n){let r,i,o=t.nodeBefore,s=t.nodeAfter;if(o.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!i.isTextblock&&!Rt(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(r[0]||s.type).validEnd){if(n){let i=t.pos+s.nodeSize,a=le.empty;for(let e=r.length-1;e>=0;e--)a=le.from(r[e].create(null,a));a=le.from(o.copy(a));let l=e.tr.step(new _t(t.pos-1,i,t.pos,i,new fe(a,1,0),r.length,!0)),u=i+2*r.length;Rt(l.doc,u)&&l.join(u),n(l.scrollIntoView())}return!0}let l=tn.findFrom(t,1),u=l&&l.$from.blockRange(l.$to),c=u&&Lt(u);if(null!=c&&c>=t.depth)return n&&n(e.tr.lift(u,c).scrollIntoView()),!0;if(a&&Jo(s,"start",!0)&&Jo(o,"end")){let r=o,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=le.empty;for(let e=i.length-1;e>=0;e--)r=le.from(i[e].copy(r));n(e.tr.step(new _t(t.pos-i.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new fe(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ns(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(sn.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const rs=ns(-1),is=ns(1);function ss(e,t=null){return function(n,r){let{from:i,to:o}=n.selection,s=!1;return n.doc.nodesBetween(i,o,((r,i)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(i),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0)}}function as(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);l=new Ae(e,e,s.depth),s.endIndex<s.parent.childCount&&(s=new Ae(i,n.doc.resolve(o.end(s.depth)),s.depth)),a=!0}let u=zt(l,e,t,s);return!!u&&(r&&r(function(e,t,n,r,i){let o=le.empty;for(let e=n.length-1;e>=0;e--)o=le.from(n[e].type.create(n[e].attrs,o));e.step(new _t(t.start-(r?2:0),t.end,t.start,t.end,new fe(o,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==i&&(s=e+1);let a=n.length-s,l=t.start+n.length-(r?2:0),u=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&Ft(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=u.child(n).nodeSize;return e}(n.tr,s,u,a,e).scrollIntoView()),!0)}}function ls(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));return!!o&&(!n||(r.node(o.depth-1).type==e?function(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new _t(o-1,s,o,s,new fe(le.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ae(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));return t(i.lift(r,Lt(r)).scrollIntoView()),!0}(t,n,e,o):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,o=n.startIndex;t>o;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?le.empty:le.from(i))))return!1;let d=o.pos,p=d+s.nodeSize;return r.step(new _t(d-(a?1:0),p+(l?1:0),d+1,p-1,new fe((a?le.empty:le.from(i.copy(le.empty))).append(l?le.empty:le.from(i.copy(le.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,o)))}}function us(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class cs{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,l=e||i.tr,u={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return s.push(i),u}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(l),s.every((e=>!0===e)))};return u}createCan(e){const{rawCommands:t,state:n}=this,r=void 0,i=e||n.tr,o=this.buildProps(i,r),s=Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:r})])));return{...s,chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r;i.storedMarks&&e.setStoredMarks(i.storedMarks);const s={tr:e,editor:r,view:o,state:us({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(s)])))}};return s}}function ds(e,t,n){if(void 0===e.config[t]&&e.parent)return ds(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?ds(e.parent,t,n):null})}return e.config[t]}function ps(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function hs(e){const t=[],{nodeExtensions:n,markExtensions:r}=ps(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=ds(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=ds(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...o,...r};r.isRequired&&void 0===r.default&&delete i.default,t.push({type:e.name,name:n,attribute:i})}))})),t}function fs(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function ms(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]="class"===e?[n[e],t].join(" "):"style"===e?[n[e],t].join("; "):t:n[e]=t})),n}),{})}function gs(e,t){return t.filter((e=>e.attribute.rendered)).map((t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]})).reduce(((e,t)=>ms(e,t)),{})}function ys(e){return"function"==typeof e}function bs(e,t=void 0,...n){return ys(e)?t?e.bind(t)(...n):e(...n):e}function vs(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function ws(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function xs(e,t){return t.nodes[e]||t.marks[e]||null}function Ms(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function Ds(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class ks{constructor(e){this.find=e.find,this.handler=e.handler}}function Es(e){var t;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(null===(t=u.nodeBefore||u.nodeAfter)||void 0===t?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let c=!1;const d=((e,t=500)=>{let n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,((t,r,i,o)=>{var s,a,l;n+=(null===(a=(s=t.type.spec).toText)||void 0===a?void 0:a.call(s,{node:t,pos:r,parent:i,index:o}))||(null===(l=e.nodeBefore)||void 0===l?void 0:l.text)||"%leaf%"})),n})(u)+o;return s.forEach((e=>{if(c)return;const t=((e,t)=>{if(Ds(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[];return r.push(n.text),r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(d,e.find);if(!t)return;const s=l.state.tr,u=us({state:l.state,transaction:s}),p={from:r-(t[0].length-o.length),to:i},{commands:h,chain:f,can:m}=new cs({editor:n,state:u});null!==e.handler({state:u,range:p,match:t,commands:h,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:i,text:o}),l.dispatch(s),c=!0)})),c}function Cs(e){const{editor:t,rules:n}=e,r=new kn({state:{init:()=>null,apply(e,t){const n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(e,i,o,s)=>Es({editor:t,from:i,to:o,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&Es({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:o}=e.state.selection;return!!o&&Es({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class Ts{constructor(e){this.find=e.find,this.handler=e.handler}}function Os(e){const{editor:t,state:n,from:r,to:i,rule:o}=e,{commands:s,chain:a,can:l}=new cs({editor:t,state:n}),u=[];n.doc.nodesBetween(r,i,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const c=Math.max(r,t),d=Math.min(i,t+e.content.size),p=((e,t)=>{if(Ds(t))return[...e.matchAll(t)];const n=t(e);return n?n.map((t=>{const n=[];return n.push(t.text),n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]})(e.textBetween(c-t,d-t,void 0,""),o.find);p.forEach((e=>{if(void 0===e.index)return;const t=c+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},d=o.handler({state:n,range:i,match:e,commands:s,chain:a,can:l});u.push(d)}))}));return u.every((e=>null!==e))}function Ss(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1;return n.map((e=>new kn({view(e){const t=t=>{var n;r=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:e=>(o=r===e.dom.parentElement,!1),paste:(e,t)=>{var n;const r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!i,u="drop"===a.getMeta("uiEvent")&&!o;if(!l&&!u)return;const c=r.doc.content.findDiffStart(s.doc.content),d=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof c||!d||c===d.b)return;const p=s.tr,h=us({state:s,transaction:p});return Os({editor:t,state:h,from:Math.max(c-1,0),to:d.b,rule:e})&&p.steps.length?p:void 0}})))}class As{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=As.resolve(e),this.schema=function(e){var t;const n=hs(e),{nodeExtensions:r,markExtensions:i}=ps(e),o=null===(t=r.find((e=>ds(e,"topNode"))))||void 0===t?void 0:t.name,s=Object.fromEntries(r.map((t=>{const r=n.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage},o=e.reduce(((e,n)=>{const r=ds(n,"extendNodeSchema",i);return{...e,...r?r(t):{}}}),{}),s=ws({...o,content:bs(ds(t,"content",i)),marks:bs(ds(t,"marks",i)),group:bs(ds(t,"group",i)),inline:bs(ds(t,"inline",i)),atom:bs(ds(t,"atom",i)),selectable:bs(ds(t,"selectable",i)),draggable:bs(ds(t,"draggable",i)),code:bs(ds(t,"code",i)),defining:bs(ds(t,"defining",i)),isolating:bs(ds(t,"isolating",i)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=bs(ds(t,"parseHTML",i));a&&(s.parseDOM=a.map((e=>vs(e,r))));const l=ds(t,"renderHTML",i);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:gs(e,r)}));const u=ds(t,"renderText",i);return u&&(s.toText=u),[t.name,s]}))),a=Object.fromEntries(i.map((t=>{const r=n.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage},o=e.reduce(((e,n)=>{const r=ds(n,"extendMarkSchema",i);return{...e,...r?r(t):{}}}),{}),s=ws({...o,inclusive:bs(ds(t,"inclusive",i)),excludes:bs(ds(t,"excludes",i)),group:bs(ds(t,"group",i)),spanning:bs(ds(t,"spanning",i)),code:bs(ds(t,"code",i)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=bs(ds(t,"parseHTML",i));a&&(s.parseDOM=a.map((e=>vs(e,r))));const l=ds(t,"renderHTML",i);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:gs(e,r)})),[t.name,s]})));return new Ge({topNode:o,nodes:s,marks:a})}(this.extensions),this.extensions.forEach((e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:xs(e.name,this.schema)};if("mark"===e.type){(null===(t=bs(ds(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const r=ds(e,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const i=ds(e,"onCreate",n);i&&this.editor.on("create",i);const o=ds(e,"onUpdate",n);o&&this.editor.on("update",o);const s=ds(e,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=ds(e,"onTransaction",n);a&&this.editor.on("transaction",a);const l=ds(e,"onFocus",n);l&&this.editor.on("focus",l);const u=ds(e,"onBlur",n);u&&this.editor.on("blur",u);const c=ds(e,"onDestroy",n);c&&this.editor.on("destroy",c)}))}static resolve(e){const t=As.sort(As.flatten(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return[...new Set(t)]}(t.map((e=>e.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e=>`'${e}'`)).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map((e=>{const t=ds(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e})).flat(10)}static sort(e){const t=100;return e.sort(((e,n)=>{const r=ds(e,"priority")||t,i=ds(n,"priority")||t;return r>i?-1:r<i?1:0}))}get commands(){return this.extensions.reduce(((e,t)=>{const n=ds(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:xs(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=As.sort([...this.extensions].reverse()),n=[],r=[],i=t.map((t=>{const i={name:t.name,options:t.options,storage:t.storage,editor:e,type:xs(t.name,this.schema)},o=[],s=ds(t,"addKeyboardShortcuts",i);if(s){const t=function(e){return new kn({props:{handleKeyDown:Go(e)}})}(Object.fromEntries(Object.entries(s()).map((([t,n])=>[t,()=>n({editor:e})]))));o.push(t)}const a=ds(t,"addInputRules",i);Ms(t,e.options.enableInputRules)&&a&&n.push(...a());const l=ds(t,"addPasteRules",i);Ms(t,e.options.enablePasteRules)&&l&&r.push(...l());const u=ds(t,"addProseMirrorPlugins",i);if(u){const e=u();o.push(...e)}return o})).flat();return[Cs({editor:e,rules:n}),...Ss({editor:e,rules:r}),...i]}get attributes(){return hs(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=ps(this.extensions);return Object.fromEntries(t.filter((e=>!!ds(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:fs(t.name,this.schema)},i=ds(t,"addNodeView",r);if(!i)return[];return[t.name,(r,o,s,a)=>{const l=gs(r,n);return i()({editor:e,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:t})}]})))}}function Ns(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function _s(e,t){const n={...e};return Ns(e)&&Ns(t)&&Object.keys(t).forEach((r=>{Ns(t[r])?r in e?n[r]=_s(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})})),n}class js{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=bs(ds(this,"addOptions",{name:this.name}))),this.storage=bs(ds(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new js(e)}configure(e={}){const t=this.extend();return t.options=_s(this.options,e),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new js(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=bs(ds(t,"addOptions",{name:t.name})),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}}function Is(e,t,n){const{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return e.nodesBetween(r,i,((e,n,u,c)=>{var d;const p=null==s?void 0:s[e.type.name];p?(e.isBlock&&!l&&(a+=o,l=!0),u&&(a+=p({node:e,pos:n,parent:u,index:c,range:t}))):e.isText?(a+=null===(d=null==e?void 0:e.text)||void 0===d?void 0:d.slice(Math.max(r,n)-n,i-n),l=!1):e.isBlock&&!l&&(a+=o,l=!0)})),a}function Ls(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}const zs=js.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new kn({key:new Tn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map((e=>e.$from.pos))),a=Math.max(...o.map((e=>e.$to.pos)));return Is(r,{from:s,to:a},{textSerializers:Ls(n)})}}})]}});function Ps(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:Ds(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Fs(e,t,n={}){return e.find((e=>e.type===t&&Ps(e.attrs,n)))}function Rs(e,t,n={}){return!!Fs(e,t,n)}function Bs(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=Fs([...r.node.marks],t,n);if(!i)return;let o=r.index,s=e.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(Fs([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,s-=e.parent.child(o).nodeSize;for(;a<e.parent.childCount&&Rs([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Us(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function Hs(e){return e&&"object"==typeof e&&!Array.isArray(e)&&!function(e){var t;return"class"===(null===(t=e.constructor)||void 0===t?void 0:t.toString().substring(0,5))}(e)}function $s(e){return Hs(e)&&e instanceof sn}function Vs(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Ws(e,t=null){if(!t)return null;const n=tn.atStart(e),r=tn.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const i=n.from,o=r.to;return"all"===t?sn.create(e,Vs(0,i,o),Vs(e.content.size,i,o)):sn.create(e,Vs(t,i,o),Vs(t,i,o))}function qs(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ys(e){const t=`<body>${e}</body>`;return(new window.DOMParser).parseFromString(t,"text/html").body}function Qs(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)?le.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Qs("",t,n)}if("string"==typeof e){const r=Xe.fromSchema(t);return n.slice?r.parseSlice(Ys(e),n.parseOptions).content:r.parse(Ys(e),n.parseOptions)}return Qs("",t,n)}function Ks(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Gs(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,s=t?fs(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:o})}));const l=i-r,u=a.filter((e=>!s||s.name===e.node.type.name)).filter((e=>Ps(e.node.attrs,n,{strict:!1})));if(o)return!!u.length;return u.reduce(((e,t)=>e+t.to-t.from),0)>=l}function Js(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Xs(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}function Zs(e,t,n={}){return Qs(e,t,{slice:!1,parseOptions:n})}function ea(e,t){const n=Us(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function ta(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}function na(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}function ra(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function ia(e,t){const{nodeExtensions:n}=ps(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=bs(ds(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}const oa=(e,t)=>{const n=ra((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!Rt(e.doc,n.pos)||(e.join(n.pos),!0)},sa=(e,t)=>{const n=ra((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!Rt(e.doc,r)||(e.join(r),!0)};function aa(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Us(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!o||o.name===e.type.name)).find((e=>Ps(e.attrs,n,{strict:!1})));let s=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);s+=o-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:o}))))}))})),0===s)return!1;const l=a.filter((e=>!o||o.name===e.mark.type.name)).filter((e=>Ps(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),u=a.filter((e=>!o||e.mark.type!==o&&e.mark.type.excludes(o))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+u:l)>=s}var la=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return!n||(i.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),a=o.blockRange(s);if(!a)return;const l=Lt(a);if(e.type.isTextblock){const{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof cn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=es(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(sn.create(s.doc,n+1)),t(s.scrollIntoView())}return!0})(e,t),deleteNode:e=>({tr:t,state:n,dispatch:r})=>{const i=fs(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1){if(o.node(e).type===i){if(r){const n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},deleteSelection:()=>({state:e,dispatch:t})=>((e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0))(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=es(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(tn.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0})(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Us(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const e=Bs(l,o,t);if(e&&e.from<=u&&e.to>=c){const t=sn.create(s,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},focus:(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{qs()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(o&&null===e&&!$s(n.state.selection))return s(),!0;const a=Ws(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const i=Qs(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===i.toString())return!0;let{from:s,to:a}="number"==typeof e?{from:e,to:e}:e,l=!0,u=!0;if((i.toString().startsWith("<")?i:[i]).forEach((e=>{e.check(),l=!!l&&(e.isText&&0===e.marks.length),u=!!u&&e.isBlock})),s===a&&u){const{parent:e}=r.doc.resolve(s);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(s-=1,a+=1)}l?r.insertText(t,s,a):r.replaceWith(s,a,i),n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Nt||i instanceof _t))return;const o=e.mapping.maps[r];let s=0;o.forEach(((e,t,n,r)=>{0===s&&(s=r)})),e.setSelection(tn.near(e.doc.resolve(s),n))}(r,r.steps.length-1,-1)}return!0},joinBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=Xo(r);if(!i){let n=r.blockRange(),i=n&&Lt(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&ts(e,i,t))return!0;if(0==r.parent.content.size&&(Jo(o,"end")||ln.isSelectable(o))){let n=Ut(e.doc,r.before(),r.after(),fe.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Jo(o,"end")?tn.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):ln.create(r.doc,i.pos-o.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),0))})(e,t),joinForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;let i=Zo(r);if(!i)return!1;let o=i.nodeAfter;if(ts(e,i,t))return!0;if(0==r.parent.content.size&&(Jo(o,"start")||ln.isSelectable(o))){let n=Ut(e.doc,r.before(),r.after(),fe.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Jo(o,"start")?tn.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):ln.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),0))})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=function(e){const t=e.split(/-(?!$)/);let n,r,i,o,s=t[t.length-1];"Space"===s&&(s=" ");for(let e=0;e<t.length-1;e+=1){const s=t[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);qs()||Ks()?o=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),o&&(s=`Meta-${s}`),i&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=o.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:r})=>!!Gs(n,fs(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Lt(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:e,dispatch:t})=>((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Ft(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Lt(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)})(e,t),liftListItem:e=>({state:t,dispatch:n})=>ls(fs(e,t.schema))(t,n),newlineInCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))})(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Js("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=fs(e,r.schema)),"mark"===a&&(s=Us(e,r.schema)),i&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,Xs(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((i=>{s===i.type&&n.addMark(r,r+e.nodeSize,s.create(Xs(i.attrs,t)))}))}))})),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),selectNodeBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=Xo(r)}let s=o&&o.nodeBefore;return!(!s||!ln.isSelectable(s)||(t&&t(e.tr.setSelection(ln.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),0))})(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=Zo(r)}let s=o&&o.nodeAfter;return!(!s||!ln.isSelectable(s)||(t&&t(e.tr.setSelection(ln.create(e.doc,o.pos)).scrollIntoView()),0))})(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:i}=e.selection,o=r.sharedDepth(i);return 0!=o&&(n=r.before(o),t&&t(e.tr.setSelection(ln.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>is(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>rs(e,t),setContent:(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,a=Zs(e,i.schema,n);return o&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Us(e,r.schema);if(i)if(s){const e=ea(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,((e,r)=>{const s=Math.max(r,i),a=Math.min(r+e.nodeSize,o);e.marks.find((e=>e.type===l))?e.marks.forEach((e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))})):n.addMark(s,a,l.create(t))}))}));return!0},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=fs(e,n.schema);return o.isTextblock?i().command((({commands:e})=>!!ss(o,t)(n)||e.clearNodes())).command((({state:e})=>ss(o,t)(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=tn.atStart(n).from,i=tn.atEnd(n).to,o=Vs(e,r,i),s=ln.create(n,o);t.setSelection(s)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=sn.atStart(n).from,s=sn.atEnd(n).to,a=Vs(r,o,s),l=Vs(i,o,s),u=sn.create(n,a,l);t.setSelection(u)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const r=fs(e,t.schema);return(i=r,function(e,t){let{$from:n,$to:r}=e.selection,o=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==i));if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=i)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,r=le.from(n?i.create():null),s=new fe(le.from(i.create(null,le.from(a.type.create(null,r)))),n?3:1,0),u=o.start,c=o.end;t(e.tr.step(new _t(u-(n?3:1),c,u,c,s,1,!0)).scrollIntoView())}return!0})(t,n);var i},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=t,{$from:a,$to:l}=o,u=ta(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(o instanceof ln&&o.node.isBlock)return!(!a.parentOffset||!Ft(s,a.pos))&&(r&&(e&&na(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;o instanceof sn&&t.deleteSelection();const s=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let c=r&&s?[{type:s,attrs:u}]:void 0,d=Ft(t.doc,t.mapping.map(a.pos),1,c);if(c||d||!Ft(t.doc,t.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(d=!0,c=s?[{type:s,attrs:u}]:void 0),d&&(t.split(t.mapping.map(a.pos),1,c),s&&!r&&!a.parentOffset&&a.parent.type!==s)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&t.setNodeMarkup(t.mapping.map(a.before()),s)}e&&na(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},splitListItem:e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const s=fs(e,n.schema),{$from:a,$to:l}=n.selection,u=n.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const d=i.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let e=le.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-n;t>=a.depth-3;t-=1)e=le.from(a.node(t).copy(e));const r=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,i=ta(d,a.node().type.name,a.node().attrs),l=(null===(o=s.contentMatch.defaultType)||void 0===o?void 0:o.createAndFill(i))||void 0;e=e.append(le.from(s.createAndFill(null,l)||void 0));const u=a.before(a.depth-(n-1));t.replace(u,a.after(-r),new fe(e,4-n,0));let c=-1;t.doc.nodesBetween(u,t.doc.content.size,((e,t)=>{if(c>-1)return!1;e.isTextblock&&0===e.content.size&&(c=t+1)})),c>-1&&t.setSelection(sn.near(t.doc.resolve(c))),t.scrollIntoView()}return!0}const p=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,h=ta(d,c.type.name,c.attrs),f=ta(d,a.node().type.name,a.node().attrs);t.delete(a.pos,l.pos);const m=p?[{type:s,attrs:h},{type:p,attrs:f}]:[{type:s,attrs:h}];return!!Ft(t.doc,a.pos,2)&&(r&&t.split(a.pos,2,m).scrollIntoView(),!0)},toggleList:(e,t)=>({editor:n,tr:r,state:i,dispatch:o,chain:s,commands:a,can:l})=>{const{extensions:u}=n.extensionManager,c=fs(e,i.schema),d=fs(t,i.schema),{selection:p}=i,{$from:h,$to:f}=p,m=h.blockRange(f);if(!m)return!1;const g=ra((e=>ia(e.type.name,u)))(p);if(m.depth>=1&&g&&m.depth-g.depth<=1){if(g.node.type===c)return a.liftListItem(d);if(ia(g.node.type.name,u)&&c.validContent(g.node.content)&&o)return s().command((()=>(r.setNodeMarkup(g.pos,c),!0))).command((()=>oa(r,c))).command((()=>sa(r,c))).run()}return s().command((()=>!!l().wrapInList(c)||a.clearNodes())).wrapInList(c).command((()=>oa(r,c))).command((()=>sa(r,c))).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Us(e,r.schema);return aa(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=fs(e,r.schema),s=fs(t,r.schema);return Gs(r,o,n)?i.setNode(s):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=fs(e,n.schema);return Gs(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const t=e.tr,n=o.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(o.text){const n=t.doc.resolve(o.from).marks();t.replaceWith(o.from,o.to,e.schema.text(o.text,n))}else t.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=Us(e,r.schema),{$from:u,empty:c,ranges:d}=a;if(!i)return!0;if(c&&s){let{from:e,to:t}=a;const r=null===(o=u.marks().find((e=>e.type===l)))||void 0===o?void 0:o.attrs,i=Bs(u,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else d.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Js("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=fs(e,r.schema)),"mark"===a&&(s=Us(e,r.schema)),i&&n.selection.ranges.forEach((e=>{const i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach((o=>{if(s===o.type){const l=Math.max(r,i),u=Math.min(r+e.nodeSize,a);n.addMark(l,u,s.create({...o.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&zt(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(fs(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>as(fs(e,n.schema),t)(n,r)});const ua=js.create({name:"commands",addCommands:()=>({...la})}),ca=js.create({name:"editable",addProseMirrorPlugins(){return[new kn({key:new Tn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),da=js.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new kn({key:new Tn("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),pa=js.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:a}=o,l=tn.atStart(r).from===s;return!(!(i&&l&&a.type.isTextblock)||a.textContent.length)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>e.joinForward(),()=>e.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return qs()||Ks()?i:r},addProseMirrorPlugins(){return[new kn({key:new Tn("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:r,from:i,to:o}=t.selection,s=tn.atStart(t.doc).from,a=tn.atEnd(t.doc).to,l=i===s&&o===a,u=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(r||!l||!u)return;const c=n.tr,d=us({state:n,transaction:c}),{commands:p}=new cs({editor:this.editor,state:d});return p.clearNodes(),c.steps.length?c:void 0}})]}}),ha=js.create({name:"tabindex",addProseMirrorPlugins(){return[new kn({key:new Tn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var fa=Object.freeze({__proto__:null,ClipboardTextSerializer:zs,Commands:ua,Editable:ca,FocusEvents:da,Keymap:pa,Tabindex:ha});function ma(e,t){const n=Js("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=fs(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,(e=>{o.push(e)}));const s=o.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?ea(e,t):{}}const ga=`.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}`;function ya(e,t){const n=[];return e.descendants(((e,r)=>{t(e)&&n.push({node:e,pos:r})})),n}function ba(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.some((t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}))}function va(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const i=Bs(n.resolve(e-1),t.type);i&&r.push({mark:t,...i})})):n.nodesBetween(e,t,((e,t)=>{r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function wa(e,t,n){const r=0,i=e.state.doc.content.size,o=Vs(t,r,i),s=Vs(n,r,i),a=e.coordsAtPos(o),l=e.coordsAtPos(s,-1),u=Math.min(a.top,l.top),c=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),p=Math.max(a.right,l.right),h={top:u,bottom:c,left:d,right:p,width:p-d,height:c-u,x:d,y:u};return{...h,toJSON:()=>h}}function xa(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length,d=va(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>u));if(d.length)return null;c<n.to&&o.delete(c,n.to),u>n.from&&o.delete(n.from+r,u),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function Ma(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let a=n.to;if(r[1]){let t=s+r[0].lastIndexOf(r[1]);t>a?t=a:a=t+r[1].length;const n=r[0][r[0].length-1];o.insertText(n,s+r[0].length-1),o.replaceWith(t,a,e.type.create(i))}else r[0]&&o.replaceWith(s,a,e.type.create(i))}})}function Da(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=bs(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function ka(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,o=n.from;const s=n.to;if(r[1]){const e=r[0].lastIndexOf(r[1]);i+=r[0].slice(e+r[1].length),o+=e;const t=o-s;t>0&&(i=r[0].slice(e-t,e)+i,o=s)}t.tr.insertText(i,o,s)}})}function Ea(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),a=s&&zt(s,e.type,i);if(!a)return null;o.wrap(s,a);const l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Rt(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)}})}class Ca{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=bs(ds(this,"addOptions",{name:this.name}))),this.storage=bs(ds(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ca(e)}configure(e={}){const t=this.extend();return t.options=_s(this.options,e),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ca(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=bs(ds(t,"addOptions",{name:t.name})),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}}class Ta{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=bs(ds(this,"addOptions",{name:this.name}))),this.storage=bs(ds(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ta(e)}configure(e={}){const t=this.extend();return t.options=_s(this.options,e),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ta(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=bs(ds(t,"addOptions",{name:t.name})),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}}function Oa(e){return new Ts({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length,d=va(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>u));if(d.length)return null;c<n.to&&o.delete(c,n.to),u>n.from&&o.delete(n.from+r,u),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}var Sa="top",Aa="bottom",Na="right",_a="left",ja="auto",Ia=[Sa,Aa,Na,_a],La="start",za="end",Pa="clippingParents",Fa="viewport",Ra="popper",Ba="reference",Ua=Ia.reduce((function(e,t){return e.concat([t+"-"+La,t+"-"+za])}),[]),Ha=[].concat(Ia,[ja]).reduce((function(e,t){return e.concat([t,t+"-"+La,t+"-"+za])}),[]),$a=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Va(e){return e?(e.nodeName||"").toLowerCase():null}function Wa(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function qa(e){return e instanceof Wa(e).Element||e instanceof Element}function Ya(e){return e instanceof Wa(e).HTMLElement||e instanceof HTMLElement}function Qa(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Wa(e).ShadowRoot||e instanceof ShadowRoot)}var Ka={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];Ya(i)&&Va(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});Ya(r)&&Va(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Ga(e){return e.split("-")[0]}var Ja=Math.max,Xa=Math.min,Za=Math.round;function el(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(Ya(e)&&t){var o=e.offsetHeight,s=e.offsetWidth;s>0&&(r=Za(n.width)/s||1),o>0&&(i=Za(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function tl(e){var t=el(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function nl(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Qa(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function rl(e){return Wa(e).getComputedStyle(e)}function il(e){return["table","td","th"].indexOf(Va(e))>=0}function ol(e){return((qa(e)?e.ownerDocument:e.document)||window.document).documentElement}function sl(e){return"html"===Va(e)?e:e.assignedSlot||e.parentNode||(Qa(e)?e.host:null)||ol(e)}function al(e){return Ya(e)&&"fixed"!==rl(e).position?e.offsetParent:null}function ll(e){for(var t=Wa(e),n=al(e);n&&il(n)&&"static"===rl(n).position;)n=al(n);return n&&("html"===Va(n)||"body"===Va(n)&&"static"===rl(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&Ya(e)&&"fixed"===rl(e).position)return null;var n=sl(e);for(Qa(n)&&(n=n.host);Ya(n)&&["html","body"].indexOf(Va(n))<0;){var r=rl(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function ul(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function cl(e,t,n){return Ja(e,Xa(t,n))}function dl(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function pl(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var hl={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ga(n.placement),l=ul(a),u=[_a,Na].indexOf(a)>=0?"height":"width";if(o&&s){var c=function(e,t){return dl("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:pl(e,Ia))}(i.padding,n),d=tl(o),p="y"===l?Sa:_a,h="y"===l?Aa:Na,f=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],g=ll(o),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=f/2-m/2,v=c[p],w=y-d[u]-c[h],x=y/2-d[u]/2+b,M=cl(v,x,w),D=l;n.modifiersData[r]=((t={})[D]=M,t.centerOffset=M-x,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&nl(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fl(e){return e.split("-")[1]}var ml={top:"auto",right:"auto",bottom:"auto",left:"auto"};function gl(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,p=s.x,h=void 0===p?0:p,f=s.y,m=void 0===f?0:f,g="function"==typeof c?c({x:h,y:m}):{x:h,y:m};h=g.x,m=g.y;var y=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),v=_a,w=Sa,x=window;if(u){var M=ll(n),D="clientHeight",k="clientWidth";if(M===Wa(n)&&"static"!==rl(M=ol(n)).position&&"absolute"===a&&(D="scrollHeight",k="scrollWidth"),i===Sa||(i===_a||i===Na)&&o===za)w=Aa,m-=(d&&M===x&&x.visualViewport?x.visualViewport.height:M[D])-r.height,m*=l?1:-1;if(i===_a||(i===Sa||i===Aa)&&o===za)v=Na,h-=(d&&M===x&&x.visualViewport?x.visualViewport.width:M[k])-r.width,h*=l?1:-1}var E,C=Object.assign({position:a},u&&ml),T=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Za(t*r)/r||0,y:Za(n*r)/r||0}}({x:h,y:m}):{x:h,y:m};return h=T.x,m=T.y,l?Object.assign({},C,((E={})[w]=b?"0":"",E[v]=y?"0":"",E.transform=(x.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",E)):Object.assign({},C,((t={})[w]=b?m+"px":"",t[v]=y?h+"px":"",t.transform="",t))}var yl={passive:!0};var bl={left:"right",right:"left",bottom:"top",top:"bottom"};function vl(e){return e.replace(/left|right|bottom|top/g,(function(e){return bl[e]}))}var wl={start:"end",end:"start"};function xl(e){return e.replace(/start|end/g,(function(e){return wl[e]}))}function Ml(e){var t=Wa(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Dl(e){return el(ol(e)).left+Ml(e).scrollLeft}function kl(e){var t=rl(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function El(e){return["html","body","#document"].indexOf(Va(e))>=0?e.ownerDocument.body:Ya(e)&&kl(e)?e:El(sl(e))}function Cl(e,t){var n;void 0===t&&(t=[]);var r=El(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=Wa(r),s=i?[o].concat(o.visualViewport||[],kl(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(Cl(sl(s)))}function Tl(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ol(e,t){return t===Fa?Tl(function(e){var t=Wa(e),n=ol(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,s=0,a=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:i,height:o,x:s+Dl(e),y:a}}(e)):qa(t)?function(e){var t=el(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):Tl(function(e){var t,n=ol(e),r=Ml(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Ja(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ja(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Dl(e),l=-r.scrollTop;return"rtl"===rl(i||n).direction&&(a+=Ja(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(ol(e)))}function Sl(e,t,n){var r="clippingParents"===t?function(e){var t=Cl(sl(e)),n=["absolute","fixed"].indexOf(rl(e).position)>=0&&Ya(e)?ll(e):e;return qa(n)?t.filter((function(e){return qa(e)&&nl(e,n)&&"body"!==Va(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],s=i.reduce((function(t,n){var r=Ol(e,n);return t.top=Ja(r.top,t.top),t.right=Xa(r.right,t.right),t.bottom=Xa(r.bottom,t.bottom),t.left=Ja(r.left,t.left),t}),Ol(e,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Al(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Ga(i):null,s=i?fl(i):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case Sa:t={x:a,y:n.y-r.height};break;case Aa:t={x:a,y:n.y+n.height};break;case Na:t={x:n.x+n.width,y:l};break;case _a:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=o?ul(o):null;if(null!=u){var c="y"===u?"height":"width";switch(s){case La:t[u]=t[u]-(n[c]/2-r[c]/2);break;case za:t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}function Nl(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,s=void 0===o?Pa:o,a=n.rootBoundary,l=void 0===a?Fa:a,u=n.elementContext,c=void 0===u?Ra:u,d=n.altBoundary,p=void 0!==d&&d,h=n.padding,f=void 0===h?0:h,m=dl("number"!=typeof f?f:pl(f,Ia)),g=c===Ra?Ba:Ra,y=e.rects.popper,b=e.elements[p?g:c],v=Sl(qa(b)?b:b.contextElement||ol(e.elements.popper),s,l),w=el(e.elements.reference),x=Al({reference:w,element:y,strategy:"absolute",placement:i}),M=Tl(Object.assign({},y,x)),D=c===Ra?M:w,k={top:v.top-D.top+m.top,bottom:D.bottom-v.bottom+m.bottom,left:v.left-D.left+m.left,right:D.right-v.right+m.right},E=e.modifiersData.offset;if(c===Ra&&E){var C=E[i];Object.keys(k).forEach((function(e){var t=[Na,Aa].indexOf(e)>=0?1:-1,n=[Sa,Aa].indexOf(e)>=0?"y":"x";k[e]+=C[n]*t}))}return k}function _l(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?Ha:l,c=fl(r),d=c?a?Ua:Ua.filter((function(e){return fl(e)===c})):Ia,p=d.filter((function(e){return u.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=Nl(e,{placement:n,boundary:i,rootBoundary:o,padding:s})[Ga(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var jl={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,g=t.options.placement,y=Ga(g),b=l||(y===g||!f?[vl(g)]:function(e){if(Ga(e)===ja)return[];var t=vl(e);return[xl(e),t,xl(t)]}(g)),v=[g].concat(b).reduce((function(e,n){return e.concat(Ga(n)===ja?_l(t,{placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,x=t.rects.popper,M=new Map,D=!0,k=v[0],E=0;E<v.length;E++){var C=v[E],T=Ga(C),O=fl(C)===La,S=[Sa,Aa].indexOf(T)>=0,A=S?"width":"height",N=Nl(t,{placement:C,boundary:c,rootBoundary:d,altBoundary:p,padding:u}),_=S?O?Na:_a:O?Aa:Sa;w[A]>x[A]&&(_=vl(_));var j=vl(_),I=[];if(o&&I.push(N[T]<=0),a&&I.push(N[_]<=0,N[j]<=0),I.every((function(e){return e}))){k=C,D=!1;break}M.set(C,I)}if(D)for(var L=function(e){var t=v.find((function(t){var n=M.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},z=f?3:1;z>0;z--){if("break"===L(z))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Il(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Ll(e){return[Sa,Na,Aa,_a].some((function(t){return e[t]>=0}))}var zl={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,s=Ha.reduce((function(e,n){return e[n]=function(e,t,n){var r=Ga(e),i=[_a,Sa].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[_a,Na].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,o),e}),{}),a=s[t.placement],l=a.x,u=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}};var Pl={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,p=n.tether,h=void 0===p||p,f=n.tetherOffset,m=void 0===f?0:f,g=Nl(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),y=Ga(t.placement),b=fl(t.placement),v=!b,w=ul(y),x="x"===w?"y":"x",M=t.modifiersData.popperOffsets,D=t.rects.reference,k=t.rects.popper,E="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,C="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(M){if(o){var S,A="y"===w?Sa:_a,N="y"===w?Aa:Na,_="y"===w?"height":"width",j=M[w],I=j+g[A],L=j-g[N],z=h?-k[_]/2:0,P=b===La?D[_]:k[_],F=b===La?-k[_]:-D[_],R=t.elements.arrow,B=h&&R?tl(R):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},H=U[A],$=U[N],V=cl(0,D[_],B[_]),W=v?D[_]/2-z-V-H-C.mainAxis:P-V-H-C.mainAxis,q=v?-D[_]/2+z+V+$+C.mainAxis:F+V+$+C.mainAxis,Y=t.elements.arrow&&ll(t.elements.arrow),Q=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,K=null!=(S=null==T?void 0:T[w])?S:0,G=j+q-K,J=cl(h?Xa(I,j+W-K-Q):I,j,h?Ja(L,G):L);M[w]=J,O[w]=J-j}if(a){var X,Z="x"===w?Sa:_a,ee="x"===w?Aa:Na,te=M[x],ne="y"===x?"height":"width",re=te+g[Z],ie=te-g[ee],oe=-1!==[Sa,_a].indexOf(y),se=null!=(X=null==T?void 0:T[x])?X:0,ae=oe?re:te-D[ne]-k[ne]-se+C.altAxis,le=oe?te+D[ne]+k[ne]-se-C.altAxis:ie,ue=h&&oe?function(e,t,n){var r=cl(e,t,n);return r>n?n:r}(ae,te,le):cl(h?ae:re,te,h?le:ie);M[x]=ue,O[x]=ue-te}t.modifiersData[r]=O}},requiresIfExists:["offset"]};function Fl(e,t,n){void 0===n&&(n=!1);var r,i,o=Ya(t),s=Ya(t)&&function(e){var t=e.getBoundingClientRect(),n=Za(t.width)/e.offsetWidth||1,r=Za(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=ol(t),l=el(e,s),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==Va(t)||kl(a))&&(u=(r=t)!==Wa(r)&&Ya(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:Ml(r)),Ya(t)?((c=el(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=Dl(a))),{x:l.left+u.scrollLeft-c.x,y:l.top+u.scrollTop-c.y,width:l.width,height:l.height}}function Rl(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var Bl={placement:"bottom",modifiers:[],strategy:"absolute"};function Ul(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Hl(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?Bl:i;return function(e,t,n){void 0===n&&(n=o);var i,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Bl,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],u=!1,c={state:a,setOptions:function(n){var i="function"==typeof n?n(a.options):n;d(),a.options=Object.assign({},o,a.options,i),a.scrollParents={reference:qa(e)?Cl(e):e.contextElement?Cl(e.contextElement):[],popper:Cl(t)};var s=function(e){var t=Rl(e);return $a.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,a.options.modifiers)));return a.orderedModifiers=s.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:a,name:t,instance:c,options:r}),s=function(){};l.push(o||s)}})),c.update()},forceUpdate:function(){if(!u){var e=a.elements,t=e.reference,n=e.popper;if(Ul(t,n)){a.rects={reference:Fl(t,ll(n),"fixed"===a.options.strategy),popper:tl(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],o=i.fn,s=i.options,l=void 0===s?{}:s,d=i.name;"function"==typeof o&&(a=o({state:a,options:l,name:d,instance:c})||a)}else a.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){c.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){d(),u=!0}};if(!Ul(e,t))return c;function d(){l.forEach((function(e){return e()})),l=[]}return c.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),c}}var $l=Hl({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,s=r.resize,a=void 0===s||s,l=Wa(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach((function(e){e.addEventListener("scroll",n.update,yl)})),a&&l.addEventListener("resize",n.update,yl),function(){o&&u.forEach((function(e){e.removeEventListener("scroll",n.update,yl)})),a&&l.removeEventListener("resize",n.update,yl)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Al({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,u={placement:Ga(t.placement),variation:fl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,gl(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,gl(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Ka,zl,jl,Pl,hl,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=Nl(t,{elementContext:"reference"}),a=Nl(t,{altBoundary:!0}),l=Il(s,r),u=Il(a,i,o),c=Ll(l),d=Ll(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}}]}),Vl='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',Wl="tippy-box",ql="tippy-content",Yl="tippy-backdrop",Ql="tippy-arrow",Kl="tippy-svg-arrow",Gl={passive:!0,capture:!0},Jl=function(){return document.body};function Xl(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Zl(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function eu(e,t){return"function"==typeof e?e.apply(void 0,t):e}function tu(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function nu(e){return[].concat(e)}function ru(e,t){-1===e.indexOf(t)&&e.push(t)}function iu(e){return[].slice.call(e)}function ou(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function su(){return document.createElement("div")}function au(e){return["Element","Fragment"].some((function(t){return Zl(e,t)}))}function lu(e){return Zl(e,"MouseEvent")}function uu(e){return au(e)?[e]:function(e){return Zl(e,"NodeList")}(e)?iu(e):Array.isArray(e)?e:iu(document.querySelectorAll(e))}function cu(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function du(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function pu(e){var t,n=nu(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function hu(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function fu(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var mu={isTouch:!1},gu=0;function yu(){mu.isTouch||(mu.isTouch=!0,window.performance&&document.addEventListener("mousemove",bu))}function bu(){var e=performance.now();e-gu<20&&(mu.isTouch=!1,document.removeEventListener("mousemove",bu)),gu=e}function vu(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var wu=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,xu=Object.assign({appendTo:Jl,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Mu=Object.keys(xu);function Du(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=xu[i])?r:o);return t}),{});return Object.assign({},e,t)}function ku(e,t){var n=Object.assign({},t,{content:eu(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Du(Object.assign({},xu,{plugins:t}))):Mu).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},xu.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function Eu(e,t){e["innerHTML"]=t}function Cu(e){var t=su();return!0===e?t.className=Ql:(t.className=Kl,au(e)?t.appendChild(e):Eu(t,e)),t}function Tu(e,t){au(t.content)?(Eu(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Eu(e,t.content):e.textContent=t.content)}function Ou(e){var t=e.firstElementChild,n=iu(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(ql)})),arrow:n.find((function(e){return e.classList.contains(Ql)||e.classList.contains(Kl)})),backdrop:n.find((function(e){return e.classList.contains(Yl)}))}}function Su(e){var t=su(),n=su();n.className=Wl,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=su();function i(n,r){var i=Ou(t),o=i.box,s=i.content,a=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Tu(s,e.props),r.arrow?a?n.arrow!==r.arrow&&(o.removeChild(a),o.appendChild(Cu(r.arrow))):o.appendChild(Cu(r.arrow)):a&&o.removeChild(a)}return r.className=ql,r.setAttribute("data-state","hidden"),Tu(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}Su.$$tippy=!0;var Au=1,Nu=[],_u=[];function ju(e,t){var n,r,i,o,s,a,l,u,c=ku(e,Object.assign({},xu,Du(ou(t)))),d=!1,p=!1,h=!1,f=!1,m=[],g=tu(Y,c.interactiveDebounce),y=Au++,b=(u=c.plugins).filter((function(e,t){return u.indexOf(e)===t})),v={id:y,reference:e,popper:su(),popperInstance:null,props:c,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){if(v.state.isDestroyed)return;j("onBeforeUpdate",[v,t]),W();var n=v.props,r=ku(e,Object.assign({},n,ou(t),{ignoreAttributes:!0}));v.props=r,V(),n.interactiveDebounce!==r.interactiveDebounce&&(z(),g=tu(Y,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?nu(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");L(),_(),M&&M(n,r);v.popperInstance&&(J(),Z().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));j("onAfterUpdate",[v,t])},setContent:function(e){v.setProps({content:e})},show:function(){var e=v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=mu.isTouch&&!v.props.touch,i=Xl(v.props.duration,0,xu.duration);if(e||t||n||r)return;if(O().hasAttribute("disabled"))return;if(j("onShow",[v],!1),!1===v.props.onShow(v))return;v.state.isVisible=!0,T()&&(x.style.visibility="visible");_(),B(),v.state.isMounted||(x.style.transition="none");if(T()){var o=A(),s=o.box,l=o.content;cu([s,l],0)}a=function(){var e;if(v.state.isVisible&&!f){if(f=!0,x.offsetHeight,x.style.transition=v.props.moveTransition,T()&&v.props.animation){var t=A(),n=t.box,r=t.content;cu([n,r],i),du([n,r],"visible")}I(),L(),ru(_u,v),null==(e=v.popperInstance)||e.forceUpdate(),j("onMount",[v]),v.props.animation&&T()&&function(e,t){H(e,t)}(i,(function(){v.state.isShown=!0,j("onShown",[v])}))}},function(){var e,t=v.props.appendTo,n=O();e=v.props.interactive&&t===Jl||"parent"===t?n.parentNode:eu(t,[n]);e.contains(x)||e.appendChild(x);v.state.isMounted=!0,J()}()},hide:function(){var e=!v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=Xl(v.props.duration,1,xu.duration);if(e||t||n)return;if(j("onHide",[v],!1),!1===v.props.onHide(v))return;v.state.isVisible=!1,v.state.isShown=!1,f=!1,d=!1,T()&&(x.style.visibility="hidden");if(z(),U(),_(!0),T()){var i=A(),o=i.box,s=i.content;v.props.animation&&(cu([o,s],r),du([o,s],"hidden"))}I(),L(),v.props.animation?T()&&function(e,t){H(e,(function(){!v.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,v.unmount):v.unmount()},hideWithInteractivity:function(e){S().addEventListener("mousemove",g),ru(Nu,g),g(e)},enable:function(){v.state.isEnabled=!0},disable:function(){v.hide(),v.state.isEnabled=!1},unmount:function(){v.state.isVisible&&v.hide();if(!v.state.isMounted)return;X(),Z().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);_u=_u.filter((function(e){return e!==v})),v.state.isMounted=!1,j("onHidden",[v])},destroy:function(){if(v.state.isDestroyed)return;v.clearDelayTimeouts(),v.unmount(),W(),delete e._tippy,v.state.isDestroyed=!0,j("onDestroy",[v])}};if(!c.render)return v;var w=c.render(v),x=w.popper,M=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+v.id,v.popper=x,e._tippy=v,x._tippy=v;var D=b.map((function(e){return e.fn(v)})),k=e.hasAttribute("aria-expanded");return V(),L(),_(),j("onCreate",[v]),c.showOnCreate&&ee(),x.addEventListener("mouseenter",(function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&S().addEventListener("mousemove",g)})),v;function E(){var e=v.props.touch;return Array.isArray(e)?e:[e,0]}function C(){return"hold"===E()[0]}function T(){var e;return!(null==(e=v.props.render)||!e.$$tippy)}function O(){return l||e}function S(){var e=O().parentNode;return e?pu(e):document}function A(){return Ou(x)}function N(e){return v.state.isMounted&&!v.state.isVisible||mu.isTouch||o&&"focus"===o.type?0:Xl(v.props.delay,e?0:1,xu.delay)}function _(e){void 0===e&&(e=!1),x.style.pointerEvents=v.props.interactive&&!e?"":"none",x.style.zIndex=""+v.props.zIndex}function j(e,t,n){var r;(void 0===n&&(n=!0),D.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=v.props)[e].apply(r,t)}function I(){var t=v.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;nu(v.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(v.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function L(){!k&&v.props.aria.expanded&&nu(v.props.triggerTarget||e).forEach((function(e){v.props.interactive?e.setAttribute("aria-expanded",v.state.isVisible&&e===O()?"true":"false"):e.removeAttribute("aria-expanded")}))}function z(){S().removeEventListener("mousemove",g),Nu=Nu.filter((function(e){return e!==g}))}function P(t){if(!mu.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!v.props.interactive||!fu(x,n)){if(nu(v.props.triggerTarget||e).some((function(e){return fu(e,n)}))){if(mu.isTouch)return;if(v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[v,t]);!0===v.props.hideOnClick&&(v.clearDelayTimeouts(),v.hide(),p=!0,setTimeout((function(){p=!1})),v.state.isMounted||U())}}}function F(){h=!0}function R(){h=!1}function B(){var e=S();e.addEventListener("mousedown",P,!0),e.addEventListener("touchend",P,Gl),e.addEventListener("touchstart",R,Gl),e.addEventListener("touchmove",F,Gl)}function U(){var e=S();e.removeEventListener("mousedown",P,!0),e.removeEventListener("touchend",P,Gl),e.removeEventListener("touchstart",R,Gl),e.removeEventListener("touchmove",F,Gl)}function H(e,t){var n=A().box;function r(e){e.target===n&&(hu(n,"remove",r),t())}if(0===e)return t();hu(n,"remove",s),hu(n,"add",r),s=r}function $(t,n,r){void 0===r&&(r=!1),nu(v.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),m.push({node:e,eventType:t,handler:n,options:r})}))}function V(){var e;C()&&($("touchstart",q,{passive:!0}),$("touchend",Q,{passive:!0})),(e=v.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch($(e,q),e){case"mouseenter":$("mouseleave",Q);break;case"focus":$(wu?"focusout":"blur",K);break;case"focusin":$("focusout",K)}}))}function W(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),m=[]}function q(e){var t,n=!1;if(v.state.isEnabled&&!G(e)&&!p){var r="focus"===(null==(t=o)?void 0:t.type);o=e,l=e.currentTarget,L(),!v.state.isVisible&&lu(e)&&Nu.forEach((function(t){return t(e)})),"click"===e.type&&(v.props.trigger.indexOf("mouseenter")<0||d)&&!1!==v.props.hideOnClick&&v.state.isVisible?n=!0:ee(e),"click"===e.type&&(d=!n),n&&!r&&te(e)}}function Y(e){var t=e.target,n=O().contains(t)||x.contains(t);if("mousemove"!==e.type||!n){var r=Z().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:c}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,s=i.placement.split("-")[0],a=i.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,u="top"===s?a.bottom.y:0,c="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=t.top-r+l>o,h=r-t.bottom-u>o,f=t.left-n+c>o,m=n-t.right-d>o;return p||h||f||m}))})(r,e)&&(z(),te(e))}}function Q(e){G(e)||v.props.trigger.indexOf("click")>=0&&d||(v.props.interactive?v.hideWithInteractivity(e):te(e))}function K(e){v.props.trigger.indexOf("focusin")<0&&e.target!==O()||v.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function G(e){return!!mu.isTouch&&C()!==e.type.indexOf("touch")>=0}function J(){X();var t=v.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,s=t.moveTransition,l=T()?Ou(x).arrow:null,u=o?{getBoundingClientRect:o,contextElement:o.contextElement||O()}:e,c={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(T()){var n=A().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},d=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},c];T()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),v.popperInstance=$l(u,x,Object.assign({},n,{placement:r,onFirstUpdate:a,modifiers:d}))}function X(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Z(){return iu(x.querySelectorAll("[data-tippy-root]"))}function ee(e){v.clearDelayTimeouts(),e&&j("onTrigger",[v,e]),B();var t=N(!0),r=E(),i=r[0],o=r[1];mu.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){v.show()}),t):v.show()}function te(e){if(v.clearDelayTimeouts(),j("onUntrigger",[v,e]),v.state.isVisible){if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=N(!1);t?r=setTimeout((function(){v.state.isVisible&&v.hide()}),t):i=requestAnimationFrame((function(){v.hide()}))}}else U()}}function Iu(e,t){void 0===t&&(t={});var n=xu.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",yu,Gl),window.addEventListener("blur",vu);var r=Object.assign({},t,{plugins:n}),i=uu(e).reduce((function(e,t){var n=t&&ju(t,r);return n&&e.push(n),e}),[]);return au(e)?i[0]:i}Iu.defaultProps=xu,Iu.setDefaultProps=function(e){Object.keys(e).forEach((function(t){xu[t]=e[t]}))},Iu.currentInput=mu,Object.assign({},Ka,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});var Lu={clientX:0,clientY:0},zu=[];function Pu(e){var t=e.clientX,n=e.clientY;Lu={clientX:t,clientY:n}}var Fu={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=pu(e.props.triggerTarget||t),r=!1,i=!1,o=!0,s=e.props;function a(){return"initial"===e.props.followCursor&&e.state.isVisible}function l(){n.addEventListener("mousemove",d)}function u(){n.removeEventListener("mousemove",d)}function c(){r=!0,e.setProps({getReferenceClientRect:null}),r=!1}function d(n){var r=!n.target||t.contains(n.target),i=e.props.followCursor,o=n.clientX,s=n.clientY,a=t.getBoundingClientRect(),l=o-a.left,u=s-a.top;!r&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=o,r=s;"initial"===i&&(n=e.left+l,r=e.top+u);var a="horizontal"===i?e.top:r,c="vertical"===i?e.right:n,d="horizontal"===i?e.bottom:r,p="vertical"===i?e.left:n;return{width:c-p,height:d-a,top:a,right:c,bottom:d,left:p}}})}function p(){e.props.followCursor&&(zu.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",Pu)}(n))}function h(){zu=zu.filter((function(t){return t.instance!==e})),0===zu.filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",Pu)}(n)}return{onCreate:p,onDestroy:h,onBeforeUpdate:function(){s=e.props},onAfterUpdate:function(t,n){var o=n.followCursor;r||void 0!==o&&s.followCursor!==o&&(h(),o?(p(),!e.state.isMounted||i||a()||l()):(u(),c()))},onMount:function(){e.props.followCursor&&!i&&(o&&(d(Lu),o=!1),a()||l())},onTrigger:function(e,t){lu(t)&&(Lu={clientX:t.clientX,clientY:t.clientY}),i="focus"===t.type},onHidden:function(){e.props.followCursor&&(c(),u(),o=!0)}}}};Iu.setDefaultProps({render:Su});class Ru{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:r})=>{const{doc:i,selection:o}=t,{empty:s}=o,a=!i.textBetween(n,r).length&&$s(t.selection);return!(!e.hasFocus()||s||a)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=Iu(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,r,i;const{state:o,composing:s}=e,{doc:a,selection:l}=o,u=t&&t.doc.eq(a)&&t.selection.eq(l);if(s||u)return;this.createTooltip();const{ranges:c}=l,d=Math.min(...c.map((e=>e.$from.pos))),p=Math.max(...c.map((e=>e.$to.pos)));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:o,oldState:t,from:d,to:p}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(i=this.tippyOptions)||void 0===i?void 0:i.getReferenceClientRect)||(()=>{if(Hs(t=o.selection)&&t instanceof ln){const t=e.nodeDOM(d);if(t)return t.getBoundingClientRect()}var t;return wa(e,d,p)})}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Bu=e=>new kn({key:"string"==typeof e.pluginKey?new Tn(e.pluginKey):e.pluginKey,view:t=>new Ru({view:t,...e})});js.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[Bu({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class Uu{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{const{selection:n}=t,{$anchor:r,empty:i}=n,o=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;return!!(e.hasFocus()&&i&&o&&s)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=Iu(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,r,i;const{state:o}=e,{doc:s,selection:a}=o,{from:l,to:u}=a;if(t&&t.doc.eq(s)&&t.selection.eq(a))return;this.createTooltip();(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:o,oldState:t}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(i=this.tippyOptions)||void 0===i?void 0:i.getReferenceClientRect)||(()=>wa(e,l,u))}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}js.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[(e={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow},new kn({key:"string"==typeof e.pluginKey?new Tn(e.pluginKey):e.pluginKey,view:t=>new Uu({view:t,...e})}))]:[];var e}});const Hu=e=>{const[n,r]=i(null);return o((()=>{if(!n)return;if(e.editor.isDestroyed)return;const{pluginKey:t="bubbleMenu",editor:r,tippyOptions:i={},shouldShow:o=null}=e,s=Bu({pluginKey:t,editor:r,element:n,tippyOptions:i,shouldShow:o});return r.registerPlugin(s),()=>r.unregisterPlugin(t)}),[e.editor,n]),t.createElement("div",{ref:r,className:e.className,style:{visibility:"hidden"}},e.children)};class $u extends class extends class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(e,t){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}(ga,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e){this.setOptions({editable:e})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=ys(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(e){if(this.isDestroyed)return;const t="string"==typeof e?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((e=>!e.key.startsWith(t)))});this.view.updateState(n)}createExtensionManager(){const e=[...this.options.enableCoreExtensions?Object.values(fa):[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new As(e,this)}createCommandManager(){this.commandManager=new cs({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Zs(this.options.content,this.schema,this.options.parseOptions),t=Ws(e,this.options.autofocus);this.view=new No(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Mn.create({doc:e,selection:t||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews();this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null===(t=this.capturedTransaction)||void 0===t?void 0:t.step(e)})):void(this.capturedTransaction=e);const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const r=e.getMeta("focus"),i=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return ma(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return Gs(e,null,n)||aa(e,null,n);const r=Js(t,e.schema);return"node"===r?Gs(e,t,n):"mark"===r&&aa(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(e,t){const n=dt.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return Is(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...n,...Ls(this.schema)}})}get isEmpty(){return function(e){var t;const n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}{constructor(){super(...arguments),this.contentComponent=null}}const Vu=({renderers:e})=>t.createElement(t.Fragment,null,Array.from(e).map((([e,t])=>h.createPortal(t.reactElement,t.element,e))));class Wu extends t.Component{constructor(e){super(e),this.editorContentRef=t.createRef(),this.state={renderers:new Map}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews()}}componentWillUnmount(){const{editor:e}=this.props;if(!e)return;if(e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild)return;const t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){const{editor:e,...n}=this.props;return t.createElement(t.Fragment,null,t.createElement("div",{ref:this.editorContentRef,...n}),t.createElement(Vu,{renderers:this.state.renderers}))}}const qu=t.memo(Wu),Yu=n({onDragStart:void 0}),Qu=()=>r(Yu),Ku=e=>{const n=e.as||"div",{nodeViewContentRef:r}=Qu();return t.createElement(n,{...e,ref:r,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style}})},Gu=t.forwardRef(((e,n)=>{const{onDragStart:r}=Qu(),i=e.as||"div";return t.createElement(i,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})}));class Ju{constructor(e,{editor:t,props:n={},as:r="div",className:i=""}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.render()}render(){var e;const n=this.component,r=this.props;(function(e){return!("function"!=typeof e||!e.prototype||!e.prototype.isReactComponent)}(n)||function(e){var t;return!("object"!=typeof e||"Symbol(react.forward_ref)"!==(null===(t=e.$$typeof)||void 0===t?void 0:t.toString()))}(n))&&(r.ref=e=>{this.ref=e}),this.reactElement=t.createElement(n,{...r}),(null===(e=this.editor)||void 0===e?void 0:e.contentComponent)&&this.editor.contentComponent.setState({renderers:this.editor.contentComponent.state.renderers.set(this.id,this)})}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;if(null===(e=this.editor)||void 0===e?void 0:e.contentComponent){const{renderers:e}=this.editor.contentComponent.state;e.delete(this.id),this.editor.contentComponent.setState({renderers:e})}}}class Xu extends class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,a;const{view:l}=this.editor,u=e.target,c=3===u.nodeType?null===(t=u.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(u))||!c)return;let d=0,p=0;if(this.dom!==c){const t=this.dom.getBoundingClientRect(),n=c.getBoundingClientRect(),a=null!==(r=e.offsetX)&&void 0!==r?r:null===(i=e.nativeEvent)||void 0===i?void 0:i.offsetX,l=null!==(o=e.offsetY)&&void 0!==o?o:null===(s=e.nativeEvent)||void 0===s?void 0:s.offsetY;d=n.x-t.x+a,p=n.y-t.y+l}null===(a=e.dataTransfer)||void 0===a||a.setDragImage(this.dom,d,p);const h=ln.create(l.state.doc,this.getPos()),f=l.state.tr.setSelection(h);l.dispatch(f)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(n))))return!1;const r="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!r)return!0;const{isEditable:i}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,a=ln.isSelectable(this.node),l="copy"===e.type,u="paste"===e.type,c="cut"===e.type,d="mousedown"===e.type,p=e.type.startsWith("drag");if(!s&&a&&p&&e.preventDefault(),s&&p&&!o)return e.preventDefault(),!1;if(s&&i&&!o&&d){const e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(()=>{this.isDragging=!1}),{once:!0}))}return!(o||r||l||u||c||d&&a)}ignoreMutation(e){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:e});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&qs()&&this.editor.isFocused){if([...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every((e=>e.isContentEditable)))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command((({tr:t})=>{const n=this.getPos();return t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0}))}deleteNode(){const e=this.getPos(),t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}const n=e=>{const n=this.component,r=this.onDragStart.bind(this);return t.createElement(Yu.Provider,{value:{onDragStart:r,nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&e.appendChild(this.contentDOMElement)}}},t.createElement(n,{...e}))};n.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let r=this.node.isInline?"span":"div";this.options.as&&(r=this.options.as);const{className:i=""}=this.options;this.renderer=new Ju(n,{editor:this.editor,props:e,as:r,className:`node-${this.node.type.name} ${i}`.trim()})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null===(e=this.renderer.element.firstElementChild)||void 0===e?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,t){const n=e=>{this.renderer.updateProps(e)};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){const r=this.node,i=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:r,oldDecorations:i,newNode:e,newDecorations:t,updateProps:()=>n({node:e,decorations:t})})}return e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,n({node:e,decorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function Zu(e,t){return n=>n.editor.contentComponent?new Xu(e,n,t):{}}const ec=(e={},t=[])=>{const[n,r]=i(null),s=function(){const[,e]=i(0);return()=>e((e=>e+1))}();return o((()=>{let t=!0;const n=new $u(e);return r(n),n.on("transaction",(()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t&&s()}))}))})),()=>{n.destroy(),t=!1}}),t),n};var tc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function nc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function rc(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var ic,oc={exports:{}};
2
2
  /*!
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see