@bigbinary/neeto-editor 0.5.2 → 0.5.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 o,useEffect as i,forwardRef as s,cloneElement as a,useLayoutEffect as l,useRef as c,useCallback as u,useImperativeHandle as d}from"react";import*as p from"react-dom";import h,{createPortal as f}from"react-dom";import m from"highlight.js/lib/languages/arduino";import g from"highlight.js/lib/languages/bash";import y from"highlight.js/lib/languages/c";import b from"highlight.js/lib/languages/cpp";import v from"highlight.js/lib/languages/csharp";import w from"highlight.js/lib/languages/css";import x from"highlight.js/lib/languages/diff";import M from"highlight.js/lib/languages/go";import D from"highlight.js/lib/languages/graphql";import k from"highlight.js/lib/languages/ini";import E from"highlight.js/lib/languages/java";import C from"highlight.js/lib/languages/javascript";import T from"highlight.js/lib/languages/json";import O from"highlight.js/lib/languages/kotlin";import A from"highlight.js/lib/languages/less";import N from"highlight.js/lib/languages/lua";import S from"highlight.js/lib/languages/makefile";import _ from"highlight.js/lib/languages/markdown";import j from"highlight.js/lib/languages/objectivec";import I from"highlight.js/lib/languages/perl";import L from"highlight.js/lib/languages/php";import z from"highlight.js/lib/languages/php-template";import P from"highlight.js/lib/languages/plaintext";import F from"highlight.js/lib/languages/python";import R from"highlight.js/lib/languages/python-repl";import B from"highlight.js/lib/languages/r";import U from"highlight.js/lib/languages/ruby";import H from"highlight.js/lib/languages/rust";import $ from"highlight.js/lib/languages/scss";import V from"highlight.js/lib/languages/shell";import W from"highlight.js/lib/languages/sql";import q from"highlight.js/lib/languages/swift";import Y from"highlight.js/lib/languages/typescript";import Q from"highlight.js/lib/languages/vbnet";import K from"highlight.js/lib/languages/wasm";import G from"highlight.js/lib/languages/xml";import J from"highlight.js/lib/languages/yaml";import X from"highlight.js/lib/core";import Z from"highlight.js/lib/common";var ee=[],te=[];function ne(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,i="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var s=ee.indexOf(i);-1===s&&(s=ee.push(i)-1,te[s]={}),n=te[s]&&te[s][r]?te[s][r]:te[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),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var s="prepend"===r?"afterbegin":"beforeend";return i.insertAdjacentElement(s,e),e}}function re(){return re=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},re.apply(this,arguments)}function oe(e){this.content=e}function ie(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let e=0;o.text[e]==i.text[e];e++)n++;return n}if(o.content.size||i.content.size){let e=ie(o.content,i.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function se(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=e.child(--o),a=t.child(--i),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=se(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}ne('@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}\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 figure, .neeto-editor figure {\n margin: 8px;\n}\n.neeto-editor-content figure figcaption, .neeto-editor figure figcaption {\n color: #49545c;\n text-align: center;\n}\n.neeto-editor-content figure:focus, .neeto-editor figure:focus {\n display: hidden;\n}\n.neeto-editor-content .image-float-left, .neeto-editor .image-float-left {\n float: left;\n margin-left: 0;\n}\n.neeto-editor-content .image-float-right, .neeto-editor .image-float-right {\n float: right;\n margin-right: 0;\n}\n.neeto-editor-content .image-float-none, .neeto-editor .image-float-none {\n float: none;\n}\n.neeto-editor-content .image-size-small, .neeto-editor .image-size-small {\n display: inline;\n}\n.neeto-editor-content .image-size-small img, .neeto-editor .image-size-small img {\n height: 100%;\n max-height: 384px;\n max-width: 500px;\n -o-object-fit: contain;\n object-fit: contain;\n margin: auto;\n}\n.neeto-editor-content .image-size-large, .neeto-editor .image-size-large {\n width: 100%;\n}\n.neeto-editor-content .image-align-center, .neeto-editor .image-align-center {\n margin: 0 auto;\n}\n.neeto-editor-content .image-banner, .neeto-editor .image-banner {\n width: 100%;\n max-height: 300px;\n overflow: hidden;\n -o-object-fit: cover;\n object-fit: cover;\n}\n.neeto-editor-content figure.ProseMirror-selectednode, .neeto-editor figure.ProseMirror-selectednode {\n outline: none;\n}\n.neeto-editor-content figure.ProseMirror-selectednode img, .neeto-editor figure.ProseMirror-selectednode img {\n -webkit-user-select: auto;\n -moz-user-select: auto;\n user-select: auto;\n}\n.neeto-editor-content--hidden {\n display: none;\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: flex-start;\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 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,o=r.find(e),i=r.content.slice();return-1==o?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new oe(i)},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),o=r.content.slice(),i=r.find(e);return o.splice(-1==i?o.length:i,0,t,n),new oe(o)},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 ae{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,o){for(let i=0,s=0;s<t;i++){let a=this.content[i],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,e-o),Math.min(a.content.size,t-o),n,r+o)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(e,a)-a,t-a),i=!n):s.isLeaf?(r?o+="function"==typeof r?r(s):r:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new ae(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 o=0,i=0;i<t;o++){let s=this.content[o],a=i+s.nodeSize;a>e&&((i<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),n.push(s),r+=s.nodeSize),i=a}return new ae(n,r)}cutByIndex(e,t){return e==t?ae.empty:0==e&&t==this.content.length?this:new ae(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new ae(r,o)}addToStart(e){return new ae([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ae(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 ie(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return se(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 o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?ce(n+1,o):ce(n,r);r=o}}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 ae.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ae(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ae.empty;let t,n=0;for(let r=0;r<e.length;r++){let o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new ae(t||e,n)}static from(e){if(!e)return ae.empty;if(e instanceof ae)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ae([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ae.empty=new ae([],0);const le={index:0,offset:0};function ce(e,t){return le.index=e,le.offset=t,le}function ue(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(!ue(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!ue(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class de{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}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&&ue(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 de.none;if(e instanceof de)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}de.none=[];class pe extends Error{}class he{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=me(this.content,e+this.openStart,t);return n&&new he(n,this.openStart,this.openEnd)}removeBetween(e,t){return new he(fe(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 he.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 he(ae.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 he(e,n,r)}}function fe(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(o==t||i.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,i.copy(fe(i.content,t-o-1,n-o-1)))}function me(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=me(s.content,t-i-1,n);return a&&e.replaceChild(o,s.copy(a))}function ge(e,t,n){if(n.openStart>e.depth)throw new pe("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new pe("Inconsistent open depths");return ye(e,t,n,0)}function ye(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let s=ye(e,t,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:o,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(ae.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Me(i,De(e,o,s,t,r))}{let r=e.parent,o=r.content;return Me(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return Me(i,ke(e,t,r))}function be(e,t){if(!t.type.compatibleContent(e.type))throw new pe("Cannot join "+t.type.name+" onto "+e.type.name)}function ve(e,t,n){let r=e.node(n);return be(r,t.node(n)),r}function we(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 xe(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(we(e.nodeAfter,r),i++));for(let e=i;e<s;e++)we(o.child(e),r);t&&t.depth==n&&t.textOffset&&we(t.nodeBefore,r)}function Me(e,t){if(!e.type.validContent(t))throw new pe("Invalid content for node "+e.type.name);return e.copy(t)}function De(e,t,n,r,o){let i=e.depth>o&&ve(e,t,o+1),s=r.depth>o&&ve(n,r,o+1),a=[];return xe(null,e,o,a),i&&s&&t.index(o)==n.index(o)?(be(i,s),we(Me(i,De(e,t,n,r,o+1)),a)):(i&&we(Me(i,ke(e,t,o+1)),a),xe(t,n,o,a),s&&we(Me(s,ke(n,r,o+1)),a)),xe(r,null,o,a),new ae(a)}function ke(e,t,n){let r=[];if(xe(null,e,n,r),e.depth>n){we(Me(ve(e,t,n+1),ke(e,t,n+1)),r)}return xe(t,null,n,r),new ae(r)}he.empty=new he(ae.empty,0,0);class Ee{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 de.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 o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}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 o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].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,o=t;for(let t=e;;){let{index:e,offset:i}=t.content.findIndex(o),s=o-i;if(n.push(t,e,r+i),!s)break;if(t=t.child(e),t.isText)break;o=s-1,r+=i+1}return new Ee(t,n,o)}static resolveCached(e,t){for(let n=0;n<Ce.length;n++){let r=Ce[n];if(r.pos==t&&r.doc==e)return r}let n=Ce[Te]=Ee.resolve(e,t);return Te=(Te+1)%Oe,n}}let Ce=[],Te=0,Oe=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 Se{constructor(e,t,n,r=de.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||ae.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&&ue(this.attrs,t||e.defaultAttrs||Ne)&&de.sameSet(this.marks,n||de.none)}copy(e=null){return e==this.content?this:new Se(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Se(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 he.empty;let r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new he(a,r.depth-i,o.depth-i)}replace(e,t,n){return ge(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 Ee.resolveCached(this,e)}resolveNoCache(e){return Ee.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()+")"),je(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=ae.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<o;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 o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.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=de.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!de.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=ae.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}Se.prototype.text=void 0;class _e extends Se{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):je(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 _e(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new _e(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 je(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Ie{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Le(e,t);if(null==n.next)return Ie.empty;let r=ze(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return n(He(e,0));function n(r){let o=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<o.length;e++)o[e][0]==t&&(r=o[e][1]);He(e,n).forEach((e=>{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let i=t[r.join(",")]=new Ie(r.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let r=o[e][1].sort(Ue);i.next.push({type:o[e][0],next:t[r.join(",")]||n(r)})}return i}}(function(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach((e=>e.to=t))}function i(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(i(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),o(i(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return o(i(e.expr,t),s),o(i(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(i(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();o(i(e.expr,s),t),s=t}if(-1==e.max)o(i(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),o(i(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=i(e.exprs[r],t);if(r==e.exprs.length-1)return s;o(s,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}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 o=t;r&&o<n;o++)r=r.matchType(e.child(o).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 o(i,s){let a=i.matchFragment(e,n);if(a&&(!t||a.validEnd))return ae.from(s.map((e=>e.createAndFill())));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=o(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(),o=r.match;if(o.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<o.next.length;e++){let{type:i,next:s}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.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")}}Ie.empty=new Ie(!0);class Le{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 ze(e){let t=[];do{t.push(Pe(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Pe(e){let t=[];do{t.push(Fe(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Fe(e){let t=function(e){if(e.eat("(")){let t=ze(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 o=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&o.push(r)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(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=Be(e,t)}return t}function Re(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Be(e,t){let n=Re(e),r=n;return e.eat(",")&&(r="}"!=e.next?Re(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Ue(e,t){return t-e}function He(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(Ue)}function $e(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 Ve(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(void 0===o){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=t.default}n[r]=o}return n}function We(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Ye(e[n]);return t}class qe{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=We(n.attrs),this.defaultAttrs=$e(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==Ie.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:Ve(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Se(this,this.computeAttrs(e),ae.from(t),de.setFrom(n))}createChecked(e=null,t,n){if(t=ae.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new Se(this,this.computeAttrs(e),t,de.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=ae.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(ae.empty,!0);return o?new Se(this,e,t.append(o),de.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:de.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new qe(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 Ye{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Qe{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=We(r.attrs),this.excluded=null;let o=$e(this.attrs);this.instance=o?new de(this,o):null}create(e=null){return!e&&this.instance?this.instance:new de(this,Ve(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,o)=>n[e]=new Qe(e,r++,t,o))),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 Ke{constructor(e){this.cached=Object.create(null),this.spec={nodes:oe.from(e.nodes),marks:oe.from(e.marks||{}),topNode:e.topNode},this.nodes=qe.compile(this.spec.nodes,this),this.marks=Qe.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||"",o=n.spec.marks;n.contentMatch=t[r]||(t[r]=Ie.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==o?null:o?Ge(this,o.split(" ")):""!=o&&n.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Ge(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 qe))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 _e(n,n.defaultAttrs,e,de.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Se.fromJSON(this,e)}markFromJSON(e){return de.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Ge(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Je{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 st(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new st(this,t,!0);return n.addAll(e,t.from,t.to),he.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(at(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 o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(e)||r.context&&!n.matchesContext(r.context)||i.length>e.length&&(61!=i.charCodeAt(e.length)||i.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=lt(e)),e.mark=t}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=lt(e)),e.node=t}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Je(e,Je.schemaRules(e)))}}const Xe={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},Ze={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},et={ol:!0,ul:!0},tt=1,nt=2,rt=4;function ot(e,t,n){return null!=t?(t?tt:0)|("full"===t?nt:0):e&&"pre"==e.whitespace?tt|nt:n&~rt}class it{constructor(e,t,n,r,o,i,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=de.none,this.stashMarks=[],this.match=i||(s&rt?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(ae.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&tt)){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=ae.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(ae.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&&!Xe.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class st{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,o=t.topNode,i=ot(null,t.preserveWhitespace,0)|(n?rt:0);r=o?new it(o.type,o.attrs,de.none,de.none,!0,t.topMatch||o.type.contentMatch,i):new it(n?null:e.schema.topNodeType,null,de.none,de.none,!0,null,i),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&nt||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&tt)t=n.options&nt?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],o=e.previousSibling;(!r||o&&"BR"==o.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();et.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&&et.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(o?o.ignore:Ze.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let t,n=this.top,i=this.needsBlock;if(Xe.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=i}else this.addElementByRule(e,o,!1===o.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=de.none;e:for(let n=0;n<e.length;n+=2)for(let r;;){let o=this.parser.matchStyle(e[n],e[n+1],this,r);if(!o)continue e;if(o.ignore)return null;if(t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),!1!==o.consuming)break;r=o}return t}addElementByRule(e,t,n){let r,o,i;if(t.node)o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):r=this.enter(o,t.attrs||null,t.preserveWhitespace);else{i=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(i)}let s=this.top;if(o&&o.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--,i&&this.removePendingMark(i,s)}addAll(e,t,n){let r=t||0;for(let o=t?e.childNodes[t]:e.firstChild,i=null==n?null:e.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.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 o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let i=ot(e,r,o.options);o.options&rt&&0==o.content.length&&(i|=rt),this.nodes.push(new it(e,t,o.activeMarks,o.pendingMarks,n,null,i)),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),o=-(n?n.depth+1:0)+(r?0:1),i=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return i(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 at(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function lt(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 o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class ut{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=pt(t).createDocumentFragment());let r=n,o=[];return e.forEach((e=>{if(o.length||e.marks.length){let n=0,i=0;for(;n<o.length&&i<e.marks.length;){let t=e.marks[i];if(this.marks[t.type.name]){if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],s=this.serializeMark(n,e.isInline,t);s&&(o.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}=ut.renderSpec(pt(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 o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&ut.renderSpec(pt(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,o=t[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s=n?e.createElementNS(n,o):e.createElement(o),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 o=l;o<t.length;o++){let i=t[o];if(0===i){if(o<t.length-1||o>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:o}=ut.renderSpec(e,i,n);if(s.appendChild(t),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ut(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=dt(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return dt(e.marks)}}function dt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function pt(e){return e.document||window.document}const ht=65535,ft=Math.pow(2,16);function mt(e,t){return e+t*ft}function gt(e){return e&ht}const yt=1,bt=2,vt=4,wt=8;class xt{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&wt)>0}get deletedBefore(){return(this.delInfo&(yt|vt))>0}get deletedAfter(){return(this.delInfo&(bt|vt))>0}get deletedAcross(){return(this.delInfo&vt)>0}}class Mt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Mt.empty)return Mt.empty}recover(e){let t=0,n=gt(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&ht))/ft}(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,o=this.inverted?2:1,i=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+o],c=this.ranges[s+i],u=a+l;if(e<=u){let o=a+r+((l?e==a?-1:e==u?1:t:t)<0?0:c);if(n)return o;let i=e==(t<0?a:u)?null:mt(s/3,e-a),d=e==a?bt:e==u?yt:vt;return(t<0?e!=a:e!=u)&&(d|=wt),new xt(o,d,i)}r+=c-l}return n?e+r:new xt(e+r,0,null)}touches(e,t){let n=0,r=gt(t),o=this.inverted?2:1,i=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+o];if(e<=s+a&&t==3*r)return!0;n+=this.ranges[t+i]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),o+=c-l}}invert(){return new Mt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Mt.empty:new Mt(e<0?[0,-e,0]:[0,0,e])}}Mt.empty=new Mt([]);class Dt{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 Dt(this.maps,this.mirror,e,t)}copy(){return new Dt(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 Dt;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 o=this.maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return n?e:new xt(e,r,null)}}const kt=Object.create(null);class Et{getMap(){return Mt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=kt[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 kt)throw new RangeError("Duplicate use of step JSON ID "+e);return kt[e]=t,t.prototype.jsonID=e,t}}class Ct{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Ct(e,null)}static fail(e){return new Ct(null,e)}static fromReplace(e,t,n,r){try{return Ct.ok(e.replace(t,n,r))}catch(e){if(e instanceof pe)return Ct.fail(e.message);throw e}}}function Tt(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(Tt(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return ae.fromArray(r)}class Ot extends Et{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)),o=new he(Tt(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 Ct.fromReplace(e,this.from,this.to,o)}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 Ot(t.pos,n.pos,this.mark)}merge(e){return e instanceof Ot&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ot(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 Ot(t.from,t.to,e.markFromJSON(t.mark))}}Et.jsonID("addMark",Ot);class At extends Et{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 he(Tt(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Ct.fromReplace(e,this.from,this.to,n)}invert(){return new Ot(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))}}Et.jsonID("removeMark",At);class Nt extends Et{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&_t(e,this.from,this.to)?Ct.fail("Structure replace would overwrite content"):Ct.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Mt([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?he.empty:new he(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?he.empty:new he(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,he.fromJSON(e,t.slice),!!t.structure)}}Et.jsonID("replace",Nt);class St extends Et{constructor(e,t,n,r,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(_t(e,this.from,this.gapFrom)||_t(e,this.gapTo,this.to)))return Ct.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ct.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Ct.fromReplace(e,this.from,this.to,n):Ct.fail("Content does not fit in gap")}getMap(){return new Mt([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 St(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),o=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||o>n.pos?null:new St(t.pos,n.pos,r,o,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 St(t.from,t.to,t.gapFrom,t.gapTo,he.fromJSON(e,t.slice),t.insert,!!t.structure)}}function _t(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function jt(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function It(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(o,i,t))return n;if(0==n||r.type.spec.isolating||!jt(r,o,i))break}return null}function Lt(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<o;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return i?o.map(zt).concat({type:t,attrs:n}).concat(i.map(zt)):null}function zt(e){return{type:e,attrs:null}}function Pt(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>i;e--,t--){let n=o.node(e),i=o.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function Ft(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 Rt(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.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,i=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(i,i,o);else{let e=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=e&&s.canReplaceWith(i,i,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Bt(e,t,n=t,r=he.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return Ut(o,i,r)?new Nt(t,n,r):new Ht(o,i,r).fit()}function Ut(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Et.jsonID("replaceAround",St);class Ht{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=ae.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=ae.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 o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new he(o,i,s);return e>-1?new St(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=Wt(this.unplaced.content,t-1).firstChild,n=r.content):n=this.unplaced.content;let o=n.firstChild;for(let n=this.depth;n>=0;n--){let i,{type:s,match:a}=this.frontier[n],l=null;if(1==e&&(o?a.matchType(o.type)||(l=a.fillBefore(ae.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:t,frontierDepth:n,parent:r,inject:l};if(2==e&&o&&(i=a.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:n,parent:r,wrap:i};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Wt(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new he(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=Wt(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new he($t(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new he($t(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let i=this.unplaced,s=n?n.content:i.content,a=i.openStart-e,l=0,c=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));u=u.matchFragment(r)}let p=s.size+e-(i.content.size-i.openEnd);for(;l<s.childCount;){let e=s.child(l),t=u.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(u=t,c.push(qt(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=Vt(this.placed,t,ae.from(c)),this.frontier[t].match=u,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?he.empty:new he($t(i.content,e-1,1),e-1,p<0?i.openEnd:e-1):new he($t(i.content,e,l),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Yt(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],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=Yt(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=Yt(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:i,move:o?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=Vt(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=Vt(this.placed,this.depth,ae.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(ae.empty,!0);e.childCount&&(this.placed=Vt(this.placed,this.frontier.length,e))}}function $t(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy($t(e.firstChild.content,t-1,n)))}function Vt(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Vt(e.lastChild.content,t-1,n)))}function Wt(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function qt(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,qt(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(ae.empty,!0)))),e.copy(r)}function Yt(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.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,i.content,s)?a:null}function Qt(e){return e.spec.defining||e.spec.definingForContent}function Kt(e,t,n,r,o){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(Kt(o.content,t+1,n,r,o)))}if(t>r){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(ae.empty,!0))}return e}function Gt(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(o<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;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}let Jt=class extends Error{};Jt=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Jt.prototype=Object.create(Error.prototype)).constructor=Jt,Jt.prototype.name="TransformError";class Xt{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Dt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Jt(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=he.empty){let r=Bt(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new he(ae.from(n),0,0))}delete(e,t){return this.replace(e,t,he.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 o=e.doc.resolve(t),i=e.doc.resolve(n);if(Ut(o,i,r))return e.step(new Nt(t,n,r));let s=Gt(o,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:o.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),c=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=c[e].type,n=Qt(t);if(n&&o.node(l).type!=t)u=e;else if(n||!t.isTextblock)break}for(let t=r.openStart;t>=0;t--){let a=(t+u+1)%(r.openStart+1),d=c[a];if(d)for(let t=0;t<s.length;t++){let c=s[(t+l)%s.length],u=!0;c<0&&(u=!1,c=-c);let p=o.node(c-1),h=o.index(c-1);if(p.canReplaceWith(h,h,d.type,d.marks))return e.replace(o.before(c),u?i.after(c):n,new he(Kt(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=o.before(e),n=i.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 o=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!=o&&(t=n=o)}e.replaceRange(t,n,new he(ae.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=Gt(r,o);for(let t=0;t<i.length;t++){let n=i[t],s=t==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return e.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i)return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:o,depth:i}=t,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=ae.empty,d=0;for(let e=i,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=ae.from(r.node(e).copy(u)),d++):l--;let p=ae.empty,h=0;for(let e=i,t=!1;e>n;e--)t||o.after(e+1)<o.end(e)?(t=!0,p=ae.from(o.node(e).copy(p)),h++):c++;e.step(new St(l,c,s,a,new he(u.append(p),d,h),u.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=new Nt(t-n,t+n,he.empty,!0);e.step(r)}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=ae.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=ae.from(n[e].type.create(n[e].attrs,r))}let o=t.start,i=t.end;e.step(new St(o,i,o,i,new he(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,o)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(i).map(n),r)){e.clearIncompatible(e.mapping.slice(i).map(n,1),r);let s=e.mapping.slice(i),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new St(a,l,a+1,l-1,new he(ae.from(r.create(o,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,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new St(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new he(ae.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 o=e.doc.resolve(t),i=ae.empty,s=ae.empty;for(let e=o.depth,t=o.depth-n,a=n-1;e>t;e--,a--){i=ae.from(o.node(e).copy(i));let t=r&&r[a];s=ae.from(t?t.type.create(t.attrs,s):o.node(e).copy(s))}e.step(new Nt(t,t,new he(i.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let o,i,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),d=Math.min(l+e.nodeSize,n),p=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(p)||(o&&o.to==c&&o.mark.eq(u[e])?o.to=d:s.push(o=new At(c,d,u[e])));i&&i.to==c?i.to=d:a.push(i=new Ot(c,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 o=[],i=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;i++;let a=null;if(r instanceof Qe){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<o.length;e++){let t=o[e];t.step==i-1&&l.eq(o[e].style)&&(n=t)}n?(n.to=r,n.step=i):o.push({style:l,from:Math.max(s,t),to:r,step:i})}}})),o.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 o=e.doc.nodeAt(t),i=[],s=t+1;for(let t=0;t<o.childCount;t++){let a=o.child(t),l=s+a.nodeSize,c=r.matchType(a.type);if(c){r=c;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 i.push(new Nt(s,l,he.empty));s=l}if(!r.validEnd){let t=r.fillBefore(ae.empty,!0);e.replace(s,s,new he(t,0,0))}for(let t=i.length-1;t>=0;t--)e.step(i[t])}(this,e,t,n),this}}const Zt=Object.create(null);class en{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new tn(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=he.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=e.mapping.slice(o);e.replaceRange(c.map(a.pos),c.map(l.pos),s?he.empty:t),0==s&&pn(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=e.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),pn(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new on(e):dn(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 o=t<0?dn(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):dn(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}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 dn(e,e,0,0,1)||new cn(e)}static atEnd(e){return dn(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=Zt[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 Zt)throw new RangeError("Duplicate use of selection JSON ID "+e);return Zt[e]=t,t.prototype.jsonID=e,t}getBookmark(){return on.between(this.$anchor,this.$head).getBookmark()}}en.prototype.visible=!0;class tn{constructor(e,t){this.$from=e,this.$to=t}}let nn=!1;function rn(e){nn||e.parent.inlineContent||(nn=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class on extends en{constructor(e,t=e){rn(e),rn(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 en.near(n);let r=e.resolve(t.map(this.anchor));return new on(r.parent.inlineContent?r:n,n)}replace(e,t=he.empty){if(super.replace(e,t),t==he.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof on&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new sn(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 on(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=en.findFrom(t,n,!0)||en.findFrom(t,-n,!0);if(!e)return en.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(en.findFrom(e,-n,!0)||en.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new on(e,t)}}en.jsonID("text",on);class sn{constructor(e,t){this.anchor=e,this.head=t}map(e){return new sn(e.map(this.anchor),e.map(this.head))}resolve(e){return on.between(e.resolve(this.anchor),e.resolve(this.head))}}class an extends en{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),o=e.resolve(r);return n?en.near(o):new an(o)}content(){return new he(ae.from(this.node),0,0)}eq(e){return e instanceof an&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ln(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new an(e.resolve(t.anchor))}static create(e,t){return new an(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}an.prototype.visible=!1,en.jsonID("node",an);class ln{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new sn(n,n):new ln(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&an.isSelectable(n)?new an(t):en.near(t)}}class cn extends en{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=he.empty){if(t==he.empty){e.delete(0,e.doc.content.size);let t=en.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 un}}en.jsonID("all",cn);const un={map(){return this},resolve:e=>new cn(e)};function dn(e,t,n,r,o,i=!1){if(t.inlineContent)return on.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&an.isSelectable(r))return an.create(e,n-(o<0?r.nodeSize:0))}else{let t=dn(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function pn(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,i=e.steps[r];(i instanceof Nt||i instanceof St)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==o&&(o=r)})),e.setSelection(en.near(e.doc.resolve(o),n)))}const hn=1,fn=2,mn=4;class gn extends Xt{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|hn)&~fn,this.storedMarks=null,this}get selectionSet(){return(this.updated&hn)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=fn,this}ensureMarks(e){return de.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&fn)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~fn,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)||de.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 o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(en.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|=mn,this}get scrolledIntoView(){return(this.updated&mn)>0}}function yn(e,t){return t&&e?e.bind(t):e}class bn{constructor(e,t,n){this.name=e,this.init=yn(t.init,n),this.apply=yn(t.apply,n)}}const vn=[new bn("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new bn("selection",{init:(e,t)=>e.selection||en.atStart(t.doc),apply:e=>e.selection}),new bn("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new bn("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class wn{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=vn.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 bn(e.key,e.spec.state,e))}))}}class xn{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 o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let a=r?r[i].n:0,l=r?r[i].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new xn(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new gn(this)}static create(e){let t=new wn(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new xn(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 wn(this.schema,e.plugins),n=t.fields,r=new xn(t);for(let t=0;t<n.length;t++){let o=n[t].name;r[o]=this.hasOwnProperty(o)?this[o]: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],o=r.spec.state;o&&o.toJSON&&(t[n]=o.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 wn(e.schema,e.plugins),o=new xn(r);return r.fields.forEach((r=>{if("doc"==r.name)o.doc=Se.fromJSON(e.schema,t.doc);else if("selection"==r.name)o.selection=en.fromJSON(o.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,i))return void(o[r.name]=a.fromJSON.call(s,e,t[i],o))}o[r.name]=r.init(e,o)}})),o}}function Mn(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=Mn(o,t,{})),n[r]=o}return n}class Dn{constructor(e){this.spec=e,this.props={},e.props&&Mn(e.props,this,this.props),this.key=e.key?e.key.key:En("plugin")}getState(e){return e[this.key]}}const kn=Object.create(null);function En(e){return e in kn?e+"$"+ ++kn[e]:(kn[e]=0,e+"$")}class Cn{constructor(e="key"){this.key=En(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Tn="undefined"!=typeof navigator?navigator:null,On="undefined"!=typeof document?document:null,An=Tn&&Tn.userAgent||"",Nn=/Edge\/(\d+)/.exec(An),Sn=/MSIE \d/.exec(An),_n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(An),jn=!!(Sn||_n||Nn),In=Sn?document.documentMode:_n?+_n[1]:Nn?+Nn[1]:0,Ln=!jn&&/gecko\/(\d+)/i.test(An);Ln&&(/Firefox\/(\d+)/.exec(An)||[0,0])[1];const zn=!jn&&/Chrome\/(\d+)/.exec(An),Pn=!!zn,Fn=zn?+zn[1]:0,Rn=!jn&&!!Tn&&/Apple Computer/.test(Tn.vendor),Bn=Rn&&(/Mobile\/\w+/.test(An)||!!Tn&&Tn.maxTouchPoints>2),Un=Bn||!!Tn&&/Mac/.test(Tn.platform),Hn=/Android \d/.test(An),$n=!!On&&"webkitFontSmoothing"in On.documentElement.style,Vn=$n?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Wn=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},qn=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let Yn=null;const Qn=function(e,t,n){let r=Yn||(Yn=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Kn=function(e,t,n,r){return n&&(Jn(e,t,n,r,-1)||Jn(e,t,n,r,1))},Gn=/^(img|br|input|textarea|hr)$/i;function Jn(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Xn(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Zn(e)||Gn.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Wn(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?Xn(e):0}}}function Xn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Zn(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 er=function(e){let t=e.isCollapsed;return t&&Pn&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function tr(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function nr(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function rr(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 ir(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;s=qn(s)){if(1!=s.nodeType)continue;let e=s,n=e==i.body,a=n?nr(i):or(e),l=0,c=0;if(t.top<a.top+rr(r,"top")?c=-(a.top-t.top+rr(o,"top")):t.bottom>a.bottom-rr(r,"bottom")&&(c=t.bottom-a.bottom+rr(o,"bottom")),t.left<a.left+rr(r,"left")?l=-(a.left-t.left+rr(o,"left")):t.right>a.right-rr(r,"right")&&(l=t.right-a.right+rr(o,"right")),l||c)if(n)i.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let o=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}if(n)break}}function sr(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=qn(r));return t}function ar(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let lr=null;function cr(e,t){let n,r,o=2e8,i=0,s=t.top,a=t.top;for(let l=e.firstChild,c=0;l;l=l.nextSibling,c++){let e;if(1==l.nodeType)e=l.getClientRects();else{if(3!=l.nodeType)continue;e=Qn(l).getClientRects()}for(let u=0;u<e.length;u++){let d=e[u];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<o){n=l,o=e,r=e&&3==n.nodeType?{left:d.right<t.left?d.right:d.left,top:t.top}:t,1==l.nodeType&&e&&(i=c+(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)&&(i=c+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=hr(r,1);if(n.top!=n.bottom&&ur(t,n))return{node:e,offset:o+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:i}:cr(n,r)}function ur(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function dr(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=e.childNodes[i];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let o=e[r];if(ur(t,o))return dr(n,t,o)}}if((i=(i+1)%r)==o)break}return e}function pr(e,t){let n,r=e.dom.ownerDocument,o=0;if(r.caretPositionFromPoint)try{let e=r.caretPositionFromPoint(t.left,t.top);e&&({offsetNode:n,offset:o}=e)}catch(e){}if(!n&&r.caretRangeFromPoint){let e=r.caretRangeFromPoint(t.left,t.top);e&&({startContainer:n,startOffset:o}=e)}let i,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(!ur(t,n))return null;if(s=dr(e.dom,t,n),!s)return null}if(Rn)for(let e=s;n&&e;e=qn(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(Ln&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let e,r=n.childNodes[o];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&o++}n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(i=function(e,t,n,r){let o=-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)o=t.posBefore;else{if(!(e.right<r.left||e.bottom<r.top))break;o=t.posAfter}}n=t.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,1)}(e,n,o,t))}null==i&&(i=function(e,t,n){let{node:r,offset:o}=cr(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:i,inside:a?a.posAtStart-a.border:-1}}function hr(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const fr=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function mr(e,t,n){let{node:r,offset:o}=e.docView.domFromPos(t,n<0?-1:1),i=$n||Ln;if(3==r.nodeType){if(!i||!fr.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let e=o,t=o,i=n<0?1:-1;return n<0&&!o?(t++,i=-1):n>=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,gr(hr(Qn(r,e,t),i),i<0)}{let e=hr(Qn(r,o,o),n);if(Ln&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=hr(Qn(r,o-1,o-1),-1);if(t.top==e.top){let n=hr(Qn(r,o,o+1),-1);if(n.top!=e.top)return gr(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t).parent.inlineContent){if(o&&(n<0||o==Xn(r))){let e=r.childNodes[o-1];if(1==e.nodeType)return yr(e.getBoundingClientRect(),!1)}if(o<Xn(r)){let e=r.childNodes[o];if(1==e.nodeType)return yr(e.getBoundingClientRect(),!0)}return yr(r.getBoundingClientRect(),n>=0)}if(o&&(n<0||o==Xn(r))){let e=r.childNodes[o-1],t=3==e.nodeType?Qn(e,Xn(e)-(i?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return gr(hr(t,1),!1)}if(o<Xn(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Qn(e,0,i?0:1):1==e.nodeType?e:null:null;if(t)return gr(hr(t,-1),!0)}return gr(hr(3==r.nodeType?Qn(r):r,-n),n>=0)}function gr(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 yr(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 br(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}const vr=/[\u0590-\u08ac]/;let wr=null,xr=null,Mr=!1;function Dr(e,t,n){return wr==t&&xr==n?Mr:(wr=t,xr=n,Mr="up"==n||"down"==n?function(e,t,n){let r=t.selection,o="up"==n?r.$from:r.$to;return br(e,t,(()=>{let{node:t}=e.docView.domFromPos(o.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=mr(e,o.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=Qn(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=e.domSelection();return vr.test(r.parent.textContent)&&a.modify?br(e,t,(()=>{let t=a.getRangeAt(0),o=a.focusNode,i=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)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?i:s}(e,t,n))}const kr=0,Er=1,Cr=2,Tr=3;class Or{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=kr,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>Wn(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 o,i=this.getDesc(r);if(i&&(!t||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;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 o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0};let n,r=0,o=0;for(let t=0;r<this.children.length;r++){let n=this.children[r],i=t+n.size;if(i>e||n instanceof Lr){o=e-t;break}t=i}if(o)return this.children[r].domFromPos(o-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?Wn(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?Wn(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,o=-1;for(let i=n,s=0;;s++){let n=this.children[s],a=i+n.size;if(-1==r&&e<=a){let o=i+n.border;if(e>=o&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=i;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=Wn(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)){o=Wn(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}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 o=Math.min(e,t),i=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(o>a&&i<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),c=!1;if((Ln||Rn)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(c=!(!t||"\n"!=e.nodeValue[t-1]),c&&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:Wn(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(Ln&&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||c&&Rn)&&Kn(s.node,s.offset,l.anchorNode,l.anchorOffset)&&Kn(a.node,a.offset,l.focusNode,l.focusOffset))return;let u=!1;if((l.extend||e==t)&&!c){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),u=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!u){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 o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let r=n+o.border,s=i-o.border;if(e>=r&&t<=s)return this.dirty=e==n||t==i?Cr:Er,void(e!=r||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-r,t-r):o.dirty=Tr);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?Tr:Cr}n=i}this.dirty=Cr}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?Cr:Er;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Ar extends Or{constructor(e,t,n,r){let o,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,(()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r))),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==kr&&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 Or{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 Sr extends Or{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let o=r.nodeViews[t.type.name],i=o&&o(t,r,n);return i&&i.dom||(i=ut.renderSpec(document,t.type.spec.toDOM(t,n))),new Sr(e,t,i.dom,i.contentDOM||i.dom)}parseRule(){return this.dirty&Tr||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!=Tr&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=kr){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=kr}}slice(e,t,n){let r=Sr.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;t<i&&(o=Qr(o,t,i,n)),e>0&&(o=Qr(o,0,e,n));for(let e=0;e<o.length;e++)o[e].parent=r;return r.children=o,r}}class _r extends Or{constructor(e,t,n,r,o,i,s,a,l){super(e,[],o,i),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s,i&&this.updateChildren(a,l)}static create(e,t,n,r,o,i){let s,a=o.nodeViews[t.type.name],l=a&&a(t,o,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:i),n,r),c=l&&l.dom,u=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else c||({dom:c,contentDOM:u}=ut.renderSpec(document,t.type.spec.toDOM(t)));u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return c=$r(c,n,t),l?s=new zr(e,t,n,r,c,u||null,d,l,o,i+1):t.isText?new Ir(e,t,n,r,c,d,o):new _r(e,t,n,r,c,u||null,d,o,i+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=()=>ae.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return this.dirty==kr&&e.eq(this.node)&&Vr(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,o=e.composing?this.localCompositionInfo(e,t):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new qr(this,i&&i.node);!function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,o,t.forChild(i,s),n),i+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){if(s<o.length&&o[s].to==i){let e,t=o[s++];for(;s<o.length&&o[s].to==i;)(e||(e=[t])).push(o[s++]);if(e){e.sort(Yr);for(let t=0;t<e.length;t++)n(e[t],c,!!l)}else n(t,c,!!l)}let u,d;if(l)d=-1,u=l,l=null;else{if(!(c<e.childCount))break;d=c,u=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=i&&a.splice(e--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let p=i+u.nodeSize;if(u.isText){let e=p;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<p&&(l=u.cut(e-i),u=u.cut(0,e-i),p=e,d=-1)}let h=u.isInline&&!u.isLeaf?a.filter((e=>!e.inline)):a.slice();r(u,h,t.forChild(i,u),d),i=p}}(this.node,this.innerDeco,((t,o,i)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!i&&a.syncToMarks(o==this.node.childCount?de.none:this.node.child(o).marks,n,e),a.placeWidget(t,e,r)}),((t,i,l,c)=>{let u;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,i,l,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(t,i,l,u,e)||a.updateNextNode(t,i,l,e,c)||a.addNode(t,i,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Cr)&&(i&&this.protectLocalComposition(e,i),Pr(this.contentDOM,this.children,e),Bn&&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 on)||n<t||r>t+this.node.content.size)return null;let o=e.domSelection(),i=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=Xn(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(o.focusNode,o.focusOffset);if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,o=function(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<e.childCount;){let t=e.child(o++);if(i+=t.nodeSize,!t.isText)break;l+=t.text}if(i>=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 o<0?null:{node:i,pos:o,text:e}}return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new Nr(this,o,t,r);e.input.compositionNodes.push(i),this.children=Qr(this.children,n,n+r.length,e,i)}update(e,t,n,r){return!(this.dirty==Tr||!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=kr}updateOuterDeco(e){if(Vr(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Ur(this.dom,this.nodeDOM,Br(this.outerDeco,this.node,t),Br(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 jr(e,t,n,r,o){return $r(r,t,e),new _r(void 0,e,t,n,r,r,r,o,0)}class Ir extends _r{constructor(e,t,n,r,o,i,s){super(e,t,n,r,o,null,i,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==Tr||this.dirty!=kr&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==kr&&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=kr,!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),o=document.createTextNode(r.text);return new Ir(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=Tr)}get domAtom(){return!1}}class Lr extends Or{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==kr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class zr extends _r{constructor(e,t,n,r,o,i,s,a,l,c){super(e,t,n,r,o,i,s,l,c),this.spec=a}update(e,t,n,r){if(this.dirty==Tr)return!1;if(this.spec.update){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}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 Pr(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let s=t[i],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=Wr(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(a,r);if(s instanceof Sr){let t=r?r.previousSibling:e.lastChild;Pr(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Wr(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const Fr=function(e){e&&(this.nodeName=e)};Fr.prototype=Object.create(null);const Rr=[new Fr];function Br(e,t,n){if(0==e.length)return Rr;let r=n?Rr[0]:new Fr,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s){s.nodeName&&o.push(r=new Fr(s.nodeName));for(let e in s){let i=s[e];null!=i&&(n&&1==o.length&&o.push(r=new Fr(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+i:"style"==e?r.style=(r.style?r.style+";":"")+i:"nodeName"!=e&&(r[e]=i))}}}return o}function Ur(e,t,n,r){if(n==Rr&&r==Rr)return t;let o=t;for(let t=0;t<r.length;t++){let i=r[t],s=n[t];if(t){let t;s&&s.nodeName==i.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==i.nodeName||(t=document.createElement(i.nodeName),t.pmIsDeco=!0,t.appendChild(o),s=Rr[0]),o=t}Hr(o,s||Rr[0],i)}return o}function Hr(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):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==o.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<o.length;t++)-1==r.indexOf(o[t])&&e.classList.add(o[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 $r(e,t,n){return Ur(e,e,Rr,Br(t,n,1!=e.nodeType))}function Vr(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 Wr(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class qr{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,o=e.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Sr)){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(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,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,o=this.stack.length>>1,i=Math.min(o,e.length);for(;r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=kr,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<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[o])){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=Sr.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,o){let i=this.top.children[r];return i.dirty==Tr&&i.dom==i.contentDOM&&(i.dirty=Cr),!!i.update(e,t,n,o)&&(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,o){for(let i=this.index;i<this.top.children.length;i++){let s=this.top.children[i];if(s instanceof _r){let a=this.preMatch.matched.get(s);if(null!=a&&a!=o)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!=Tr&&Vr(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,i),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(e,t,n,r,o){this.top.children.splice(this.index++,0,_r.create(this.top,e,t,n,r,o)),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 Sr;)t=e,e=t.children[t.children.length-1];e&&e instanceof Ir&&!/\n$/.test(e.node.text)||((Rn||Pn)&&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 Lr(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}function Yr(e,t){return e.type.side-t.type.side}function Qr(e,t,n,r,o){let i=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Kr(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(er(n)){for(a=c;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&an.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==Xn(e);r||o;){if(e==n)return!0;let t=Wn(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==Xn(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;l=new an(s==e?c: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=oo(e,a,c,"pointer"==t||e.state.selection.head<c.pos&&!i?1:-1)}return l}function Gr(e){return e.editable?e.hasFocus():so(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Jr(e,t=!1){let n=e.state.selection;if(no(e,n),Gr(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Pn){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Kn(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,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,Wn(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&jn&&In<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,o,{anchor:i,head:s}=n;!Xr||n instanceof on||(n.$from.parent.inlineContent||(r=Zr(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=Zr(e,n.to))),e.docView.setSelection(i,s,e.root,t),Xr&&(r&&to(r),o&&to(o)),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,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Gr(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Xr=Rn||Pn&&Fn<63;function Zr(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Rn&&o&&"false"==o.contentEditable)return eo(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return eo(o);if(i)return eo(i)}}function eo(e){return e.contentEditable="true",Rn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function to(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function no(e,t){if(t instanceof an){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(ro(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else ro(e)}function ro(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function oo(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||on.between(t,n,r)}function io(e){return(!e.editable||e.root.activeElement==e.dom)&&so(e)}function so(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 ao(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&en.findFrom(i,t)}function lo(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function co(e,t,n){let r=e.state.selection;if(!(r instanceof on)){if(r instanceof an&&r.node.isInline)return lo(e,new on(t>0?r.$to:r.$from));{let n=ao(e.state,t);return!!n&&lo(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=ao(e.state,t);return!!(n&&n instanceof an)&&lo(e,n)}if(!(Un&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=t<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(an.isSelectable(i)?lo(e,new an(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):!!$n&&lo(e,new on(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}function uo(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function po(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function ho(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;for(Ln&&1==n.nodeType&&r<uo(n)&&po(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(po(e))o=n,i=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(mo(n))break;{let t=n.previousSibling;for(;t&&po(t);)o=n.parentNode,i=Wn(t),t=t.previousSibling;if(t)n=t,r=uo(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?go(e,t,n,r):o&&go(e,t,o,i)}function fo(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=uo(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!po(n.childNodes[r]))break;o=n,i=++r}else{if(mo(n))break;{let t=n.nextSibling;for(;t&&po(t);)o=t.parentNode,i=Wn(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=uo(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}o&&go(e,t,o,i)}function mo(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function go(e,t,n,r){if(er(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:o}=e;setTimeout((()=>{e.state==o&&Jr(e)}),50)}function yo(e,t,n){let r=e.state.selection;if(r instanceof on&&!r.empty||n.indexOf("s")>-1)return!1;if(Un&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=ao(e.state,t);if(n&&n instanceof an)return lo(e,n)}if(!o.parent.inlineContent){let n=t<0?o:i,s=r instanceof cn?en.near(n,t):en.findFrom(n,t);return!!s&&lo(e,s)}return!1}function bo(e,t){if(!(e.state.selection instanceof on))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=e.state.tr;return t<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),e.dispatch(r),!0}return!1}function vo(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function wo(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||Un&&72==n&&"c"==r?bo(e,-1)||ho(e):46==n||Un&&68==n&&"c"==r?bo(e,1)||fo(e):13==n||27==n||(37==n||Un&&66==n&&"c"==r?co(e,-1,r)||ho(e):39==n||Un&&70==n&&"c"==r?co(e,1,r)||fo(e):38==n||Un&&80==n&&"c"==r?yo(e,-1,r)||ho(e):40==n||Un&&78==n&&"c"==r?function(e){if(!Rn||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;vo(e,n,"true"),setTimeout((()=>vo(e,n,"false")),20)}return!1}(e)||yo(e,1,r)||fo(e):r==(Un?"m":"c")&&(66==n||73==n||89==n||90==n))}function xo(e,t){let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;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")||ut.fromSchema(e.state.schema),a=So(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,d=0;for(;u&&1==u.nodeType&&(c=Ao[u.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}u=l.firstChild}u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${o} ${i}${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 Mo(e,t,n,r,o){let i,s,a=o.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 he(ae.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):he.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,o,r)));if(n)s=n;else{let n=o.marks(),{schema:r}=e.state,s=ut.fromSchema(r);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),i=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=So().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&Ao[o[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),$n&&function(e){let t=e.querySelectorAll(Pn?"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)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let e=+u[3];e>0&&i.firstChild;e--)i=i.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Je.fromSchema(e.state.schema);s=t.parseSlice(i,{preserveWhitespace:!(!l&&!u),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Do.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(u)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:o,openStart:i,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;o=ae.from(t.create(n[e+1],o)),i++,s++}return new he(o,i,s)}(Oo(s,+u[1],+u[2]),u[4]);else if(s=he.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),i=[];if(e.forEach((e=>{if(!i)return;let t,n=o.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&r.length&&Eo(n,r,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=Co(i[i.length-1],r.length));let t=ko(e,n);i.push(t),o=o.matchType(t.type),r=n}})),i)return ae.from(i)}return e}(s.content,o),!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=Oo(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const Do=/^(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 ko(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,ae.from(e));return e}function Eo(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let i=Eo(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(ae.from(ko(n,e,o+1))))}}function Co(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Co(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(ae.empty,!0);return e.copy(n.append(r))}function To(e,t,n,r,o,i){let s=t<0?e.firstChild:e.lastChild,a=s.content;return o<r-1&&(a=To(a,t,n,r,o+1,i)),o>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(ae.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Oo(e,t,n){return t<e.openStart&&(e=new he(To(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new he(To(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Ao={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 No=null;function So(){return No||(No=document.implementation.createHTMLDocument("title"))}const _o={};let jo={};class Io{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 Lo(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function zo(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Po(e,t))}))}function Po(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Fo(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 Ro(e){return{left:e.clientX,top:e.clientY}}function Bo(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(e.someProp(t,(t=>r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1))))return!0;return!1}function Uo(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Ho(e,t,n,r,o){return Bo(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(o?function(e,t){if(-1==t)return!1;let n,r,o=e.state.selection;o instanceof an&&(n=o.node);let i=e.state.doc.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e);if(an.isSelectable(t)){r=n&&o.$from.depth>0&&e>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(e);break}}return null!=r&&(Uo(e,an.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&&an.isSelectable(r))&&(Uo(e,new an(n),"pointer"),!0)}(e,n))}function $o(e,t,n,r){return Bo(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Vo(e,t,n,r){return Bo(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&&(Uo(e,on.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(t);for(let t=o.depth+1;t>0;t--){let n=t>o.depth?o.nodeAfter:o.node(t),i=o.before(t);if(n.inlineContent)Uo(e,on.create(r,i+1,i+1+n.content.size),"pointer");else{if(!an.isSelectable(n))continue;Uo(e,an.create(r,i),"pointer")}return!0}}(e,n,r)}function Wo(e){return Xo(e)}jo.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Qo(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Hn||!Pn||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Bn||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||wo(e,n)?n.preventDefault():Lo(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,tr(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},jo.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},jo.keypress=(e,t)=>{let n=t;if(Qo(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Un&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof on&&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 qo=Un?"metaKey":"ctrlKey";_o.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Wo(e),o=Date.now(),i="singleClick";o-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[qo]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=e.posAtCoords(Ro(n));s&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Yo(e,s,n,!!r)):("doubleClick"==i?$o:Vo)(e,s.pos,s.inside,n)?n.preventDefault():Lo(e,"pointer"))};class Yo{constructor(e,t,n,r){let o,i;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[qo],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,i=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&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof an&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Ln||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)),Lo(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((()=>Jr(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(Ro(e))),this.allowDefault||!t?Lo(this.view,"pointer"):Ho(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Rn&&this.mightDrag&&!this.mightDrag.node.isAtom||Pn&&!(this.view.state.selection instanceof on)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Uo(this.view,en.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Lo(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),Lo(this.view,"pointer"),0==e.buttons&&this.done()}}function Qo(e,t){return!!e.composing||!!(Rn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}_o.touchdown=e=>{Wo(e),Lo(e,"pointer")},_o.contextmenu=e=>Wo(e);const Ko=Hn?5e3:-1;function Go(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Xo(e)),t))}function Jo(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 Xo(e,t=!1){if(!(Hn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Jo(e),t||e.docView&&e.docView.dirty){let t=Kr(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}jo.compositionstart=jo.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(),Xo(e,!0),e.markCursor=null;else if(Xo(e),Ln&&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}Go(e,Ko)},jo.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Go(e,20))};const Zo=jn&&In<15||Bn&&Vn<604;function ei(e,t,n,r){let o=Mo(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,o||he.empty))))return!0;if(!o)return!1;let i=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),s=i?e.state.tr.replaceSelectionWith(i,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}_o.copy=jo.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let i=Zo?null:n.clipboardData,s=r.content(),{dom:a,text:l}=xo(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.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(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},jo.paste=(e,t)=>{let n=t;if(e.composing&&!Hn)return;let r=Zo?null:n.clipboardData;r&&ei(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?ei(e,r.value,null,t):ei(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class ti{constructor(e,t){this.slice=e,this.move=t}}const ni=Un?"altKey":"ctrlKey";_o.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(Ro(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof an?o.to-1:o.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(an.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(an.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=xo(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Zo?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Zo||n.dataTransfer.setData("text/plain",l),e.dragging=new ti(s,!n[ni])},_o.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},jo.dragover=jo.dragenter=(e,t)=>t.preventDefault(),jo.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(Ro(n));if(!o)return;let i=e.state.doc.resolve(o.pos);if(!i)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Mo(e,n.dataTransfer.getData(Zo?"Text":"text/plain"),Zo?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[ni]);if(e.someProp("handleDrop",(t=>t(e,n,s||he.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?Rt(e.state.doc,i.pos,s):i.pos;null==l&&(l=i.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(p))return;let h=c.doc.resolve(u);if(d&&an.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new an(h));else{let t=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,o)=>t=o)),c.setSelection(oo(e,h,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},_o.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())&&Jr(e)}),20))},_o.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)},_o.beforeinput=(e,t)=>{if(Pn&&Hn&&"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,tr(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 jo)_o[e]=jo[e];function ri(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 oi{constructor(e,t){this.toDOM=e,this.spec=t||ci,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new ai(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof oi&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ri(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ii{constructor(e,t){this.attrs=e,this.spec=t||ci}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new ai(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof ii&&ri(this.attrs,e.attrs)&&ri(this.spec,e.spec)}static is(e){return e.type instanceof ii}destroy(){}}class si{constructor(e,t){this.attrs=e,this.spec=t||ci}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new ai(o.pos-n,i.pos-n,this)}valid(e,t){let n,{index:r,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(n=e.child(r)).isText&&o+n.nodeSize==t.to}eq(e){return this==e||e instanceof si&&ri(this.attrs,e.attrs)&&ri(this.spec,e.spec)}destroy(){}}class ai{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new ai(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 ai(e,e,new oi(t,n))}static inline(e,t,n,r){return new ai(e,t,new ii(n,r))}static node(e,t,n,r){return new ai(e,t,new si(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof ii}}const li=[],ci={};class ui{constructor(e,t){this.local=e.length?e:li,this.children=t.length?t:li}static create(e,t){return t.length?gi(t,e,0,ci):di}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,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==di||0==e.maps.length?this:this.mapInner(e,t,0,0,n||ci)}mapInner(e,t,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,s){let a=e.slice(),l=(e,t,n,r)=>{for(let s=0;s<a.length;s+=3){let l,c=a[s+1];if(c<0||e>c+i)continue;let u=a[s]+i;t>=u?a[s+1]=e<=u?-2:-1:n>=o&&(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 c=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){c=!0,a[t+1]=-1;continue}let l=n.map(e[t]+i),u=l-o;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+i,-1)-o,{index:p,offset:h}=r.content.findIndex(u),f=r.maybeChild(p);if(f&&h==u&&h+f.nodeSize==d){let r=a[t+2].mapInner(n,f,l+1,e[t]+i+1,s);r!=di?(a[t]=u,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,c=!0)}else c=!0}if(c){let l=function(e,t,n,r,o,i,s){function a(e,t){for(let i=0;i<e.local.length;i++){let a=e.local[i].map(r,o,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[i].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]+i+1);return n}(a,e,t,n,o,i,s),c=gi(l,r,0,s);t=c.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<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new ui(t.sort(yi),a)}(this.children,i||[],e,t,n,r,o):i?new ui(i.sort(yi),li):di}add(e,t){return t.length?this==di?ui.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,o=0;e.forEach(((e,i)=>{let s,a=i+n;if(s=fi(t,e,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(e,s,a+1):r.splice(o,0,i,i+e.nodeSize,gi(s,e,a+1,ci)),o+=3}}));let i=hi(o?mi(t):t,-n);for(let t=0;t<i.length;t++)i[t].type.valid(e,i[t])||i.splice(t--,1);return new ui(i.length?this.local.concat(i).sort(yi):this.local,r||this.children)}remove(e){return 0==e.length||this==di?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 o,i=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>i&&t.to<s&&(e[n]=null,(o||(o=[])).push(t));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=di?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<e.length;o++)if(n=e[o])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 ui(r,n):di}forChild(e,t){if(this==di)return this;if(t.isLeaf)return ui.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 o=e+1,i=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>o&&t.type instanceof ii){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new ui(r.sort(yi),li);return n?new pi([e,n]):e}return n||di}eq(e){if(this==e)return!0;if(!(e instanceof ui)||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 bi(this.localsInner(e))}localsInner(e){if(this==di)return li;if(e.inlineContent||!this.local.some(ii.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof ii||t.push(this.local[e]);return t}}ui.empty=new ui([],[]),ui.removeOverlap=bi;const di=ui.empty;class pi{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,ci)));return pi.from(n)}forChild(e,t){if(t.isLeaf)return ui.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,t);o!=di&&(o instanceof pi?n=n.concat(o.members):n.push(o))}return pi.from(n)}eq(e){if(!(e instanceof pi)||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 o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?bi(n?t:t.sort(yi)):li}static from(e){switch(e.length){case 0:return di;case 1:return e[0];default:return new pi(e)}}}function hi(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new ai(o.from+t,o.to+t,o.type))}return n}function fi(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let t,i=0;i<e.length;i++)(t=e[i])&&t.from>n&&t.to<r&&((o||(o=[])).push(t),e[i]=null);return o}function mi(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function gi(e,t,n,r){let o=[],i=!1;t.forEach(((t,s)=>{let a=fi(e,t,s+n);if(a){i=!0;let e=gi(a,t,n+s+1,r);e!=di&&o.push(s,s+t.nodeSize,e)}}));let s=hi(i?mi(e):e,-n).sort(yi);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||o.length?new ui(s,o):di}function yi(e,t){return e.from-t.from||e.to-t.to}function bi(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),vi(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),vi(t,o+1,i.copy(r.to,i.to)))}}return t}function vi(e,t,n){for(;t<e.length&&yi(n,e[t])>0;)t++;e.splice(t,0,n)}function wi(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=di&&t.push(r)})),e.cursorWrapper&&t.push(ui.create(e.state.doc,[e.cursorWrapper.deco])),pi.from(t)}const xi={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Mi=jn&&In<=11;class Di{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 ki{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Di,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]);jn&&In<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),Mi&&(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,xi),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(io(this.view)){if(this.suppressingSelectionUpdates)return Jr(this.view);if(jn&&In<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&Kn(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)&&io(this.view)&&!this.ignoreSelectionChange(t),r=-1,o=-1,i=!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),o=o<0?n.to:Math.max(n.to,o),n.typeOver&&(i=!0))}if(Ln&&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,o),function(e){if(Ei)return;Ei=!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,o,i,s),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||Jr(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,o=e.nextSibling;if(jn&&In<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:i}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(e.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==e.target?Wn(r)+1:0,s=n.localPosFromDOM(e.target,i,-1),a=o&&o.parentNode==e.target?Wn(o):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 Ei=!1;function Ci(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Rn&&/^(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||Rn&&/^(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 Ti(e,t,n,r,o){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Kr(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 i=e.state.doc.resolve(t),s=i.sharedDepth(n);t=i.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:o,fromOffset:i,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelection(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],er(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Pn&&8===e.input.lastKeyCode)for(let e=s;e>i;e--){let t=o.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")||Je.fromSchema(e.state.schema),h=d.resolve(a),f=null,m=p.parse(o,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Ci,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(Pn&&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 c,u,d=e.state.doc,p=d.slice(l.from,l.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(c=e.state.selection.to,u="end"):(c=e.state.selection.from,u="start"),e.input.lastKeyCode=null;let h=function(e,t,n,r,o){let i=e.findDiffStart(t,n);if(null==i)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==o){r-=s+Math.max(0,i-Math.min(s,a))-i}if(s<i&&e.size<t.size){i-=r<=i&&r>=s?i-r:0,a=i+(a-s),s=i}else if(a<i){i-=r<=i&&r>=a?i-r:0,s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}(p.content,l.doc.content,l.from,c,u);if((Bn&&e.input.lastIOSEnter>Date.now()-225||Hn)&&o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",(t=>t(e,tr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!h){if(!(r&&a instanceof on&&!a.empty&&a.$head.sameParent(a.$anchor))||e.composing||l.sel&&l.sel.anchor!=l.sel.head){if(l.sel){let t=Oi(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 on&&(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)),jn&&In<=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((Bn&&e.input.lastIOSEnter>Date.now()-225&&(!b||o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!b&&m.pos<l.doc.content.size&&(f=en.findFrom(l.doc.resolve(m.pos+1),1,!0))&&f.head==g.pos)&&e.someProp("handleKeyDown",(t=>t(e,tr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>h.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||Ai(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(Ai(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Ai(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,tr(8,"Backspace")))))return void(Hn&&Pn&&e.domObserver.suppressSelectionUpdates());Pn&&Hn&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),Hn&&!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,tr(13,"Enter"))}))}),20));let v,w,x,M=h.start,D=h.endA;if(b)if(m.pos==g.pos)jn&&In<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Jr(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,o,i=e.firstChild.marks,s=t.firstChild.marks,a=i,l=s;for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);for(let e=0;e<i.length;e++)l=i[e].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",o=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",o=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(o(t.child(e)));if(ae.from(c).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=Oi(e,v.doc,l.sel);t&&!(Pn&&Hn&&e.composing&&t.empty&&(h.start!=h.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==M||t.head==v.mapping.map(D)-1)||jn&&t.empty&&t.head==M)&&v.setSelection(t)}w&&v.ensureMarks(w),e.dispatch(v.scrollIntoView())}function Oi(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:oo(e,t.resolve(n.anchor),t.resolve(n.head))}function Ai(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}class Ni{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 Io,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Li),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=ji(this),_i(this),this.nodeViews=Ii(this),this.docView=jr(this.state.doc,Si(this),wi(this),this.dom,this),this.domObserver=new ki(this,((e,t,n,r)=>Ti(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in _o){let n=_o[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Fo(e,t)||Po(e,t)||!e.editable&&t.type in jo||n(e,t)})}Rn&&e.dom.addEventListener("input",(()=>null)),zo(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&&zo(this),this._props=e,e.plugins&&(e.plugins.forEach(Li),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,o=!1;if(e.storedMarks&&this.composing&&(Jo(this),o=!0),this.state=e,t){let e=Ii(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),zo(this)}this.editable=ji(this),_i(this);let i=wi(this),s=Si(this),a=t?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",l=r||!this.docView.matchesNode(e.doc,s,i);!l&&e.selection.eq(n.selection)||(o=!0);let c="preserve"==a&&o&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(i,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=o-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:sr(e.dom)}}(this);if(o){this.domObserver.stop();let t=l&&(jn||Pn)&&!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=Pn?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(e.doc,s,i,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=jr(e.doc,s,i,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 Kn(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Jr(this,t):(no(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 an){let n=this.docView.domAfterPos(e.selection.from);1==n.nodeType&&ir(this,n.getBoundingClientRect(),t)}else ir(this,this.coordsAtPos(e.selection.head,1),t)}else c&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;ar(n,0==r?0:r-t)}(c)}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 o=this.directPlugins[r].props[e];if(null!=o&&(n=t?t(o):o))return n}let o=this.state.plugins;if(o)for(let r=0;r<o.length;r++){let i=o[r].props[e];if(null!=i&&(n=t?t(i):i))return n}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(lr)return e.focus(lr);let t=sr(e);e.focus(null==lr?{get preventScroll(){return lr={preventScroll:!0},!0}}:void 0),lr||(lr=!1,ar(t,0))}(this.dom),Jr(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 pr(this,e)}coordsAtPos(e,t=1){return mr(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 Dr(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,[],wi(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){Po(e,t)||!_o[t.type]||!e.editable&&t.type in jo||_o[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 Si(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]))})),[ai.node(0,e.state.doc.content.size,t)]}function _i(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:ai.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function ji(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Ii(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 Li(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 zi={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:"'",229:"q"},Pi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Fi="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Ri="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Bi="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Ui="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Hi="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),$i=Fi&&(Ui||+Fi[1]<57)||Bi&&Ui,Vi=0;Vi<10;Vi++)zi[48+Vi]=zi[96+Vi]=String(Vi);for(Vi=1;Vi<=24;Vi++)zi[Vi+111]="F"+Vi;for(Vi=65;Vi<=90;Vi++)zi[Vi]=String.fromCharCode(Vi+32),Pi[Vi]=String.fromCharCode(Vi);for(var Wi in zi)Pi.hasOwnProperty(Wi)||(Pi[Wi]=zi[Wi]);const qi="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Yi(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let e=0;e<i.length-1;e++){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!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);qi?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Qi(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 Ki(e){let t=function(e){let t=Object.create(null);for(let n in e)t[Yi(n)]=e[n];return t}(e);return function(e,n){let r,o=function(e){var t=!($i&&(e.ctrlKey||e.altKey||e.metaKey)||(Ri||Hi)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?Pi:zi)[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),i=1==o.length&&" "!=o,s=t[Qi(o,n,!i)];if(s&&s(e.state,e.dispatch,e))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=zi[n.keyCode])&&r!=o){let o=t[Qi(r,n,!0)];if(o&&o(e.state,e.dispatch,e))return!0}else if(i&&n.shiftKey){let r=t[Qi(o,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}function Gi(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 Ji(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 Xi(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 Zi(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 es(e,t,n){let r,o,i=t.nodeBefore,s=t.nodeAfter;if(i.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(i,i+1)||!o.isTextblock&&!Ft(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=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(r[0]||s.type).validEnd){if(n){let o=t.pos+s.nodeSize,a=ae.empty;for(let e=r.length-1;e>=0;e--)a=ae.from(r[e].create(null,a));a=ae.from(i.copy(a));let l=e.tr.step(new St(t.pos-1,o,t.pos,o,new he(a,1,0),r.length,!0)),c=o+2*r.length;Ft(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=en.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&It(c);if(null!=u&&u>=t.depth)return n&&n(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&Gi(s,"start",!0)&&Gi(i,"end")){let r=i,o=[];for(;o.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=ae.empty;for(let e=o.length-1;e>=0;e--)r=ae.from(o[e].copy(r));n(e.tr.step(new St(t.pos-o.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new he(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ts(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(on.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}const ns=ts(-1),rs=ts(1);function is(e,t=null){return function(n,r){let{from:o,to:i}=n.selection,s=!1;return n.doc.nodesBetween(o,i,((r,o)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(o),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(o,i,e,t).scrollIntoView()),!0)}}function ss(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==o.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(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let c=Lt(l,e,t,s);return!!c&&(r&&r(function(e,t,n,r,o){let i=ae.empty;for(let e=n.length-1;e>=0;e--)i=ae.from(n[e].type.create(n[e].attrs,i));e.step(new St(t.start-(r?2:0),t.end,t.start,t.end,new he(i,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==o&&(s=e+1);let a=n.length-s,l=t.start+n.length-(r?2:0),c=t.parent;for(let n=t.startIndex,r=t.endIndex,o=!0;n<r;n++,o=!1)!o&&Pt(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(n).nodeSize;return e}(n.tr,s,c,a,e).scrollIntoView()),!0)}}function as(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));return!!i&&(!n||(r.node(i.depth-1).type==e?function(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new St(i-1,s,i,s,new he(ae.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ae(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));return t(o.lift(r,It(r)).scrollIntoView()),!0}(t,n,e,i):function(e,t,n){let r=e.tr,o=n.parent;for(let e=n.end,t=n.endIndex-1,i=n.startIndex;t>i;t--)e-=o.child(t).nodeSize,r.delete(e-1,e+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?ae.empty:ae.from(o))))return!1;let d=i.pos,p=d+s.nodeSize;return r.step(new St(d-(a?1:0),p+(l?1:0),d+1,p-1,new he((a?ae.empty:ae.from(o.copy(ae.empty))).append(l?ae.empty:ae.from(o.copy(ae.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,i)))}}function ls(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=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 i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=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:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!e,l=e||o.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),o=n(...e)(r);return s.push(o),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),s.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=void 0,o=e||n.tr,i=this.buildProps(o,r),s=Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:r})])));return{...s,chain:()=>this.createChain(o,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r;o.storedMarks&&e.setStoredMarks(o.storedMarks);const s={tr:e,editor:r,view:i,state:ls({state:o,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 us(e,t,n){if(void 0===e.config[t]&&e.parent)return us(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?us(e.parent,t,n):null})}return e.config[t]}function ds(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function ps(e){const t=[],{nodeExtensions:n,markExtensions:r}=ds(e),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=us(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:{...i,...r}})}))}))}))})),o.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=us(e,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{const o={...i,...r};r.isRequired&&void 0===r.default&&delete o.default,t.push({type:e.name,name:n,attribute:o})}))})),t}function hs(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 fs(...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 ms(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)=>fs(e,t)),{})}function gs(e){return"function"==typeof e}function ys(e,t=void 0,...n){return gs(e)?t?e.bind(t)(...n):e(...n):e}function bs(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const o=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,...o}}}}function vs(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 ws(e,t){return t.nodes[e]||t.marks[e]||null}function xs(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function Ms(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class Ds{constructor(e){this.find=e.find,this.handler=e.handler}}function ks(e){var t;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(t=c.nodeBefore||c.nodeAfter)||void 0===t?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let u=!1;const d=((e,t=500)=>{let n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,((t,r,o,i)=>{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:o,index:i}))||(null===(l=e.nodeBefore)||void 0===l?void 0:l.text)||"%leaf%"})),n})(c)+i;return s.forEach((e=>{if(u)return;const t=((e,t)=>{if(Ms(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,c=ls({state:l.state,transaction:s}),p={from:r-(t[0].length-i.length),to:o},{commands:h,chain:f,can:m}=new cs({editor:n,state:c});null!==e.handler({state:c,range:p,match:t,commands:h,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),u=!0)})),u}function Es(e){const{editor:t,rules:n}=e,r=new Dn({state:{init:()=>null,apply(e,t){const n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(e,o,i,s)=>ks({editor:t,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:o}=e.state.selection;o&&ks({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;const{$cursor:i}=e.state.selection;return!!i&&ks({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class Cs{constructor(e){this.find=e.find,this.handler=e.handler}}function Ts(e){const{editor:t,state:n,from:r,to:o,rule:i}=e,{commands:s,chain:a,can:l}=new cs({editor:t,state:n}),c=[];n.doc.nodesBetween(r,o,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const u=Math.max(r,t),d=Math.min(o,t+e.content.size),p=((e,t)=>{if(Ms(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(u-t,d-t,void 0,""),i.find);p.forEach((e=>{if(void 0===e.index)return;const t=u+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},d=i.handler({state:n,range:o,match:e,commands:s,chain:a,can:l});c.push(d)}))}));return c.every((e=>null!==e))}function Os(e){const{editor:t,rules:n}=e;let r=null,o=!1,i=!1;return n.map((e=>new Dn({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=>(i=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 o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!o,c="drop"===a.getMeta("uiEvent")&&!i;if(!l&&!c)return;const u=r.doc.content.findDiffStart(s.doc.content),d=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof u||!d||u===d.b)return;const p=s.tr,h=ls({state:s,transaction:p});return Ts({editor:t,state:h,from:Math.max(u-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=ps(e),{nodeExtensions:r,markExtensions:o}=ds(e),i=null===(t=r.find((e=>us(e,"topNode"))))||void 0===t?void 0:t.name,s=Object.fromEntries(r.map((t=>{const r=n.filter((e=>e.type===t.name)),o={name:t.name,options:t.options,storage:t.storage},i=e.reduce(((e,n)=>{const r=us(n,"extendNodeSchema",o);return{...e,...r?r(t):{}}}),{}),s=vs({...i,content:ys(us(t,"content",o)),marks:ys(us(t,"marks",o)),group:ys(us(t,"group",o)),inline:ys(us(t,"inline",o)),atom:ys(us(t,"atom",o)),selectable:ys(us(t,"selectable",o)),draggable:ys(us(t,"draggable",o)),code:ys(us(t,"code",o)),defining:ys(us(t,"defining",o)),isolating:ys(us(t,"isolating",o)),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=ys(us(t,"parseHTML",o));a&&(s.parseDOM=a.map((e=>bs(e,r))));const l=us(t,"renderHTML",o);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:ms(e,r)}));const c=us(t,"renderText",o);return c&&(s.toText=c),[t.name,s]}))),a=Object.fromEntries(o.map((t=>{const r=n.filter((e=>e.type===t.name)),o={name:t.name,options:t.options,storage:t.storage},i=e.reduce(((e,n)=>{const r=us(n,"extendMarkSchema",o);return{...e,...r?r(t):{}}}),{}),s=vs({...i,inclusive:ys(us(t,"inclusive",o)),excludes:ys(us(t,"excludes",o)),group:ys(us(t,"group",o)),spanning:ys(us(t,"spanning",o)),code:ys(us(t,"code",o)),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=ys(us(t,"parseHTML",o));a&&(s.parseDOM=a.map((e=>bs(e,r))));const l=us(t,"renderHTML",o);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:ms(e,r)})),[t.name,s]})));return new Ke({topNode:i,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:ws(e.name,this.schema)};if("mark"===e.type){(null===(t=ys(us(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const r=us(e,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=us(e,"onCreate",n);o&&this.editor.on("create",o);const i=us(e,"onUpdate",n);i&&this.editor.on("update",i);const s=us(e,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=us(e,"onTransaction",n);a&&this.editor.on("transaction",a);const l=us(e,"onFocus",n);l&&this.editor.on("focus",l);const c=us(e,"onBlur",n);c&&this.editor.on("blur",c);const u=us(e,"onDestroy",n);u&&this.editor.on("destroy",u)}))}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=us(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=us(e,"priority")||t,o=us(n,"priority")||t;return r>o?-1:r<o?1:0}))}get commands(){return this.extensions.reduce(((e,t)=>{const n=us(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:ws(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=As.sort([...this.extensions].reverse()),n=[],r=[],o=t.map((t=>{const o={name:t.name,options:t.options,storage:t.storage,editor:e,type:ws(t.name,this.schema)},i=[],s=us(t,"addKeyboardShortcuts",o);if(s){const t=function(e){return new Dn({props:{handleKeyDown:Ki(e)}})}(Object.fromEntries(Object.entries(s()).map((([t,n])=>[t,()=>n({editor:e})]))));i.push(t)}const a=us(t,"addInputRules",o);xs(t,e.options.enableInputRules)&&a&&n.push(...a());const l=us(t,"addPasteRules",o);xs(t,e.options.enablePasteRules)&&l&&r.push(...l());const c=us(t,"addProseMirrorPlugins",o);if(c){const e=c();i.push(...e)}return i})).flat();return[Es({editor:e,rules:n}),...Os({editor:e,rules:r}),...o]}get attributes(){return ps(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=ds(this.extensions);return Object.fromEntries(t.filter((e=>!!us(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:hs(t.name,this.schema)},o=us(t,"addNodeView",r);if(!o)return[];return[t.name,(r,i,s,a)=>{const l=ms(r,n);return o()({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 Ss(e,t){const n={...e};return Ns(e)&&Ns(t)&&Object.keys(t).forEach((r=>{Ns(t[r])?r in e?n[r]=Ss(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})})),n}class _s{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=ys(us(this,"addOptions",{name:this.name}))),this.storage=ys(us(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new _s(e)}configure(e={}){const t=this.extend();return t.options=Ss(this.options,e),t.storage=ys(us(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new _s(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=ys(us(t,"addOptions",{name:t.name})),t.storage=ys(us(t,"addStorage",{name:t.name,options:t.options})),t}}function js(e,t,n){const{from:r,to:o}=t,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return e.nodesBetween(r,o,((e,n,c,u)=>{var d;const p=null==s?void 0:s[e.type.name];p?(e.isBlock&&!l&&(a+=i,l=!0),c&&(a+=p({node:e,pos:n,parent:c,index:u,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,o-n),l=!1):e.isBlock&&!l&&(a+=i,l=!0)})),a}function Is(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}const Ls=_s.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Dn({key:new Cn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,s=Math.min(...i.map((e=>e.$from.pos))),a=Math.max(...i.map((e=>e.$to.pos)));return js(r,{from:s,to:a},{textSerializers:Is(n)})}}})]}});function zs(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:Ms(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Ps(e,t,n={}){return e.find((e=>e.type===t&&zs(e.attrs,n)))}function Fs(e,t,n={}){return!!Ps(e,t,n)}function Rs(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 o=Ps([...r.node.marks],t,n);if(!o)return;let i=r.index,s=e.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(Ps([...r.node.marks],t,n);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,s-=e.parent.child(i).nodeSize;for(;a<e.parent.childCount&&Fs([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Bs(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 Us(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 Hs(e){return Us(e)&&e instanceof on}function $s(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Vs(e,t=null){if(!t)return null;const n=en.atStart(e),r=en.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const o=n.from,i=r.to;return"all"===t?on.create(e,$s(0,o,i),$s(e.content.size,o,i)):on.create(e,$s(t,o,i),$s(t,o,i))}function Ws(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function qs(e){const t=`<body>${e}</body>`;return(new window.DOMParser).parseFromString(t,"text/html").body}function Ys(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)?ae.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Ys("",t,n)}if("string"==typeof e){const r=Je.fromSchema(t);return n.slice?r.parseSlice(qs(e),n.parseOptions).content:r.parse(qs(e),n.parseOptions)}return Ys("",t,n)}function Qs(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Ks(e,t,n={}){const{from:r,to:o,empty:i}=e.selection,s=t?hs(t,e.schema):null,a=[];e.doc.nodesBetween(r,o,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);a.push({node:e,from:n,to:i})}));const l=o-r,c=a.filter((e=>!s||s.name===e.node.type.name)).filter((e=>zs(e.node.attrs,n,{strict:!1})));if(i)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}function Gs(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Js(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 Xs(e,t,n={}){return Ys(e,t,{slice:!1,parseOptions:n})}function Zs(e,t){const n=Bs(t,e.schema),{from:r,to:o,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function ea(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 ta(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 na(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 ra(e,t){const{nodeExtensions:n}=ds(t),r=n.find((t=>t.name===e));if(!r)return!1;const o=ys(us(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}const oa=(e,t)=>{const n=na((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 o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Ft(e.doc,n.pos)||(e.join(n.pos),!0)},ia=(e,t)=>{const n=na((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 o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Ft(e.doc,r)||(e.join(r),!0)};function sa(e,t,n={}){const{empty:r,ranges:o}=e.selection,i=t?Bs(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!i||i.name===e.type.name)).find((e=>zs(e.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((({$from:t,$to:n})=>{const r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);s+=i-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:i}))))}))})),0===s)return!1;const l=a.filter((e=>!i||i.name===e.mark.type.name)).filter((e=>zs(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!i||e.mark.type!==i&&e.mark.type.excludes(i))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=s}var aa=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:o}=r;return!n||(o.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:o}=t,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+e.nodeSize)),a=i.blockRange(s);if(!a)return;const l=It(a);if(e.type.isTextblock){const{defaultType:e}=i.parent.contentMatchAt(i.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:o}=n;if(n instanceof cn||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Zi(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(n,i.createAndFill());s.setSelection(on.create(s.doc,n+1)),t(s.scrollIntoView())}return!0})(e,t),deleteNode:e=>({tr:t,state:n,dispatch:r})=>{const o=hs(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1){if(i.node(e).type===o){if(r){const n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!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 o=n.node(-1),i=n.indexAfter(-1),s=Zi(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,s.createAndFill());o.setSelection(en.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0})(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:o})=>{const i=Bs(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const e=Rs(l,i,t);if(e&&e.from<=c&&e.to>=u){const t=on.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:o,dispatch:i})=>{t={scrollIntoView:!0,...t};const s=()=>{Ws()&&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(i&&null===e&&!Hs(n.state.selection))return s(),!0;const a=Vs(o.doc,e)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.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:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const o=Ys(t,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===o.toString())return!0;let{from:s,to:a}="number"==typeof e?{from:e,to:e}:e,l=!0,c=!0;if((o.toString().startsWith("<")?o:[o]).forEach((e=>{e.check(),l=!!l&&(e.isText&&0===e.marks.length),c=!!c&&e.isBlock})),s===a&&c){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,o),n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const o=e.steps[r];if(!(o instanceof Nt||o instanceof St))return;const i=e.mapping.maps[r];let s=0;i.forEach(((e,t,n,r)=>{0===s&&(s=r)})),e.setSelection(en.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 o=Ji(r);if(!o){let n=r.blockRange(),o=n&&It(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&es(e,o,t))return!0;if(0==r.parent.content.size&&(Gi(i,"end")||an.isSelectable(i))){let n=Bt(e.doc,r.before(),r.after(),he.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Gi(i,"end")?en.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):an.create(r.doc,o.pos-i.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(t&&t(e.tr.delete(o.pos-i.nodeSize,o.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 o=Xi(r);if(!o)return!1;let i=o.nodeAfter;if(es(e,o,t))return!0;if(0==r.parent.content.size&&(Gi(i,"start")||an.isSelectable(i))){let n=Bt(e.doc,r.before(),r.after(),he.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Gi(i,"start")?en.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):an.create(r.doc,r.mapping.map(o.pos))),t(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),0))})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:o})=>{const i=function(e){const t=e.split(/-(?!$)/);let n,r,o,i,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))i=!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))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);Ws()||Qs()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=i.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.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&&o&&r.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:r})=>!!Ks(n,hs(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&It(o);return null!=i&&(t&&t(e.tr.lift(o,i).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(Pt(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&It(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)})(e,t),liftListItem:e=>({state:t,dispatch:n})=>as(hs(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:o})=>{let i=null,s=null;const a=Gs("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(i=hs(e,r.schema)),"mark"===a&&(s=Bs(e,r.schema)),o&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{i&&i===e.type&&n.setNodeMarkup(r,void 0,Js(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((o=>{s===o.type&&n.addMark(r,r+e.nodeSize,s.create(Js(o.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:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=Ji(r)}let s=i&&i.nodeBefore;return!(!s||!an.isSelectable(s)||(t&&t(e.tr.setSelection(an.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),0))})(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=Xi(r)}let s=i&&i.nodeAfter;return!(!s||!an.isSelectable(s)||(t&&t(e.tr.setSelection(an.create(e.doc,i.pos)).scrollIntoView()),0))})(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:o}=e.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),t&&t(e.tr.setSelection(an.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>rs(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>ns(e,t),setContent:(e,t=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=Xs(e,o.schema,n);return i&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Bs(e,r.schema);if(o)if(s){const e=Zs(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const o=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(o,i,((e,r)=>{const s=Math.max(r,o),a=Math.min(r+e.nodeSize,i);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:o})=>{const i=hs(e,n.schema);return i.isTextblock?o().command((({commands:e})=>!!is(i,t)(n)||e.clearNodes())).command((({state:e})=>is(i,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=en.atStart(n).from,o=en.atEnd(n).to,i=$s(e,r,o),s=an.create(n,i);t.setSelection(s)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,i=on.atStart(n).from,s=on.atEnd(n).to,a=$s(r,i,s),l=$s(o,i,s),c=on.create(n,a,l);t.setSelection(c)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const r=hs(e,t.schema);return(o=r,function(e,t){let{$from:n,$to:r}=e.selection,i=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==o));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=o)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,r=ae.from(n?o.create():null),s=new he(ae.from(o.create(null,ae.from(a.type.create(null,r)))),n?3:1,0),c=i.start,u=i.end;t(e.tr.step(new St(c-(n?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0})(t,n);var o},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=t,{$from:a,$to:l}=i,c=ea(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof an&&i.node.isBlock)return!(!a.parentOffset||!Pt(s,a.pos))&&(r&&(e&&ta(n,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;i instanceof on&&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 u=r&&s?[{type:s,attrs:c}]:void 0,d=Pt(t.doc,t.mapping.map(a.pos),1,u);if(u||d||!Pt(t.doc,t.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(d=!0,u=s?[{type:s,attrs:c}]:void 0),d&&(t.split(t.mapping.map(a.pos),1,u),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&&ta(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0},splitListItem:e=>({tr:t,state:n,dispatch:r,editor:o})=>{var i;const s=hs(e,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const d=o.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=ae.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=ae.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,o=ea(d,a.node().type.name,a.node().attrs),l=(null===(i=s.contentMatch.defaultType)||void 0===i?void 0:i.createAndFill(o))||void 0;e=e.append(ae.from(s.createAndFill(null,l)||void 0));const c=a.before(a.depth-(n-1));t.replace(c,a.after(-r),new he(e,4-n,0));let u=-1;t.doc.nodesBetween(c,t.doc.content.size,((e,t)=>{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)})),u>-1&&t.setSelection(on.near(t.doc.resolve(u))),t.scrollIntoView()}return!0}const p=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,h=ea(d,u.type.name,u.attrs),f=ea(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!!Pt(t.doc,a.pos,2)&&(r&&t.split(a.pos,2,m).scrollIntoView(),!0)},toggleList:(e,t)=>({editor:n,tr:r,state:o,dispatch:i,chain:s,commands:a,can:l})=>{const{extensions:c}=n.extensionManager,u=hs(e,o.schema),d=hs(t,o.schema),{selection:p}=o,{$from:h,$to:f}=p,m=h.blockRange(f);if(!m)return!1;const g=na((e=>ra(e.type.name,c)))(p);if(m.depth>=1&&g&&m.depth-g.depth<=1){if(g.node.type===u)return a.liftListItem(d);if(ra(g.node.type.name,c)&&u.validContent(g.node.content)&&i)return s().command((()=>(r.setNodeMarkup(g.pos,u),!0))).command((()=>oa(r,u))).command((()=>ia(r,u))).run()}return s().command((()=>!!l().wrapInList(u)||a.clearNodes())).wrapInList(u).command((()=>oa(r,u))).command((()=>ia(r,u))).run()},toggleMark:(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Bs(e,r.schema);return sa(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},toggleNode:(e,t,n={})=>({state:r,commands:o})=>{const i=hs(e,r.schema),s=hs(t,r.schema);return Ks(r,i,n)?o.setNode(s):o.setNode(i,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const o=hs(e,n.schema);return Ks(n,o,t)?r.lift(o):r.wrapIn(o,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){const t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){const n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:o}=n;return r||t&&o.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=Bs(e,r.schema),{$from:c,empty:u,ranges:d}=a;if(!o)return!0;if(u&&s){let{from:e,to:t}=a;const r=null===(i=c.marks().find((e=>e.type===l)))||void 0===i?void 0:i.attrs,o=Rs(c,l,r);o&&(e=o.from,t=o.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:o})=>{let i=null,s=null;const a=Gs("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(i=hs(e,r.schema)),"mark"===a&&(s=Bs(e,r.schema)),o&&n.selection.ranges.forEach((e=>{const o=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(o,a,((e,r)=>{i&&i===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach((i=>{if(s===i.type){const l=Math.max(r,o),c=Math.min(r+e.nodeSize,a);n.addMark(l,c,s.create({...i.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&Lt(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(hs(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>ss(hs(e,n.schema),t)(n,r)});const la=_s.create({name:"commands",addCommands:()=>({...aa})}),ca=_s.create({name:"editable",addProseMirrorPlugins(){return[new Dn({key:new Cn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ua=_s.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Dn({key:new Cn("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}}}})]}}),da=_s.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:o,$anchor:i}=n,{pos:s,parent:a}=i,l=en.atStart(r).from===s;return!(!(o&&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},o={...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 Ws()||Qs()?o:r},addProseMirrorPlugins(){return[new Dn({key:new Cn("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:r,from:o,to:i}=t.selection,s=en.atStart(t.doc).from,a=en.atEnd(t.doc).to,l=o===s&&i===a,c=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(r||!l||!c)return;const u=n.tr,d=ls({state:n,transaction:u}),{commands:p}=new cs({editor:this.editor,state:d});return p.clearNodes(),u.steps.length?u:void 0}})]}}),pa=_s.create({name:"tabindex",addProseMirrorPlugins(){return[new Dn({key:new Cn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var ha=Object.freeze({__proto__:null,ClipboardTextSerializer:Ls,Commands:la,Editable:ca,FocusEvents:ua,Keymap:da,Tabindex:pa});function fa(e,t){const n=Gs("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=hs(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,(e=>{i.push(e)}));const s=i.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?Zs(e,t):{}}const ma=`.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 ga(e,t){const n=[];return e.descendants(((e,r)=>{t(e)&&n.push({node:e,pos:r})})),n}function ya(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 ba(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const o=Rs(n.resolve(e-1),t.type);o&&r.push({mark:t,...o})})):n.nodesBetween(e,t,((e,t)=>{r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function va(e,t,n){const r=0,o=e.state.doc.content.size,i=$s(t,r,o),s=$s(n,r,o),a=e.coordsAtPos(i),l=e.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),p=Math.max(a.right,l.right),h={top:c,bottom:u,left:d,right:p,width:p-d,height:u-c,x:d,y:c};return{...h,toJSON:()=>h}}function wa(e){return new Ds({find:e.find,handler:({state:t,range:n,match:r})=>{const o=ys(e.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length,d=ba(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>c));if(d.length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+r,c),l=n.from+r+s.length,i.addMark(n.from+r,l,e.type.create(o||{})),i.removeStoredMark(e.type)}}})}function xa(e){return new Ds({find:e.find,handler:({state:t,range:n,match:r})=>{const o=ys(e.getAttributes,void 0,r)||{},{tr:i}=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];i.insertText(n,s+r[0].length-1),i.replaceWith(t,a,e.type.create(o))}else r[0]&&i.replaceWith(s,a,e.type.create(o))}})}function Ma(e){return new Ds({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=ys(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)}})}function Da(e){return new Ds({find:e.find,handler:({state:t,range:n,match:r})=>{let o=e.replace,i=n.from;const s=n.to;if(r[1]){const e=r[0].lastIndexOf(r[1]);o+=r[0].slice(e+r[1].length),i+=e;const t=i-s;t>0&&(o=r[0].slice(e-t,e)+o,i=s)}t.tr.insertText(o,i,s)}})}function ka(e){return new Ds({find:e.find,handler:({state:t,range:n,match:r})=>{const o=ys(e.getAttributes,void 0,r)||{},i=t.tr.delete(n.from,n.to),s=i.doc.resolve(n.from).blockRange(),a=s&&Lt(s,e.type,o);if(!a)return null;i.wrap(s,a);const l=i.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Ft(i.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&i.join(n.from-1)}})}class Ea{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=ys(us(this,"addOptions",{name:this.name}))),this.storage=ys(us(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ea(e)}configure(e={}){const t=this.extend();return t.options=Ss(this.options,e),t.storage=ys(us(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ea(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=ys(us(t,"addOptions",{name:t.name})),t.storage=ys(us(t,"addStorage",{name:t.name,options:t.options})),t}}class Ca{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=ys(us(this,"addOptions",{name:this.name}))),this.storage=ys(us(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ca(e)}configure(e={}){const t=this.extend();return t.options=Ss(this.options,e),t.storage=ys(us(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=ys(us(t,"addOptions",{name:t.name})),t.storage=ys(us(t,"addStorage",{name:t.name,options:t.options})),t}}function Ta(e){return new Cs({find:e.find,handler:({state:t,range:n,match:r})=>{const o=ys(e.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length,d=ba(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>c));if(d.length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+r,c),l=n.from+r+s.length,i.addMark(n.from+r,l,e.type.create(o||{})),i.removeStoredMark(e.type)}}})}var Oa="top",Aa="bottom",Na="right",Sa="left",_a="auto",ja=[Oa,Aa,Na,Sa],Ia="start",La="end",za="clippingParents",Pa="viewport",Fa="popper",Ra="reference",Ba=ja.reduce((function(e,t){return e.concat([t+"-"+Ia,t+"-"+La])}),[]),Ua=[].concat(ja,[_a]).reduce((function(e,t){return e.concat([t,t+"-"+Ia,t+"-"+La])}),[]),Ha=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function $a(e){return e?(e.nodeName||"").toLowerCase():null}function Va(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Wa(e){return e instanceof Va(e).Element||e instanceof Element}function qa(e){return e instanceof Va(e).HTMLElement||e instanceof HTMLElement}function Ya(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Va(e).ShadowRoot||e instanceof ShadowRoot)}var Qa={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];qa(o)&&$a(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});qa(r)&&$a(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Ka(e){return e.split("-")[0]}var Ga=Math.max,Ja=Math.min,Xa=Math.round;function Za(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,o=1;if(qa(e)&&t){var i=e.offsetHeight,s=e.offsetWidth;s>0&&(r=Xa(n.width)/s||1),i>0&&(o=Xa(n.height)/i||1)}return{width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function el(e){var t=Za(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 tl(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ya(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function nl(e){return Va(e).getComputedStyle(e)}function rl(e){return["table","td","th"].indexOf($a(e))>=0}function ol(e){return((Wa(e)?e.ownerDocument:e.document)||window.document).documentElement}function il(e){return"html"===$a(e)?e:e.assignedSlot||e.parentNode||(Ya(e)?e.host:null)||ol(e)}function sl(e){return qa(e)&&"fixed"!==nl(e).position?e.offsetParent:null}function al(e){for(var t=Va(e),n=sl(e);n&&rl(n)&&"static"===nl(n).position;)n=sl(n);return n&&("html"===$a(n)||"body"===$a(n)&&"static"===nl(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&qa(e)&&"fixed"===nl(e).position)return null;var n=il(e);for(Ya(n)&&(n=n.host);qa(n)&&["html","body"].indexOf($a(n))<0;){var r=nl(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 ll(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function cl(e,t,n){return Ga(e,Ja(t,n))}function ul(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function dl(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var pl={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ka(n.placement),l=ll(a),c=[Sa,Na].indexOf(a)>=0?"height":"width";if(i&&s){var u=function(e,t){return ul("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:dl(e,ja))}(o.padding,n),d=el(i),p="y"===l?Oa:Sa,h="y"===l?Aa:Na,f=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],g=al(i),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=f/2-m/2,v=u[p],w=y-d[c]-u[h],x=y/2-d[c]/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)))&&tl(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function hl(e){return e.split("-")[1]}var fl={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ml(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,p=s.x,h=void 0===p?0:p,f=s.y,m=void 0===f?0:f,g="function"==typeof u?u({x:h,y:m}):{x:h,y:m};h=g.x,m=g.y;var y=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),v=Sa,w=Oa,x=window;if(c){var M=al(n),D="clientHeight",k="clientWidth";if(M===Va(n)&&"static"!==nl(M=ol(n)).position&&"absolute"===a&&(D="scrollHeight",k="scrollWidth"),o===Oa||(o===Sa||o===Na)&&i===La)w=Aa,m-=(d&&M===x&&x.visualViewport?x.visualViewport.height:M[D])-r.height,m*=l?1:-1;if(o===Sa||(o===Oa||o===Aa)&&i===La)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},c&&fl),T=!0===u?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Xa(t*r)/r||0,y:Xa(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 gl={passive:!0};var yl={left:"right",right:"left",bottom:"top",top:"bottom"};function bl(e){return e.replace(/left|right|bottom|top/g,(function(e){return yl[e]}))}var vl={start:"end",end:"start"};function wl(e){return e.replace(/start|end/g,(function(e){return vl[e]}))}function xl(e){var t=Va(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Ml(e){return Za(ol(e)).left+xl(e).scrollLeft}function Dl(e){var t=nl(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function kl(e){return["html","body","#document"].indexOf($a(e))>=0?e.ownerDocument.body:qa(e)&&Dl(e)?e:kl(il(e))}function El(e,t){var n;void 0===t&&(t=[]);var r=kl(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Va(r),s=o?[i].concat(i.visualViewport||[],Dl(r)?r:[]):r,a=t.concat(s);return o?a:a.concat(El(il(s)))}function Cl(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Tl(e,t){return t===Pa?Cl(function(e){var t=Va(e),n=ol(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,s=0,a=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:o,height:i,x:s+Ml(e),y:a}}(e)):Wa(t)?function(e){var t=Za(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):Cl(function(e){var t,n=ol(e),r=xl(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=Ga(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Ga(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+Ml(e),l=-r.scrollTop;return"rtl"===nl(o||n).direction&&(a+=Ga(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}(ol(e)))}function Ol(e,t,n){var r="clippingParents"===t?function(e){var t=El(il(e)),n=["absolute","fixed"].indexOf(nl(e).position)>=0&&qa(e)?al(e):e;return Wa(n)?t.filter((function(e){return Wa(e)&&tl(e,n)&&"body"!==$a(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),i=o[0],s=o.reduce((function(t,n){var r=Tl(e,n);return t.top=Ga(r.top,t.top),t.right=Ja(r.right,t.right),t.bottom=Ja(r.bottom,t.bottom),t.left=Ga(r.left,t.left),t}),Tl(e,i));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,o=e.placement,i=o?Ka(o):null,s=o?hl(o):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case Oa: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 Sa:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?ll(i):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case Ia:t[c]=t[c]-(n[u]/2-r[u]/2);break;case La:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}function Nl(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.boundary,s=void 0===i?za:i,a=n.rootBoundary,l=void 0===a?Pa:a,c=n.elementContext,u=void 0===c?Fa:c,d=n.altBoundary,p=void 0!==d&&d,h=n.padding,f=void 0===h?0:h,m=ul("number"!=typeof f?f:dl(f,ja)),g=u===Fa?Ra:Fa,y=e.rects.popper,b=e.elements[p?g:u],v=Ol(Wa(b)?b:b.contextElement||ol(e.elements.popper),s,l),w=Za(e.elements.reference),x=Al({reference:w,element:y,strategy:"absolute",placement:o}),M=Cl(Object.assign({},y,x)),D=u===Fa?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(u===Fa&&E){var C=E[o];Object.keys(k).forEach((function(e){var t=[Na,Aa].indexOf(e)>=0?1:-1,n=[Oa,Aa].indexOf(e)>=0?"y":"x";k[e]+=C[n]*t}))}return k}function Sl(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?Ua:l,u=hl(r),d=u?a?Ba:Ba.filter((function(e){return hl(e)===u})):ja,p=d.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=Nl(e,{placement:n,boundary:o,rootBoundary:i,padding:s})[Ka(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var _l={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,g=t.options.placement,y=Ka(g),b=l||(y===g||!f?[bl(g)]:function(e){if(Ka(e)===_a)return[];var t=bl(e);return[wl(e),t,wl(t)]}(g)),v=[g].concat(b).reduce((function(e,n){return e.concat(Ka(n)===_a?Sl(t,{placement:n,boundary:u,rootBoundary:d,padding:c,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=Ka(C),O=hl(C)===Ia,A=[Oa,Aa].indexOf(T)>=0,N=A?"width":"height",S=Nl(t,{placement:C,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),_=A?O?Na:Sa:O?Aa:Oa;w[N]>x[N]&&(_=bl(_));var j=bl(_),I=[];if(i&&I.push(S[T]<=0),a&&I.push(S[_]<=0,S[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 jl(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 Il(e){return[Oa,Na,Aa,Sa].some((function(t){return e[t]>=0}))}var Ll={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,s=Ua.reduce((function(e,n){return e[n]=function(e,t,n){var r=Ka(e),o=[Sa,Oa].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Sa,Na].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,i),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}};var zl={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,u=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:c,padding:d,altBoundary:u}),y=Ka(t.placement),b=hl(t.placement),v=!b,w=ll(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(i){var A,N="y"===w?Oa:Sa,S="y"===w?Aa:Na,_="y"===w?"height":"width",j=M[w],I=j+g[N],L=j-g[S],z=h?-k[_]/2:0,P=b===Ia?D[_]:k[_],F=b===Ia?-k[_]:-D[_],R=t.elements.arrow,B=h&&R?el(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[N],$=U[S],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&&al(t.elements.arrow),Q=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,K=null!=(A=null==T?void 0:T[w])?A:0,G=j+q-K,J=cl(h?Ja(I,j+W-K-Q):I,j,h?Ga(L,G):L);M[w]=J,O[w]=J-j}if(a){var X,Z="x"===w?Oa:Sa,ee="x"===w?Aa:Na,te=M[x],ne="y"===x?"height":"width",re=te+g[Z],oe=te-g[ee],ie=-1!==[Oa,Sa].indexOf(y),se=null!=(X=null==T?void 0:T[x])?X:0,ae=ie?re:te-D[ne]-k[ne]-se+C.altAxis,le=ie?te+D[ne]+k[ne]-se-C.altAxis:oe,ce=h&&ie?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:oe);M[x]=ce,O[x]=ce-te}t.modifiersData[r]=O}},requiresIfExists:["offset"]};function Pl(e,t,n){void 0===n&&(n=!1);var r,o,i=qa(t),s=qa(t)&&function(e){var t=e.getBoundingClientRect(),n=Xa(t.width)/e.offsetWidth||1,r=Xa(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=ol(t),l=Za(e,s),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&(("body"!==$a(t)||Dl(a))&&(c=(r=t)!==Va(r)&&qa(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:xl(r)),qa(t)?((u=Za(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):a&&(u.x=Ml(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function Fl(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}var Rl={placement:"bottom",modifiers:[],strategy:"absolute"};function Bl(){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 Ul(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?Rl:o;return function(e,t,n){void 0===n&&(n=i);var o,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Rl,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,u={state:a,setOptions:function(n){var o="function"==typeof n?n(a.options):n;d(),a.options=Object.assign({},i,a.options,o),a.scrollParents={reference:Wa(e)?El(e):e.contextElement?El(e.contextElement):[],popper:El(t)};var s=function(e){var t=Fl(e);return Ha.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,o=e.effect;if("function"==typeof o){var i=o({state:a,name:t,instance:u,options:r}),s=function(){};l.push(i||s)}})),u.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,n=e.popper;if(Bl(t,n)){a.rects={reference:Pl(t,al(n),"fixed"===a.options.strategy),popper:el(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 o=a.orderedModifiers[r],i=o.fn,s=o.options,l=void 0===s?{}:s,d=o.name;"function"==typeof i&&(a=i({state:a,options:l,name:d,instance:u})||a)}else a.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(e){u.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(o())}))}))),s}),destroy:function(){d(),c=!0}};if(!Bl(e,t))return u;function d(){l.forEach((function(e){return e()})),l=[]}return u.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),u}}var Hl=Ul({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,s=r.resize,a=void 0===s||s,l=Va(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,gl)})),a&&l.addEventListener("resize",n.update,gl),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,gl)})),a&&l.removeEventListener("resize",n.update,gl)}},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,o=void 0===r||r,i=n.adaptive,s=void 0===i||i,a=n.roundOffsets,l=void 0===a||a,c={placement:Ka(t.placement),variation:hl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ml(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ml(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Qa,Ll,_l,zl,pl,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=Nl(t,{elementContext:"reference"}),a=Nl(t,{altBoundary:!0}),l=jl(s,r),c=jl(a,o,i),u=Il(l),d=Il(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),$l='<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>',Vl="tippy-box",Wl="tippy-content",ql="tippy-backdrop",Yl="tippy-arrow",Ql="tippy-svg-arrow",Kl={passive:!0,capture:!0},Gl=function(){return document.body};function Jl(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Xl(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Zl(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ec(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function tc(e){return[].concat(e)}function nc(e,t){-1===e.indexOf(t)&&e.push(t)}function rc(e){return[].slice.call(e)}function oc(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function ic(){return document.createElement("div")}function sc(e){return["Element","Fragment"].some((function(t){return Xl(e,t)}))}function ac(e){return Xl(e,"MouseEvent")}function lc(e){return sc(e)?[e]:function(e){return Xl(e,"NodeList")}(e)?rc(e):Array.isArray(e)?e:rc(document.querySelectorAll(e))}function cc(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function uc(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function dc(e){var t,n=tc(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function pc(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function hc(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 fc={isTouch:!1},mc=0;function gc(){fc.isTouch||(fc.isTouch=!0,window.performance&&document.addEventListener("mousemove",yc))}function yc(){var e=performance.now();e-mc<20&&(fc.isTouch=!1,document.removeEventListener("mousemove",yc)),mc=e}function bc(){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 vc=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,wc=Object.assign({appendTo:Gl,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}),xc=Object.keys(wc);function Mc(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=wc[o])?r:i);return t}),{});return Object.assign({},e,t)}function Dc(e,t){var n=Object.assign({},t,{content:Zl(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Mc(Object.assign({},wc,{plugins:t}))):xc).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({},wc.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 kc(e,t){e["innerHTML"]=t}function Ec(e){var t=ic();return!0===e?t.className=Yl:(t.className=Ql,sc(e)?t.appendChild(e):kc(t,e)),t}function Cc(e,t){sc(t.content)?(kc(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?kc(e,t.content):e.textContent=t.content)}function Tc(e){var t=e.firstElementChild,n=rc(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(Wl)})),arrow:n.find((function(e){return e.classList.contains(Yl)||e.classList.contains(Ql)})),backdrop:n.find((function(e){return e.classList.contains(ql)}))}}function Oc(e){var t=ic(),n=ic();n.className=Vl,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ic();function o(n,r){var o=Tc(t),i=o.box,s=o.content,a=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Cc(s,e.props),r.arrow?a?n.arrow!==r.arrow&&(i.removeChild(a),i.appendChild(Ec(r.arrow))):i.appendChild(Ec(r.arrow)):a&&i.removeChild(a)}return r.className=Wl,r.setAttribute("data-state","hidden"),Cc(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}Oc.$$tippy=!0;var Ac=1,Nc=[],Sc=[];function _c(e,t){var n,r,o,i,s,a,l,c,u=Dc(e,Object.assign({},wc,Mc(oc(t)))),d=!1,p=!1,h=!1,f=!1,m=[],g=ec(Y,u.interactiveDebounce),y=Ac++,b=(c=u.plugins).filter((function(e,t){return c.indexOf(e)===t})),v={id:y,reference:e,popper:ic(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(o)},setProps:function(t){if(v.state.isDestroyed)return;j("onBeforeUpdate",[v,t]),W();var n=v.props,r=Dc(e,Object.assign({},n,oc(t),{ignoreAttributes:!0}));v.props=r,V(),n.interactiveDebounce!==r.interactiveDebounce&&(z(),g=ec(Y,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?tc(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=fc.isTouch&&!v.props.touch,o=Jl(v.props.duration,0,wc.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 i=N(),s=i.box,l=i.content;cc([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=N(),n=t.box,r=t.content;cc([n,r],o),uc([n,r],"visible")}I(),L(),nc(Sc,v),null==(e=v.popperInstance)||e.forceUpdate(),j("onMount",[v]),v.props.animation&&T()&&function(e,t){H(e,t)}(o,(function(){v.state.isShown=!0,j("onShown",[v])}))}},function(){var e,t=v.props.appendTo,n=O();e=v.props.interactive&&t===Gl||"parent"===t?n.parentNode:Zl(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=Jl(v.props.duration,1,wc.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 o=N(),i=o.box,s=o.content;v.props.animation&&(cc([i,s],r),uc([i,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){A().addEventListener("mousemove",g),nc(Nc,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);Sc=Sc.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(!u.render)return v;var w=u.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]),u.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&&A().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 A(){var e=O().parentNode;return e?dc(e):document}function N(){return Tc(x)}function S(e){return v.state.isMounted&&!v.state.isVisible||fc.isTouch||i&&"focus"===i.type?0:Jl(v.props.delay,e?0:1,wc.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;tc(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 o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function L(){!k&&v.props.aria.expanded&&tc(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(){A().removeEventListener("mousemove",g),Nc=Nc.filter((function(e){return e!==g}))}function P(t){if(!fc.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!v.props.interactive||!hc(x,n)){if(tc(v.props.triggerTarget||e).some((function(e){return hc(e,n)}))){if(fc.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=A();e.addEventListener("mousedown",P,!0),e.addEventListener("touchend",P,Kl),e.addEventListener("touchstart",R,Kl),e.addEventListener("touchmove",F,Kl)}function U(){var e=A();e.removeEventListener("mousedown",P,!0),e.removeEventListener("touchend",P,Kl),e.removeEventListener("touchstart",R,Kl),e.removeEventListener("touchmove",F,Kl)}function H(e,t){var n=N().box;function r(e){e.target===n&&(pc(n,"remove",r),t())}if(0===e)return t();pc(n,"remove",s),pc(n,"add",r),s=r}function $(t,n,r){void 0===r&&(r=!1),tc(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":$(vc?"focusout":"blur",K);break;case"focusin":$("focusout",K)}}))}function W(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),m=[]}function q(e){var t,n=!1;if(v.state.isEnabled&&!G(e)&&!p){var r="focus"===(null==(t=i)?void 0:t.type);i=e,l=e.currentTarget,L(),!v.state.isVisible&&ac(e)&&Nc.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:u}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,s=o.placement.split("-")[0],a=o.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,u="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=t.top-r+l>i,h=r-t.bottom-c>i,f=t.left-n+u>i,m=n-t.right-d>i;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!!fc.isTouch&&C()!==e.type.indexOf("touch")>=0}function J(){X();var t=v.props,n=t.popperOptions,r=t.placement,o=t.offset,i=t.getReferenceClientRect,s=t.moveTransition,l=T()?Tc(x).arrow:null,c=i?{getBoundingClientRect:i,contextElement:i.contextElement||O()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(T()){var n=N().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:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},u];T()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),v.popperInstance=Hl(c,x,Object.assign({},n,{placement:r,onFirstUpdate:a,modifiers:d}))}function X(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Z(){return rc(x.querySelectorAll("[data-tippy-root]"))}function ee(e){v.clearDelayTimeouts(),e&&j("onTrigger",[v,e]),B();var t=S(!0),r=E(),o=r[0],i=r[1];fc.isTouch&&"hold"===o&&i&&(t=i),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=S(!1);t?r=setTimeout((function(){v.state.isVisible&&v.hide()}),t):o=requestAnimationFrame((function(){v.hide()}))}}else U()}}function jc(e,t){void 0===t&&(t={});var n=wc.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",gc,Kl),window.addEventListener("blur",bc);var r=Object.assign({},t,{plugins:n}),o=lc(e).reduce((function(e,t){var n=t&&_c(t,r);return n&&e.push(n),e}),[]);return sc(e)?o[0]:o}jc.defaultProps=wc,jc.setDefaultProps=function(e){Object.keys(e).forEach((function(t){wc[t]=e[t]}))},jc.currentInput=fc,Object.assign({},Qa,{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 Ic={clientX:0,clientY:0},Lc=[];function zc(e){var t=e.clientX,n=e.clientY;Ic={clientX:t,clientY:n}}var Pc={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=dc(e.props.triggerTarget||t),r=!1,o=!1,i=!0,s=e.props;function a(){return"initial"===e.props.followCursor&&e.state.isVisible}function l(){n.addEventListener("mousemove",d)}function c(){n.removeEventListener("mousemove",d)}function u(){r=!0,e.setProps({getReferenceClientRect:null}),r=!1}function d(n){var r=!n.target||t.contains(n.target),o=e.props.followCursor,i=n.clientX,s=n.clientY,a=t.getBoundingClientRect(),l=i-a.left,c=s-a.top;!r&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=i,r=s;"initial"===o&&(n=e.left+l,r=e.top+c);var a="horizontal"===o?e.top:r,u="vertical"===o?e.right:n,d="horizontal"===o?e.bottom:r,p="vertical"===o?e.left:n;return{width:u-p,height:d-a,top:a,right:u,bottom:d,left:p}}})}function p(){e.props.followCursor&&(Lc.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",zc)}(n))}function h(){Lc=Lc.filter((function(t){return t.instance!==e})),0===Lc.filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",zc)}(n)}return{onCreate:p,onDestroy:h,onBeforeUpdate:function(){s=e.props},onAfterUpdate:function(t,n){var i=n.followCursor;r||void 0!==i&&s.followCursor!==i&&(h(),i?(p(),!e.state.isMounted||o||a()||l()):(c(),u()))},onMount:function(){e.props.followCursor&&!o&&(i&&(d(Ic),i=!1),a()||l())},onTrigger:function(e,t){ac(t)&&(Ic={clientX:t.clientX,clientY:t.clientY}),o="focus"===t.type},onHidden:function(){e.props.followCursor&&(u(),c(),i=!0)}}}};jc.setDefaultProps({render:Oc});class Fc{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:r})=>{const{doc:o,selection:i}=t,{empty:s}=i,a=!o.textBetween(n,r).length&&Hs(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,o&&(this.shouldShow=o),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=jc(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,o;const{state:i,composing:s}=e,{doc:a,selection:l}=i,c=t&&t.doc.eq(a)&&t.selection.eq(l);if(s||c)return;this.createTooltip();const{ranges:u}=l,d=Math.min(...u.map((e=>e.$from.pos))),p=Math.max(...u.map((e=>e.$to.pos)));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:i,oldState:t,from:d,to:p}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||(()=>{if(Us(t=i.selection)&&t instanceof an){const t=e.nodeDOM(d);if(t)return t.getBoundingClientRect()}var t;return va(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 Rc=e=>new Dn({key:"string"==typeof e.pluginKey?new Cn(e.pluginKey):e.pluginKey,view:t=>new Fc({view:t,...e})});_s.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[Rc({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class Bc{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{const{selection:n}=t,{$anchor:r,empty:o}=n,i=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;return!!(e.hasFocus()&&o&&i&&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,o&&(this.shouldShow=o),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=jc(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,o;const{state:i}=e,{doc:s,selection:a}=i,{from:l,to:c}=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:i,oldState:t}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||(()=>va(e,l,c))}),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)}}_s.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 Dn({key:"string"==typeof e.pluginKey?new Cn(e.pluginKey):e.pluginKey,view:t=>new Bc({view:t,...e})}))]:[];var e}});const Uc=e=>{const[n,r]=o(null);return i((()=>{if(!n)return;if(e.editor.isDestroyed)return;const{pluginKey:t="bubbleMenu",editor:r,tippyOptions:o={},shouldShow:i=null}=e,s=Rc({pluginKey:t,editor:r,element:n,tippyOptions:o,shouldShow:i});return r.registerPlugin(s),()=>r.unregisterPlugin(t)}),[e.editor,n]),t.createElement("div",{ref:r,className:e.className,style:{visibility:"hidden"}},e.children)};class Hc 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}(ma,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=gs(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(ha):[],...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=Xs(this.options.content,this.schema,this.options.parseOptions),t=Vs(e,this.options.autofocus);this.view=new Ni(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:xn.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"),o=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return fa(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 Ks(e,null,n)||sa(e,null,n);const r=Gs(t,e.schema);return"node"===r?Ks(e,t,n):"mark"===r&&sa(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(e,t){const n=ut.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 js(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...n,...Is(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 $c=({renderers:e})=>t.createElement(t.Fragment,null,Array.from(e).map((([e,t])=>h.createPortal(t.reactElement,t.element,e))));class Vc 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($c,{renderers:this.state.renderers}))}}const Wc=t.memo(Vc),qc=n({onDragStart:void 0}),Yc=()=>r(qc),Qc=e=>{const n=e.as||"div",{nodeViewContentRef:r}=Yc();return t.createElement(n,{...e,ref:r,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style}})},Kc=t.forwardRef(((e,n)=>{const{onDragStart:r}=Yc(),o=e.as||"div";return t.createElement(o,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})}));class Gc{constructor(e,{editor:t,props:n={},as:r="div",className:o=""}){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"),o&&this.element.classList.add(...o.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 Jc 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,o,i,s,a;const{view:l}=this.editor,c=e.target,u=3===c.nodeType?null===(t=c.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(c))||!u)return;let d=0,p=0;if(this.dom!==u){const t=this.dom.getBoundingClientRect(),n=u.getBoundingClientRect(),a=null!==(r=e.offsetX)&&void 0!==r?r:null===(o=e.nativeEvent)||void 0===o?void 0:o.offsetX,l=null!==(i=e.offsetY)&&void 0!==i?i: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=an.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:o}=this.editor,{isDragging:i}=this,s=!!this.node.type.spec.draggable,a=an.isSelectable(this.node),l="copy"===e.type,c="paste"===e.type,u="cut"===e.type,d="mousedown"===e.type,p=e.type.startsWith("drag");if(!s&&a&&p&&e.preventDefault(),s&&p&&!i)return e.preventDefault(),!1;if(s&&o&&!i&&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!(i||r||l||c||u||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&&Ws()&&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(qc.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:o=""}=this.options;this.renderer=new Gc(n,{editor:this.editor,props:e,as:r,className:`node-${this.node.type.name} ${o}`.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,o=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:r,oldDecorations:o,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 Xc(e,t){return n=>n.editor.contentComponent?new Jc(e,n,t):{}}const Zc=(e={},t=[])=>{const[n,r]=o(null),s=function(){const[,e]=o(0);return()=>e((e=>e+1))}();return i((()=>{let t=!0;const n=new Hc(e);return r(n),n.on("transaction",(()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t&&s()}))}))})),()=>{n.destroy(),t=!1}}),t),n};var eu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function tu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function nu(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 ru,ou={exports:{}};
1
+ import*as e from"react";import t,{createContext as n,useContext as r,useState as o,useEffect as i,forwardRef as s,cloneElement as a,useLayoutEffect as l,useRef as c,useCallback as u,useImperativeHandle as d}from"react";import*as p from"react-dom";import h,{createPortal as f}from"react-dom";import m from"highlight.js/lib/languages/arduino";import g from"highlight.js/lib/languages/bash";import y from"highlight.js/lib/languages/c";import b from"highlight.js/lib/languages/cpp";import v from"highlight.js/lib/languages/csharp";import w from"highlight.js/lib/languages/css";import x from"highlight.js/lib/languages/diff";import M from"highlight.js/lib/languages/go";import D from"highlight.js/lib/languages/graphql";import k from"highlight.js/lib/languages/ini";import E from"highlight.js/lib/languages/java";import C from"highlight.js/lib/languages/javascript";import T from"highlight.js/lib/languages/json";import O from"highlight.js/lib/languages/kotlin";import A from"highlight.js/lib/languages/less";import N from"highlight.js/lib/languages/lua";import S from"highlight.js/lib/languages/makefile";import _ from"highlight.js/lib/languages/markdown";import j from"highlight.js/lib/languages/objectivec";import I from"highlight.js/lib/languages/perl";import L from"highlight.js/lib/languages/php";import z from"highlight.js/lib/languages/php-template";import P from"highlight.js/lib/languages/plaintext";import F from"highlight.js/lib/languages/python";import R from"highlight.js/lib/languages/python-repl";import B from"highlight.js/lib/languages/r";import U from"highlight.js/lib/languages/ruby";import H from"highlight.js/lib/languages/rust";import $ from"highlight.js/lib/languages/scss";import V from"highlight.js/lib/languages/shell";import W from"highlight.js/lib/languages/sql";import q from"highlight.js/lib/languages/swift";import Y from"highlight.js/lib/languages/typescript";import Q from"highlight.js/lib/languages/vbnet";import K from"highlight.js/lib/languages/wasm";import G from"highlight.js/lib/languages/xml";import J from"highlight.js/lib/languages/yaml";import X from"highlight.js/lib/core";import Z from"highlight.js/lib/common";var ee=[],te=[];function ne(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",o=!0===t.singleTag,i="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var s=ee.indexOf(i);-1===s&&(s=ee.push(i)-1,te[s]={}),n=te[s]&&te[s][r]?te[s][r]:te[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),o=0;o<n.length;o++)e.setAttribute(n[o],t.attributes[n[o]]);var s="prepend"===r?"afterbegin":"beforeend";return i.insertAdjacentElement(s,e),e}}function re(){return re=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},re.apply(this,arguments)}function oe(e){this.content=e}function ie(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let e=0;o.text[e]==i.text[e];e++)n++;return n}if(o.content.size||i.content.size){let e=ie(o.content,i.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function se(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=e.child(--o),a=t.child(--i),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=se(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}ne('@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}\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 figure, .neeto-editor figure {\n margin: 8px;\n}\n.neeto-editor-content figure figcaption, .neeto-editor figure figcaption {\n color: #49545c;\n text-align: center;\n}\n.neeto-editor-content figure:focus, .neeto-editor figure:focus {\n display: hidden;\n}\n.neeto-editor-content .image-float-left, .neeto-editor .image-float-left {\n float: left;\n margin-left: 0;\n}\n.neeto-editor-content .image-float-right, .neeto-editor .image-float-right {\n float: right;\n margin-right: 0;\n}\n.neeto-editor-content .image-float-none, .neeto-editor .image-float-none {\n float: none;\n}\n.neeto-editor-content .image-size-small, .neeto-editor .image-size-small {\n display: inline;\n}\n.neeto-editor-content .image-size-small img, .neeto-editor .image-size-small img {\n height: 100%;\n max-height: 384px;\n max-width: 500px;\n -o-object-fit: contain;\n object-fit: contain;\n margin: auto;\n}\n.neeto-editor-content .image-size-large, .neeto-editor .image-size-large {\n width: 100%;\n}\n.neeto-editor-content .image-align-center, .neeto-editor .image-align-center {\n margin: 0 auto;\n}\n.neeto-editor-content .image-banner, .neeto-editor .image-banner {\n width: 100%;\n max-height: 300px;\n overflow: hidden;\n -o-object-fit: cover;\n object-fit: cover;\n}\n.neeto-editor-content figure.ProseMirror-selectednode, .neeto-editor figure.ProseMirror-selectednode {\n outline: none;\n}\n.neeto-editor-content figure.ProseMirror-selectednode img, .neeto-editor figure.ProseMirror-selectednode img {\n -webkit-user-select: auto;\n -moz-user-select: auto;\n user-select: auto;\n}\n.neeto-editor-content--hidden {\n display: none;\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: flex-start;\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,o=r.find(e),i=r.content.slice();return-1==o?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new oe(i)},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),o=r.content.slice(),i=r.find(e);return o.splice(-1==i?o.length:i,0,t,n),new oe(o)},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 ae{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,o){for(let i=0,s=0;s<t;i++){let a=this.content[i],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,e-o),Math.min(a.content.size,t-o),n,r+o)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(e,a)-a,t-a),i=!n):s.isLeaf?(r?o+="function"==typeof r?r(s):r:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new ae(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 o=0,i=0;i<t;o++){let s=this.content[o],a=i+s.nodeSize;a>e&&((i<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),n.push(s),r+=s.nodeSize),i=a}return new ae(n,r)}cutByIndex(e,t){return e==t?ae.empty:0==e&&t==this.content.length?this:new ae(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new ae(r,o)}addToStart(e){return new ae([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ae(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 ie(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return se(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 o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?ce(n+1,o):ce(n,r);r=o}}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 ae.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ae(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ae.empty;let t,n=0;for(let r=0;r<e.length;r++){let o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new ae(t||e,n)}static from(e){if(!e)return ae.empty;if(e instanceof ae)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ae([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ae.empty=new ae([],0);const le={index:0,offset:0};function ce(e,t){return le.index=e,le.offset=t,le}function ue(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(!ue(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!ue(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class de{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}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&&ue(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 de.none;if(e instanceof de)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}de.none=[];class pe extends Error{}class he{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=me(this.content,e+this.openStart,t);return n&&new he(n,this.openStart,this.openEnd)}removeBetween(e,t){return new he(fe(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 he.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 he(ae.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 he(e,n,r)}}function fe(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(o==t||i.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,i.copy(fe(i.content,t-o-1,n-o-1)))}function me(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=me(s.content,t-i-1,n);return a&&e.replaceChild(o,s.copy(a))}function ge(e,t,n){if(n.openStart>e.depth)throw new pe("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new pe("Inconsistent open depths");return ye(e,t,n,0)}function ye(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let s=ye(e,t,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:o,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(ae.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Me(i,De(e,o,s,t,r))}{let r=e.parent,o=r.content;return Me(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return Me(i,ke(e,t,r))}function be(e,t){if(!t.type.compatibleContent(e.type))throw new pe("Cannot join "+t.type.name+" onto "+e.type.name)}function ve(e,t,n){let r=e.node(n);return be(r,t.node(n)),r}function we(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 xe(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(we(e.nodeAfter,r),i++));for(let e=i;e<s;e++)we(o.child(e),r);t&&t.depth==n&&t.textOffset&&we(t.nodeBefore,r)}function Me(e,t){if(!e.type.validContent(t))throw new pe("Invalid content for node "+e.type.name);return e.copy(t)}function De(e,t,n,r,o){let i=e.depth>o&&ve(e,t,o+1),s=r.depth>o&&ve(n,r,o+1),a=[];return xe(null,e,o,a),i&&s&&t.index(o)==n.index(o)?(be(i,s),we(Me(i,De(e,t,n,r,o+1)),a)):(i&&we(Me(i,ke(e,t,o+1)),a),xe(t,n,o,a),s&&we(Me(s,ke(n,r,o+1)),a)),xe(r,null,o,a),new ae(a)}function ke(e,t,n){let r=[];if(xe(null,e,n,r),e.depth>n){we(Me(ve(e,t,n+1),ke(e,t,n+1)),r)}return xe(t,null,n,r),new ae(r)}he.empty=new he(ae.empty,0,0);class Ee{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 de.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 o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}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 o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].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,o=t;for(let t=e;;){let{index:e,offset:i}=t.content.findIndex(o),s=o-i;if(n.push(t,e,r+i),!s)break;if(t=t.child(e),t.isText)break;o=s-1,r+=i+1}return new Ee(t,n,o)}static resolveCached(e,t){for(let n=0;n<Ce.length;n++){let r=Ce[n];if(r.pos==t&&r.doc==e)return r}let n=Ce[Te]=Ee.resolve(e,t);return Te=(Te+1)%Oe,n}}let Ce=[],Te=0,Oe=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 Se{constructor(e,t,n,r=de.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||ae.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&&ue(this.attrs,t||e.defaultAttrs||Ne)&&de.sameSet(this.marks,n||de.none)}copy(e=null){return e==this.content?this:new Se(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Se(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 he.empty;let r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new he(a,r.depth-i,o.depth-i)}replace(e,t,n){return ge(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 Ee.resolveCached(this,e)}resolveNoCache(e){return Ee.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()+")"),je(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=ae.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<o;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 o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.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=de.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!de.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=ae.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}Se.prototype.text=void 0;class _e extends Se{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):je(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 _e(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new _e(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 je(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Ie{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Le(e,t);if(null==n.next)return Ie.empty;let r=ze(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return n(He(e,0));function n(r){let o=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<o.length;e++)o[e][0]==t&&(r=o[e][1]);He(e,n).forEach((e=>{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let i=t[r.join(",")]=new Ie(r.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let r=o[e][1].sort(Ue);i.next.push({type:o[e][0],next:t[r.join(",")]||n(r)})}return i}}(function(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach((e=>e.to=t))}function i(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(i(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),o(i(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return o(i(e.expr,t),s),o(i(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(i(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();o(i(e.expr,s),t),s=t}if(-1==e.max)o(i(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),o(i(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=i(e.exprs[r],t);if(r==e.exprs.length-1)return s;o(s,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}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 o=t;r&&o<n;o++)r=r.matchType(e.child(o).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 o(i,s){let a=i.matchFragment(e,n);if(a&&(!t||a.validEnd))return ae.from(s.map((e=>e.createAndFill())));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=o(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(),o=r.match;if(o.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<o.next.length;e++){let{type:i,next:s}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.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")}}Ie.empty=new Ie(!0);class Le{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 ze(e){let t=[];do{t.push(Pe(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Pe(e){let t=[];do{t.push(Fe(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Fe(e){let t=function(e){if(e.eat("(")){let t=ze(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 o=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&o.push(r)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(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=Be(e,t)}return t}function Re(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Be(e,t){let n=Re(e),r=n;return e.eat(",")&&(r="}"!=e.next?Re(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Ue(e,t){return t-e}function He(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(Ue)}function $e(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 Ve(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(void 0===o){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=t.default}n[r]=o}return n}function We(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Ye(e[n]);return t}class qe{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=We(n.attrs),this.defaultAttrs=$e(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==Ie.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:Ve(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Se(this,this.computeAttrs(e),ae.from(t),de.setFrom(n))}createChecked(e=null,t,n){if(t=ae.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new Se(this,this.computeAttrs(e),t,de.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=ae.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(ae.empty,!0);return o?new Se(this,e,t.append(o),de.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:de.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new qe(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 Ye{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Qe{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=We(r.attrs),this.excluded=null;let o=$e(this.attrs);this.instance=o?new de(this,o):null}create(e=null){return!e&&this.instance?this.instance:new de(this,Ve(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,o)=>n[e]=new Qe(e,r++,t,o))),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 Ke{constructor(e){this.cached=Object.create(null),this.spec={nodes:oe.from(e.nodes),marks:oe.from(e.marks||{}),topNode:e.topNode},this.nodes=qe.compile(this.spec.nodes,this),this.marks=Qe.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||"",o=n.spec.marks;n.contentMatch=t[r]||(t[r]=Ie.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==o?null:o?Ge(this,o.split(" ")):""!=o&&n.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Ge(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 qe))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 _e(n,n.defaultAttrs,e,de.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Se.fromJSON(this,e)}markFromJSON(e){return de.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Ge(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Je{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 st(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new st(this,t,!0);return n.addAll(e,t.from,t.to),he.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(at(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 o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(e)||r.context&&!n.matchesContext(r.context)||i.length>e.length&&(61!=i.charCodeAt(e.length)||i.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=lt(e)),e.mark=t}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=lt(e)),e.node=t}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Je(e,Je.schemaRules(e)))}}const Xe={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},Ze={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},et={ol:!0,ul:!0},tt=1,nt=2,rt=4;function ot(e,t,n){return null!=t?(t?tt:0)|("full"===t?nt:0):e&&"pre"==e.whitespace?tt|nt:n&~rt}class it{constructor(e,t,n,r,o,i,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=de.none,this.stashMarks=[],this.match=i||(s&rt?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(ae.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&tt)){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=ae.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(ae.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&&!Xe.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class st{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,o=t.topNode,i=ot(null,t.preserveWhitespace,0)|(n?rt:0);r=o?new it(o.type,o.attrs,de.none,de.none,!0,t.topMatch||o.type.contentMatch,i):new it(n?null:e.schema.topNodeType,null,de.none,de.none,!0,null,i),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&nt||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&tt)t=n.options&nt?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],o=e.previousSibling;(!r||o&&"BR"==o.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();et.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&&et.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(o?o.ignore:Ze.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let t,n=this.top,i=this.needsBlock;if(Xe.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=i}else this.addElementByRule(e,o,!1===o.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=de.none;e:for(let n=0;n<e.length;n+=2)for(let r;;){let o=this.parser.matchStyle(e[n],e[n+1],this,r);if(!o)continue e;if(o.ignore)return null;if(t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),!1!==o.consuming)break;r=o}return t}addElementByRule(e,t,n){let r,o,i;if(t.node)o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):r=this.enter(o,t.attrs||null,t.preserveWhitespace);else{i=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(i)}let s=this.top;if(o&&o.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--,i&&this.removePendingMark(i,s)}addAll(e,t,n){let r=t||0;for(let o=t?e.childNodes[t]:e.firstChild,i=null==n?null:e.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.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 o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let i=ot(e,r,o.options);o.options&rt&&0==o.content.length&&(i|=rt),this.nodes.push(new it(e,t,o.activeMarks,o.pendingMarks,n,null,i)),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),o=-(n?n.depth+1:0)+(r?0:1),i=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return i(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 at(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function lt(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 o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class ut{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=pt(t).createDocumentFragment());let r=n,o=[];return e.forEach((e=>{if(o.length||e.marks.length){let n=0,i=0;for(;n<o.length&&i<e.marks.length;){let t=e.marks[i];if(this.marks[t.type.name]){if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],s=this.serializeMark(n,e.isInline,t);s&&(o.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}=ut.renderSpec(pt(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 o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&ut.renderSpec(pt(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,o=t[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s=n?e.createElementNS(n,o):e.createElement(o),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 o=l;o<t.length;o++){let i=t[o];if(0===i){if(o<t.length-1||o>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:o}=ut.renderSpec(e,i,n);if(s.appendChild(t),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ut(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=dt(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return dt(e.marks)}}function dt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function pt(e){return e.document||window.document}const ht=65535,ft=Math.pow(2,16);function mt(e,t){return e+t*ft}function gt(e){return e&ht}const yt=1,bt=2,vt=4,wt=8;class xt{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&wt)>0}get deletedBefore(){return(this.delInfo&(yt|vt))>0}get deletedAfter(){return(this.delInfo&(bt|vt))>0}get deletedAcross(){return(this.delInfo&vt)>0}}class Mt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Mt.empty)return Mt.empty}recover(e){let t=0,n=gt(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&ht))/ft}(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,o=this.inverted?2:1,i=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+o],c=this.ranges[s+i],u=a+l;if(e<=u){let o=a+r+((l?e==a?-1:e==u?1:t:t)<0?0:c);if(n)return o;let i=e==(t<0?a:u)?null:mt(s/3,e-a),d=e==a?bt:e==u?yt:vt;return(t<0?e!=a:e!=u)&&(d|=wt),new xt(o,d,i)}r+=c-l}return n?e+r:new xt(e+r,0,null)}touches(e,t){let n=0,r=gt(t),o=this.inverted?2:1,i=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+o];if(e<=s+a&&t==3*r)return!0;n+=this.ranges[t+i]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),o+=c-l}}invert(){return new Mt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Mt.empty:new Mt(e<0?[0,-e,0]:[0,0,e])}}Mt.empty=new Mt([]);class Dt{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 Dt(this.maps,this.mirror,e,t)}copy(){return new Dt(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 Dt;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 o=this.maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return n?e:new xt(e,r,null)}}const kt=Object.create(null);class Et{getMap(){return Mt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=kt[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 kt)throw new RangeError("Duplicate use of step JSON ID "+e);return kt[e]=t,t.prototype.jsonID=e,t}}class Ct{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Ct(e,null)}static fail(e){return new Ct(null,e)}static fromReplace(e,t,n,r){try{return Ct.ok(e.replace(t,n,r))}catch(e){if(e instanceof pe)return Ct.fail(e.message);throw e}}}function Tt(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(Tt(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return ae.fromArray(r)}class Ot extends Et{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)),o=new he(Tt(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 Ct.fromReplace(e,this.from,this.to,o)}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 Ot(t.pos,n.pos,this.mark)}merge(e){return e instanceof Ot&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ot(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 Ot(t.from,t.to,e.markFromJSON(t.mark))}}Et.jsonID("addMark",Ot);class At extends Et{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 he(Tt(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Ct.fromReplace(e,this.from,this.to,n)}invert(){return new Ot(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))}}Et.jsonID("removeMark",At);class Nt extends Et{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&_t(e,this.from,this.to)?Ct.fail("Structure replace would overwrite content"):Ct.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Mt([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?he.empty:new he(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?he.empty:new he(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,he.fromJSON(e,t.slice),!!t.structure)}}Et.jsonID("replace",Nt);class St extends Et{constructor(e,t,n,r,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(_t(e,this.from,this.gapFrom)||_t(e,this.gapTo,this.to)))return Ct.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ct.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Ct.fromReplace(e,this.from,this.to,n):Ct.fail("Content does not fit in gap")}getMap(){return new Mt([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 St(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),o=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||o>n.pos?null:new St(t.pos,n.pos,r,o,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 St(t.from,t.to,t.gapFrom,t.gapTo,he.fromJSON(e,t.slice),t.insert,!!t.structure)}}function _t(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function jt(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function It(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(o,i,t))return n;if(0==n||r.type.spec.isolating||!jt(r,o,i))break}return null}function Lt(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<o;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return i?o.map(zt).concat({type:t,attrs:n}).concat(i.map(zt)):null}function zt(e){return{type:e,attrs:null}}function Pt(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>i;e--,t--){let n=o.node(e),i=o.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function Ft(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 Rt(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.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,i=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(i,i,o);else{let e=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=e&&s.canReplaceWith(i,i,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Bt(e,t,n=t,r=he.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return Ut(o,i,r)?new Nt(t,n,r):new Ht(o,i,r).fit()}function Ut(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Et.jsonID("replaceAround",St);class Ht{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=ae.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=ae.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 o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new he(o,i,s);return e>-1?new St(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=Wt(this.unplaced.content,t-1).firstChild,n=r.content):n=this.unplaced.content;let o=n.firstChild;for(let n=this.depth;n>=0;n--){let i,{type:s,match:a}=this.frontier[n],l=null;if(1==e&&(o?a.matchType(o.type)||(l=a.fillBefore(ae.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:t,frontierDepth:n,parent:r,inject:l};if(2==e&&o&&(i=a.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:n,parent:r,wrap:i};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Wt(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new he(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=Wt(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new he($t(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new he($t(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let i=this.unplaced,s=n?n.content:i.content,a=i.openStart-e,l=0,c=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));u=u.matchFragment(r)}let p=s.size+e-(i.content.size-i.openEnd);for(;l<s.childCount;){let e=s.child(l),t=u.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(u=t,c.push(qt(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=Vt(this.placed,t,ae.from(c)),this.frontier[t].match=u,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?he.empty:new he($t(i.content,e-1,1),e-1,p<0?i.openEnd:e-1):new he($t(i.content,e,l),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Yt(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],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=Yt(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=Yt(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:i,move:o?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=Vt(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=Vt(this.placed,this.depth,ae.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(ae.empty,!0);e.childCount&&(this.placed=Vt(this.placed,this.frontier.length,e))}}function $t(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy($t(e.firstChild.content,t-1,n)))}function Vt(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Vt(e.lastChild.content,t-1,n)))}function Wt(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function qt(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,qt(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(ae.empty,!0)))),e.copy(r)}function Yt(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.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,i.content,s)?a:null}function Qt(e){return e.spec.defining||e.spec.definingForContent}function Kt(e,t,n,r,o){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(Kt(o.content,t+1,n,r,o)))}if(t>r){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(ae.empty,!0))}return e}function Gt(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(o<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;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}let Jt=class extends Error{};Jt=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Jt.prototype=Object.create(Error.prototype)).constructor=Jt,Jt.prototype.name="TransformError";class Xt{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Dt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Jt(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=he.empty){let r=Bt(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new he(ae.from(n),0,0))}delete(e,t){return this.replace(e,t,he.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 o=e.doc.resolve(t),i=e.doc.resolve(n);if(Ut(o,i,r))return e.step(new Nt(t,n,r));let s=Gt(o,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:o.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),c=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=c[e].type,n=Qt(t);if(n&&o.node(l).type!=t)u=e;else if(n||!t.isTextblock)break}for(let t=r.openStart;t>=0;t--){let a=(t+u+1)%(r.openStart+1),d=c[a];if(d)for(let t=0;t<s.length;t++){let c=s[(t+l)%s.length],u=!0;c<0&&(u=!1,c=-c);let p=o.node(c-1),h=o.index(c-1);if(p.canReplaceWith(h,h,d.type,d.marks))return e.replace(o.before(c),u?i.after(c):n,new he(Kt(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=o.before(e),n=i.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 o=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!=o&&(t=n=o)}e.replaceRange(t,n,new he(ae.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=Gt(r,o);for(let t=0;t<i.length;t++){let n=i[t],s=t==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return e.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i)return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:o,depth:i}=t,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=ae.empty,d=0;for(let e=i,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=ae.from(r.node(e).copy(u)),d++):l--;let p=ae.empty,h=0;for(let e=i,t=!1;e>n;e--)t||o.after(e+1)<o.end(e)?(t=!0,p=ae.from(o.node(e).copy(p)),h++):c++;e.step(new St(l,c,s,a,new he(u.append(p),d,h),u.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=new Nt(t-n,t+n,he.empty,!0);e.step(r)}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=ae.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=ae.from(n[e].type.create(n[e].attrs,r))}let o=t.start,i=t.end;e.step(new St(o,i,o,i,new he(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,o)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(i).map(n),r)){e.clearIncompatible(e.mapping.slice(i).map(n,1),r);let s=e.mapping.slice(i),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new St(a,l,a+1,l-1,new he(ae.from(r.create(o,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,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new St(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new he(ae.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 o=e.doc.resolve(t),i=ae.empty,s=ae.empty;for(let e=o.depth,t=o.depth-n,a=n-1;e>t;e--,a--){i=ae.from(o.node(e).copy(i));let t=r&&r[a];s=ae.from(t?t.type.create(t.attrs,s):o.node(e).copy(s))}e.step(new Nt(t,t,new he(i.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let o,i,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),d=Math.min(l+e.nodeSize,n),p=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(p)||(o&&o.to==c&&o.mark.eq(u[e])?o.to=d:s.push(o=new At(c,d,u[e])));i&&i.to==c?i.to=d:a.push(i=new Ot(c,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 o=[],i=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;i++;let a=null;if(r instanceof Qe){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<o.length;e++){let t=o[e];t.step==i-1&&l.eq(o[e].style)&&(n=t)}n?(n.to=r,n.step=i):o.push({style:l,from:Math.max(s,t),to:r,step:i})}}})),o.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 o=e.doc.nodeAt(t),i=[],s=t+1;for(let t=0;t<o.childCount;t++){let a=o.child(t),l=s+a.nodeSize,c=r.matchType(a.type);if(c){r=c;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 i.push(new Nt(s,l,he.empty));s=l}if(!r.validEnd){let t=r.fillBefore(ae.empty,!0);e.replace(s,s,new he(t,0,0))}for(let t=i.length-1;t>=0;t--)e.step(i[t])}(this,e,t,n),this}}const Zt=Object.create(null);class en{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new tn(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=he.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=e.mapping.slice(o);e.replaceRange(c.map(a.pos),c.map(l.pos),s?he.empty:t),0==s&&pn(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=e.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),pn(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new on(e):dn(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 o=t<0?dn(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):dn(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}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 dn(e,e,0,0,1)||new cn(e)}static atEnd(e){return dn(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=Zt[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 Zt)throw new RangeError("Duplicate use of selection JSON ID "+e);return Zt[e]=t,t.prototype.jsonID=e,t}getBookmark(){return on.between(this.$anchor,this.$head).getBookmark()}}en.prototype.visible=!0;class tn{constructor(e,t){this.$from=e,this.$to=t}}let nn=!1;function rn(e){nn||e.parent.inlineContent||(nn=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class on extends en{constructor(e,t=e){rn(e),rn(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 en.near(n);let r=e.resolve(t.map(this.anchor));return new on(r.parent.inlineContent?r:n,n)}replace(e,t=he.empty){if(super.replace(e,t),t==he.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof on&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new sn(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 on(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=en.findFrom(t,n,!0)||en.findFrom(t,-n,!0);if(!e)return en.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(en.findFrom(e,-n,!0)||en.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new on(e,t)}}en.jsonID("text",on);class sn{constructor(e,t){this.anchor=e,this.head=t}map(e){return new sn(e.map(this.anchor),e.map(this.head))}resolve(e){return on.between(e.resolve(this.anchor),e.resolve(this.head))}}class an extends en{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),o=e.resolve(r);return n?en.near(o):new an(o)}content(){return new he(ae.from(this.node),0,0)}eq(e){return e instanceof an&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ln(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new an(e.resolve(t.anchor))}static create(e,t){return new an(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}an.prototype.visible=!1,en.jsonID("node",an);class ln{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new sn(n,n):new ln(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&an.isSelectable(n)?new an(t):en.near(t)}}class cn extends en{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=he.empty){if(t==he.empty){e.delete(0,e.doc.content.size);let t=en.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 un}}en.jsonID("all",cn);const un={map(){return this},resolve:e=>new cn(e)};function dn(e,t,n,r,o,i=!1){if(t.inlineContent)return on.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&an.isSelectable(r))return an.create(e,n-(o<0?r.nodeSize:0))}else{let t=dn(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function pn(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,i=e.steps[r];(i instanceof Nt||i instanceof St)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==o&&(o=r)})),e.setSelection(en.near(e.doc.resolve(o),n)))}const hn=1,fn=2,mn=4;class gn extends Xt{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|hn)&~fn,this.storedMarks=null,this}get selectionSet(){return(this.updated&hn)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=fn,this}ensureMarks(e){return de.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&fn)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~fn,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)||de.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 o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(en.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|=mn,this}get scrolledIntoView(){return(this.updated&mn)>0}}function yn(e,t){return t&&e?e.bind(t):e}class bn{constructor(e,t,n){this.name=e,this.init=yn(t.init,n),this.apply=yn(t.apply,n)}}const vn=[new bn("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new bn("selection",{init:(e,t)=>e.selection||en.atStart(t.doc),apply:e=>e.selection}),new bn("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new bn("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class wn{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=vn.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 bn(e.key,e.spec.state,e))}))}}class xn{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 o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let a=r?r[i].n:0,l=r?r[i].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new xn(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new gn(this)}static create(e){let t=new wn(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new xn(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 wn(this.schema,e.plugins),n=t.fields,r=new xn(t);for(let t=0;t<n.length;t++){let o=n[t].name;r[o]=this.hasOwnProperty(o)?this[o]: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],o=r.spec.state;o&&o.toJSON&&(t[n]=o.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 wn(e.schema,e.plugins),o=new xn(r);return r.fields.forEach((r=>{if("doc"==r.name)o.doc=Se.fromJSON(e.schema,t.doc);else if("selection"==r.name)o.selection=en.fromJSON(o.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,i))return void(o[r.name]=a.fromJSON.call(s,e,t[i],o))}o[r.name]=r.init(e,o)}})),o}}function Mn(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=Mn(o,t,{})),n[r]=o}return n}class Dn{constructor(e){this.spec=e,this.props={},e.props&&Mn(e.props,this,this.props),this.key=e.key?e.key.key:En("plugin")}getState(e){return e[this.key]}}const kn=Object.create(null);function En(e){return e in kn?e+"$"+ ++kn[e]:(kn[e]=0,e+"$")}class Cn{constructor(e="key"){this.key=En(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Tn="undefined"!=typeof navigator?navigator:null,On="undefined"!=typeof document?document:null,An=Tn&&Tn.userAgent||"",Nn=/Edge\/(\d+)/.exec(An),Sn=/MSIE \d/.exec(An),_n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(An),jn=!!(Sn||_n||Nn),In=Sn?document.documentMode:_n?+_n[1]:Nn?+Nn[1]:0,Ln=!jn&&/gecko\/(\d+)/i.test(An);Ln&&(/Firefox\/(\d+)/.exec(An)||[0,0])[1];const zn=!jn&&/Chrome\/(\d+)/.exec(An),Pn=!!zn,Fn=zn?+zn[1]:0,Rn=!jn&&!!Tn&&/Apple Computer/.test(Tn.vendor),Bn=Rn&&(/Mobile\/\w+/.test(An)||!!Tn&&Tn.maxTouchPoints>2),Un=Bn||!!Tn&&/Mac/.test(Tn.platform),Hn=/Android \d/.test(An),$n=!!On&&"webkitFontSmoothing"in On.documentElement.style,Vn=$n?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Wn=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},qn=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let Yn=null;const Qn=function(e,t,n){let r=Yn||(Yn=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Kn=function(e,t,n,r){return n&&(Jn(e,t,n,r,-1)||Jn(e,t,n,r,1))},Gn=/^(img|br|input|textarea|hr)$/i;function Jn(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Xn(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Zn(e)||Gn.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Wn(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?Xn(e):0}}}function Xn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Zn(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 er=function(e){let t=e.isCollapsed;return t&&Pn&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function tr(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function nr(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function rr(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 ir(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;s=qn(s)){if(1!=s.nodeType)continue;let e=s,n=e==i.body,a=n?nr(i):or(e),l=0,c=0;if(t.top<a.top+rr(r,"top")?c=-(a.top-t.top+rr(o,"top")):t.bottom>a.bottom-rr(r,"bottom")&&(c=t.bottom-a.bottom+rr(o,"bottom")),t.left<a.left+rr(r,"left")?l=-(a.left-t.left+rr(o,"left")):t.right>a.right-rr(r,"right")&&(l=t.right-a.right+rr(o,"right")),l||c)if(n)i.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let o=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}if(n)break}}function sr(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=qn(r));return t}function ar(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let lr=null;function cr(e,t){let n,r,o=2e8,i=0,s=t.top,a=t.top;for(let l=e.firstChild,c=0;l;l=l.nextSibling,c++){let e;if(1==l.nodeType)e=l.getClientRects();else{if(3!=l.nodeType)continue;e=Qn(l).getClientRects()}for(let u=0;u<e.length;u++){let d=e[u];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<o){n=l,o=e,r=e&&3==n.nodeType?{left:d.right<t.left?d.right:d.left,top:t.top}:t,1==l.nodeType&&e&&(i=c+(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)&&(i=c+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=hr(r,1);if(n.top!=n.bottom&&ur(t,n))return{node:e,offset:o+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:i}:cr(n,r)}function ur(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function dr(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=e.childNodes[i];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let o=e[r];if(ur(t,o))return dr(n,t,o)}}if((i=(i+1)%r)==o)break}return e}function pr(e,t){let n,r=e.dom.ownerDocument,o=0;if(r.caretPositionFromPoint)try{let e=r.caretPositionFromPoint(t.left,t.top);e&&({offsetNode:n,offset:o}=e)}catch(e){}if(!n&&r.caretRangeFromPoint){let e=r.caretRangeFromPoint(t.left,t.top);e&&({startContainer:n,startOffset:o}=e)}let i,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(!ur(t,n))return null;if(s=dr(e.dom,t,n),!s)return null}if(Rn)for(let e=s;n&&e;e=qn(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(Ln&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let e,r=n.childNodes[o];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&o++}n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(i=function(e,t,n,r){let o=-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)o=t.posBefore;else{if(!(e.right<r.left||e.bottom<r.top))break;o=t.posAfter}}n=t.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,1)}(e,n,o,t))}null==i&&(i=function(e,t,n){let{node:r,offset:o}=cr(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:i,inside:a?a.posAtStart-a.border:-1}}function hr(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const fr=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function mr(e,t,n){let{node:r,offset:o}=e.docView.domFromPos(t,n<0?-1:1),i=$n||Ln;if(3==r.nodeType){if(!i||!fr.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let e=o,t=o,i=n<0?1:-1;return n<0&&!o?(t++,i=-1):n>=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,gr(hr(Qn(r,e,t),i),i<0)}{let e=hr(Qn(r,o,o),n);if(Ln&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=hr(Qn(r,o-1,o-1),-1);if(t.top==e.top){let n=hr(Qn(r,o,o+1),-1);if(n.top!=e.top)return gr(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t).parent.inlineContent){if(o&&(n<0||o==Xn(r))){let e=r.childNodes[o-1];if(1==e.nodeType)return yr(e.getBoundingClientRect(),!1)}if(o<Xn(r)){let e=r.childNodes[o];if(1==e.nodeType)return yr(e.getBoundingClientRect(),!0)}return yr(r.getBoundingClientRect(),n>=0)}if(o&&(n<0||o==Xn(r))){let e=r.childNodes[o-1],t=3==e.nodeType?Qn(e,Xn(e)-(i?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return gr(hr(t,1),!1)}if(o<Xn(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Qn(e,0,i?0:1):1==e.nodeType?e:null:null;if(t)return gr(hr(t,-1),!0)}return gr(hr(3==r.nodeType?Qn(r):r,-n),n>=0)}function gr(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 yr(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 br(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}const vr=/[\u0590-\u08ac]/;let wr=null,xr=null,Mr=!1;function Dr(e,t,n){return wr==t&&xr==n?Mr:(wr=t,xr=n,Mr="up"==n||"down"==n?function(e,t,n){let r=t.selection,o="up"==n?r.$from:r.$to;return br(e,t,(()=>{let{node:t}=e.docView.domFromPos(o.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=mr(e,o.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=Qn(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=e.domSelection();return vr.test(r.parent.textContent)&&a.modify?br(e,t,(()=>{let t=a.getRangeAt(0),o=a.focusNode,i=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)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?i:s}(e,t,n))}const kr=0,Er=1,Cr=2,Tr=3;class Or{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=kr,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>Wn(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 o,i=this.getDesc(r);if(i&&(!t||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;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 o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0};let n,r=0,o=0;for(let t=0;r<this.children.length;r++){let n=this.children[r],i=t+n.size;if(i>e||n instanceof Lr){o=e-t;break}t=i}if(o)return this.children[r].domFromPos(o-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?Wn(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?Wn(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,o=-1;for(let i=n,s=0;;s++){let n=this.children[s],a=i+n.size;if(-1==r&&e<=a){let o=i+n.border;if(e>=o&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=i;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=Wn(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)){o=Wn(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}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 o=Math.min(e,t),i=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(o>a&&i<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),c=!1;if((Ln||Rn)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(c=!(!t||"\n"!=e.nodeValue[t-1]),c&&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:Wn(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(Ln&&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||c&&Rn)&&Kn(s.node,s.offset,l.anchorNode,l.anchorOffset)&&Kn(a.node,a.offset,l.focusNode,l.focusOffset))return;let u=!1;if((l.extend||e==t)&&!c){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),u=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!u){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 o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let r=n+o.border,s=i-o.border;if(e>=r&&t<=s)return this.dirty=e==n||t==i?Cr:Er,void(e!=r||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-r,t-r):o.dirty=Tr);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?Tr:Cr}n=i}this.dirty=Cr}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?Cr:Er;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Ar extends Or{constructor(e,t,n,r){let o,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,(()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r))),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==kr&&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 Or{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 Sr extends Or{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let o=r.nodeViews[t.type.name],i=o&&o(t,r,n);return i&&i.dom||(i=ut.renderSpec(document,t.type.spec.toDOM(t,n))),new Sr(e,t,i.dom,i.contentDOM||i.dom)}parseRule(){return this.dirty&Tr||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!=Tr&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=kr){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=kr}}slice(e,t,n){let r=Sr.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;t<i&&(o=Qr(o,t,i,n)),e>0&&(o=Qr(o,0,e,n));for(let e=0;e<o.length;e++)o[e].parent=r;return r.children=o,r}}class _r extends Or{constructor(e,t,n,r,o,i,s,a,l){super(e,[],o,i),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s,i&&this.updateChildren(a,l)}static create(e,t,n,r,o,i){let s,a=o.nodeViews[t.type.name],l=a&&a(t,o,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:i),n,r),c=l&&l.dom,u=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else c||({dom:c,contentDOM:u}=ut.renderSpec(document,t.type.spec.toDOM(t)));u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return c=$r(c,n,t),l?s=new zr(e,t,n,r,c,u||null,d,l,o,i+1):t.isText?new Ir(e,t,n,r,c,d,o):new _r(e,t,n,r,c,u||null,d,o,i+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=()=>ae.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return this.dirty==kr&&e.eq(this.node)&&Vr(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,o=e.composing?this.localCompositionInfo(e,t):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new qr(this,i&&i.node);!function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,o,t.forChild(i,s),n),i+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){if(s<o.length&&o[s].to==i){let e,t=o[s++];for(;s<o.length&&o[s].to==i;)(e||(e=[t])).push(o[s++]);if(e){e.sort(Yr);for(let t=0;t<e.length;t++)n(e[t],c,!!l)}else n(t,c,!!l)}let u,d;if(l)d=-1,u=l,l=null;else{if(!(c<e.childCount))break;d=c,u=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=i&&a.splice(e--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let p=i+u.nodeSize;if(u.isText){let e=p;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<p&&(l=u.cut(e-i),u=u.cut(0,e-i),p=e,d=-1)}let h=u.isInline&&!u.isLeaf?a.filter((e=>!e.inline)):a.slice();r(u,h,t.forChild(i,u),d),i=p}}(this.node,this.innerDeco,((t,o,i)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!i&&a.syncToMarks(o==this.node.childCount?de.none:this.node.child(o).marks,n,e),a.placeWidget(t,e,r)}),((t,i,l,c)=>{let u;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,i,l,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(t,i,l,u,e)||a.updateNextNode(t,i,l,e,c)||a.addNode(t,i,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Cr)&&(i&&this.protectLocalComposition(e,i),Pr(this.contentDOM,this.children,e),Bn&&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 on)||n<t||r>t+this.node.content.size)return null;let o=e.domSelection(),i=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=Xn(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(o.focusNode,o.focusOffset);if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,o=function(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<e.childCount;){let t=e.child(o++);if(i+=t.nodeSize,!t.isText)break;l+=t.text}if(i>=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 o<0?null:{node:i,pos:o,text:e}}return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new Nr(this,o,t,r);e.input.compositionNodes.push(i),this.children=Qr(this.children,n,n+r.length,e,i)}update(e,t,n,r){return!(this.dirty==Tr||!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=kr}updateOuterDeco(e){if(Vr(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Ur(this.dom,this.nodeDOM,Br(this.outerDeco,this.node,t),Br(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 jr(e,t,n,r,o){return $r(r,t,e),new _r(void 0,e,t,n,r,r,r,o,0)}class Ir extends _r{constructor(e,t,n,r,o,i,s){super(e,t,n,r,o,null,i,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==Tr||this.dirty!=kr&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==kr&&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=kr,!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),o=document.createTextNode(r.text);return new Ir(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=Tr)}get domAtom(){return!1}}class Lr extends Or{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==kr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class zr extends _r{constructor(e,t,n,r,o,i,s,a,l,c){super(e,t,n,r,o,i,s,l,c),this.spec=a}update(e,t,n,r){if(this.dirty==Tr)return!1;if(this.spec.update){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}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 Pr(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let s=t[i],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=Wr(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(a,r);if(s instanceof Sr){let t=r?r.previousSibling:e.lastChild;Pr(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Wr(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const Fr=function(e){e&&(this.nodeName=e)};Fr.prototype=Object.create(null);const Rr=[new Fr];function Br(e,t,n){if(0==e.length)return Rr;let r=n?Rr[0]:new Fr,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s){s.nodeName&&o.push(r=new Fr(s.nodeName));for(let e in s){let i=s[e];null!=i&&(n&&1==o.length&&o.push(r=new Fr(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+i:"style"==e?r.style=(r.style?r.style+";":"")+i:"nodeName"!=e&&(r[e]=i))}}}return o}function Ur(e,t,n,r){if(n==Rr&&r==Rr)return t;let o=t;for(let t=0;t<r.length;t++){let i=r[t],s=n[t];if(t){let t;s&&s.nodeName==i.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==i.nodeName||(t=document.createElement(i.nodeName),t.pmIsDeco=!0,t.appendChild(o),s=Rr[0]),o=t}Hr(o,s||Rr[0],i)}return o}function Hr(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):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==o.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<o.length;t++)-1==r.indexOf(o[t])&&e.classList.add(o[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 $r(e,t,n){return Ur(e,e,Rr,Br(t,n,1!=e.nodeType))}function Vr(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 Wr(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class qr{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,o=e.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Sr)){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(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,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,o=this.stack.length>>1,i=Math.min(o,e.length);for(;r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=kr,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<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[o])){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=Sr.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,o){let i=this.top.children[r];return i.dirty==Tr&&i.dom==i.contentDOM&&(i.dirty=Cr),!!i.update(e,t,n,o)&&(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,o){for(let i=this.index;i<this.top.children.length;i++){let s=this.top.children[i];if(s instanceof _r){let a=this.preMatch.matched.get(s);if(null!=a&&a!=o)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!=Tr&&Vr(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,i),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(e,t,n,r,o){this.top.children.splice(this.index++,0,_r.create(this.top,e,t,n,r,o)),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 Sr;)t=e,e=t.children[t.children.length-1];e&&e instanceof Ir&&!/\n$/.test(e.node.text)||((Rn||Pn)&&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 Lr(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}function Yr(e,t){return e.type.side-t.type.side}function Qr(e,t,n,r,o){let i=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Kr(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(er(n)){for(a=c;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&an.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==Xn(e);r||o;){if(e==n)return!0;let t=Wn(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==Xn(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;l=new an(s==e?c: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=oo(e,a,c,"pointer"==t||e.state.selection.head<c.pos&&!i?1:-1)}return l}function Gr(e){return e.editable?e.hasFocus():so(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Jr(e,t=!1){let n=e.state.selection;if(no(e,n),Gr(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Pn){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Kn(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,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,Wn(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&jn&&In<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,o,{anchor:i,head:s}=n;!Xr||n instanceof on||(n.$from.parent.inlineContent||(r=Zr(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=Zr(e,n.to))),e.docView.setSelection(i,s,e.root,t),Xr&&(r&&to(r),o&&to(o)),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,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Gr(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Xr=Rn||Pn&&Fn<63;function Zr(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Rn&&o&&"false"==o.contentEditable)return eo(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return eo(o);if(i)return eo(i)}}function eo(e){return e.contentEditable="true",Rn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function to(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function no(e,t){if(t instanceof an){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(ro(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else ro(e)}function ro(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function oo(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||on.between(t,n,r)}function io(e){return(!e.editable||e.root.activeElement==e.dom)&&so(e)}function so(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 ao(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&en.findFrom(i,t)}function lo(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function co(e,t,n){let r=e.state.selection;if(!(r instanceof on)){if(r instanceof an&&r.node.isInline)return lo(e,new on(t>0?r.$to:r.$from));{let n=ao(e.state,t);return!!n&&lo(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=ao(e.state,t);return!!(n&&n instanceof an)&&lo(e,n)}if(!(Un&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=t<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(an.isSelectable(i)?lo(e,new an(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):!!$n&&lo(e,new on(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}function uo(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function po(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function ho(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;for(Ln&&1==n.nodeType&&r<uo(n)&&po(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(po(e))o=n,i=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(mo(n))break;{let t=n.previousSibling;for(;t&&po(t);)o=n.parentNode,i=Wn(t),t=t.previousSibling;if(t)n=t,r=uo(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?go(e,t,n,r):o&&go(e,t,o,i)}function fo(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=uo(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!po(n.childNodes[r]))break;o=n,i=++r}else{if(mo(n))break;{let t=n.nextSibling;for(;t&&po(t);)o=t.parentNode,i=Wn(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=uo(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}o&&go(e,t,o,i)}function mo(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function go(e,t,n,r){if(er(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:o}=e;setTimeout((()=>{e.state==o&&Jr(e)}),50)}function yo(e,t,n){let r=e.state.selection;if(r instanceof on&&!r.empty||n.indexOf("s")>-1)return!1;if(Un&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=ao(e.state,t);if(n&&n instanceof an)return lo(e,n)}if(!o.parent.inlineContent){let n=t<0?o:i,s=r instanceof cn?en.near(n,t):en.findFrom(n,t);return!!s&&lo(e,s)}return!1}function bo(e,t){if(!(e.state.selection instanceof on))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=e.state.tr;return t<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),e.dispatch(r),!0}return!1}function vo(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function wo(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||Un&&72==n&&"c"==r?bo(e,-1)||ho(e):46==n||Un&&68==n&&"c"==r?bo(e,1)||fo(e):13==n||27==n||(37==n||Un&&66==n&&"c"==r?co(e,-1,r)||ho(e):39==n||Un&&70==n&&"c"==r?co(e,1,r)||fo(e):38==n||Un&&80==n&&"c"==r?yo(e,-1,r)||ho(e):40==n||Un&&78==n&&"c"==r?function(e){if(!Rn||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;vo(e,n,"true"),setTimeout((()=>vo(e,n,"false")),20)}return!1}(e)||yo(e,1,r)||fo(e):r==(Un?"m":"c")&&(66==n||73==n||89==n||90==n))}function xo(e,t){let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;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")||ut.fromSchema(e.state.schema),a=So(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,d=0;for(;u&&1==u.nodeType&&(c=Ao[u.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}u=l.firstChild}u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${o} ${i}${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 Mo(e,t,n,r,o){let i,s,a=o.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 he(ae.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):he.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,o,r)));if(n)s=n;else{let n=o.marks(),{schema:r}=e.state,s=ut.fromSchema(r);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),i=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=So().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&Ao[o[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),$n&&function(e){let t=e.querySelectorAll(Pn?"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)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let e=+u[3];e>0&&i.firstChild;e--)i=i.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Je.fromSchema(e.state.schema);s=t.parseSlice(i,{preserveWhitespace:!(!l&&!u),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Do.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(u)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:o,openStart:i,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;o=ae.from(t.create(n[e+1],o)),i++,s++}return new he(o,i,s)}(Oo(s,+u[1],+u[2]),u[4]);else if(s=he.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),i=[];if(e.forEach((e=>{if(!i)return;let t,n=o.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&r.length&&Eo(n,r,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=Co(i[i.length-1],r.length));let t=ko(e,n);i.push(t),o=o.matchType(t.type),r=n}})),i)return ae.from(i)}return e}(s.content,o),!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=Oo(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const Do=/^(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 ko(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,ae.from(e));return e}function Eo(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let i=Eo(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(ae.from(ko(n,e,o+1))))}}function Co(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Co(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(ae.empty,!0);return e.copy(n.append(r))}function To(e,t,n,r,o,i){let s=t<0?e.firstChild:e.lastChild,a=s.content;return o<r-1&&(a=To(a,t,n,r,o+1,i)),o>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(ae.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Oo(e,t,n){return t<e.openStart&&(e=new he(To(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new he(To(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Ao={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 No=null;function So(){return No||(No=document.implementation.createHTMLDocument("title"))}const _o={};let jo={};class Io{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 Lo(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function zo(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Po(e,t))}))}function Po(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Fo(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 Ro(e){return{left:e.clientX,top:e.clientY}}function Bo(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(e.someProp(t,(t=>r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1))))return!0;return!1}function Uo(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Ho(e,t,n,r,o){return Bo(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(o?function(e,t){if(-1==t)return!1;let n,r,o=e.state.selection;o instanceof an&&(n=o.node);let i=e.state.doc.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e);if(an.isSelectable(t)){r=n&&o.$from.depth>0&&e>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(e);break}}return null!=r&&(Uo(e,an.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&&an.isSelectable(r))&&(Uo(e,new an(n),"pointer"),!0)}(e,n))}function $o(e,t,n,r){return Bo(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Vo(e,t,n,r){return Bo(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&&(Uo(e,on.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(t);for(let t=o.depth+1;t>0;t--){let n=t>o.depth?o.nodeAfter:o.node(t),i=o.before(t);if(n.inlineContent)Uo(e,on.create(r,i+1,i+1+n.content.size),"pointer");else{if(!an.isSelectable(n))continue;Uo(e,an.create(r,i),"pointer")}return!0}}(e,n,r)}function Wo(e){return Xo(e)}jo.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Qo(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Hn||!Pn||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Bn||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||wo(e,n)?n.preventDefault():Lo(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,tr(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},jo.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},jo.keypress=(e,t)=>{let n=t;if(Qo(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Un&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof on&&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 qo=Un?"metaKey":"ctrlKey";_o.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Wo(e),o=Date.now(),i="singleClick";o-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[qo]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=e.posAtCoords(Ro(n));s&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Yo(e,s,n,!!r)):("doubleClick"==i?$o:Vo)(e,s.pos,s.inside,n)?n.preventDefault():Lo(e,"pointer"))};class Yo{constructor(e,t,n,r){let o,i;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[qo],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,i=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&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof an&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Ln||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)),Lo(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((()=>Jr(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(Ro(e))),this.allowDefault||!t?Lo(this.view,"pointer"):Ho(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Rn&&this.mightDrag&&!this.mightDrag.node.isAtom||Pn&&!(this.view.state.selection instanceof on)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Uo(this.view,en.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Lo(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),Lo(this.view,"pointer"),0==e.buttons&&this.done()}}function Qo(e,t){return!!e.composing||!!(Rn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}_o.touchdown=e=>{Wo(e),Lo(e,"pointer")},_o.contextmenu=e=>Wo(e);const Ko=Hn?5e3:-1;function Go(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Xo(e)),t))}function Jo(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 Xo(e,t=!1){if(!(Hn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Jo(e),t||e.docView&&e.docView.dirty){let t=Kr(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}jo.compositionstart=jo.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(),Xo(e,!0),e.markCursor=null;else if(Xo(e),Ln&&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}Go(e,Ko)},jo.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Go(e,20))};const Zo=jn&&In<15||Bn&&Vn<604;function ei(e,t,n,r){let o=Mo(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,o||he.empty))))return!0;if(!o)return!1;let i=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),s=i?e.state.tr.replaceSelectionWith(i,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}_o.copy=jo.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let i=Zo?null:n.clipboardData,s=r.content(),{dom:a,text:l}=xo(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.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(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},jo.paste=(e,t)=>{let n=t;if(e.composing&&!Hn)return;let r=Zo?null:n.clipboardData;r&&ei(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?ei(e,r.value,null,t):ei(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class ti{constructor(e,t){this.slice=e,this.move=t}}const ni=Un?"altKey":"ctrlKey";_o.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(Ro(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof an?o.to-1:o.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(an.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(an.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=xo(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Zo?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Zo||n.dataTransfer.setData("text/plain",l),e.dragging=new ti(s,!n[ni])},_o.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},jo.dragover=jo.dragenter=(e,t)=>t.preventDefault(),jo.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(Ro(n));if(!o)return;let i=e.state.doc.resolve(o.pos);if(!i)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Mo(e,n.dataTransfer.getData(Zo?"Text":"text/plain"),Zo?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[ni]);if(e.someProp("handleDrop",(t=>t(e,n,s||he.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?Rt(e.state.doc,i.pos,s):i.pos;null==l&&(l=i.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(p))return;let h=c.doc.resolve(u);if(d&&an.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new an(h));else{let t=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,o)=>t=o)),c.setSelection(oo(e,h,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},_o.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())&&Jr(e)}),20))},_o.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)},_o.beforeinput=(e,t)=>{if(Pn&&Hn&&"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,tr(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 jo)_o[e]=jo[e];function ri(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 oi{constructor(e,t){this.toDOM=e,this.spec=t||ci,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new ai(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof oi&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ri(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ii{constructor(e,t){this.attrs=e,this.spec=t||ci}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new ai(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof ii&&ri(this.attrs,e.attrs)&&ri(this.spec,e.spec)}static is(e){return e.type instanceof ii}destroy(){}}class si{constructor(e,t){this.attrs=e,this.spec=t||ci}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new ai(o.pos-n,i.pos-n,this)}valid(e,t){let n,{index:r,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(n=e.child(r)).isText&&o+n.nodeSize==t.to}eq(e){return this==e||e instanceof si&&ri(this.attrs,e.attrs)&&ri(this.spec,e.spec)}destroy(){}}class ai{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new ai(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 ai(e,e,new oi(t,n))}static inline(e,t,n,r){return new ai(e,t,new ii(n,r))}static node(e,t,n,r){return new ai(e,t,new si(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof ii}}const li=[],ci={};class ui{constructor(e,t){this.local=e.length?e:li,this.children=t.length?t:li}static create(e,t){return t.length?gi(t,e,0,ci):di}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,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==di||0==e.maps.length?this:this.mapInner(e,t,0,0,n||ci)}mapInner(e,t,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,s){let a=e.slice(),l=(e,t,n,r)=>{for(let s=0;s<a.length;s+=3){let l,c=a[s+1];if(c<0||e>c+i)continue;let u=a[s]+i;t>=u?a[s+1]=e<=u?-2:-1:n>=o&&(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 c=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){c=!0,a[t+1]=-1;continue}let l=n.map(e[t]+i),u=l-o;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+i,-1)-o,{index:p,offset:h}=r.content.findIndex(u),f=r.maybeChild(p);if(f&&h==u&&h+f.nodeSize==d){let r=a[t+2].mapInner(n,f,l+1,e[t]+i+1,s);r!=di?(a[t]=u,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,c=!0)}else c=!0}if(c){let l=function(e,t,n,r,o,i,s){function a(e,t){for(let i=0;i<e.local.length;i++){let a=e.local[i].map(r,o,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[i].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]+i+1);return n}(a,e,t,n,o,i,s),c=gi(l,r,0,s);t=c.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<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new ui(t.sort(yi),a)}(this.children,i||[],e,t,n,r,o):i?new ui(i.sort(yi),li):di}add(e,t){return t.length?this==di?ui.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,o=0;e.forEach(((e,i)=>{let s,a=i+n;if(s=fi(t,e,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(e,s,a+1):r.splice(o,0,i,i+e.nodeSize,gi(s,e,a+1,ci)),o+=3}}));let i=hi(o?mi(t):t,-n);for(let t=0;t<i.length;t++)i[t].type.valid(e,i[t])||i.splice(t--,1);return new ui(i.length?this.local.concat(i).sort(yi):this.local,r||this.children)}remove(e){return 0==e.length||this==di?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 o,i=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>i&&t.to<s&&(e[n]=null,(o||(o=[])).push(t));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=di?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<e.length;o++)if(n=e[o])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 ui(r,n):di}forChild(e,t){if(this==di)return this;if(t.isLeaf)return ui.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 o=e+1,i=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>o&&t.type instanceof ii){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new ui(r.sort(yi),li);return n?new pi([e,n]):e}return n||di}eq(e){if(this==e)return!0;if(!(e instanceof ui)||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 bi(this.localsInner(e))}localsInner(e){if(this==di)return li;if(e.inlineContent||!this.local.some(ii.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof ii||t.push(this.local[e]);return t}}ui.empty=new ui([],[]),ui.removeOverlap=bi;const di=ui.empty;class pi{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,ci)));return pi.from(n)}forChild(e,t){if(t.isLeaf)return ui.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,t);o!=di&&(o instanceof pi?n=n.concat(o.members):n.push(o))}return pi.from(n)}eq(e){if(!(e instanceof pi)||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 o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?bi(n?t:t.sort(yi)):li}static from(e){switch(e.length){case 0:return di;case 1:return e[0];default:return new pi(e)}}}function hi(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new ai(o.from+t,o.to+t,o.type))}return n}function fi(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let t,i=0;i<e.length;i++)(t=e[i])&&t.from>n&&t.to<r&&((o||(o=[])).push(t),e[i]=null);return o}function mi(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function gi(e,t,n,r){let o=[],i=!1;t.forEach(((t,s)=>{let a=fi(e,t,s+n);if(a){i=!0;let e=gi(a,t,n+s+1,r);e!=di&&o.push(s,s+t.nodeSize,e)}}));let s=hi(i?mi(e):e,-n).sort(yi);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||o.length?new ui(s,o):di}function yi(e,t){return e.from-t.from||e.to-t.to}function bi(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),vi(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),vi(t,o+1,i.copy(r.to,i.to)))}}return t}function vi(e,t,n){for(;t<e.length&&yi(n,e[t])>0;)t++;e.splice(t,0,n)}function wi(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=di&&t.push(r)})),e.cursorWrapper&&t.push(ui.create(e.state.doc,[e.cursorWrapper.deco])),pi.from(t)}const xi={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Mi=jn&&In<=11;class Di{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 ki{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Di,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]);jn&&In<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),Mi&&(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,xi),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(io(this.view)){if(this.suppressingSelectionUpdates)return Jr(this.view);if(jn&&In<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&Kn(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)&&io(this.view)&&!this.ignoreSelectionChange(t),r=-1,o=-1,i=!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),o=o<0?n.to:Math.max(n.to,o),n.typeOver&&(i=!0))}if(Ln&&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,o),function(e){if(Ei)return;Ei=!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,o,i,s),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||Jr(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,o=e.nextSibling;if(jn&&In<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:i}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(e.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==e.target?Wn(r)+1:0,s=n.localPosFromDOM(e.target,i,-1),a=o&&o.parentNode==e.target?Wn(o):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 Ei=!1;function Ci(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Rn&&/^(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||Rn&&/^(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 Ti(e,t,n,r,o){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Kr(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 i=e.state.doc.resolve(t),s=i.sharedDepth(n);t=i.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:o,fromOffset:i,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelection(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],er(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Pn&&8===e.input.lastKeyCode)for(let e=s;e>i;e--){let t=o.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")||Je.fromSchema(e.state.schema),h=d.resolve(a),f=null,m=p.parse(o,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Ci,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(Pn&&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 c,u,d=e.state.doc,p=d.slice(l.from,l.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(c=e.state.selection.to,u="end"):(c=e.state.selection.from,u="start"),e.input.lastKeyCode=null;let h=function(e,t,n,r,o){let i=e.findDiffStart(t,n);if(null==i)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==o){r-=s+Math.max(0,i-Math.min(s,a))-i}if(s<i&&e.size<t.size){i-=r<=i&&r>=s?i-r:0,a=i+(a-s),s=i}else if(a<i){i-=r<=i&&r>=a?i-r:0,s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}(p.content,l.doc.content,l.from,c,u);if((Bn&&e.input.lastIOSEnter>Date.now()-225||Hn)&&o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",(t=>t(e,tr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!h){if(!(r&&a instanceof on&&!a.empty&&a.$head.sameParent(a.$anchor))||e.composing||l.sel&&l.sel.anchor!=l.sel.head){if(l.sel){let t=Oi(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 on&&(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)),jn&&In<=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((Bn&&e.input.lastIOSEnter>Date.now()-225&&(!b||o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!b&&m.pos<l.doc.content.size&&(f=en.findFrom(l.doc.resolve(m.pos+1),1,!0))&&f.head==g.pos)&&e.someProp("handleKeyDown",(t=>t(e,tr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>h.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||Ai(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(Ai(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Ai(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,tr(8,"Backspace")))))return void(Hn&&Pn&&e.domObserver.suppressSelectionUpdates());Pn&&Hn&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),Hn&&!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,tr(13,"Enter"))}))}),20));let v,w,x,M=h.start,D=h.endA;if(b)if(m.pos==g.pos)jn&&In<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Jr(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,o,i=e.firstChild.marks,s=t.firstChild.marks,a=i,l=s;for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);for(let e=0;e<i.length;e++)l=i[e].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",o=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",o=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(o(t.child(e)));if(ae.from(c).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=Oi(e,v.doc,l.sel);t&&!(Pn&&Hn&&e.composing&&t.empty&&(h.start!=h.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==M||t.head==v.mapping.map(D)-1)||jn&&t.empty&&t.head==M)&&v.setSelection(t)}w&&v.ensureMarks(w),e.dispatch(v.scrollIntoView())}function Oi(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:oo(e,t.resolve(n.anchor),t.resolve(n.head))}function Ai(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}class Ni{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 Io,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Li),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=ji(this),_i(this),this.nodeViews=Ii(this),this.docView=jr(this.state.doc,Si(this),wi(this),this.dom,this),this.domObserver=new ki(this,((e,t,n,r)=>Ti(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in _o){let n=_o[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Fo(e,t)||Po(e,t)||!e.editable&&t.type in jo||n(e,t)})}Rn&&e.dom.addEventListener("input",(()=>null)),zo(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&&zo(this),this._props=e,e.plugins&&(e.plugins.forEach(Li),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,o=!1;if(e.storedMarks&&this.composing&&(Jo(this),o=!0),this.state=e,t){let e=Ii(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),zo(this)}this.editable=ji(this),_i(this);let i=wi(this),s=Si(this),a=t?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",l=r||!this.docView.matchesNode(e.doc,s,i);!l&&e.selection.eq(n.selection)||(o=!0);let c="preserve"==a&&o&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(i,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=o-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:sr(e.dom)}}(this);if(o){this.domObserver.stop();let t=l&&(jn||Pn)&&!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=Pn?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(e.doc,s,i,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=jr(e.doc,s,i,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 Kn(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Jr(this,t):(no(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 an){let n=this.docView.domAfterPos(e.selection.from);1==n.nodeType&&ir(this,n.getBoundingClientRect(),t)}else ir(this,this.coordsAtPos(e.selection.head,1),t)}else c&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;ar(n,0==r?0:r-t)}(c)}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 o=this.directPlugins[r].props[e];if(null!=o&&(n=t?t(o):o))return n}let o=this.state.plugins;if(o)for(let r=0;r<o.length;r++){let i=o[r].props[e];if(null!=i&&(n=t?t(i):i))return n}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(lr)return e.focus(lr);let t=sr(e);e.focus(null==lr?{get preventScroll(){return lr={preventScroll:!0},!0}}:void 0),lr||(lr=!1,ar(t,0))}(this.dom),Jr(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 pr(this,e)}coordsAtPos(e,t=1){return mr(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 Dr(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,[],wi(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){Po(e,t)||!_o[t.type]||!e.editable&&t.type in jo||_o[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 Si(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]))})),[ai.node(0,e.state.doc.content.size,t)]}function _i(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:ai.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function ji(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Ii(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 Li(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 zi={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:"'",229:"q"},Pi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Fi="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Ri="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Bi="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Ui="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Hi="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),$i=Fi&&(Ui||+Fi[1]<57)||Bi&&Ui,Vi=0;Vi<10;Vi++)zi[48+Vi]=zi[96+Vi]=String(Vi);for(Vi=1;Vi<=24;Vi++)zi[Vi+111]="F"+Vi;for(Vi=65;Vi<=90;Vi++)zi[Vi]=String.fromCharCode(Vi+32),Pi[Vi]=String.fromCharCode(Vi);for(var Wi in zi)Pi.hasOwnProperty(Wi)||(Pi[Wi]=zi[Wi]);const qi="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Yi(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let e=0;e<i.length-1;e++){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!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);qi?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Qi(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 Ki(e){let t=function(e){let t=Object.create(null);for(let n in e)t[Yi(n)]=e[n];return t}(e);return function(e,n){let r,o=function(e){var t=!($i&&(e.ctrlKey||e.altKey||e.metaKey)||(Ri||Hi)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?Pi:zi)[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),i=1==o.length&&" "!=o,s=t[Qi(o,n,!i)];if(s&&s(e.state,e.dispatch,e))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=zi[n.keyCode])&&r!=o){let o=t[Qi(r,n,!0)];if(o&&o(e.state,e.dispatch,e))return!0}else if(i&&n.shiftKey){let r=t[Qi(o,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}function Gi(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 Ji(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 Xi(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 Zi(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 es(e,t,n){let r,o,i=t.nodeBefore,s=t.nodeAfter;if(i.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(i,i+1)||!o.isTextblock&&!Ft(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=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(r[0]||s.type).validEnd){if(n){let o=t.pos+s.nodeSize,a=ae.empty;for(let e=r.length-1;e>=0;e--)a=ae.from(r[e].create(null,a));a=ae.from(i.copy(a));let l=e.tr.step(new St(t.pos-1,o,t.pos,o,new he(a,1,0),r.length,!0)),c=o+2*r.length;Ft(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=en.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&It(c);if(null!=u&&u>=t.depth)return n&&n(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&Gi(s,"start",!0)&&Gi(i,"end")){let r=i,o=[];for(;o.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=ae.empty;for(let e=o.length-1;e>=0;e--)r=ae.from(o[e].copy(r));n(e.tr.step(new St(t.pos-o.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new he(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ts(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(on.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}const ns=ts(-1),rs=ts(1);function is(e,t=null){return function(n,r){let{from:o,to:i}=n.selection,s=!1;return n.doc.nodesBetween(o,i,((r,o)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(o),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(o,i,e,t).scrollIntoView()),!0)}}function ss(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==o.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(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let c=Lt(l,e,t,s);return!!c&&(r&&r(function(e,t,n,r,o){let i=ae.empty;for(let e=n.length-1;e>=0;e--)i=ae.from(n[e].type.create(n[e].attrs,i));e.step(new St(t.start-(r?2:0),t.end,t.start,t.end,new he(i,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==o&&(s=e+1);let a=n.length-s,l=t.start+n.length-(r?2:0),c=t.parent;for(let n=t.startIndex,r=t.endIndex,o=!0;n<r;n++,o=!1)!o&&Pt(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(n).nodeSize;return e}(n.tr,s,c,a,e).scrollIntoView()),!0)}}function as(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));return!!i&&(!n||(r.node(i.depth-1).type==e?function(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new St(i-1,s,i,s,new he(ae.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ae(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));return t(o.lift(r,It(r)).scrollIntoView()),!0}(t,n,e,i):function(e,t,n){let r=e.tr,o=n.parent;for(let e=n.end,t=n.endIndex-1,i=n.startIndex;t>i;t--)e-=o.child(t).nodeSize,r.delete(e-1,e+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?ae.empty:ae.from(o))))return!1;let d=i.pos,p=d+s.nodeSize;return r.step(new St(d-(a?1:0),p+(l?1:0),d+1,p-1,new he((a?ae.empty:ae.from(o.copy(ae.empty))).append(l?ae.empty:ae.from(o.copy(ae.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,i)))}}function ls(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=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 i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=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:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!e,l=e||o.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),o=n(...e)(r);return s.push(o),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),s.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=void 0,o=e||n.tr,i=this.buildProps(o,r),s=Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:r})])));return{...s,chain:()=>this.createChain(o,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r;o.storedMarks&&e.setStoredMarks(o.storedMarks);const s={tr:e,editor:r,view:i,state:ls({state:o,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 us(e,t,n){if(void 0===e.config[t]&&e.parent)return us(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?us(e.parent,t,n):null})}return e.config[t]}function ds(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function ps(e){const t=[],{nodeExtensions:n,markExtensions:r}=ds(e),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=us(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:{...i,...r}})}))}))}))})),o.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=us(e,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{const o={...i,...r};r.isRequired&&void 0===r.default&&delete o.default,t.push({type:e.name,name:n,attribute:o})}))})),t}function hs(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 fs(...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 ms(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)=>fs(e,t)),{})}function gs(e){return"function"==typeof e}function ys(e,t=void 0,...n){return gs(e)?t?e.bind(t)(...n):e(...n):e}function bs(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const o=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,...o}}}}function vs(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 ws(e,t){return t.nodes[e]||t.marks[e]||null}function xs(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function Ms(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class Ds{constructor(e){this.find=e.find,this.handler=e.handler}}function ks(e){var t;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(t=c.nodeBefore||c.nodeAfter)||void 0===t?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let u=!1;const d=((e,t=500)=>{let n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,((t,r,o,i)=>{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:o,index:i}))||(null===(l=e.nodeBefore)||void 0===l?void 0:l.text)||"%leaf%"})),n})(c)+i;return s.forEach((e=>{if(u)return;const t=((e,t)=>{if(Ms(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,c=ls({state:l.state,transaction:s}),p={from:r-(t[0].length-i.length),to:o},{commands:h,chain:f,can:m}=new cs({editor:n,state:c});null!==e.handler({state:c,range:p,match:t,commands:h,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),u=!0)})),u}function Es(e){const{editor:t,rules:n}=e,r=new Dn({state:{init:()=>null,apply(e,t){const n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(e,o,i,s)=>ks({editor:t,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:o}=e.state.selection;o&&ks({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;const{$cursor:i}=e.state.selection;return!!i&&ks({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class Cs{constructor(e){this.find=e.find,this.handler=e.handler}}function Ts(e){const{editor:t,state:n,from:r,to:o,rule:i}=e,{commands:s,chain:a,can:l}=new cs({editor:t,state:n}),c=[];n.doc.nodesBetween(r,o,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const u=Math.max(r,t),d=Math.min(o,t+e.content.size),p=((e,t)=>{if(Ms(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(u-t,d-t,void 0,""),i.find);p.forEach((e=>{if(void 0===e.index)return;const t=u+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},d=i.handler({state:n,range:o,match:e,commands:s,chain:a,can:l});c.push(d)}))}));return c.every((e=>null!==e))}function Os(e){const{editor:t,rules:n}=e;let r=null,o=!1,i=!1;return n.map((e=>new Dn({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=>(i=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 o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!o,c="drop"===a.getMeta("uiEvent")&&!i;if(!l&&!c)return;const u=r.doc.content.findDiffStart(s.doc.content),d=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof u||!d||u===d.b)return;const p=s.tr,h=ls({state:s,transaction:p});return Ts({editor:t,state:h,from:Math.max(u-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=ps(e),{nodeExtensions:r,markExtensions:o}=ds(e),i=null===(t=r.find((e=>us(e,"topNode"))))||void 0===t?void 0:t.name,s=Object.fromEntries(r.map((t=>{const r=n.filter((e=>e.type===t.name)),o={name:t.name,options:t.options,storage:t.storage},i=e.reduce(((e,n)=>{const r=us(n,"extendNodeSchema",o);return{...e,...r?r(t):{}}}),{}),s=vs({...i,content:ys(us(t,"content",o)),marks:ys(us(t,"marks",o)),group:ys(us(t,"group",o)),inline:ys(us(t,"inline",o)),atom:ys(us(t,"atom",o)),selectable:ys(us(t,"selectable",o)),draggable:ys(us(t,"draggable",o)),code:ys(us(t,"code",o)),defining:ys(us(t,"defining",o)),isolating:ys(us(t,"isolating",o)),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=ys(us(t,"parseHTML",o));a&&(s.parseDOM=a.map((e=>bs(e,r))));const l=us(t,"renderHTML",o);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:ms(e,r)}));const c=us(t,"renderText",o);return c&&(s.toText=c),[t.name,s]}))),a=Object.fromEntries(o.map((t=>{const r=n.filter((e=>e.type===t.name)),o={name:t.name,options:t.options,storage:t.storage},i=e.reduce(((e,n)=>{const r=us(n,"extendMarkSchema",o);return{...e,...r?r(t):{}}}),{}),s=vs({...i,inclusive:ys(us(t,"inclusive",o)),excludes:ys(us(t,"excludes",o)),group:ys(us(t,"group",o)),spanning:ys(us(t,"spanning",o)),code:ys(us(t,"code",o)),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=ys(us(t,"parseHTML",o));a&&(s.parseDOM=a.map((e=>bs(e,r))));const l=us(t,"renderHTML",o);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:ms(e,r)})),[t.name,s]})));return new Ke({topNode:i,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:ws(e.name,this.schema)};if("mark"===e.type){(null===(t=ys(us(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const r=us(e,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=us(e,"onCreate",n);o&&this.editor.on("create",o);const i=us(e,"onUpdate",n);i&&this.editor.on("update",i);const s=us(e,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=us(e,"onTransaction",n);a&&this.editor.on("transaction",a);const l=us(e,"onFocus",n);l&&this.editor.on("focus",l);const c=us(e,"onBlur",n);c&&this.editor.on("blur",c);const u=us(e,"onDestroy",n);u&&this.editor.on("destroy",u)}))}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=us(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=us(e,"priority")||t,o=us(n,"priority")||t;return r>o?-1:r<o?1:0}))}get commands(){return this.extensions.reduce(((e,t)=>{const n=us(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:ws(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=As.sort([...this.extensions].reverse()),n=[],r=[],o=t.map((t=>{const o={name:t.name,options:t.options,storage:t.storage,editor:e,type:ws(t.name,this.schema)},i=[],s=us(t,"addKeyboardShortcuts",o);if(s){const t=function(e){return new Dn({props:{handleKeyDown:Ki(e)}})}(Object.fromEntries(Object.entries(s()).map((([t,n])=>[t,()=>n({editor:e})]))));i.push(t)}const a=us(t,"addInputRules",o);xs(t,e.options.enableInputRules)&&a&&n.push(...a());const l=us(t,"addPasteRules",o);xs(t,e.options.enablePasteRules)&&l&&r.push(...l());const c=us(t,"addProseMirrorPlugins",o);if(c){const e=c();i.push(...e)}return i})).flat();return[Es({editor:e,rules:n}),...Os({editor:e,rules:r}),...o]}get attributes(){return ps(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=ds(this.extensions);return Object.fromEntries(t.filter((e=>!!us(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:hs(t.name,this.schema)},o=us(t,"addNodeView",r);if(!o)return[];return[t.name,(r,i,s,a)=>{const l=ms(r,n);return o()({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 Ss(e,t){const n={...e};return Ns(e)&&Ns(t)&&Object.keys(t).forEach((r=>{Ns(t[r])?r in e?n[r]=Ss(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})})),n}class _s{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=ys(us(this,"addOptions",{name:this.name}))),this.storage=ys(us(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new _s(e)}configure(e={}){const t=this.extend();return t.options=Ss(this.options,e),t.storage=ys(us(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new _s(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=ys(us(t,"addOptions",{name:t.name})),t.storage=ys(us(t,"addStorage",{name:t.name,options:t.options})),t}}function js(e,t,n){const{from:r,to:o}=t,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return e.nodesBetween(r,o,((e,n,c,u)=>{var d;const p=null==s?void 0:s[e.type.name];p?(e.isBlock&&!l&&(a+=i,l=!0),c&&(a+=p({node:e,pos:n,parent:c,index:u,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,o-n),l=!1):e.isBlock&&!l&&(a+=i,l=!0)})),a}function Is(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}const Ls=_s.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Dn({key:new Cn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,s=Math.min(...i.map((e=>e.$from.pos))),a=Math.max(...i.map((e=>e.$to.pos)));return js(r,{from:s,to:a},{textSerializers:Is(n)})}}})]}});function zs(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:Ms(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Ps(e,t,n={}){return e.find((e=>e.type===t&&zs(e.attrs,n)))}function Fs(e,t,n={}){return!!Ps(e,t,n)}function Rs(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 o=Ps([...r.node.marks],t,n);if(!o)return;let i=r.index,s=e.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(Ps([...r.node.marks],t,n);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,s-=e.parent.child(i).nodeSize;for(;a<e.parent.childCount&&Fs([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Bs(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 Us(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 Hs(e){return Us(e)&&e instanceof on}function $s(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Vs(e,t=null){if(!t)return null;const n=en.atStart(e),r=en.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const o=n.from,i=r.to;return"all"===t?on.create(e,$s(0,o,i),$s(e.content.size,o,i)):on.create(e,$s(t,o,i),$s(t,o,i))}function Ws(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function qs(e){const t=`<body>${e}</body>`;return(new window.DOMParser).parseFromString(t,"text/html").body}function Ys(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)?ae.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Ys("",t,n)}if("string"==typeof e){const r=Je.fromSchema(t);return n.slice?r.parseSlice(qs(e),n.parseOptions).content:r.parse(qs(e),n.parseOptions)}return Ys("",t,n)}function Qs(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Ks(e,t,n={}){const{from:r,to:o,empty:i}=e.selection,s=t?hs(t,e.schema):null,a=[];e.doc.nodesBetween(r,o,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);a.push({node:e,from:n,to:i})}));const l=o-r,c=a.filter((e=>!s||s.name===e.node.type.name)).filter((e=>zs(e.node.attrs,n,{strict:!1})));if(i)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}function Gs(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Js(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 Xs(e,t,n={}){return Ys(e,t,{slice:!1,parseOptions:n})}function Zs(e,t){const n=Bs(t,e.schema),{from:r,to:o,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function ea(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 ta(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 na(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 ra(e,t){const{nodeExtensions:n}=ds(t),r=n.find((t=>t.name===e));if(!r)return!1;const o=ys(us(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}const oa=(e,t)=>{const n=na((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 o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Ft(e.doc,n.pos)||(e.join(n.pos),!0)},ia=(e,t)=>{const n=na((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 o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Ft(e.doc,r)||(e.join(r),!0)};function sa(e,t,n={}){const{empty:r,ranges:o}=e.selection,i=t?Bs(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!i||i.name===e.type.name)).find((e=>zs(e.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((({$from:t,$to:n})=>{const r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);s+=i-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:i}))))}))})),0===s)return!1;const l=a.filter((e=>!i||i.name===e.mark.type.name)).filter((e=>zs(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!i||e.mark.type!==i&&e.mark.type.excludes(i))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=s}var aa=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:o}=r;return!n||(o.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:o}=t,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+e.nodeSize)),a=i.blockRange(s);if(!a)return;const l=It(a);if(e.type.isTextblock){const{defaultType:e}=i.parent.contentMatchAt(i.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:o}=n;if(n instanceof cn||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Zi(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(n,i.createAndFill());s.setSelection(on.create(s.doc,n+1)),t(s.scrollIntoView())}return!0})(e,t),deleteNode:e=>({tr:t,state:n,dispatch:r})=>{const o=hs(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1){if(i.node(e).type===o){if(r){const n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!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 o=n.node(-1),i=n.indexAfter(-1),s=Zi(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,s.createAndFill());o.setSelection(en.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0})(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:o})=>{const i=Bs(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const e=Rs(l,i,t);if(e&&e.from<=c&&e.to>=u){const t=on.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:o,dispatch:i})=>{t={scrollIntoView:!0,...t};const s=()=>{Ws()&&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(i&&null===e&&!Hs(n.state.selection))return s(),!0;const a=Vs(o.doc,e)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.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:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const o=Ys(t,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===o.toString())return!0;let{from:s,to:a}="number"==typeof e?{from:e,to:e}:e,l=!0,c=!0;if((o.toString().startsWith("<")?o:[o]).forEach((e=>{e.check(),l=!!l&&(e.isText&&0===e.marks.length),c=!!c&&e.isBlock})),s===a&&c){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,o),n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const o=e.steps[r];if(!(o instanceof Nt||o instanceof St))return;const i=e.mapping.maps[r];let s=0;i.forEach(((e,t,n,r)=>{0===s&&(s=r)})),e.setSelection(en.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 o=Ji(r);if(!o){let n=r.blockRange(),o=n&&It(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&es(e,o,t))return!0;if(0==r.parent.content.size&&(Gi(i,"end")||an.isSelectable(i))){let n=Bt(e.doc,r.before(),r.after(),he.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Gi(i,"end")?en.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):an.create(r.doc,o.pos-i.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(t&&t(e.tr.delete(o.pos-i.nodeSize,o.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 o=Xi(r);if(!o)return!1;let i=o.nodeAfter;if(es(e,o,t))return!0;if(0==r.parent.content.size&&(Gi(i,"start")||an.isSelectable(i))){let n=Bt(e.doc,r.before(),r.after(),he.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Gi(i,"start")?en.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):an.create(r.doc,r.mapping.map(o.pos))),t(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),0))})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:o})=>{const i=function(e){const t=e.split(/-(?!$)/);let n,r,o,i,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))i=!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))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);Ws()||Qs()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=i.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.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&&o&&r.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:r})=>!!Ks(n,hs(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&It(o);return null!=i&&(t&&t(e.tr.lift(o,i).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(Pt(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&It(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)})(e,t),liftListItem:e=>({state:t,dispatch:n})=>as(hs(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:o})=>{let i=null,s=null;const a=Gs("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(i=hs(e,r.schema)),"mark"===a&&(s=Bs(e,r.schema)),o&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{i&&i===e.type&&n.setNodeMarkup(r,void 0,Js(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((o=>{s===o.type&&n.addMark(r,r+e.nodeSize,s.create(Js(o.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:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=Ji(r)}let s=i&&i.nodeBefore;return!(!s||!an.isSelectable(s)||(t&&t(e.tr.setSelection(an.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),0))})(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=Xi(r)}let s=i&&i.nodeAfter;return!(!s||!an.isSelectable(s)||(t&&t(e.tr.setSelection(an.create(e.doc,i.pos)).scrollIntoView()),0))})(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:o}=e.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),t&&t(e.tr.setSelection(an.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>rs(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>ns(e,t),setContent:(e,t=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=Xs(e,o.schema,n);return i&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Bs(e,r.schema);if(o)if(s){const e=Zs(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const o=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(o,i,((e,r)=>{const s=Math.max(r,o),a=Math.min(r+e.nodeSize,i);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:o})=>{const i=hs(e,n.schema);return i.isTextblock?o().command((({commands:e})=>!!is(i,t)(n)||e.clearNodes())).command((({state:e})=>is(i,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=en.atStart(n).from,o=en.atEnd(n).to,i=$s(e,r,o),s=an.create(n,i);t.setSelection(s)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,i=on.atStart(n).from,s=on.atEnd(n).to,a=$s(r,i,s),l=$s(o,i,s),c=on.create(n,a,l);t.setSelection(c)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const r=hs(e,t.schema);return(o=r,function(e,t){let{$from:n,$to:r}=e.selection,i=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==o));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=o)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,r=ae.from(n?o.create():null),s=new he(ae.from(o.create(null,ae.from(a.type.create(null,r)))),n?3:1,0),c=i.start,u=i.end;t(e.tr.step(new St(c-(n?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0})(t,n);var o},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=t,{$from:a,$to:l}=i,c=ea(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof an&&i.node.isBlock)return!(!a.parentOffset||!Pt(s,a.pos))&&(r&&(e&&ta(n,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;i instanceof on&&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 u=r&&s?[{type:s,attrs:c}]:void 0,d=Pt(t.doc,t.mapping.map(a.pos),1,u);if(u||d||!Pt(t.doc,t.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(d=!0,u=s?[{type:s,attrs:c}]:void 0),d&&(t.split(t.mapping.map(a.pos),1,u),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&&ta(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0},splitListItem:e=>({tr:t,state:n,dispatch:r,editor:o})=>{var i;const s=hs(e,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const d=o.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=ae.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=ae.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,o=ea(d,a.node().type.name,a.node().attrs),l=(null===(i=s.contentMatch.defaultType)||void 0===i?void 0:i.createAndFill(o))||void 0;e=e.append(ae.from(s.createAndFill(null,l)||void 0));const c=a.before(a.depth-(n-1));t.replace(c,a.after(-r),new he(e,4-n,0));let u=-1;t.doc.nodesBetween(c,t.doc.content.size,((e,t)=>{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)})),u>-1&&t.setSelection(on.near(t.doc.resolve(u))),t.scrollIntoView()}return!0}const p=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,h=ea(d,u.type.name,u.attrs),f=ea(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!!Pt(t.doc,a.pos,2)&&(r&&t.split(a.pos,2,m).scrollIntoView(),!0)},toggleList:(e,t)=>({editor:n,tr:r,state:o,dispatch:i,chain:s,commands:a,can:l})=>{const{extensions:c}=n.extensionManager,u=hs(e,o.schema),d=hs(t,o.schema),{selection:p}=o,{$from:h,$to:f}=p,m=h.blockRange(f);if(!m)return!1;const g=na((e=>ra(e.type.name,c)))(p);if(m.depth>=1&&g&&m.depth-g.depth<=1){if(g.node.type===u)return a.liftListItem(d);if(ra(g.node.type.name,c)&&u.validContent(g.node.content)&&i)return s().command((()=>(r.setNodeMarkup(g.pos,u),!0))).command((()=>oa(r,u))).command((()=>ia(r,u))).run()}return s().command((()=>!!l().wrapInList(u)||a.clearNodes())).wrapInList(u).command((()=>oa(r,u))).command((()=>ia(r,u))).run()},toggleMark:(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Bs(e,r.schema);return sa(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},toggleNode:(e,t,n={})=>({state:r,commands:o})=>{const i=hs(e,r.schema),s=hs(t,r.schema);return Ks(r,i,n)?o.setNode(s):o.setNode(i,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const o=hs(e,n.schema);return Ks(n,o,t)?r.lift(o):r.wrapIn(o,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){const t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){const n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:o}=n;return r||t&&o.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=Bs(e,r.schema),{$from:c,empty:u,ranges:d}=a;if(!o)return!0;if(u&&s){let{from:e,to:t}=a;const r=null===(i=c.marks().find((e=>e.type===l)))||void 0===i?void 0:i.attrs,o=Rs(c,l,r);o&&(e=o.from,t=o.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:o})=>{let i=null,s=null;const a=Gs("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(i=hs(e,r.schema)),"mark"===a&&(s=Bs(e,r.schema)),o&&n.selection.ranges.forEach((e=>{const o=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(o,a,((e,r)=>{i&&i===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach((i=>{if(s===i.type){const l=Math.max(r,o),c=Math.min(r+e.nodeSize,a);n.addMark(l,c,s.create({...i.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&Lt(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(hs(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>ss(hs(e,n.schema),t)(n,r)});const la=_s.create({name:"commands",addCommands:()=>({...aa})}),ca=_s.create({name:"editable",addProseMirrorPlugins(){return[new Dn({key:new Cn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ua=_s.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Dn({key:new Cn("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}}}})]}}),da=_s.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:o,$anchor:i}=n,{pos:s,parent:a}=i,l=en.atStart(r).from===s;return!(!(o&&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},o={...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 Ws()||Qs()?o:r},addProseMirrorPlugins(){return[new Dn({key:new Cn("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:r,from:o,to:i}=t.selection,s=en.atStart(t.doc).from,a=en.atEnd(t.doc).to,l=o===s&&i===a,c=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(r||!l||!c)return;const u=n.tr,d=ls({state:n,transaction:u}),{commands:p}=new cs({editor:this.editor,state:d});return p.clearNodes(),u.steps.length?u:void 0}})]}}),pa=_s.create({name:"tabindex",addProseMirrorPlugins(){return[new Dn({key:new Cn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var ha=Object.freeze({__proto__:null,ClipboardTextSerializer:Ls,Commands:la,Editable:ca,FocusEvents:ua,Keymap:da,Tabindex:pa});function fa(e,t){const n=Gs("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=hs(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,(e=>{i.push(e)}));const s=i.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?Zs(e,t):{}}const ma=`.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 ga(e,t){const n=[];return e.descendants(((e,r)=>{t(e)&&n.push({node:e,pos:r})})),n}function ya(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 ba(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const o=Rs(n.resolve(e-1),t.type);o&&r.push({mark:t,...o})})):n.nodesBetween(e,t,((e,t)=>{r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function va(e,t,n){const r=0,o=e.state.doc.content.size,i=$s(t,r,o),s=$s(n,r,o),a=e.coordsAtPos(i),l=e.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),p=Math.max(a.right,l.right),h={top:c,bottom:u,left:d,right:p,width:p-d,height:u-c,x:d,y:c};return{...h,toJSON:()=>h}}function wa(e){return new Ds({find:e.find,handler:({state:t,range:n,match:r})=>{const o=ys(e.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length,d=ba(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>c));if(d.length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+r,c),l=n.from+r+s.length,i.addMark(n.from+r,l,e.type.create(o||{})),i.removeStoredMark(e.type)}}})}function xa(e){return new Ds({find:e.find,handler:({state:t,range:n,match:r})=>{const o=ys(e.getAttributes,void 0,r)||{},{tr:i}=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];i.insertText(n,s+r[0].length-1),i.replaceWith(t,a,e.type.create(o))}else r[0]&&i.replaceWith(s,a,e.type.create(o))}})}function Ma(e){return new Ds({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=ys(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)}})}function Da(e){return new Ds({find:e.find,handler:({state:t,range:n,match:r})=>{let o=e.replace,i=n.from;const s=n.to;if(r[1]){const e=r[0].lastIndexOf(r[1]);o+=r[0].slice(e+r[1].length),i+=e;const t=i-s;t>0&&(o=r[0].slice(e-t,e)+o,i=s)}t.tr.insertText(o,i,s)}})}function ka(e){return new Ds({find:e.find,handler:({state:t,range:n,match:r})=>{const o=ys(e.getAttributes,void 0,r)||{},i=t.tr.delete(n.from,n.to),s=i.doc.resolve(n.from).blockRange(),a=s&&Lt(s,e.type,o);if(!a)return null;i.wrap(s,a);const l=i.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Ft(i.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&i.join(n.from-1)}})}class Ea{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=ys(us(this,"addOptions",{name:this.name}))),this.storage=ys(us(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ea(e)}configure(e={}){const t=this.extend();return t.options=Ss(this.options,e),t.storage=ys(us(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ea(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=ys(us(t,"addOptions",{name:t.name})),t.storage=ys(us(t,"addStorage",{name:t.name,options:t.options})),t}}class Ca{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=ys(us(this,"addOptions",{name:this.name}))),this.storage=ys(us(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ca(e)}configure(e={}){const t=this.extend();return t.options=Ss(this.options,e),t.storage=ys(us(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=ys(us(t,"addOptions",{name:t.name})),t.storage=ys(us(t,"addStorage",{name:t.name,options:t.options})),t}}function Ta(e){return new Cs({find:e.find,handler:({state:t,range:n,match:r})=>{const o=ys(e.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length,d=ba(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>c));if(d.length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+r,c),l=n.from+r+s.length,i.addMark(n.from+r,l,e.type.create(o||{})),i.removeStoredMark(e.type)}}})}var Oa="top",Aa="bottom",Na="right",Sa="left",_a="auto",ja=[Oa,Aa,Na,Sa],Ia="start",La="end",za="clippingParents",Pa="viewport",Fa="popper",Ra="reference",Ba=ja.reduce((function(e,t){return e.concat([t+"-"+Ia,t+"-"+La])}),[]),Ua=[].concat(ja,[_a]).reduce((function(e,t){return e.concat([t,t+"-"+Ia,t+"-"+La])}),[]),Ha=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function $a(e){return e?(e.nodeName||"").toLowerCase():null}function Va(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Wa(e){return e instanceof Va(e).Element||e instanceof Element}function qa(e){return e instanceof Va(e).HTMLElement||e instanceof HTMLElement}function Ya(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Va(e).ShadowRoot||e instanceof ShadowRoot)}var Qa={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];qa(o)&&$a(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});qa(r)&&$a(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Ka(e){return e.split("-")[0]}var Ga=Math.max,Ja=Math.min,Xa=Math.round;function Za(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,o=1;if(qa(e)&&t){var i=e.offsetHeight,s=e.offsetWidth;s>0&&(r=Xa(n.width)/s||1),i>0&&(o=Xa(n.height)/i||1)}return{width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function el(e){var t=Za(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 tl(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ya(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function nl(e){return Va(e).getComputedStyle(e)}function rl(e){return["table","td","th"].indexOf($a(e))>=0}function ol(e){return((Wa(e)?e.ownerDocument:e.document)||window.document).documentElement}function il(e){return"html"===$a(e)?e:e.assignedSlot||e.parentNode||(Ya(e)?e.host:null)||ol(e)}function sl(e){return qa(e)&&"fixed"!==nl(e).position?e.offsetParent:null}function al(e){for(var t=Va(e),n=sl(e);n&&rl(n)&&"static"===nl(n).position;)n=sl(n);return n&&("html"===$a(n)||"body"===$a(n)&&"static"===nl(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&qa(e)&&"fixed"===nl(e).position)return null;var n=il(e);for(Ya(n)&&(n=n.host);qa(n)&&["html","body"].indexOf($a(n))<0;){var r=nl(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 ll(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function cl(e,t,n){return Ga(e,Ja(t,n))}function ul(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function dl(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var pl={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ka(n.placement),l=ll(a),c=[Sa,Na].indexOf(a)>=0?"height":"width";if(i&&s){var u=function(e,t){return ul("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:dl(e,ja))}(o.padding,n),d=el(i),p="y"===l?Oa:Sa,h="y"===l?Aa:Na,f=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],g=al(i),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=f/2-m/2,v=u[p],w=y-d[c]-u[h],x=y/2-d[c]/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)))&&tl(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function hl(e){return e.split("-")[1]}var fl={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ml(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,p=s.x,h=void 0===p?0:p,f=s.y,m=void 0===f?0:f,g="function"==typeof u?u({x:h,y:m}):{x:h,y:m};h=g.x,m=g.y;var y=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),v=Sa,w=Oa,x=window;if(c){var M=al(n),D="clientHeight",k="clientWidth";if(M===Va(n)&&"static"!==nl(M=ol(n)).position&&"absolute"===a&&(D="scrollHeight",k="scrollWidth"),o===Oa||(o===Sa||o===Na)&&i===La)w=Aa,m-=(d&&M===x&&x.visualViewport?x.visualViewport.height:M[D])-r.height,m*=l?1:-1;if(o===Sa||(o===Oa||o===Aa)&&i===La)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},c&&fl),T=!0===u?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Xa(t*r)/r||0,y:Xa(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 gl={passive:!0};var yl={left:"right",right:"left",bottom:"top",top:"bottom"};function bl(e){return e.replace(/left|right|bottom|top/g,(function(e){return yl[e]}))}var vl={start:"end",end:"start"};function wl(e){return e.replace(/start|end/g,(function(e){return vl[e]}))}function xl(e){var t=Va(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Ml(e){return Za(ol(e)).left+xl(e).scrollLeft}function Dl(e){var t=nl(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function kl(e){return["html","body","#document"].indexOf($a(e))>=0?e.ownerDocument.body:qa(e)&&Dl(e)?e:kl(il(e))}function El(e,t){var n;void 0===t&&(t=[]);var r=kl(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Va(r),s=o?[i].concat(i.visualViewport||[],Dl(r)?r:[]):r,a=t.concat(s);return o?a:a.concat(El(il(s)))}function Cl(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Tl(e,t){return t===Pa?Cl(function(e){var t=Va(e),n=ol(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,s=0,a=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:o,height:i,x:s+Ml(e),y:a}}(e)):Wa(t)?function(e){var t=Za(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):Cl(function(e){var t,n=ol(e),r=xl(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=Ga(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Ga(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+Ml(e),l=-r.scrollTop;return"rtl"===nl(o||n).direction&&(a+=Ga(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}(ol(e)))}function Ol(e,t,n){var r="clippingParents"===t?function(e){var t=El(il(e)),n=["absolute","fixed"].indexOf(nl(e).position)>=0&&qa(e)?al(e):e;return Wa(n)?t.filter((function(e){return Wa(e)&&tl(e,n)&&"body"!==$a(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),i=o[0],s=o.reduce((function(t,n){var r=Tl(e,n);return t.top=Ga(r.top,t.top),t.right=Ja(r.right,t.right),t.bottom=Ja(r.bottom,t.bottom),t.left=Ga(r.left,t.left),t}),Tl(e,i));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,o=e.placement,i=o?Ka(o):null,s=o?hl(o):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case Oa: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 Sa:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?ll(i):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case Ia:t[c]=t[c]-(n[u]/2-r[u]/2);break;case La:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}function Nl(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.boundary,s=void 0===i?za:i,a=n.rootBoundary,l=void 0===a?Pa:a,c=n.elementContext,u=void 0===c?Fa:c,d=n.altBoundary,p=void 0!==d&&d,h=n.padding,f=void 0===h?0:h,m=ul("number"!=typeof f?f:dl(f,ja)),g=u===Fa?Ra:Fa,y=e.rects.popper,b=e.elements[p?g:u],v=Ol(Wa(b)?b:b.contextElement||ol(e.elements.popper),s,l),w=Za(e.elements.reference),x=Al({reference:w,element:y,strategy:"absolute",placement:o}),M=Cl(Object.assign({},y,x)),D=u===Fa?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(u===Fa&&E){var C=E[o];Object.keys(k).forEach((function(e){var t=[Na,Aa].indexOf(e)>=0?1:-1,n=[Oa,Aa].indexOf(e)>=0?"y":"x";k[e]+=C[n]*t}))}return k}function Sl(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?Ua:l,u=hl(r),d=u?a?Ba:Ba.filter((function(e){return hl(e)===u})):ja,p=d.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=Nl(e,{placement:n,boundary:o,rootBoundary:i,padding:s})[Ka(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var _l={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,g=t.options.placement,y=Ka(g),b=l||(y===g||!f?[bl(g)]:function(e){if(Ka(e)===_a)return[];var t=bl(e);return[wl(e),t,wl(t)]}(g)),v=[g].concat(b).reduce((function(e,n){return e.concat(Ka(n)===_a?Sl(t,{placement:n,boundary:u,rootBoundary:d,padding:c,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=Ka(C),O=hl(C)===Ia,A=[Oa,Aa].indexOf(T)>=0,N=A?"width":"height",S=Nl(t,{placement:C,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),_=A?O?Na:Sa:O?Aa:Oa;w[N]>x[N]&&(_=bl(_));var j=bl(_),I=[];if(i&&I.push(S[T]<=0),a&&I.push(S[_]<=0,S[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 jl(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 Il(e){return[Oa,Na,Aa,Sa].some((function(t){return e[t]>=0}))}var Ll={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,s=Ua.reduce((function(e,n){return e[n]=function(e,t,n){var r=Ka(e),o=[Sa,Oa].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Sa,Na].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,i),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}};var zl={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,u=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:c,padding:d,altBoundary:u}),y=Ka(t.placement),b=hl(t.placement),v=!b,w=ll(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(i){var A,N="y"===w?Oa:Sa,S="y"===w?Aa:Na,_="y"===w?"height":"width",j=M[w],I=j+g[N],L=j-g[S],z=h?-k[_]/2:0,P=b===Ia?D[_]:k[_],F=b===Ia?-k[_]:-D[_],R=t.elements.arrow,B=h&&R?el(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[N],$=U[S],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&&al(t.elements.arrow),Q=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,K=null!=(A=null==T?void 0:T[w])?A:0,G=j+q-K,J=cl(h?Ja(I,j+W-K-Q):I,j,h?Ga(L,G):L);M[w]=J,O[w]=J-j}if(a){var X,Z="x"===w?Oa:Sa,ee="x"===w?Aa:Na,te=M[x],ne="y"===x?"height":"width",re=te+g[Z],oe=te-g[ee],ie=-1!==[Oa,Sa].indexOf(y),se=null!=(X=null==T?void 0:T[x])?X:0,ae=ie?re:te-D[ne]-k[ne]-se+C.altAxis,le=ie?te+D[ne]+k[ne]-se-C.altAxis:oe,ce=h&&ie?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:oe);M[x]=ce,O[x]=ce-te}t.modifiersData[r]=O}},requiresIfExists:["offset"]};function Pl(e,t,n){void 0===n&&(n=!1);var r,o,i=qa(t),s=qa(t)&&function(e){var t=e.getBoundingClientRect(),n=Xa(t.width)/e.offsetWidth||1,r=Xa(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=ol(t),l=Za(e,s),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&(("body"!==$a(t)||Dl(a))&&(c=(r=t)!==Va(r)&&qa(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:xl(r)),qa(t)?((u=Za(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):a&&(u.x=Ml(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function Fl(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}var Rl={placement:"bottom",modifiers:[],strategy:"absolute"};function Bl(){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 Ul(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?Rl:o;return function(e,t,n){void 0===n&&(n=i);var o,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Rl,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,u={state:a,setOptions:function(n){var o="function"==typeof n?n(a.options):n;d(),a.options=Object.assign({},i,a.options,o),a.scrollParents={reference:Wa(e)?El(e):e.contextElement?El(e.contextElement):[],popper:El(t)};var s=function(e){var t=Fl(e);return Ha.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,o=e.effect;if("function"==typeof o){var i=o({state:a,name:t,instance:u,options:r}),s=function(){};l.push(i||s)}})),u.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,n=e.popper;if(Bl(t,n)){a.rects={reference:Pl(t,al(n),"fixed"===a.options.strategy),popper:el(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 o=a.orderedModifiers[r],i=o.fn,s=o.options,l=void 0===s?{}:s,d=o.name;"function"==typeof i&&(a=i({state:a,options:l,name:d,instance:u})||a)}else a.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(e){u.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(o())}))}))),s}),destroy:function(){d(),c=!0}};if(!Bl(e,t))return u;function d(){l.forEach((function(e){return e()})),l=[]}return u.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),u}}var Hl=Ul({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,s=r.resize,a=void 0===s||s,l=Va(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,gl)})),a&&l.addEventListener("resize",n.update,gl),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,gl)})),a&&l.removeEventListener("resize",n.update,gl)}},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,o=void 0===r||r,i=n.adaptive,s=void 0===i||i,a=n.roundOffsets,l=void 0===a||a,c={placement:Ka(t.placement),variation:hl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ml(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ml(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Qa,Ll,_l,zl,pl,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=Nl(t,{elementContext:"reference"}),a=Nl(t,{altBoundary:!0}),l=jl(s,r),c=jl(a,o,i),u=Il(l),d=Il(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),$l='<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>',Vl="tippy-box",Wl="tippy-content",ql="tippy-backdrop",Yl="tippy-arrow",Ql="tippy-svg-arrow",Kl={passive:!0,capture:!0},Gl=function(){return document.body};function Jl(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Xl(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Zl(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ec(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function tc(e){return[].concat(e)}function nc(e,t){-1===e.indexOf(t)&&e.push(t)}function rc(e){return[].slice.call(e)}function oc(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function ic(){return document.createElement("div")}function sc(e){return["Element","Fragment"].some((function(t){return Xl(e,t)}))}function ac(e){return Xl(e,"MouseEvent")}function lc(e){return sc(e)?[e]:function(e){return Xl(e,"NodeList")}(e)?rc(e):Array.isArray(e)?e:rc(document.querySelectorAll(e))}function cc(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function uc(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function dc(e){var t,n=tc(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function pc(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function hc(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 fc={isTouch:!1},mc=0;function gc(){fc.isTouch||(fc.isTouch=!0,window.performance&&document.addEventListener("mousemove",yc))}function yc(){var e=performance.now();e-mc<20&&(fc.isTouch=!1,document.removeEventListener("mousemove",yc)),mc=e}function bc(){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 vc=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,wc=Object.assign({appendTo:Gl,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}),xc=Object.keys(wc);function Mc(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=wc[o])?r:i);return t}),{});return Object.assign({},e,t)}function Dc(e,t){var n=Object.assign({},t,{content:Zl(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Mc(Object.assign({},wc,{plugins:t}))):xc).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({},wc.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 kc(e,t){e["innerHTML"]=t}function Ec(e){var t=ic();return!0===e?t.className=Yl:(t.className=Ql,sc(e)?t.appendChild(e):kc(t,e)),t}function Cc(e,t){sc(t.content)?(kc(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?kc(e,t.content):e.textContent=t.content)}function Tc(e){var t=e.firstElementChild,n=rc(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(Wl)})),arrow:n.find((function(e){return e.classList.contains(Yl)||e.classList.contains(Ql)})),backdrop:n.find((function(e){return e.classList.contains(ql)}))}}function Oc(e){var t=ic(),n=ic();n.className=Vl,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ic();function o(n,r){var o=Tc(t),i=o.box,s=o.content,a=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Cc(s,e.props),r.arrow?a?n.arrow!==r.arrow&&(i.removeChild(a),i.appendChild(Ec(r.arrow))):i.appendChild(Ec(r.arrow)):a&&i.removeChild(a)}return r.className=Wl,r.setAttribute("data-state","hidden"),Cc(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}Oc.$$tippy=!0;var Ac=1,Nc=[],Sc=[];function _c(e,t){var n,r,o,i,s,a,l,c,u=Dc(e,Object.assign({},wc,Mc(oc(t)))),d=!1,p=!1,h=!1,f=!1,m=[],g=ec(Y,u.interactiveDebounce),y=Ac++,b=(c=u.plugins).filter((function(e,t){return c.indexOf(e)===t})),v={id:y,reference:e,popper:ic(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(o)},setProps:function(t){if(v.state.isDestroyed)return;j("onBeforeUpdate",[v,t]),W();var n=v.props,r=Dc(e,Object.assign({},n,oc(t),{ignoreAttributes:!0}));v.props=r,V(),n.interactiveDebounce!==r.interactiveDebounce&&(z(),g=ec(Y,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?tc(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=fc.isTouch&&!v.props.touch,o=Jl(v.props.duration,0,wc.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 i=N(),s=i.box,l=i.content;cc([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=N(),n=t.box,r=t.content;cc([n,r],o),uc([n,r],"visible")}I(),L(),nc(Sc,v),null==(e=v.popperInstance)||e.forceUpdate(),j("onMount",[v]),v.props.animation&&T()&&function(e,t){H(e,t)}(o,(function(){v.state.isShown=!0,j("onShown",[v])}))}},function(){var e,t=v.props.appendTo,n=O();e=v.props.interactive&&t===Gl||"parent"===t?n.parentNode:Zl(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=Jl(v.props.duration,1,wc.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 o=N(),i=o.box,s=o.content;v.props.animation&&(cc([i,s],r),uc([i,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){A().addEventListener("mousemove",g),nc(Nc,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);Sc=Sc.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(!u.render)return v;var w=u.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]),u.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&&A().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 A(){var e=O().parentNode;return e?dc(e):document}function N(){return Tc(x)}function S(e){return v.state.isMounted&&!v.state.isVisible||fc.isTouch||i&&"focus"===i.type?0:Jl(v.props.delay,e?0:1,wc.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;tc(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 o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function L(){!k&&v.props.aria.expanded&&tc(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(){A().removeEventListener("mousemove",g),Nc=Nc.filter((function(e){return e!==g}))}function P(t){if(!fc.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!v.props.interactive||!hc(x,n)){if(tc(v.props.triggerTarget||e).some((function(e){return hc(e,n)}))){if(fc.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=A();e.addEventListener("mousedown",P,!0),e.addEventListener("touchend",P,Kl),e.addEventListener("touchstart",R,Kl),e.addEventListener("touchmove",F,Kl)}function U(){var e=A();e.removeEventListener("mousedown",P,!0),e.removeEventListener("touchend",P,Kl),e.removeEventListener("touchstart",R,Kl),e.removeEventListener("touchmove",F,Kl)}function H(e,t){var n=N().box;function r(e){e.target===n&&(pc(n,"remove",r),t())}if(0===e)return t();pc(n,"remove",s),pc(n,"add",r),s=r}function $(t,n,r){void 0===r&&(r=!1),tc(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":$(vc?"focusout":"blur",K);break;case"focusin":$("focusout",K)}}))}function W(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),m=[]}function q(e){var t,n=!1;if(v.state.isEnabled&&!G(e)&&!p){var r="focus"===(null==(t=i)?void 0:t.type);i=e,l=e.currentTarget,L(),!v.state.isVisible&&ac(e)&&Nc.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:u}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,s=o.placement.split("-")[0],a=o.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,u="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=t.top-r+l>i,h=r-t.bottom-c>i,f=t.left-n+u>i,m=n-t.right-d>i;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!!fc.isTouch&&C()!==e.type.indexOf("touch")>=0}function J(){X();var t=v.props,n=t.popperOptions,r=t.placement,o=t.offset,i=t.getReferenceClientRect,s=t.moveTransition,l=T()?Tc(x).arrow:null,c=i?{getBoundingClientRect:i,contextElement:i.contextElement||O()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(T()){var n=N().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:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},u];T()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),v.popperInstance=Hl(c,x,Object.assign({},n,{placement:r,onFirstUpdate:a,modifiers:d}))}function X(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Z(){return rc(x.querySelectorAll("[data-tippy-root]"))}function ee(e){v.clearDelayTimeouts(),e&&j("onTrigger",[v,e]),B();var t=S(!0),r=E(),o=r[0],i=r[1];fc.isTouch&&"hold"===o&&i&&(t=i),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=S(!1);t?r=setTimeout((function(){v.state.isVisible&&v.hide()}),t):o=requestAnimationFrame((function(){v.hide()}))}}else U()}}function jc(e,t){void 0===t&&(t={});var n=wc.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",gc,Kl),window.addEventListener("blur",bc);var r=Object.assign({},t,{plugins:n}),o=lc(e).reduce((function(e,t){var n=t&&_c(t,r);return n&&e.push(n),e}),[]);return sc(e)?o[0]:o}jc.defaultProps=wc,jc.setDefaultProps=function(e){Object.keys(e).forEach((function(t){wc[t]=e[t]}))},jc.currentInput=fc,Object.assign({},Qa,{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 Ic={clientX:0,clientY:0},Lc=[];function zc(e){var t=e.clientX,n=e.clientY;Ic={clientX:t,clientY:n}}var Pc={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=dc(e.props.triggerTarget||t),r=!1,o=!1,i=!0,s=e.props;function a(){return"initial"===e.props.followCursor&&e.state.isVisible}function l(){n.addEventListener("mousemove",d)}function c(){n.removeEventListener("mousemove",d)}function u(){r=!0,e.setProps({getReferenceClientRect:null}),r=!1}function d(n){var r=!n.target||t.contains(n.target),o=e.props.followCursor,i=n.clientX,s=n.clientY,a=t.getBoundingClientRect(),l=i-a.left,c=s-a.top;!r&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=i,r=s;"initial"===o&&(n=e.left+l,r=e.top+c);var a="horizontal"===o?e.top:r,u="vertical"===o?e.right:n,d="horizontal"===o?e.bottom:r,p="vertical"===o?e.left:n;return{width:u-p,height:d-a,top:a,right:u,bottom:d,left:p}}})}function p(){e.props.followCursor&&(Lc.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",zc)}(n))}function h(){Lc=Lc.filter((function(t){return t.instance!==e})),0===Lc.filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",zc)}(n)}return{onCreate:p,onDestroy:h,onBeforeUpdate:function(){s=e.props},onAfterUpdate:function(t,n){var i=n.followCursor;r||void 0!==i&&s.followCursor!==i&&(h(),i?(p(),!e.state.isMounted||o||a()||l()):(c(),u()))},onMount:function(){e.props.followCursor&&!o&&(i&&(d(Ic),i=!1),a()||l())},onTrigger:function(e,t){ac(t)&&(Ic={clientX:t.clientX,clientY:t.clientY}),o="focus"===t.type},onHidden:function(){e.props.followCursor&&(u(),c(),i=!0)}}}};jc.setDefaultProps({render:Oc});class Fc{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:r})=>{const{doc:o,selection:i}=t,{empty:s}=i,a=!o.textBetween(n,r).length&&Hs(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,o&&(this.shouldShow=o),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=jc(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,o;const{state:i,composing:s}=e,{doc:a,selection:l}=i,c=t&&t.doc.eq(a)&&t.selection.eq(l);if(s||c)return;this.createTooltip();const{ranges:u}=l,d=Math.min(...u.map((e=>e.$from.pos))),p=Math.max(...u.map((e=>e.$to.pos)));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:i,oldState:t,from:d,to:p}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||(()=>{if(Us(t=i.selection)&&t instanceof an){const t=e.nodeDOM(d);if(t)return t.getBoundingClientRect()}var t;return va(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 Rc=e=>new Dn({key:"string"==typeof e.pluginKey?new Cn(e.pluginKey):e.pluginKey,view:t=>new Fc({view:t,...e})});_s.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[Rc({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class Bc{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{const{selection:n}=t,{$anchor:r,empty:o}=n,i=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;return!!(e.hasFocus()&&o&&i&&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,o&&(this.shouldShow=o),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=jc(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,o;const{state:i}=e,{doc:s,selection:a}=i,{from:l,to:c}=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:i,oldState:t}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||(()=>va(e,l,c))}),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)}}_s.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 Dn({key:"string"==typeof e.pluginKey?new Cn(e.pluginKey):e.pluginKey,view:t=>new Bc({view:t,...e})}))]:[];var e}});const Uc=e=>{const[n,r]=o(null);return i((()=>{if(!n)return;if(e.editor.isDestroyed)return;const{pluginKey:t="bubbleMenu",editor:r,tippyOptions:o={},shouldShow:i=null}=e,s=Rc({pluginKey:t,editor:r,element:n,tippyOptions:o,shouldShow:i});return r.registerPlugin(s),()=>r.unregisterPlugin(t)}),[e.editor,n]),t.createElement("div",{ref:r,className:e.className,style:{visibility:"hidden"}},e.children)};class Hc 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}(ma,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=gs(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(ha):[],...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=Xs(this.options.content,this.schema,this.options.parseOptions),t=Vs(e,this.options.autofocus);this.view=new Ni(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:xn.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"),o=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return fa(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 Ks(e,null,n)||sa(e,null,n);const r=Gs(t,e.schema);return"node"===r?Ks(e,t,n):"mark"===r&&sa(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(e,t){const n=ut.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 js(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...n,...Is(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 $c=({renderers:e})=>t.createElement(t.Fragment,null,Array.from(e).map((([e,t])=>h.createPortal(t.reactElement,t.element,e))));class Vc 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($c,{renderers:this.state.renderers}))}}const Wc=t.memo(Vc),qc=n({onDragStart:void 0}),Yc=()=>r(qc),Qc=e=>{const n=e.as||"div",{nodeViewContentRef:r}=Yc();return t.createElement(n,{...e,ref:r,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style}})},Kc=t.forwardRef(((e,n)=>{const{onDragStart:r}=Yc(),o=e.as||"div";return t.createElement(o,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})}));class Gc{constructor(e,{editor:t,props:n={},as:r="div",className:o=""}){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"),o&&this.element.classList.add(...o.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 Jc 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,o,i,s,a;const{view:l}=this.editor,c=e.target,u=3===c.nodeType?null===(t=c.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(c))||!u)return;let d=0,p=0;if(this.dom!==u){const t=this.dom.getBoundingClientRect(),n=u.getBoundingClientRect(),a=null!==(r=e.offsetX)&&void 0!==r?r:null===(o=e.nativeEvent)||void 0===o?void 0:o.offsetX,l=null!==(i=e.offsetY)&&void 0!==i?i: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=an.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:o}=this.editor,{isDragging:i}=this,s=!!this.node.type.spec.draggable,a=an.isSelectable(this.node),l="copy"===e.type,c="paste"===e.type,u="cut"===e.type,d="mousedown"===e.type,p=e.type.startsWith("drag");if(!s&&a&&p&&e.preventDefault(),s&&p&&!i)return e.preventDefault(),!1;if(s&&o&&!i&&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!(i||r||l||c||u||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&&Ws()&&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(qc.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:o=""}=this.options;this.renderer=new Gc(n,{editor:this.editor,props:e,as:r,className:`node-${this.node.type.name} ${o}`.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,o=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:r,oldDecorations:o,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 Xc(e,t){return n=>n.editor.contentComponent?new Jc(e,n,t):{}}const Zc=(e={},t=[])=>{const[n,r]=o(null),s=function(){const[,e]=o(0);return()=>e((e=>e+1))}();return i((()=>{let t=!0;const n=new Hc(e);return r(n),n.on("transaction",(()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t&&s()}))}))})),()=>{n.destroy(),t=!1}}),t),n};var eu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function tu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function nu(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 ru,ou={exports:{}};
2
2
  /*!
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see