@bigbinary/neeto-editor 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import*as e from"react";import t,{createContext as n,useContext as r,useState as i,useEffect as o,forwardRef as s,cloneElement as a,useLayoutEffect as l,useRef as u,useCallback as c,useImperativeHandle as d}from"react";import*as p from"react-dom";import h,{createPortal as f,flushSync as m}from"react-dom";import g from"highlight.js/lib/languages/arduino";import y from"highlight.js/lib/languages/bash";import b from"highlight.js/lib/languages/c";import v from"highlight.js/lib/languages/cpp";import w from"highlight.js/lib/languages/csharp";import x from"highlight.js/lib/languages/css";import M from"highlight.js/lib/languages/diff";import D from"highlight.js/lib/languages/go";import k from"highlight.js/lib/languages/graphql";import E from"highlight.js/lib/languages/ini";import C from"highlight.js/lib/languages/java";import T from"highlight.js/lib/languages/javascript";import O from"highlight.js/lib/languages/json";import S from"highlight.js/lib/languages/kotlin";import A from"highlight.js/lib/languages/less";import N from"highlight.js/lib/languages/lua";import _ from"highlight.js/lib/languages/makefile";import j from"highlight.js/lib/languages/markdown";import I from"highlight.js/lib/languages/objectivec";import L from"highlight.js/lib/languages/perl";import z from"highlight.js/lib/languages/php";import P from"highlight.js/lib/languages/php-template";import F from"highlight.js/lib/languages/plaintext";import R from"highlight.js/lib/languages/python";import B from"highlight.js/lib/languages/python-repl";import U from"highlight.js/lib/languages/r";import H from"highlight.js/lib/languages/ruby";import $ from"highlight.js/lib/languages/rust";import V from"highlight.js/lib/languages/scss";import W from"highlight.js/lib/languages/shell";import q from"highlight.js/lib/languages/sql";import Y from"highlight.js/lib/languages/swift";import Q from"highlight.js/lib/languages/typescript";import K from"highlight.js/lib/languages/vbnet";import G from"highlight.js/lib/languages/wasm";import J from"highlight.js/lib/languages/xml";import X from"highlight.js/lib/languages/yaml";import Z from"highlight.js/lib/core";import ee from"highlight.js/lib/common";var te=[],ne=[];function re(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",i=!0===t.singleTag,o="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var s=te.indexOf(o);-1===s&&(s=te.push(o)-1,ne[s]={}),n=ne[s]&&ne[s][r]?ne[s][r]:ne[s][r]=a()}else n=a();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function a(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),i=0;i<n.length;i++)e.setAttribute(n[i],t.attributes[n[i]]);var s="prepend"===r?"afterbegin":"beforeend";return o.insertAdjacentElement(s,e),e}}function ie(){return ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ie.apply(this,arguments)}function oe(e){this.content=e}function se(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let e=0;i.text[e]==o.text[e];e++)n++;return n}if(i.content.size||o.content.size){let e=se(i.content,o.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function ae(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let e=ae(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}re('@charset "UTF-8";\n@import url("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/night-owl.min.css");\n/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n/* Document\n ========================================================================== */\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n/* Sections\n ========================================================================== */\n/**\n * Remove the margin in all browsers.\n */\nbody {\n margin: 0;\n}\n/**\n * Render the `main` element consistently in IE.\n */\nmain {\n display: block;\n}\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\n/* Grouping content\n ========================================================================== */\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n/* Text-level semantics\n ========================================================================== */\n/**\n * Remove the gray background on active links in IE 10.\n */\na {\n background-color: transparent;\n}\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted; /* 2 */\n}\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\nb,\nstrong {\n font-weight: bolder;\n}\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n/**\n * Add the correct font size in all browsers.\n */\nsmall {\n font-size: 80%;\n}\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * all browsers.\n */\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\nsub {\n bottom: -0.25em;\n}\nsup {\n top: -0.5em;\n}\n/* Embedded content\n ========================================================================== */\n/**\n * Remove the border on images inside links in IE 10.\n */\nimg {\n border-style: none;\n}\n/* Forms\n ========================================================================== */\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\nbutton,\ninput {\n /* 1 */\n overflow: visible;\n}\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\nbutton,\nselect {\n /* 1 */\n text-transform: none;\n}\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\nbutton,\n[type=button],\n[type=reset],\n[type=submit] {\n -webkit-appearance: button;\n}\n/**\n * Remove the inner border and padding in Firefox.\n */\nbutton::-moz-focus-inner,\n[type=button]::-moz-focus-inner,\n[type=reset]::-moz-focus-inner,\n[type=submit]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n/**\n * Restore the focus styles unset by the previous rule.\n */\nbutton:-moz-focusring,\n[type=button]:-moz-focusring,\n[type=reset]:-moz-focusring,\n[type=submit]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n/**\n * Correct the padding in Firefox.\n */\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * `fieldset` elements in all browsers.\n */\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\nprogress {\n vertical-align: baseline;\n}\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\ntextarea {\n overflow: auto;\n}\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n[type=checkbox],\n[type=radio] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n[type=number]::-webkit-inner-spin-button,\n[type=number]::-webkit-outer-spin-button {\n height: auto;\n}\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n[type=search] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n[type=search]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n/* Interactive\n ========================================================================== */\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\ndetails {\n display: block;\n}\n/*\n * Add the correct display in all browsers.\n */\nsummary {\n display: list-item;\n}\n/* Misc\n ========================================================================== */\n/**\n * Add the correct display in IE 10+.\n */\ntemplate {\n display: none;\n}\n/**\n * Add the correct display in IE 10.\n */\n[hidden] {\n display: none;\n}\nbutton {\n background-color: transparent;\n background-image: none;\n}\nbody {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.3;\n color: #222;\n}\nbody *,\nbody *::after,\nbody *::before {\n box-sizing: border-box;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n@-webkit-keyframes shake {\n 0% {\n transform: translateX(0);\n }\n 10% {\n transform: translateX(-4px);\n }\n 20% {\n transform: translateX(4px);\n }\n 30% {\n transform: translateX(-4px);\n }\n 40% {\n transform: translateX(4px);\n }\n 50% {\n transform: translateX(-4px);\n }\n 60% {\n transform: translateX(4px);\n }\n 70% {\n transform: translateX(-4px);\n }\n 80% {\n transform: translateX(4px);\n }\n 90% {\n transform: translateX(-4px);\n }\n 100% {\n transform: translateX(0);\n }\n}\n@keyframes shake {\n 0% {\n transform: translateX(0);\n }\n 10% {\n transform: translateX(-4px);\n }\n 20% {\n transform: translateX(4px);\n }\n 30% {\n transform: translateX(-4px);\n }\n 40% {\n transform: translateX(4px);\n }\n 50% {\n transform: translateX(-4px);\n }\n 60% {\n transform: translateX(4px);\n }\n 70% {\n transform: translateX(-4px);\n }\n 80% {\n transform: translateX(4px);\n }\n 90% {\n transform: translateX(-4px);\n }\n 100% {\n transform: translateX(0);\n }\n}\n@-webkit-keyframes fade-in {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes spin {\n 0% {\n transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.ne-dropdown__popup {\n width: auto;\n max-height: 445px;\n max-width: 360px;\n overflow-y: auto;\n background-color: #ffffff;\n border-radius: 2px;\n border: thin solid #f8f9f9;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n padding: 4px 0;\n z-index: 99999;\n}\n.ne-dropdown__popup li,\n.ne-dropdown__popup .ne-dropdown--item {\n display: flex;\n cursor: pointer;\n position: relative;\n white-space: nowrap;\n transition: all 0.3s ease-in-out;\n font-size: 14px;\n font-weight: 400;\n color: #2f3941;\n padding: 8px 40px 8px 16px;\n text-decoration: none;\n outline-color: transparent;\n}\n.ne-dropdown__popup li.disabled,\n.ne-dropdown__popup .ne-dropdown--item.disabled {\n cursor: not-allowed;\n color: #87929d;\n}\n.ne-dropdown__popup li:hover, .ne-dropdown__popup li:focus,\n.ne-dropdown__popup .ne-dropdown--item:hover,\n.ne-dropdown__popup .ne-dropdown--item:focus {\n background-color: #e9ebed;\n}\n.ne-dropdown__popup li.loading:not(.active):after,\n.ne-dropdown__popup .ne-dropdown--item.loading:not(.active):after {\n content: "";\n position: absolute;\n right: 16px;\n top: 0;\n bottom: 0;\n margin: auto;\n width: 16px;\n height: 16px;\n display: block;\n border-radius: 50%;\n border: solid 2px #e9ebed;\n border-top-color: #1b1f23;\n border-left-color: #1b1f23;\n -webkit-animation: theme("animation.spin");\n animation: theme("animation.spin");\n}\n.ne-dropdown__popup li.active,\n.ne-dropdown__popup .ne-dropdown--item.active {\n background-color: #2f3941;\n color: #ffffff;\n}\n.ne-avatar--container {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 2px;\n position: relative;\n}\n.ne-avatar--container.ne-avatar--container-round {\n border-radius: 999px;\n}\n.ne-avatar--container .ne-avatar__text {\n font-weight: 600;\n text-align: center;\n text-transform: capitalize;\n font-size: 10px;\n color: #68737d;\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-medium {\n font-size: 12px;\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-large {\n font-size: 18px;\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-xlarge {\n font-size: 24px;\n}\n.ne-avatar--container .ne-avatar__status {\n position: absolute;\n right: 0;\n top: 0;\n width: 0.4rem;\n height: 0.4rem;\n background-color: white;\n border: 0.5px solid white;\n border-radius: 999px;\n transform: translateX(-40%);\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-medium {\n width: 0.465rem;\n height: 0.465rem;\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-large {\n width: 0.563rem;\n height: 0.563rem;\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-xlarge {\n width: 0.75rem;\n height: 0.75rem;\n transform: translateX(-65%);\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-square {\n transform: translate(25%, -25%);\n}\n.ne-avatar--container .ne-avatar__status.online {\n background-color: #00ba88;\n}\n.ne-avatar--container .ne-avatar__status.idle {\n background-color: #f3cd82;\n}\n.ne-avatar--container .ne-avatar__status.offline {\n background-color: #d8dcde;\n}\n.ne-avatar--container .ne-avatar {\n display: inline-block;\n border-radius: 2px;\n height: 1.5rem;\n width: 1.5rem;\n}\n.ne-avatar--container .ne-avatar.hidden {\n display: none;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--medium {\n height: 2rem;\n width: 2rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--large {\n height: 2.5rem;\n width: 2.5rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--xlarge {\n height: 4rem;\n width: 4rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--round {\n border-radius: 999px;\n}\n.ne-tab__wrapper {\n width: 100%;\n border-bottom: 1px solid #d8dcde;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n}\n.ne-tab__wrapper--size-large .ne-tab {\n font-size: 20px;\n padding-left: 12px;\n padding-right: 12px;\n}\n.ne-tab__wrapper--underline-none {\n border-bottom: none;\n}\n.ne-tab__wrapper--underline-none .ne-tab::before {\n display: none;\n}\n.ne-tab {\n color: #87929d;\n font-weight: 600;\n font-size: 14px;\n line-height: 1;\n padding: 12px 8px;\n transition: all 0.3s ease-in-out;\n position: relative;\n cursor: pointer;\n text-decoration: none;\n outline: none;\n}\n.ne-tab:hover, .ne-tab:focus, .ne-tab:focus-visible, .ne-tab:active {\n text-decoration: none;\n outline: none;\n}\n.ne-tab__icon {\n margin-right: 12px;\n}\n.ne-tab svg {\n width: 16px;\n height: 16px;\n}\n.ne-tab:hover {\n color: #68737d;\n}\n.ne-tab:before {\n content: "";\n position: absolute;\n width: 100%;\n height: 1px;\n background-color: transparent;\n left: 0;\n right: 0;\n bottom: -1px;\n transition: all 0.3s ease-in-out;\n}\n.ne-tab.active {\n color: #2f3941;\n}\n.ne-tab.active:before {\n background-color: #2f3941;\n}\n.ne-btn {\n display: inline-flex;\n align-items: center;\n font-size: 14px;\n font-weight: 500;\n border-radius: 2px;\n line-height: 1.2;\n transition: all 0.3s ease-in-out;\n border: none;\n cursor: pointer;\n padding: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n padding: 4px 8px;\n min-height: 28px;\n letter-spacing: -0.15px;\n outline: none;\n}\n.ne-btn--icon-only {\n padding-left: 6px;\n padding-right: 6px;\n}\n.ne-btn:focus, .ne-btn:focus-visible {\n outline: none;\n}\n.ne-btn:hover {\n text-decoration: none;\n}\n.ne-btn.disabled {\n cursor: not-allowed;\n opacity: 0.4;\n}\n.ne-btn .ne-btn__icon:last-child:not(:first-child),\n.ne-btn .ne-btn__spinner:last-child:not(:first-child) {\n margin-left: 8px;\n}\n.ne-btn--icon-left {\n flex-direction: row-reverse;\n}\n.ne-btn--icon-left .ne-btn__icon:last-child:not(:first-child),\n.ne-btn--icon-left .ne-btn__spinner:last-child:not(:first-child) {\n margin-right: 8px;\n margin-left: 0;\n}\n.ne-btn__icon,\n.ne-btn__spinner,\n.ne-btn__spinner-wrapper {\n color: inherit;\n}\n.ne-btn__icon svg,\n.ne-btn__spinner svg,\n.ne-btn__spinner-wrapper svg {\n color: inherit !important;\n}\n.ne-btn--width-full {\n width: 100% !important;\n justify-content: center;\n}\n.ne-btn--size-large {\n font-size: 16px;\n padding: 6px 12px;\n min-height: 32px;\n}\n.ne-btn--size-large.ne-btn--icon-only {\n padding-left: 8px;\n padding-right: 8px;\n}\n.ne-btn--style-primary {\n color: #ffffff;\n background-color: #2f3941;\n}\n.ne-btn--style-primary:hover:not(:disabled), .ne-btn--style-primary:active {\n color: #ffffff;\n background-color: #49545c;\n}\n.ne-btn--style-primary:focus-visible {\n color: #ffffff;\n box-shadow: 0 0 0 3px #e5e5e5;\n}\n.ne-btn--style-secondary {\n color: #2f3941;\n background-color: #e9ebed;\n}\n.ne-btn--style-secondary:hover:not(:disabled), .ne-btn--style-secondary:active {\n color: #2f3941;\n background-color: #c2c8cc;\n}\n.ne-btn--style-secondary:focus-visible {\n color: #2f3941;\n box-shadow: 0 0 0 3px #e5e5e5;\n}\n.ne-btn--style-text {\n color: #2f3941;\n}\n.ne-btn--style-text:hover:not(:disabled), .ne-btn--style-text:active {\n color: #2f3941;\n background-color: #e9ebed;\n}\n.ne-btn--style-text:focus-visible {\n color: #2f3941;\n box-shadow: 0 0 0 3px #e5e5e5;\n}\n.ne-btn--style-link {\n color: #5e5ce6;\n min-height: initial;\n padding: 0;\n}\n.ne-btn--style-link:hover:not(:disabled), .ne-btn--style-link:active, .ne-btn--style-link:focus {\n opacity: 0.8;\n color: #5e5ce6;\n}\n.ne-btn--style-link:focus-visible {\n color: #1c1aa9;\n}\n.ne-btn--style-danger {\n color: #f56a58;\n background-color: #ffefed;\n}\n.ne-btn--style-danger:hover:not(:disabled), .ne-btn--style-danger:active {\n color: #f56a58;\n background-color: #ffe4e0;\n}\n.ne-btn--style-danger:focus-visible {\n color: #f56a58;\n box-shadow: 0 0 0 3px #ffe4e0;\n}\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0;\n}\n[data-tippy-root] {\n max-width: calc(100vw - 10px);\n}\n.tippy-box {\n position: relative;\n background-color: #2f3941;\n color: #ffffff;\n border-radius: 2px;\n font-size: 12px;\n line-height: 1.4;\n outline: 0;\n transition-property: transform, visibility, opacity;\n}\n.tippy-box[data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n.tippy-box[data-placement^=top] > .tippy-arrow:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top;\n}\n.tippy-box[data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n.tippy-box[data-placement^=bottom] > .tippy-arrow:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom;\n}\n.tippy-box[data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n.tippy-box[data-placement^=left] > .tippy-arrow:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left;\n}\n.tippy-box[data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n.tippy-box[data-placement^=right] > .tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right;\n}\n.tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);\n}\n.tippy-arrow {\n width: 16px;\n height: 16px;\n color: #2f3941;\n}\n.tippy-arrow:before {\n content: "";\n position: absolute;\n border-color: transparent;\n border-style: solid;\n}\n.tippy-content {\n position: relative;\n padding: 5px 9px;\n z-index: 1;\n}\n.tippy-box[data-placement^=top] > .tippy-svg-arrow {\n bottom: 0;\n}\n.tippy-box[data-placement^=top] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=top] > .tippy-svg-arrow > svg {\n top: 16px;\n transform: rotate(180deg);\n}\n.tippy-box[data-placement^=bottom] > .tippy-svg-arrow {\n top: 0;\n}\n.tippy-box[data-placement^=bottom] > .tippy-svg-arrow > svg {\n bottom: 16px;\n}\n.tippy-box[data-placement^=left] > .tippy-svg-arrow {\n right: 0;\n}\n.tippy-box[data-placement^=left] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=left] > .tippy-svg-arrow > svg {\n transform: rotate(90deg);\n top: calc(50% - 3px);\n left: 13px;\n}\n.tippy-box[data-placement^=right] > .tippy-svg-arrow {\n left: 0;\n}\n.tippy-box[data-placement^=right] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=right] > .tippy-svg-arrow > svg {\n transform: rotate(-90deg);\n top: calc(50% - 3px);\n right: 13px;\n}\n.tippy-svg-arrow {\n width: 16px;\n height: 16px;\n fill: #2f3941;\n text-align: initial;\n}\n.tippy-svg-arrow,\n.tippy-svg-arrow > svg {\n position: absolute;\n}\n.tippy-svg-arrow > svg > path {\n fill: #2f3941;\n}\n.tippy-box[data-theme~=light] .tippy-svg-arrow > svg > path {\n fill: #ffffff;\n}\n.tippy-box[data-theme~=light] {\n color: #2f3941;\n box-shadow: 0 0 20px 4px rgba(154, 161, 177, 0.15), 0 4px 80px -8px rgba(36, 40, 47, 0.25), 0 4px 4px -2px rgba(91, 94, 105, 0.15);\n background-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=top] > .tippy-arrow:before {\n border-top-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=bottom] > .tippy-arrow:before {\n border-bottom-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=left] > .tippy-arrow:before {\n border-left-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=right] > .tippy-arrow:before {\n border-right-color: #ffffff;\n}\n.tippy-box[data-theme~=light] > .tippy-backdrop {\n background-color: #ffffff;\n}\n.tippy-box[data-theme~=light] > .tippy-svg-arrow {\n fill: #ffffff;\n}\n.ne-input__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n flex-grow: 1;\n}\n.ne-input__wrapper .ne-label {\n margin-bottom: 4px;\n}\n.ne-input__wrapper .ne-input {\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n font-size: 14px;\n line-height: 1.6;\n transition: all 0.3s ease-in-out;\n border-radius: 2px;\n border: thin solid #c2c8cc;\n background-color: #ffffff;\n color: #2f3941;\n overflow: hidden;\n}\n.ne-input__wrapper .ne-input.ne-input--textarea {\n padding: 8px;\n}\n.ne-input__wrapper .ne-input input,\n.ne-input__wrapper .ne-input textarea {\n width: 100%;\n background-color: transparent;\n color: inherit;\n border: none;\n font-size: inherit;\n line-height: inherit;\n box-shadow: none;\n outline: none;\n}\n.ne-input__wrapper .ne-input input::-moz-placeholder, .ne-input__wrapper .ne-input textarea::-moz-placeholder {\n color: #c2c8cc;\n}\n.ne-input__wrapper .ne-input input::placeholder,\n.ne-input__wrapper .ne-input textarea::placeholder {\n color: #c2c8cc;\n}\n.ne-input__wrapper .ne-input input:focus,\n.ne-input__wrapper .ne-input textarea:focus {\n outline-color: transparent;\n}\n.ne-input__wrapper .ne-input input {\n padding: 8px;\n}\n.ne-input__wrapper .ne-input textarea {\n padding: 0;\n max-height: 224px;\n overflow-y: auto;\n}\n.ne-input__wrapper .ne-input:focus-within:not(.ne-input--naked, .ne-input--error) {\n border-color: #2f3941;\n box-shadow: 0px 0px 0px 3px #e9ebed;\n}\n.ne-input__wrapper .ne-input:hover:not(.ne-input--naked, .ne-input--error, .ne-input--disabled) {\n border-color: #49545c;\n}\n.ne-input__wrapper .ne-input.ne-input--error {\n border-color: #f56a58;\n}\n.ne-input__wrapper .ne-input.ne-input--error:focus-within:not(.ne-input--naked) {\n box-shadow: 0 0 0 3px #ffefed;\n}\n.ne-input__wrapper .ne-input.ne-input--error textarea {\n resize: none;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled {\n background-color: #f8f9f9;\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled input {\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled textarea {\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--small input {\n padding: 6px 8px;\n line-height: 1.3;\n}\n.ne-input__wrapper .ne-input.ne-input--naked {\n padding: 0;\n border: none;\n box-shadow: none;\n}\n.ne-input__wrapper .ne-input.ne-input--naked .ne-input__prefix {\n margin-left: 0;\n}\n.ne-input__wrapper .ne-input.ne-input--naked .ne-input__suffix {\n margin-right: 0;\n}\n.ne-input__wrapper .ne-input__prefix,\n.ne-input__wrapper .ne-input__suffix {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n font-size: 14px;\n color: #68737d;\n}\n.ne-input__wrapper .ne-input__prefix svg,\n.ne-input__wrapper .ne-input__suffix svg {\n width: 16px;\n height: 16px;\n}\n.ne-input__wrapper .ne-input__prefix {\n margin-left: 10px;\n}\n.ne-input__wrapper .ne-input__suffix {\n margin-right: 10px;\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__prefix,\n.ne-input__wrapper .ne-input--block-add-on .ne-input__suffix {\n margin: 0;\n padding: 8px 10px;\n background-color: #f8f9f9;\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__prefix {\n border-right: thin solid #d8dcde;\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__suffix {\n border-left: thin solid #d8dcde;\n}\n.ne-input__help-text {\n margin-top: 8px;\n font-size: 12px;\n color: #87929d;\n line-height: 1.6;\n}\n.ne-input__error {\n margin-top: 4px;\n font-size: 12px;\n color: #f56a58;\n}\n.ne-modal__backdrop {\n position: fixed;\n z-index: 99999;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n overflow: auto;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n transition: all 0.3s ease-in-out;\n background-color: rgba(135, 146, 157, 0.5);\n}\n.ne-modal__backdrop .ne-modal__wrapper {\n width: 50%;\n max-width: 100%;\n max-height: 100vh;\n overflow-y: auto;\n position: relative;\n background-color: #ffffff;\n border-radius: 2px;\n}\n.ne-modal__backdrop .ne-modal__wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.ne-modal__backdrop .ne-modal__wrapper::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.ne-modal__backdrop .ne-modal__wrapper::-webkit-scrollbar-track {\n background: "transparent";\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-modal__close {\n position: absolute;\n top: 12px;\n right: 12px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--xs {\n width: 320px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--sm {\n width: 480px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--md {\n width: 720px;\n}\n.ne-modal__backdrop .ne-icon__wrapper {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n margin-bottom: 32px;\n padding: 10px 0 0 2px;\n}\n.neeto-editor-loader {\n width: 100%;\n height: 32px;\n display: flex;\n align-items: center;\n text-align: center;\n}\n.neeto-editor-loader__spinner-icon {\n width: 16px;\n height: 16px;\n display: inline-block;\n border-radius: 999px;\n border: solid 2px #e9ebed;\n border-top-color: #2f3941;\n border-left-color: #2f3941;\n -webkit-animation: spin 600ms linear infinite;\n animation: spin 600ms linear infinite;\n margin: 1px auto;\n}\n.neeto-editor-slash-commands__wrapper {\n padding: 12px;\n overflow-y: auto;\n max-height: 384px;\n width: 320px;\n max-width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n gap: 4px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item {\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n padding: 8px 12px;\n gap: 12px;\n border-radius: 4px;\n transition: all 0.3s ease-in-out;\n cursor: pointer;\n color: #ffffff;\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item:hover, .neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item.active {\n background-color: #49545c;\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item .neeto-editor-slash-commands__item-content h5 {\n font-size: 14px;\n font-weight: 600;\n line-height: 1.5;\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item .neeto-editor-slash-commands__item-content p {\n font-size: 12px;\n color: #d8dcde;\n}\n.neeto-editor-mentions__wrapper {\n padding: 8px;\n width: 208px;\n max-height: 256px;\n overflow-y: auto;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n padding: 8px;\n transition: all 0.3s ease-in-out;\n cursor: pointer;\n font-size: 12px;\n color: #ffffff;\n border-radius: 4px;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item p {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item .ne-avatar--container {\n margin-right: 8px;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item:hover, .neeto-editor-mentions__wrapper .neeto-editor-mentions__item.active {\n background-color: #49545c;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item.neeto-editor-mentions__item--light {\n color: #2f3941;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item.neeto-editor-mentions__item--light:hover, .neeto-editor-mentions__wrapper .neeto-editor-mentions__item.neeto-editor-mentions__item--light.active {\n background-color: #e9ebed;\n}\n.neeto-editor-mentions__wrapper.neeto-editor-mentions__wrapper--small {\n width: 176px;\n padding: 0 4px;\n}\n.ProseMirror.slash-active p.is-empty:last-child::before {\n content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkwIiBoZWlnaHQ9IjIzIiB2aWV3Qm94PSIwIDAgMTkwIDIz IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmci Pgo8cmVjdCB4PSIzNCIgeT0iNCIgd2lkdGg9IjE5IiBoZWlnaHQ9IjE5IiByeD0i NCIgZmlsbD0iI0YzRjRGNiIvPgo8cGF0aCBkPSJNNDEuNTA3OCAxOS45NzY2SDQw LjAxNTZMNDQuNDkyMiA3LjYyNUg0NS45ODQ0TDQxLjUwNzggMTkuOTc2NloiIGZp bGw9IiM2QjcyODAiLz4KPHBhdGggZD0iTTguMDMyMjMgOS4xMjY5NUg0LjgzMzAx VjE4SDMuNTI3MzRWOS4xMjY5NUgwLjMzNDk2MVY4LjA0Njg4SDguMDMyMjNWOS4x MjY5NVpNMTEuMjM4MyAxNi4xNDc1TDEyLjk2MDkgMTAuNjAzNUgxNC4zMTQ1TDEx LjM0MDggMTkuMTQxNkMxMC44ODA1IDIwLjM3MjEgMTAuMTQ5MSAyMC45ODczIDku MTQ2NDggMjAuOTg3M0w4LjkwNzIzIDIwLjk2NjhMOC40MzU1NSAyMC44Nzc5VjE5 Ljg1MjVMOC43NzczNCAxOS44Nzk5QzkuMjA1NzMgMTkuODc5OSA5LjUzODQxIDE5 Ljc5MzMgOS43NzUzOSAxOS42MjAxQzEwLjAxNjkgMTkuNDQ2OSAxMC4yMTUyIDE5 LjEzMDIgMTAuMzcwMSAxOC42Njk5TDEwLjY1MDQgMTcuOTE4TDguMDExNzIgMTAu NjAzNUg5LjM5MjU4TDExLjIzODMgMTYuMTQ3NVpNMjEuNjk3MyAxNC4zODM4QzIx LjY5NzMgMTUuNTA5NCAyMS40Mzk4IDE2LjQxNjMgMjAuOTI0OCAxNy4xMDQ1QzIw LjQwOTggMTcuNzkyNiAxOS43MTI2IDE4LjEzNjcgMTguODMzIDE4LjEzNjdDMTcu OTM1MiAxOC4xMzY3IDE3LjIyODggMTcuODUxOSAxNi43MTM5IDE3LjI4MjJWMjAu ODQzOEgxNS40NDkyVjEwLjYwMzVIMTYuNjA0NUwxNi42NjYgMTEuNDIzOEMxNy4x ODEgMTAuNzg1OCAxNy44OTY1IDEwLjQ2NjggMTguODEyNSAxMC40NjY4QzE5Ljcw MTIgMTAuNDY2OCAyMC40MDMgMTAuODAxOCAyMC45MTggMTEuNDcxN0MyMS40Mzc1 IDEyLjE0MTYgMjEuNjk3MyAxMy4wNzM2IDIxLjY5NzMgMTQuMjY3NlYxNC4zODM4 Wk0yMC40MzI2IDE0LjI0MDJDMjAuNDMyNiAxMy40MDYyIDIwLjI1NDkgMTIuNzQ3 NyAxOS44OTk0IDEyLjI2NDZDMTkuNTQzOSAxMS43ODE2IDE5LjA1NjMgMTEuNTQg MTguNDM2NSAxMS41NEMxNy42NzA5IDExLjU0IDE3LjA5NjcgMTEuODc5NiAxNi43 MTM5IDEyLjU1ODZWMTYuMDkyOEMxNy4wOTIxIDE2Ljc2NzMgMTcuNjcwOSAxNy4x MDQ1IDE4LjQ1MDIgMTcuMTA0NUMxOS4wNTYzIDE3LjEwNDUgMTkuNTM3MSAxNi44 NjUyIDE5Ljg5MjYgMTYuMzg2N0MyMC4yNTI2IDE1LjkwMzYgMjAuNDMyNiAxNS4x ODgyIDIwLjQzMjYgMTQuMjQwMlpNMjYuMzc5OSAxOC4xMzY3QzI1LjM3NzMgMTgu MTM2NyAyNC41NjE1IDE3LjgwODYgMjMuOTMyNiAxNy4xNTIzQzIzLjMwMzcgMTYu NDkxNSAyMi45ODkzIDE1LjYwOTcgMjIuOTg5MyAxNC41MDY4VjE0LjI3NDRDMjIu OTg5MyAxMy41NDA3IDIzLjEyODMgMTIuODg2NyAyMy40MDYyIDEyLjMxMjVDMjMu Njg4OCAxMS43MzM3IDI0LjA4MDcgMTEuMjgyNiAyNC41ODIgMTAuOTU5QzI1LjA4 NzkgMTAuNjMwOSAyNS42MzQ4IDEwLjQ2NjggMjYuMjIyNyAxMC40NjY4QzI3LjE4 NDIgMTAuNDY2OCAyNy45MzE2IDEwLjc4MzUgMjguNDY0OCAxMS40MTdDMjguOTk4 IDEyLjA1MDUgMjkuMjY0NiAxMi45NTc0IDI5LjI2NDYgMTQuMTM3N1YxNC42NjQx SDI0LjI1MzlDMjQuMjcyMSAxNS4zOTMyIDI0LjQ4NCAxNS45ODM0IDI0Ljg4OTYg MTYuNDM0NkMyNS4yOTk4IDE2Ljg4MTIgMjUuODE5MyAxNy4xMDQ1IDI2LjQ0ODIg MTcuMTA0NUMyNi44OTQ5IDE3LjEwNDUgMjcuMjczMSAxNy4wMTMzIDI3LjU4MyAx Ni44MzExQzI3Ljg5MjkgMTYuNjQ4OCAyOC4xNjQxIDE2LjQwNzIgMjguMzk2NSAx Ni4xMDY0TDI5LjE2ODkgMTYuNzA4QzI4LjU0OTIgMTcuNjYwNSAyNy42MTk1IDE4 LjEzNjcgMjYuMzc5OSAxOC4xMzY3Wk0yNi4yMjI3IDExLjUwNTlDMjUuNzEyMiAx MS41MDU5IDI1LjI4MzkgMTEuNjkyNyAyNC45Mzc1IDEyLjA2NjRDMjQuNTkxMSAx Mi40MzU1IDI0LjM3NyAxMi45NTUxIDI0LjI5NDkgMTMuNjI1SDI4VjEzLjUyOTND MjcuOTYzNSAxMi44ODY3IDI3Ljc5MDQgMTIuMzkgMjcuNDgwNSAxMi4wMzkxQzI3 LjE3MDYgMTEuNjgzNiAyNi43NTEzIDExLjUwNTkgMjYuMjIyNyAxMS41MDU5WiIg ZmlsbD0iIzZCNzI4MCIvPgo8cGF0aCBkPSJNNTkuNjcyOSA4LjgxMjVWMTAuNjAz NUg2MS4wNTM3VjExLjU4MTFINTkuNjcyOVYxNi4xNjhDNTkuNjcyOSAxNi40NjQy IDU5LjczNDQgMTYuNjg3NSA1OS44NTc0IDE2LjgzNzlDNTkuOTgwNSAxNi45ODM3 IDYwLjE5MDEgMTcuMDU2NiA2MC40ODYzIDE3LjA1NjZDNjAuNjMyMiAxNy4wNTY2 IDYwLjgzMjcgMTcuMDI5MyA2MS4wODc5IDE2Ljk3NDZWMThDNjAuNzU1MiAxOC4w OTExIDYwLjQzMTYgMTguMTM2NyA2MC4xMTcyIDE4LjEzNjdDNTkuNTUyMSAxOC4x MzY3IDU5LjEyNiAxNy45NjU4IDU4LjgzODkgMTcuNjI0QzU4LjU1MTggMTcuMjgy MiA1OC40MDgyIDE2Ljc5NjkgNTguNDA4MiAxNi4xNjhWMTEuNTgxMUg1Ny4wNjE1 VjEwLjYwMzVINTguNDA4MlY4LjgxMjVINTkuNjcyOVpNNjIuMDY1NCAxNC4yMzM0 QzYyLjA2NTQgMTMuNTA4OCA2Mi4yMDY3IDEyLjg1NzEgNjIuNDg5MyAxMi4yNzgz QzYyLjc3NjQgMTEuNjk5NSA2My4xNzI5IDExLjI1MjkgNjMuNjc4NyAxMC45Mzg1 QzY0LjE4OTEgMTAuNjI0IDY0Ljc3MDIgMTAuNDY2OCA2NS40MjE5IDEwLjQ2NjhD NjYuNDI5IDEwLjQ2NjggNjcuMjQyNSAxMC44MTU0IDY3Ljg2MjMgMTEuNTEyN0M2 OC40ODY3IDEyLjIxIDY4Ljc5ODggMTMuMTM3NCA2OC43OTg4IDE0LjI5NDlWMTQu MzgzOEM2OC43OTg4IDE1LjEwMzggNjguNjU5OCAxNS43NTEgNjguMzgxOCAxNi4z MjUyQzY4LjEwODQgMTYuODk0OSA2Ny43MTQyIDE3LjMzOTIgNjcuMTk5MiAxNy42 NTgyQzY2LjY4ODggMTcuOTc3MiA2Ni4xMDA5IDE4LjEzNjcgNjUuNDM1NSAxOC4x MzY3QzY0LjQzMjkgMTguMTM2NyA2My42MTk1IDE3Ljc4ODEgNjIuOTk1MSAxNy4w OTA4QzYyLjM3NTMgMTYuMzkzNiA2Mi4wNjU0IDE1LjQ3MDcgNjIuMDY1NCAxNC4z MjIzVjE0LjIzMzRaTTYzLjMzNjkgMTQuMzgzOEM2My4zMzY5IDE1LjIwNDEgNjMu NTI2IDE1Ljg2MjYgNjMuOTA0MyAxNi4zNTk0QzY0LjI4NzEgMTYuODU2MSA2NC43 OTc1IDE3LjEwNDUgNjUuNDM1NSAxNy4xMDQ1QzY2LjA3ODEgMTcuMTA0NSA2Ni41 ODg1IDE2Ljg1MzggNjYuOTY2OCAxNi4zNTI1QzY3LjM0NTEgMTUuODQ2NyA2Ny41 MzQyIDE1LjE0MDMgNjcuNTM0MiAxNC4yMzM0QzY3LjUzNDIgMTMuNDIyMiA2Ny4z NDA1IDEyLjc2NiA2Ni45NTMxIDEyLjI2NDZDNjYuNTcwMyAxMS43NTg4IDY2LjA1 OTkgMTEuNTA1OSA2NS40MjE5IDExLjUwNTlDNjQuNzk3NSAxMS41MDU5IDY0LjI5 MzkgMTEuNzU0MiA2My45MTExIDEyLjI1MUM2My41MjgzIDEyLjc0NzcgNjMuMzM2 OSAxMy40NTg3IDYzLjMzNjkgMTQuMzgzOFpNNzYuODI0MiAxNy4xMDQ1Qzc3LjI3 NTQgMTcuMTA0NSA3Ny42Njk2IDE2Ljk2NzggNzguMDA2OCAxNi42OTQzQzc4LjM0 NDEgMTYuNDIwOSA3OC41MzA5IDE2LjA3OTEgNzguNTY3NCAxNS42Njg5SDc5Ljc2 MzdDNzkuNzQwOSAxNi4wOTI4IDc5LjU5NTEgMTYuNDk2MSA3OS4zMjYyIDE2Ljg3 ODlDNzkuMDU3MyAxNy4yNjE3IDc4LjY5NzMgMTcuNTY3MSA3OC4yNDYxIDE3Ljc5 NDlDNzcuNzk5NSAxOC4wMjI4IDc3LjMyNTUgMTguMTM2NyA3Ni44MjQyIDE4LjEz NjdDNzUuODE3MSAxOC4xMzY3IDc1LjAxNSAxNy44MDE4IDc0LjQxOCAxNy4xMzE4 QzczLjgyNTUgMTYuNDU3NCA3My41MjkzIDE1LjUzNjggNzMuNTI5MyAxNC4zNzAx VjE0LjE1ODJDNzMuNTI5MyAxMy40MzgyIDczLjY2MTUgMTIuNzk3OSA3My45MjU4 IDEyLjIzNzNDNzQuMTkwMSAxMS42NzY4IDc0LjU2ODQgMTEuMjQxNSA3NS4wNjA1 IDEwLjkzMTZDNzUuNTU3MyAxMC42MjE3IDc2LjE0MjkgMTAuNDY2OCA3Ni44MTc0 IDEwLjQ2NjhDNzcuNjQ2OCAxMC40NjY4IDc4LjMzNSAxMC43MTUyIDc4Ljg4MTgg MTEuMjExOUM3OS40MzMzIDExLjcwODcgNzkuNzI3MiAxMi4zNTM1IDc5Ljc2Mzcg MTMuMTQ2NUg3OC41Njc0Qzc4LjUzMDkgMTIuNjY4IDc4LjM0ODYgMTIuMjc2IDc4 LjAyMDUgMTEuOTcwN0M3Ny42OTY5IDExLjY2MDggNzcuMjk1OSAxMS41MDU5IDc2 LjgxNzQgMTEuNTA1OUM3Ni4xNzQ4IDExLjUwNTkgNzUuNjc1OCAxMS43MzgzIDc1 LjMyMDMgMTIuMjAzMUM3NC45Njk0IDEyLjY2MzQgNzQuNzkzOSAxMy4zMzExIDc0 Ljc5MzkgMTQuMjA2MVYxNC40NDUzQzc0Ljc5MzkgMTUuMjk3NSA3NC45Njk0IDE1 Ljk1MzggNzUuMzIwMyAxNi40MTQxQzc1LjY3MTIgMTYuODc0MyA3Ni4xNzI1IDE3 LjEwNDUgNzYuODI0MiAxNy4xMDQ1Wk04Mi40NTAyIDExLjQ5OUM4My4wMTA3IDEw LjgxMDkgODMuNzM5OSAxMC40NjY4IDg0LjYzNzcgMTAuNDY2OEM4Ni4yMDA4IDEw LjQ2NjggODYuOTg5MyAxMS4zNDg2IDg3LjAwMjkgMTMuMTEyM1YxOEg4NS43Mzgz VjEzLjEwNTVDODUuNzMzNyAxMi41NzIzIDg1LjYxMDcgMTIuMTc4MSA4NS4zNjkx IDExLjkyMjlDODUuMTMyMiAxMS42Njc2IDg0Ljc2MDcgMTEuNTQgODQuMjU0OSAx MS41NEM4My44NDQ3IDExLjU0IDgzLjQ4NDcgMTEuNjQ5NCA4My4xNzQ4IDExLjg2 ODJDODIuODY0OSAxMi4wODY5IDgyLjYyMzQgMTIuMzc0IDgyLjQ1MDIgMTIuNzI5 NVYxOEg4MS4xODU1VjcuNUg4Mi40NTAyVjExLjQ5OVpNOTMuNDYyOSAxOEM5My4z OSAxNy44NTQyIDkzLjMzMDcgMTcuNTk0NCA5My4yODUyIDE3LjIyMDdDOTIuNjk3 MyAxNy44MzE0IDkxLjk5NTQgMTguMTM2NyA5MS4xNzk3IDE4LjEzNjdDOTAuNDUw NSAxOC4xMzY3IDg5Ljg1MTIgMTcuOTMxNiA4OS4zODE4IDE3LjUyMTVDODguOTE3 IDE3LjEwNjggODguNjg0NiAxNi41ODI3IDg4LjY4NDYgMTUuOTQ5MkM4OC42ODQ2 IDE1LjE3OSA4OC45NzYyIDE0LjU4MiA4OS41NTk2IDE0LjE1ODJDOTAuMTQ3NSAx My43Mjk4IDkwLjk3MjMgMTMuNTE1NiA5Mi4wMzQyIDEzLjUxNTZIOTMuMjY0NlYx Mi45MzQ2QzkzLjI2NDYgMTIuNDkyNSA5My4xMzI1IDEyLjE0MTYgOTIuODY4MiAx MS44ODE4QzkyLjYwMzggMTEuNjE3NSA5Mi4yMTQyIDExLjQ4NTQgOTEuNjk5MiAx MS40ODU0QzkxLjI0OCAxMS40ODU0IDkwLjg2OTggMTEuNTk5MyA5MC41NjQ1IDEx LjgyNzFDOTAuMjU5MSAxMi4wNTUgOTAuMTA2NCAxMi4zMzA3IDkwLjEwNjQgMTIu NjU0M0g4OC44MzVDODguODM1IDEyLjI4NTIgODguOTY0OCAxMS45Mjk3IDg5LjIy NDYgMTEuNTg3OUM4OS40ODg5IDExLjI0MTUgODkuODQ0NCAxMC45NjgxIDkwLjI5 MSAxMC43Njc2QzkwLjc0MjIgMTAuNTY3MSA5MS4yMzY3IDEwLjQ2NjggOTEuNzc0 NCAxMC40NjY4QzkyLjYyNjYgMTAuNDY2OCA5My4yOTQzIDEwLjY4MSA5My43Nzcz IDExLjEwOTRDOTQuMjYwNCAxMS41MzMyIDk0LjUxMTEgMTIuMTE4OCA5NC41Mjkz IDEyLjg2NjJWMTYuMjcwNUM5NC41MjkzIDE2Ljk0OTUgOTQuNjE1OSAxNy40ODk2 IDk0Ljc4OTEgMTcuODkwNlYxOEg5My40NjI5Wk05MS4zNjQzIDE3LjAzNjFDOTEu NzYwNyAxNy4wMzYxIDkyLjEzNjcgMTYuOTMzNiA5Mi40OTIyIDE2LjcyODVDOTIu ODQ3NyAxNi41MjM0IDkzLjEwNTEgMTYuMjU2OCA5My4yNjQ2IDE1LjkyODdWMTQu NDExMUg5Mi4yNzM0QzkwLjcyNCAxNC40MTExIDg5Ljk0OTIgMTQuODY0NiA4OS45 NDkyIDE1Ljc3MTVDODkuOTQ5MiAxNi4xNjggOTAuMDgxNCAxNi40Nzc5IDkwLjM0 NTcgMTYuNzAxMkM5MC42MSAxNi45MjQ1IDkwLjk0OTUgMTcuMDM2MSA5MS4zNjQz IDE3LjAzNjFaTTk3LjcwOCAxMC42MDM1TDk3Ljc0OSAxMS41MzMyQzk4LjMxNDEg MTAuODIyMyA5OS4wNTI0IDEwLjQ2NjggOTkuOTYzOSAxMC40NjY4QzEwMS41Mjcg MTAuNDY2OCAxMDIuMzE1IDExLjM0ODYgMTAyLjMyOSAxMy4xMTIzVjE4SDEwMS4w NjRWMTMuMTA1NUMxMDEuMDYgMTIuNTcyMyAxMDAuOTM3IDEyLjE3ODEgMTAwLjY5 NSAxMS45MjI5QzEwMC40NTggMTEuNjY3NiAxMDAuMDg3IDExLjU0IDk5LjU4MTEg MTEuNTRDOTkuMTcwOSAxMS41NCA5OC44MTA5IDExLjY0OTQgOTguNTAxIDExLjg2 ODJDOTguMTkxMSAxMi4wODY5IDk3Ljk0OTUgMTIuMzc0IDk3Ljc3NjQgMTIuNzI5 NVYxOEg5Ni41MTE3VjEwLjYwMzVIOTcuNzA4Wk0xMDMuOTM2IDE0LjI0MDJDMTAz LjkzNiAxMy4wODcyIDEwNC4yMDIgMTIuMTcxMiAxMDQuNzM1IDExLjQ5MjJDMTA1 LjI2OSAxMC44MDg2IDEwNS45NzUgMTAuNDY2OCAxMDYuODU0IDEwLjQ2NjhDMTA3 Ljc1NyAxMC40NjY4IDEwOC40NjEgMTAuNzg1OCAxMDguOTY3IDExLjQyMzhMMTA5 LjAyOCAxMC42MDM1SDExMC4xODRWMTcuODIyM0MxMTAuMTg0IDE4Ljc3OTMgMTA5 Ljg5OSAxOS41MzM1IDEwOS4zMjkgMjAuMDg1QzEwOC43NjQgMjAuNjM2NCAxMDgu MDAzIDIwLjkxMjEgMTA3LjA0NiAyMC45MTIxQzEwNi41MTMgMjAuOTEyMSAxMDUu OTkxIDIwLjc5ODIgMTA1LjQ4IDIwLjU3MDNDMTA0Ljk3IDIwLjM0MjQgMTA0LjU4 IDIwLjAzMDMgMTA0LjMxMiAxOS42MzM4TDEwNC45NjggMTguODc1QzEwNS41MSAx OS41NDQ5IDEwNi4xNzMgMTkuODc5OSAxMDYuOTU3IDE5Ljg3OTlDMTA3LjU3MiAx OS44Nzk5IDEwOC4wNTEgMTkuNzA2NyAxMDguMzkzIDE5LjM2MDRDMTA4LjczOSAx OS4wMTQgMTA4LjkxMiAxOC41MjY0IDEwOC45MTIgMTcuODk3NVYxNy4yNjE3QzEw OC40MDYgMTcuODQ1MSAxMDcuNzE2IDE4LjEzNjcgMTA2Ljg0MSAxOC4xMzY3QzEw NS45NzUgMTguMTM2NyAxMDUuMjczIDE3Ljc4ODEgMTA0LjczNSAxNy4wOTA4QzEw NC4yMDIgMTYuMzkzNiAxMDMuOTM2IDE1LjQ0MzQgMTAzLjkzNiAxNC4yNDAyWk0x MDUuMjA3IDE0LjM4MzhDMTA1LjIwNyAxNS4yMTc4IDEwNS4zNzggMTUuODc0IDEw NS43MiAxNi4zNTI1QzEwNi4wNjIgMTYuODI2NSAxMDYuNTQgMTcuMDYzNSAxMDcu MTU1IDE3LjA2MzVDMTA3Ljk1MyAxNy4wNjM1IDEwOC41MzggMTYuNzAxMiAxMDgu OTEyIDE1Ljk3NjZWMTIuNTk5NkMxMDguNTI1IDExLjg5MzIgMTA3Ljk0NCAxMS41 NCAxMDcuMTY5IDExLjU0QzEwNi41NTQgMTEuNTQgMTA2LjA3MyAxMS43NzkzIDEw NS43MjcgMTIuMjU3OEMxMDUuMzggMTIuNzM2MyAxMDUuMjA3IDEzLjQ0NSAxMDUu MjA3IDE0LjM4MzhaTTExNS4xNjcgMTguMTM2N0MxMTQuMTY0IDE4LjEzNjcgMTEz LjM0OSAxNy44MDg2IDExMi43MiAxNy4xNTIzQzExMi4wOTEgMTYuNDkxNSAxMTEu Nzc2IDE1LjYwOTcgMTExLjc3NiAxNC41MDY4VjE0LjI3NDRDMTExLjc3NiAxMy41 NDA3IDExMS45MTUgMTIuODg2NyAxMTIuMTkzIDEyLjMxMjVDMTEyLjQ3NiAxMS43 MzM3IDExMi44NjggMTEuMjgyNiAxMTMuMzY5IDEwLjk1OUMxMTMuODc1IDEwLjYz MDkgMTE0LjQyMiAxMC40NjY4IDExNS4wMSAxMC40NjY4QzExNS45NzEgMTAuNDY2 OCAxMTYuNzE5IDEwLjc4MzUgMTE3LjI1MiAxMS40MTdDMTE3Ljc4NSAxMi4wNTA1 IDExOC4wNTIgMTIuOTU3NCAxMTguMDUyIDE0LjEzNzdWMTQuNjY0MUgxMTMuMDQx QzExMy4wNTkgMTUuMzkzMiAxMTMuMjcxIDE1Ljk4MzQgMTEzLjY3NyAxNi40MzQ2 QzExNC4wODcgMTYuODgxMiAxMTQuNjA2IDE3LjEwNDUgMTE1LjIzNSAxNy4xMDQ1 QzExNS42ODIgMTcuMTA0NSAxMTYuMDYgMTcuMDEzMyAxMTYuMzcgMTYuODMxMUMx MTYuNjggMTYuNjQ4OCAxMTYuOTUxIDE2LjQwNzIgMTE3LjE4NCAxNi4xMDY0TDEx Ny45NTYgMTYuNzA4QzExNy4zMzYgMTcuNjYwNSAxMTYuNDA3IDE4LjEzNjcgMTE1 LjE2NyAxOC4xMzY3Wk0xMTUuMDEgMTEuNTA1OUMxMTQuNDk5IDExLjUwNTkgMTE0 LjA3MSAxMS42OTI3IDExMy43MjUgMTIuMDY2NEMxMTMuMzc4IDEyLjQzNTUgMTEz LjE2NCAxMi45NTUxIDExMy4wODIgMTMuNjI1SDExNi43ODdWMTMuNTI5M0MxMTYu NzUxIDEyLjg4NjcgMTE2LjU3NyAxMi4zOSAxMTYuMjY4IDEyLjAzOTFDMTE1Ljk1 OCAxMS42ODM2IDExNS41MzggMTEuNTA1OSAxMTUuMDEgMTEuNTA1OVpNMTI5LjI1 NiAxNC4zODM4QzEyOS4yNTYgMTUuNTE0IDEyOC45OTYgMTYuNDIzMiAxMjguNDc3 IDE3LjExMTNDMTI3Ljk1NyAxNy43OTQ5IDEyNy4yNiAxOC4xMzY3IDEyNi4zODUg MTguMTM2N0MxMjUuNDUxIDE4LjEzNjcgMTI0LjcyOCAxNy44MDYzIDEyNC4yMTgg MTcuMTQ1NUwxMjQuMTU2IDE4SDEyMi45OTRWNy41SDEyNC4yNTlWMTEuNDE3QzEy NC43NjkgMTAuNzgzNSAxMjUuNDczIDEwLjQ2NjggMTI2LjM3MSAxMC40NjY4QzEy Ny4yNjkgMTAuNDY2OCAxMjcuOTczIDEwLjgwNjMgMTI4LjQ4MyAxMS40ODU0QzEy OC45OTggMTIuMTY0NCAxMjkuMjU2IDEzLjA5NDEgMTI5LjI1NiAxNC4yNzQ0VjE0 LjM4MzhaTTEyNy45OTEgMTQuMjQwMkMxMjcuOTkxIDEzLjM3ODkgMTI3LjgyNSAx Mi43MTM1IDEyNy40OTIgMTIuMjQ0MUMxMjcuMTYgMTEuNzc0NyAxMjYuNjgxIDEx LjU0IDEyNi4wNTcgMTEuNTRDMTI1LjIyMyAxMS41NCAxMjQuNjIzIDExLjkyNzQg MTI0LjI1OSAxMi43MDIxVjE1LjkwMTRDMTI0LjY0NiAxNi42NzYxIDEyNS4yNSAx Ny4wNjM1IDEyNi4wNyAxNy4wNjM1QzEyNi42NzYgMTcuMDYzNSAxMjcuMTQ4IDE2 LjgyODggMTI3LjQ4NSAxNi4zNTk0QzEyNy44MjMgMTUuODkgMTI3Ljk5MSAxNS4x ODM2IDEyNy45OTEgMTQuMjQwMlpNMTMyLjIyOSAxOEgxMzAuOTY1VjcuNUgxMzIu MjI5VjE4Wk0xMzMuOTI1IDE0LjIzMzRDMTMzLjkyNSAxMy41MDg4IDEzNC4wNjYg MTIuODU3MSAxMzQuMzQ5IDEyLjI3ODNDMTM0LjYzNiAxMS42OTk1IDEzNS4wMzIg MTEuMjUyOSAxMzUuNTM4IDEwLjkzODVDMTM2LjA0OSAxMC42MjQgMTM2LjYzIDEw LjQ2NjggMTM3LjI4MSAxMC40NjY4QzEzOC4yODggMTAuNDY2OCAxMzkuMTAyIDEw LjgxNTQgMTM5LjcyMiAxMS41MTI3QzE0MC4zNDYgMTIuMjEgMTQwLjY1OCAxMy4x Mzc0IDE0MC42NTggMTQuMjk0OVYxNC4zODM4QzE0MC42NTggMTUuMTAzOCAxNDAu NTE5IDE1Ljc1MSAxNDAuMjQxIDE2LjMyNTJDMTM5Ljk2OCAxNi44OTQ5IDEzOS41 NzQgMTcuMzM5MiAxMzkuMDU5IDE3LjY1ODJDMTM4LjU0OCAxNy45NzcyIDEzNy45 NiAxOC4xMzY3IDEzNy4yOTUgMTguMTM2N0MxMzYuMjkyIDE4LjEzNjcgMTM1LjQ3 OSAxNy43ODgxIDEzNC44NTQgMTcuMDkwOEMxMzQuMjM1IDE2LjM5MzYgMTMzLjky NSAxNS40NzA3IDEzMy45MjUgMTQuMzIyM1YxNC4yMzM0Wk0xMzUuMTk2IDE0LjM4 MzhDMTM1LjE5NiAxNS4yMDQxIDEzNS4zODUgMTUuODYyNiAxMzUuNzY0IDE2LjM1 OTRDMTM2LjE0NiAxNi44NTYxIDEzNi42NTcgMTcuMTA0NSAxMzcuMjk1IDE3LjEw NDVDMTM3LjkzOCAxNy4xMDQ1IDEzOC40NDggMTYuODUzOCAxMzguODI2IDE2LjM1 MjVDMTM5LjIwNCAxNS44NDY3IDEzOS4zOTQgMTUuMTQwMyAxMzkuMzk0IDE0LjIz MzRDMTM5LjM5NCAxMy40MjIyIDEzOS4yIDEyLjc2NiAxMzguODEyIDEyLjI2NDZD MTM4LjQzIDExLjc1ODggMTM3LjkxOSAxMS41MDU5IDEzNy4yODEgMTEuNTA1OUMx MzYuNjU3IDExLjUwNTkgMTM2LjE1MyAxMS43NTQyIDEzNS43NzEgMTIuMjUxQzEz NS4zODggMTIuNzQ3NyAxMzUuMTk2IDEzLjQ1ODcgMTM1LjE5NiAxNC4zODM4Wk0x NDUuMjExIDE3LjEwNDVDMTQ1LjY2MiAxNy4xMDQ1IDE0Ni4wNTYgMTYuOTY3OCAx NDYuMzk0IDE2LjY5NDNDMTQ2LjczMSAxNi40MjA5IDE0Ni45MTggMTYuMDc5MSAx NDYuOTU0IDE1LjY2ODlIMTQ4LjE1QzE0OC4xMjggMTYuMDkyOCAxNDcuOTgyIDE2 LjQ5NjEgMTQ3LjcxMyAxNi44Nzg5QzE0Ny40NDQgMTcuMjYxNyAxNDcuMDg0IDE3 LjU2NzEgMTQ2LjYzMyAxNy43OTQ5QzE0Ni4xODYgMTguMDIyOCAxNDUuNzEyIDE4 LjEzNjcgMTQ1LjIxMSAxOC4xMzY3QzE0NC4yMDQgMTguMTM2NyAxNDMuNDAyIDE3 LjgwMTggMTQyLjgwNSAxNy4xMzE4QzE0Mi4yMTIgMTYuNDU3NCAxNDEuOTE2IDE1 LjUzNjggMTQxLjkxNiAxNC4zNzAxVjE0LjE1ODJDMTQxLjkxNiAxMy40MzgyIDE0 Mi4wNDggMTIuNzk3OSAxNDIuMzEyIDEyLjIzNzNDMTQyLjU3NyAxMS42NzY4IDE0 Mi45NTUgMTEuMjQxNSAxNDMuNDQ3IDEwLjkzMTZDMTQzLjk0NCAxMC42MjE3IDE0 NC41MyAxMC40NjY4IDE0NS4yMDQgMTAuNDY2OEMxNDYuMDM0IDEwLjQ2NjggMTQ2 LjcyMiAxMC43MTUyIDE0Ny4yNjkgMTEuMjExOUMxNDcuODIgMTEuNzA4NyAxNDgu MTE0IDEyLjM1MzUgMTQ4LjE1IDEzLjE0NjVIMTQ2Ljk1NEMxNDYuOTE4IDEyLjY2 OCAxNDYuNzM1IDEyLjI3NiAxNDYuNDA3IDExLjk3MDdDMTQ2LjA4NCAxMS42NjA4 IDE0NS42ODMgMTEuNTA1OSAxNDUuMjA0IDExLjUwNTlDMTQ0LjU2MiAxMS41MDU5 IDE0NC4wNjIgMTEuNzM4MyAxNDMuNzA3IDEyLjIwMzFDMTQzLjM1NiAxMi42NjM0 IDE0My4xODEgMTMuMzMxMSAxNDMuMTgxIDE0LjIwNjFWMTQuNDQ1M0MxNDMuMTgx IDE1LjI5NzUgMTQzLjM1NiAxNS45NTM4IDE0My43MDcgMTYuNDE0MUMxNDQuMDU4 IDE2Ljg3NDMgMTQ0LjU1OSAxNy4xMDQ1IDE0NS4yMTEgMTcuMTA0NVpNMTUxLjYz NyAxNC41NzUyTDE1MC44NDQgMTUuNDAyM1YxOEgxNDkuNTc5VjcuNUgxNTAuODQ0 VjEzLjg1MDZMMTUxLjUyMSAxMy4wMzcxTDE1My44MjQgMTAuNjAzNUgxNTUuMzYy TDE1Mi40ODQgMTMuNjkzNEwxNTUuNjk3IDE4SDE1NC4yMTRMMTUxLjYzNyAxNC41 NzUyWk0xNjEuODU2IDguODEyNVYxMC42MDM1SDE2My4yMzdWMTEuNTgxMUgxNjEu ODU2VjE2LjE2OEMxNjEuODU2IDE2LjQ2NDIgMTYxLjkxOCAxNi42ODc1IDE2Mi4w NDEgMTYuODM3OUMxNjIuMTY0IDE2Ljk4MzcgMTYyLjM3NCAxNy4wNTY2IDE2Mi42 NyAxNy4wNTY2QzE2Mi44MTYgMTcuMDU2NiAxNjMuMDE2IDE3LjAyOTMgMTYzLjI3 MSAxNi45NzQ2VjE4QzE2Mi45MzkgMTguMDkxMSAxNjIuNjE1IDE4LjEzNjcgMTYy LjMwMSAxOC4xMzY3QzE2MS43MzYgMTguMTM2NyAxNjEuMzEgMTcuOTY1OCAxNjEu MDIyIDE3LjYyNEMxNjAuNzM1IDE3LjI4MjIgMTYwLjU5MiAxNi43OTY5IDE2MC41 OTIgMTYuMTY4VjExLjU4MTFIMTU5LjI0NVYxMC42MDM1SDE2MC41OTJWOC44MTI1 SDE2MS44NTZaTTE2Ny4xNDEgMTYuMTQ3NUwxNjguODYzIDEwLjYwMzVIMTcwLjIx N0wxNjcuMjQzIDE5LjE0MTZDMTY2Ljc4MyAyMC4zNzIxIDE2Ni4wNTEgMjAuOTg3 MyAxNjUuMDQ5IDIwLjk4NzNMMTY0LjgxIDIwLjk2NjhMMTY0LjMzOCAyMC44Nzc5 VjE5Ljg1MjVMMTY0LjY4IDE5Ljg3OTlDMTY1LjEwOCAxOS44Nzk5IDE2NS40NDEg MTkuNzkzMyAxNjUuNjc4IDE5LjYyMDFDMTY1LjkxOSAxOS40NDY5IDE2Ni4xMTgg MTkuMTMwMiAxNjYuMjcyIDE4LjY2OTlMMTY2LjU1MyAxNy45MThMMTYzLjkxNCAx MC42MDM1SDE2NS4yOTVMMTY3LjE0MSAxNi4xNDc1Wk0xNzcuNiAxNC4zODM4QzE3 Ny42IDE1LjUwOTQgMTc3LjM0MiAxNi40MTYzIDE3Ni44MjcgMTcuMTA0NUMxNzYu MzEyIDE3Ljc5MjYgMTc1LjYxNSAxOC4xMzY3IDE3NC43MzUgMTguMTM2N0MxNzMu ODM4IDE4LjEzNjcgMTczLjEzMSAxNy44NTE5IDE3Mi42MTYgMTcuMjgyMlYyMC44 NDM4SDE3MS4zNTJWMTAuNjAzNUgxNzIuNTA3TDE3Mi41NjggMTEuNDIzOEMxNzMu MDgzIDEwLjc4NTggMTczLjc5OSAxMC40NjY4IDE3NC43MTUgMTAuNDY2OEMxNzUu NjA0IDEwLjQ2NjggMTc2LjMwNSAxMC44MDE4IDE3Ni44MiAxMS40NzE3QzE3Ny4z NCAxMi4xNDE2IDE3Ny42IDEzLjA3MzYgMTc3LjYgMTQuMjY3NlYxNC4zODM4Wk0x NzYuMzM1IDE0LjI0MDJDMTc2LjMzNSAxMy40MDYyIDE3Ni4xNTcgMTIuNzQ3NyAx NzUuODAyIDEyLjI2NDZDMTc1LjQ0NiAxMS43ODE2IDE3NC45NTkgMTEuNTQgMTc0 LjMzOSAxMS41NEMxNzMuNTczIDExLjU0IDE3Mi45OTkgMTEuODc5NiAxNzIuNjE2 IDEyLjU1ODZWMTYuMDkyOEMxNzIuOTk0IDE2Ljc2NzMgMTczLjU3MyAxNy4xMDQ1 IDE3NC4zNTMgMTcuMTA0NUMxNzQuOTU5IDE3LjEwNDUgMTc1LjQzOSAxNi44NjUy IDE3NS43OTUgMTYuMzg2N0MxNzYuMTU1IDE1LjkwMzYgMTc2LjMzNSAxNS4xODgy IDE3Ni4zMzUgMTQuMjQwMlpNMTgyLjI4MiAxOC4xMzY3QzE4MS4yOCAxOC4xMzY3 IDE4MC40NjQgMTcuODA4NiAxNzkuODM1IDE3LjE1MjNDMTc5LjIwNiAxNi40OTE1 IDE3OC44OTIgMTUuNjA5NyAxNzguODkyIDE0LjUwNjhWMTQuMjc0NEMxNzguODky IDEzLjU0MDcgMTc5LjAzMSAxMi44ODY3IDE3OS4zMDkgMTIuMzEyNUMxNzkuNTkx IDExLjczMzcgMTc5Ljk4MyAxMS4yODI2IDE4MC40ODQgMTAuOTU5QzE4MC45OSAx MC42MzA5IDE4MS41MzcgMTAuNDY2OCAxODIuMTI1IDEwLjQ2NjhDMTgzLjA4NyAx MC40NjY4IDE4My44MzQgMTAuNzgzNSAxODQuMzY3IDExLjQxN0MxODQuOSAxMi4w NTA1IDE4NS4xNjcgMTIuOTU3NCAxODUuMTY3IDE0LjEzNzdWMTQuNjY0MUgxODAu MTU2QzE4MC4xNzQgMTUuMzkzMiAxODAuMzg2IDE1Ljk4MzQgMTgwLjc5MiAxNi40 MzQ2QzE4MS4yMDIgMTYuODgxMiAxODEuNzIyIDE3LjEwNDUgMTgyLjM1MSAxNy4x MDQ1QzE4Mi43OTcgMTcuMTA0NSAxODMuMTc1IDE3LjAxMzMgMTgzLjQ4NSAxNi44 MzExQzE4My43OTUgMTYuNjQ4OCAxODQuMDY2IDE2LjQwNzIgMTg0LjI5OSAxNi4x MDY0TDE4NS4wNzEgMTYuNzA4QzE4NC40NTEgMTcuNjYwNSAxODMuNTIyIDE4LjEz NjcgMTgyLjI4MiAxOC4xMzY3Wk0xODIuMTI1IDExLjUwNTlDMTgxLjYxNSAxMS41 MDU5IDE4MS4xODYgMTEuNjkyNyAxODAuODQgMTIuMDY2NEMxODAuNDkzIDEyLjQz NTUgMTgwLjI3OSAxMi45NTUxIDE4MC4xOTcgMTMuNjI1SDE4My45MDJWMTMuNTI5 M0MxODMuODY2IDEyLjg4NjcgMTgzLjY5MyAxMi4zOSAxODMuMzgzIDEyLjAzOTFD MTgzLjA3MyAxMS42ODM2IDE4Mi42NTQgMTEuNTA1OSAxODIuMTI1IDExLjUwNTla IiBmaWxsPSIjNkI3MjgwIi8+Cjwvc3ZnPgo=");\n position: absolute;\n top: -2px;\n height: 0;\n pointer-events: none;\n}\n.neeto-editor {\n max-width: 100% !important;\n border-radius: 2px;\n white-space: pre-wrap;\n padding: 12px;\n color: #2f3941;\n}\n.neeto-editor p {\n line-height: 1.625;\n margin-bottom: 16px;\n}\n.neeto-editor:focus {\n outline: none;\n}\n.neeto-editor a {\n pointer-events: none;\n}\n.neeto-editor mark {\n background: #c9e4cc;\n border-radius: 2px;\n padding: 0px 4px;\n color: inherit;\n}\n.neeto-editor [data-variable] {\n display: inline-flex;\n color: #49545c;\n background-color: rgba(233, 235, 237, 0.5);\n border-radius: 2px;\n line-height: 1;\n padding: 4px 6px;\n}\n.neeto-editor [data-mention] {\n opacity: 0.6;\n}\n.neeto-editor .ProseMirror-separator {\n display: none;\n}\n.neeto-editor.fixed-menu-active {\n border: thin solid #e9ebed;\n border-radius: 0px 0px 2px 2px;\n}\n.neeto-editor .is-empty {\n position: relative;\n}\n.neeto-editor.placeholder-active:not(.force-title) .is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title h1:first-child {\n position: relative;\n margin-bottom: 20px;\n}\n.neeto-editor.force-title .is-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title.placeholder-active .is-empty:nth-child(2):last-child:before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title.force-title--error .is-empty:first-child::after {\n position: absolute;\n content: "Title can\'t be blank";\n left: 0;\n bottom: -12px;\n color: #f56a58;\n pointer-events: none;\n font-size: 12px;\n}\n.neeto-editor hr {\n margin: 8px 0;\n}\n.neeto-editor .ProseMirror-selectednode {\n outline: 3px solid #eaf3fc;\n}\n.neeto-editor-character-count {\n padding: 4px;\n color: #68737d;\n font-size: 12px;\n text-align: right;\n}\n.neeto-editor-error {\n color: #f56a58;\n border-width: 1px;\n border-color: #f56a58;\n}\n.neeto-editor-error:focus-within {\n border-color: #f56a58;\n}\n.neeto-editor-content, .neeto-editor {\n white-space: pre-wrap;\n}\n.neeto-editor-content h1, .neeto-editor h1,\n.neeto-editor-content h2,\n.neeto-editor h2,\n.neeto-editor-content h3,\n.neeto-editor h3,\n.neeto-editor-content h4,\n.neeto-editor h4,\n.neeto-editor-content h5,\n.neeto-editor h5,\n.neeto-editor-content h6,\n.neeto-editor h6 {\n font-size: revert;\n}\n.neeto-editor-content p, .neeto-editor p {\n line-height: 1.625;\n margin-bottom: 16px;\n}\n.neeto-editor-content p:empty::after, .neeto-editor p:empty::after {\n content: " ";\n}\n.neeto-editor-content p:last-child, .neeto-editor p:last-child {\n margin-bottom: 0;\n}\n.neeto-editor-content code, .neeto-editor code {\n padding: 0.2em 0.4em;\n font-size: 85%;\n border-radius: 6px;\n background-color: rgba(175, 184, 193, 0.2);\n font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;\n}\n.neeto-editor-content pre, .neeto-editor pre {\n color: #ffffff;\n background-color: #1f2937;\n overflow-x: auto;\n font-size: 12px;\n line-height: 20px;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 2px;\n padding: 16px;\n}\n.neeto-editor-content pre > code, .neeto-editor pre > code {\n background-color: transparent;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-weight: 400;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n line-height: inherit;\n}\n.neeto-editor-content blockquote, .neeto-editor blockquote {\n font-weight: 500;\n color: #1b1f23;\n border-left-width: 4px;\n border-left-color: #e5e7eb;\n quotes: "“" "”" "‘" "’";\n margin: 8px 0;\n padding-left: 12px;\n}\n.neeto-editor-content blockquote > p::before, .neeto-editor blockquote > p::before {\n content: "" !important;\n}\n.neeto-editor-content blockquote > p::after, .neeto-editor blockquote > p::after {\n content: "" !important;\n}\n.neeto-editor-content ul, .neeto-editor ul,\n.neeto-editor-content ol,\n.neeto-editor ol {\n list-style: revert;\n margin: revert;\n padding: revert;\n}\n.neeto-editor-content ul > li > p, .neeto-editor ul > li > p,\n.neeto-editor-content ol > li > p,\n.neeto-editor ol > li > p {\n margin-top: 0 !important;\n margin-bottom: 0.375rem !important;\n}\n.neeto-editor-content ul li::before, .neeto-editor ul li::before,\n.neeto-editor-content ol li::before,\n.neeto-editor ol li::before {\n background-color: #1b1f23;\n}\n.neeto-editor-content a[href], .neeto-editor a[href] {\n color: #276ef1;\n}\n.neeto-editor-content .video-wrapper, .neeto-editor .video-wrapper {\n width: 560px;\n height: 315px;\n margin: auto;\n}\n.neeto-editor-content mark, .neeto-editor mark {\n background: #c9e4cc;\n border-radius: 2px;\n padding: 0px 4px;\n color: inherit;\n}\n.neeto-editor-content [data-variable], .neeto-editor [data-variable] {\n display: inline-flex;\n color: #49545c;\n background-color: rgba(233, 235, 237, 0.5);\n border-radius: 2px;\n line-height: 1;\n padding: 4px 6px;\n}\n.neeto-editor-content [data-mention], .neeto-editor [data-mention] {\n opacity: 0.6;\n}\n.neeto-editor-content--hidden {\n display: none;\n}\n.neeto-editor__image {\n display: inline-block;\n border: 1.5px solid #eaf3fc;\n margin: 0 12px;\n}\n.neeto-editor__image figure {\n margin: 12px;\n outline: none;\n}\n.neeto-editor__image figure img {\n -webkit-user-select: auto;\n -moz-user-select: auto;\n user-select: auto;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.neeto-editor__image figure figcaption {\n color: #49545c;\n text-align: center;\n}\n.neeto-editor__image--none {\n display: flex;\n justify-content: center;\n}\n.neeto-editor__image--left {\n float: left;\n margin-left: 0;\n}\n.neeto-editor__image--right {\n float: right;\n margin-right: 0;\n}\n.neeto-editor__image--center {\n margin: 0 auto;\n}\n.neeto-editor-fixed-menu {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n overflow-x: auto;\n border-radius: 2px 2px 0px 0px;\n background-color: #e9ebed;\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 10px;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item:hover, .neeto-editor-fixed-menu .neeto-editor-fixed-menu__item:focus, .neeto-editor-fixed-menu .neeto-editor-fixed-menu__item:active, .neeto-editor-fixed-menu .neeto-editor-fixed-menu__item.active {\n background-color: #d8dcde;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item input[type=color] {\n visibility: hidden;\n height: 0;\n width: 0;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu-addons {\n display: flex;\n align-items: center;\n margin-left: auto;\n}\n.neeto-editor-variables-suggestion {\n padding: 4px 0;\n}\n.neeto-editor-variables-list {\n padding: 4px 8px;\n min-width: 184px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block:not(:last-child) {\n margin-bottom: 12px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block h6 {\n font-size: 12px;\n font-weight: 500;\n color: #68737d;\n margin-bottom: 4px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row .neeto-editor-variable {\n padding: 4px 6px;\n font-size: 12px;\n color: #49545c;\n line-height: 1;\n background-color: #eaf3fc;\n border-radius: 2px;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row .neeto-editor-variable:hover {\n background-color: #d4e6f9;\n}\n.neeto-editor-link-wrapper .ne-dropdown__popup {\n padding: 8px;\n width: 100%;\n max-width: 400px;\n}\n.neeto-editor-link-wrapper .ne-dropdown__popup .neeto-editor-link__item {\n display: flex !important;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n gap: 12px;\n}\n.neeto-editor-font-size-wrapper .ne-dropdown__popup {\n display: flex !important;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n gap: 8px;\n padding: 4px;\n}\n.neeto-editor-font-size-wrapper .ne-dropdown__popup li {\n padding: 6px 8px;\n}\n.neeto-editor-bubble-menu {\n position: relative;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n overflow: hidden;\n border-radius: 4px;\n background: #2f3941;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item {\n padding: 8px;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:hover, .neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:active, .neeto-editor-bubble-menu .neeto-editor-bubble-menu__item.active {\n background-color: #49545c;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link {\n display: flex;\n align-items: center;\n padding: 8px;\n gap: 8px;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input {\n background-color: transparent;\n outline: none;\n line-height: 20px;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input::-moz-placeholder {\n color: rgba(255, 255, 255, 0.4);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input::placeholder {\n color: rgba(255, 255, 255, 0.4);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .ne-btn--icon-only {\n padding: 0;\n min-height: 0;\n opacity: 0.8;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .ne-btn--icon-only:hover {\n opacity: 1;\n}\n.neeto-editor-bubble-menu-animate-shake {\n -webkit-animation: 1s linear infinite alternate both shake;\n animation: 1s linear infinite alternate both shake;\n}\n.neeto-editor-image-uploader {\n display: flex;\n flex-direction: column;\n min-height: 184px;\n}\n.neeto-editor-image-uploader .ne-tab__wrapper .ne-tab {\n min-width: 88px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__content {\n flex-grow: 1;\n display: flex;\n padding: 16px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n text-align: center;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress-title, .neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-label {\n color: #49545c;\n font-size: 14px;\n margin-bottom: 4px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress-file, .neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-note {\n color: #c2c8cc;\n font-size: 12px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n border: 1px dashed #c2c8cc;\n box-sizing: border-box;\n border-radius: 2px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-container {\n width: 100%;\n height: 100%;\n background-color: #ffffff;\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-container::-moz-focus-inner {\n border: 0;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-inner {\n display: flex;\n flex-direction: column;\n justify-content: center;\n line-height: 1.4;\n text-align: center;\n font-weight: 400;\n margin: 0;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-arrow {\n visibility: hidden;\n display: none;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop--isDraggingOver {\n background-color: #e9ebed;\n border: 2px dashed #5e5ce6;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-browse {\n color: #5e5ce6;\n font-size: 14px;\n font-weight: 600;\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd--error {\n color: #f56a58;\n font-size: 12px;\n margin-top: 12px;\n text-align: center;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper {\n width: 100%;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .ne-input__wrapper {\n width: 100%;\n flex-grow: 0;\n margin-bottom: 16px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container {\n max-height: 50vh;\n overflow-y: auto;\n overflow-x: hidden;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery {\n width: 100%;\n right: -8px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item {\n width: 33.3%;\n padding-right: 16px;\n padding-bottom: 16px;\n float: left;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder {\n width: 100%;\n position: relative;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner {\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: #f8f9f9;\n border-radius: 2px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner img {\n height: 100%;\n width: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n -webkit-animation: fade-in 1.2s 1s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n animation: fade-in 1.2s 1s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n border-radius: 2px;\n position: relative;\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner a {\n opacity: 0;\n position: absolute;\n left: 8px;\n bottom: 8px;\n margin: auto;\n color: #ffffff;\n font-size: 12px;\n font-weight: 400;\n line-height: 1;\n text-transform: capitalize;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner a:hover {\n text-decoration: underline;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner:hover a {\n opacity: 1;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__text {\n font-size: 12px;\n color: #2f3941;\n text-align: center;\n margin-top: 12px;\n}\n.neeto-editor-progress-bar__wrapper {\n width: 100%;\n max-width: 256px;\n margin-top: 10px;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__percent {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__percent p {\n font-size: 12px;\n color: #2f3941;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__indicator {\n position: relative;\n width: 100%;\n height: 6px;\n border-radius: 999px;\n overflow: hidden;\n background-color: rgba(94, 92, 230, 0.2);\n margin-top: 4px;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__indicator-inner {\n height: 100%;\n background-color: #5e5ce6;\n}\n.neeto-editor-url-form__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n padding: 0 24px;\n}\n.neeto-editor-url-form__wrapper .ne-input__wrapper {\n width: 100%;\n flex-grow: 0;\n margin-bottom: 16px;\n}\n.neeto-editor-emoji {\n font-family: apple color emoji, segoe ui emoji, noto color emoji, android emoji, emojisymbols, emojione mozilla, twemoji mozilla, segoe ui symbol;\n}\n.emoji-mart.emoji-mart-light {\n font-size: 14px;\n color: #2f3941;\n border: none;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor {\n color: #87929d;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor svg {\n margin: auto;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor .emoji-mart-anchor-bar {\n background-color: #2f3941 !important;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor.emoji-mart-anchor-selected {\n color: #2f3941 !important;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-search input {\n border-radius: 2px;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-category-label span {\n padding-top: 8px;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-emoji span {\n cursor: pointer;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-emoji:hover::before {\n background-color: #e9ebed;\n border-radius: 2px;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-scroll {\n height: 264px;\n padding-bottom: 0px;\n}\n.neeto-editor-emoji-suggestion {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n padding: 4px;\n gap: 2px;\n font-family: apple color emoji, segoe ui emoji, noto color emoji, android emoji, emojisymbols, emojione mozilla, twemoji mozilla, segoe ui symbol;\n}\n.neeto-editor-emoji-suggestion p {\n font-size: 12px;\n color: #2f3941;\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item {\n padding: 6px;\n font-size: 24px;\n transition: all 0.3s ease-in-out;\n border-radius: 2px;\n line-height: 1;\n cursor: pointer;\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item:hover {\n background-color: #e9ebed;\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item--selected {\n background-color: #e9ebed;\n}\n.neeto-editor-image-editor {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1.25rem;\n}\n.neeto-editor-image-editor figure {\n display: flex;\n flex-direction: column;\n justify-content: center;\n min-height: 208px;\n max-height: 400px;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n}\n.neeto-editor-image-editor figure img {\n height: 100%;\n width: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.neeto-editor-image-editor .ne-input__wrapper {\n width: 100%;\n}\n.neeto-editor-image-editor .neeto-editor-image-editor__footer {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 0.5rem;\n}\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;\n}\n.ProseMirror {\n overflow-y: auto;\n height: 100%;\n white-space: break-spaces;\n}\n.ProseMirror::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.ProseMirror::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.ProseMirror::-webkit-scrollbar-track {\n background: "transparent";\n}\n.ProseMirror:focus {\n outline: none;\n}',{}),oe.prototype={constructor:oe,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return-1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new oe(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new oe(n)},addToStart:function(e,t){return new oe([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new oe(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new oe(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=oe.from(e)).size?new oe(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=oe.from(e)).size?new oe(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=oe.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},oe.from=function(e){if(e instanceof oe)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new oe(t)};class le{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(e,a)-a,t-a),o=!n):s.isLeaf?(r?i+="function"==typeof r?r(s):r:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new le(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new le(n,r)}cutByIndex(e,t){return e==t?le.empty:0==e&&t==this.content.length?this:new le(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new le(r,i)}addToStart(e){return new le([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new le(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return se(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return ae(this,e,t,n)}findIndex(e,t=-1){if(0==e)return ce(0,e);if(e==this.size)return ce(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?ce(n+1,i):ce(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return le.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new le(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return le.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new le(t||e,n)}static from(e){if(!e)return le.empty;if(e instanceof le)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new le([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}le.empty=new le([],0);const ue={index:0,offset:0};function ce(e,t){return ue.index=e,ue.offset=t,ue}function de(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!de(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!de(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class pe{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&de(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return pe.none;if(e instanceof pe)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}pe.none=[];class he extends Error{}class fe{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=ge(this.content,e+this.openStart,t);return n&&new fe(n,this.openStart,this.openEnd)}removeBetween(e,t){return new fe(me(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return fe.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new fe(le.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new fe(e,n,r)}}function me(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(me(o.content,t-i-1,n-i-1)))}function ge(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=ge(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function ye(e,t,n){if(n.openStart>e.depth)throw new he("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new he("Inconsistent open depths");return be(e,t,n,0)}function be(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=be(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(le.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return De(o,ke(e,i,s,t,r))}{let r=e.parent,i=r.content;return De(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return De(o,Ee(e,t,r))}function ve(e,t){if(!t.type.compatibleContent(e.type))throw new he("Cannot join "+t.type.name+" onto "+e.type.name)}function we(e,t,n){let r=e.node(n);return ve(r,t.node(n)),r}function xe(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Me(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(xe(e.nodeAfter,r),o++));for(let e=o;e<s;e++)xe(i.child(e),r);t&&t.depth==n&&t.textOffset&&xe(t.nodeBefore,r)}function De(e,t){if(!e.type.validContent(t))throw new he("Invalid content for node "+e.type.name);return e.copy(t)}function ke(e,t,n,r,i){let o=e.depth>i&&we(e,t,i+1),s=r.depth>i&&we(n,r,i+1),a=[];return Me(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(ve(o,s),xe(De(o,ke(e,t,n,r,i+1)),a)):(o&&xe(De(o,Ee(e,t,i+1)),a),Me(t,n,i,a),s&&xe(De(s,Ee(n,r,i+1)),a)),Me(r,null,i,a),new le(a)}function Ee(e,t,n){let r=[];if(Me(null,e,n,r),e.depth>n){xe(De(we(e,t,n+1),Ee(e,t,n+1)),r)}return Me(t,null,n,r),new le(r)}fe.empty=new fe(le.empty,0,0);class Ce{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return pe.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ae(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s)break;if(t=t.child(e),t.isText)break;i=s-1,r+=o+1}return new Ce(t,n,i)}static resolveCached(e,t){for(let n=0;n<Te.length;n++){let r=Te[n];if(r.pos==t&&r.doc==e)return r}let n=Te[Oe]=Ce.resolve(e,t);return Oe=(Oe+1)%Se,n}}let Te=[],Oe=0,Se=12;class Ae{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Ne=Object.create(null);class _e{constructor(e,t,n,r=pe.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||le.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&de(this.attrs,t||e.defaultAttrs||Ne)&&pe.sameSet(this.marks,n||pe.none)}copy(e=null){return e==this.content?this:new _e(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new _e(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return fe.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.node(o).content.cut(r.pos-s,i.pos-s);return new fe(a,r.depth-o,i.depth-o)}replace(e,t,n){return ye(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Ce.resolveCached(this,e)}resolveNoCache(e){return Ce.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ie(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=le.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let e=pe.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!pe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=le.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}_e.prototype.text=void 0;class je extends _e{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ie(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new je(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new je(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ie(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Le{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new ze(e,t);if(null==n.next)return Le.empty;let r=Pe(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n($e(e,0));function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);$e(e,n).forEach((e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new Le(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(He);o.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return o}}(function(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach((e=>e.to=t))}function o(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(o(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),i(o(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return i(o(e.expr,t),s),i(o(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(o(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();i(o(e.expr,s),t),s=t}if(-1==e.max)i(o(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),i(o(e.expr,s),t),s=t}return[r(s)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=o(e.exprs[r],t);if(r==e.exprs.length-1)return s;i(s,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return le.from(s.map((e=>e.createAndFill())));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r})).join("\n")}}Le.empty=new Le(!0);class ze{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Pe(e){let t=[];do{t.push(Fe(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Fe(e){let t=[];do{t.push(Re(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Re(e){let t=function(e){if(e.eat("(")){let t=Pe(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&i.push(r)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=Ue(e,t)}return t}function Be(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Ue(e,t){let n=Be(e),r=n;return e.eat(",")&&(r="}"!=e.next?Be(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function He(e,t){return t-e}function $e(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(He)}function Ve(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function We(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function qe(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Qe(e[n]);return t}class Ye{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=qe(n.attrs),this.defaultAttrs=Ve(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Le.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:We(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new _e(this,this.computeAttrs(e),le.from(t),pe.setFrom(n))}createChecked(e=null,t,n){if(t=le.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new _e(this,this.computeAttrs(e),t,pe.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=le.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(le.empty,!0);return i?new _e(this,e,t.append(i),pe.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:pe.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new Ye(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class Qe{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Ke{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=qe(r.attrs),this.excluded=null;let i=Ve(this.attrs);this.instance=i?new pe(this,i):null}create(e=null){return!e&&this.instance?this.instance:new pe(this,We(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new Ke(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class Ge{constructor(e){this.cached=Object.create(null),this.spec={nodes:oe.from(e.nodes),marks:oe.from(e.marks||{}),topNode:e.topNode},this.nodes=Ye.compile(this.spec.nodes,this),this.marks=Ke.compile(this.spec.marks,this);let t=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let n=this.nodes[e],r=n.spec.content||"",i=n.spec.marks;n.contentMatch=t[r]||(t[r]=Le.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==i?null:i?Je(this,i.split(" ")):""!=i&&n.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Je(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof Ye))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new je(n,n.defaultAttrs,e,pe.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return _e.fromJSON(this,e)}markFromJSON(e){return pe.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Je(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Xe{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new at(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new at(this,t,!0);return n.addAll(e,t.from,t.to),fe.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(lt(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ut(e)),e.mark=t}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ut(e)),e.node=t}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Xe(e,Xe.schemaRules(e)))}}const Ze={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},et={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},tt={ol:!0,ul:!0},nt=1,rt=2,it=4;function ot(e,t,n){return null!=t?(t?nt:0)|("full"===t?rt:0):e&&"pre"==e.whitespace?nt|rt:n&~it}class st{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=pe.none,this.stashMarks=[],this.match=o||(s&it?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(le.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&nt)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=le.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(le.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):ct(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ze.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class at{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,o=ot(null,t.preserveWhitespace,0)|(n?it:0);r=i?new st(i.type,i.attrs,pe.none,pe.none,!0,t.topMatch||i.type.contentMatch,o):new st(n?null:e.schema.topNodeType,null,pe.none,pe.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style"),n=t?this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(let e=0;e<n.length;e++)this.addPendingMark(n[e]);if(this.addElement(e),null!=n)for(let e=0;e<n.length;e++)this.removePendingMark(n[e],r)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(n.options&rt||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&nt)t=n.options&rt?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();tt.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&tt.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:et.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let t,n=this.top,o=this.needsBlock;if(Ze.hasOwnProperty(r))t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=o}else this.addElementByRule(e,i,!1===i.consuming?n:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=pe.none;e:for(let n=0;n<e.length;n+=2)for(let r;;){let i=this.parser.matchStyle(e[n],e[n+1],this,r);if(!i)continue e;if(i.ignore)return null;if(t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;r=i}return t}addElementByRule(e,t,n){let r,i,o;if(t.node)i=this.parser.schema.nodes[t.node],i.isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace);else{o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o)}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let e=0;e<t.length;e++)this.enterInner(t[e],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let o=ot(e,r,i.options);i.options&it&&0==i.content.length&&(o|=it),this.nodes.push(new st(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)){t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function lt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ut(e){let t={};for(let n in e)t[n]=e[n];return t}function ct(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(o.indexOf(i)<0&&s(i))return!0}};if(s(i.contentMatch))return!0}}class dt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=ht(t).createDocumentFragment());let r=n,i=[];return e.forEach((e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=dt.renderSpec(ht(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&dt.renderSpec(ht(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let i=l;i<t.length;i++){let o=t[i];if(0===o){if(i<t.length-1||i>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:i}=dt.renderSpec(e,o,n);if(s.appendChild(t),i){if(r)throw new RangeError("Multiple content holes");r=i}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new dt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=pt(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return pt(e.marks)}}function pt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ht(e){return e.document||window.document}const ft=65535,mt=Math.pow(2,16);function gt(e,t){return e+t*mt}function yt(e){return e&ft}const bt=1,vt=2,wt=4,xt=8;class Mt{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&xt)>0}get deletedBefore(){return(this.delInfo&(bt|wt))>0}get deletedAfter(){return(this.delInfo&(vt|wt))>0}get deletedAcross(){return(this.delInfo&wt)>0}}class Dt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Dt.empty)return Dt.empty}recover(e){let t=0,n=yt(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(e&ft))/mt}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+i],u=this.ranges[s+o],c=a+l;if(e<=c){let i=a+r+((l?e==a?-1:e==c?1:t:t)<0?0:u);if(n)return i;let o=e==(t<0?a:c)?null:gt(s/3,e-a),d=e==a?vt:e==c?bt:wt;return(t<0?e!=a:e!=c)&&(d|=xt),new Mt(i,d,o)}r+=u-l}return n?e+r:new Mt(e+r,0,null)}touches(e,t){let n=0,r=yt(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+i];if(e<=s+a&&t==3*r)return!0;n+=this.ranges[t+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+t],u=this.ranges[r+n];e(s,s+l,a,a+u),i+=u-l}}invert(){return new Dt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Dt.empty:new Dt(e<0?[0,-e,0]:[0,0,e])}}Dt.empty=new Dt([]);class kt{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new kt(this.maps,this.mirror,e,t)}copy(){return new kt(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new kt;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this.maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Mt(e,r,null)}}const Et=Object.create(null);class Ct{getMap(){return Dt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Et[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Et)throw new RangeError("Duplicate use of step JSON ID "+e);return Et[e]=t,t.prototype.jsonID=e,t}}class Tt{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Tt(e,null)}static fail(e){return new Tt(null,e)}static fromReplace(e,t,n,r){try{return Tt.ok(e.replace(t,n,r))}catch(e){if(e instanceof he)return Tt.fail(e.message);throw e}}}function Ot(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(Ot(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return le.fromArray(r)}class St extends Ct{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new fe(Ot(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Tt.fromReplace(e,this.from,this.to,i)}invert(){return new At(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new St(t.pos,n.pos,this.mark)}merge(e){return e instanceof St&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new St(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new St(t.from,t.to,e.markFromJSON(t.mark))}}Ct.jsonID("addMark",St);class At extends Ct{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new fe(Ot(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Tt.fromReplace(e,this.from,this.to,n)}invert(){return new St(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new At(t.pos,n.pos,this.mark)}merge(e){return e instanceof At&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new At(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new At(t.from,t.to,e.markFromJSON(t.mark))}}Ct.jsonID("removeMark",At);class Nt extends Ct{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&jt(e,this.from,this.to)?Tt.fail("Structure replace would overwrite content"):Tt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Dt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Nt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Nt(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof Nt)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?fe.empty:new fe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Nt(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?fe.empty:new fe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Nt(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Nt(t.from,t.to,fe.fromJSON(e,t.slice),!!t.structure)}}Ct.jsonID("replace",Nt);class _t extends Ct{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(jt(e,this.from,this.gapFrom)||jt(e,this.gapTo,this.to)))return Tt.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Tt.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Tt.fromReplace(e,this.from,this.to,n):Tt.fail("Content does not fit in gap")}getMap(){return new Dt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new _t(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new _t(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new _t(t.from,t.to,t.gapFrom,t.gapTo,fe.fromJSON(e,t.slice),t.insert,!!t.structure)}}function jt(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function It(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Lt(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!It(r,i,o))break}return null}function zt(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<i;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return o?i.map(Pt).concat({type:t,attrs:n}).concat(o.map(Pt)):null}function Pt(e){return{type:e,attrs:null}}function Ft(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=r&&r[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function Rt(e,t){let n=e.resolve(t),r=n.index();return function(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Bt(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(o,o,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Ut(e,t,n=t,r=fe.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return Ht(i,o,r)?new Nt(t,n,r):new $t(i,o,r).fit()}function Ht(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Ct.jsonID("replaceAround",_t);class $t{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=le.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=le.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new fe(i,o,s);return e>-1?new _t(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Nt(n.pos,r.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,r=null;t?(r=qt(this.unplaced.content,t-1).firstChild,n=r.content):n=this.unplaced.content;let i=n.firstChild;for(let n=this.depth;n>=0;n--){let o,{type:s,match:a}=this.frontier[n],l=null;if(1==e&&(i?a.matchType(i.type)||(l=a.fillBefore(le.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:t,frontierDepth:n,parent:r,inject:l};if(2==e&&i&&(o=a.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:n,parent:r,wrap:o};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=qt(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new fe(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=qt(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new fe(Vt(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new fe(Vt(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,l=0,u=[],{match:c,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)u.push(r.child(e));c=c.matchFragment(r)}let p=s.size+e-(o.content.size-o.openEnd);for(;l<s.childCount;){let e=s.child(l),t=c.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(c=t,u.push(Yt(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?p:-1)))}let h=l==s.childCount;h||(p=-1),this.placed=Wt(this.placed,t,le.from(u)),this.frontier[t].match=c,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<p;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=h?0==e?fe.empty:new fe(Vt(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new fe(Vt(o.content,e,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Qt(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=Qt(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Qt(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Wt(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Wt(this.placed,this.depth,le.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(le.empty,!0);e.childCount&&(this.placed=Wt(this.placed,this.frontier.length,e))}}function Vt(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Vt(e.firstChild.content,t-1,n)))}function Wt(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Wt(e.lastChild.content,t-1,n)))}function qt(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Yt(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Yt(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(le.empty,!0)))),e.copy(r)}function Qt(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function Kt(e){return e.spec.defining||e.spec.definingForContent}function Gt(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Gt(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(le.empty,!0))}return e}function Jt(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}let Xt=class extends Error{};Xt=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Xt.prototype=Object.create(Error.prototype)).constructor=Xt,Xt.prototype.name="TransformError";class Zt{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new kt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Xt(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=fe.empty){let r=Ut(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new fe(le.from(n),0,0))}delete(e,t){return this.replace(e,t,fe.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(Ht(i,o,r))return e.step(new Nt(t,n,r));let s=Jt(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:i.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),u=[],c=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(u.push(n),t==r.openStart)break;e=n.content}for(let e=c-1;e>=0;e--){let t=u[e].type,n=Kt(t);if(n&&i.node(l).type!=t)c=e;else if(n||!t.isTextblock)break}for(let t=r.openStart;t>=0;t--){let a=(t+c+1)%(r.openStart+1),d=u[a];if(d)for(let t=0;t<s.length;t++){let u=s[(t+l)%s.length],c=!0;u<0&&(c=!1,u=-u);let p=i.node(u-1),h=i.index(u-1);if(p.canReplaceWith(h,h,d.type,d.marks))return e.replace(i.before(u),c?o.after(u):n,new fe(Gt(r.content,0,r.openStart,a),a,r.openEnd))}}let d=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,r),!(e.steps.length>d));a--){let e=s[a];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}(e.doc,t,r.type);null!=i&&(t=n=i)}e.replaceRange(t,n,new fe(le.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=Jt(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o)return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,u=a,c=le.empty,d=0;for(let e=o,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,c=le.from(r.node(e).copy(c)),d++):l--;let p=le.empty,h=0;for(let e=o,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,p=le.from(i.node(e).copy(p)),h++):u++;e.step(new _t(l,u,s,a,new fe(c.append(p),d,h),c.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=new Nt(t-n,t+n,fe.empty,!0);e.step(r)}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=le.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=le.from(n[e].type.create(n[e].attrs,r))}let i=t.start,o=t.end;e.step(new _t(i,o,i,o,new fe(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),r)){e.clearIncompatible(e.mapping.slice(o).map(n,1),r);let s=e.mapping.slice(o),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new _t(a,l,a+1,l-1,new fe(le.from(r.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r=[]){return function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new _t(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new fe(le.from(s),0,0),1,!0))}(this,e,t,n,r),this}split(e,t=1,n){return function(e,t,n=1,r){let i=e.doc.resolve(t),o=le.empty,s=le.empty;for(let e=i.depth,t=i.depth-n,a=n-1;e>t;e--,a--){o=le.from(i.node(e).copy(o));let t=r&&r[a];s=le.from(t?t.type.create(t.attrs,s):i.node(e).copy(s))}e.step(new Nt(t,t,new fe(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,u)=>{if(!e.isInline)return;let c=e.marks;if(!r.isInSet(c)&&u.type.allowsMarkType(r.type)){let u=Math.max(l,t),d=Math.min(l+e.nodeSize,n),p=r.addToSet(c);for(let e=0;e<c.length;e++)c[e].isInSet(p)||(i&&i.to==u&&i.mark.eq(c[e])?i.to=d:s.push(i=new At(u,d,c[e])));o&&o.to==u?o.to=d:a.push(o=new St(u,d,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;o++;let a=null;if(r instanceof Ke){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&l.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=o):i.push({style:l,from:Math.max(s,t),to:r,step:o})}}})),i.forEach((t=>e.step(new At(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<i.childCount;t++){let a=i.child(t),l=s+a.nodeSize,u=r.matchType(a.type);if(u){r=u;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new At(s,l,a.marks[t]))}else o.push(new Nt(s,l,fe.empty));s=l}if(!r.validEnd){let t=r.fillBefore(le.empty,!0);e.replace(s,s,new fe(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}(this,e,t,n),this}}const en=Object.create(null);class tn{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new nn(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=fe.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],u=e.mapping.slice(i);e.replaceRange(u.map(a.pos),u.map(l.pos),s?fe.empty:t),0==s&&hn(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=e.mapping.slice(n),l=a.map(o.pos),u=a.map(s.pos);i?e.deleteRange(l,u):(e.replaceRangeWith(l,u,t),hn(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new sn(e):pn(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?pn(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):pn(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new cn(e.node(0))}static atStart(e){return pn(e,e,0,0,1)||new cn(e)}static atEnd(e){return pn(e,e,e.content.size,e.childCount,-1)||new cn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=en[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in en)throw new RangeError("Duplicate use of selection JSON ID "+e);return en[e]=t,t.prototype.jsonID=e,t}getBookmark(){return sn.between(this.$anchor,this.$head).getBookmark()}}tn.prototype.visible=!0;class nn{constructor(e,t){this.$from=e,this.$to=t}}let rn=!1;function on(e){rn||e.parent.inlineContent||(rn=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class sn extends tn{constructor(e,t=e){on(e),on(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return tn.near(n);let r=e.resolve(t.map(this.anchor));return new sn(r.parent.inlineContent?r:n,n)}replace(e,t=fe.empty){if(super.replace(e,t),t==fe.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof sn&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new an(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new sn(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=tn.findFrom(t,n,!0)||tn.findFrom(t,-n,!0);if(!e)return tn.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(tn.findFrom(e,-n,!0)||tn.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new sn(e,t)}}tn.jsonID("text",sn);class an{constructor(e,t){this.anchor=e,this.head=t}map(e){return new an(e.map(this.anchor),e.map(this.head))}resolve(e){return sn.between(e.resolve(this.anchor),e.resolve(this.head))}}class ln extends tn{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?tn.near(i):new ln(i)}content(){return new fe(le.from(this.node),0,0)}eq(e){return e instanceof ln&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new un(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ln(e.resolve(t.anchor))}static create(e,t){return new ln(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}ln.prototype.visible=!1,tn.jsonID("node",ln);class un{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new an(n,n):new un(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&ln.isSelectable(n)?new ln(t):tn.near(t)}}class cn extends tn{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=fe.empty){if(t==fe.empty){e.delete(0,e.doc.content.size);let t=tn.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new cn(e)}map(e){return new cn(e)}eq(e){return e instanceof cn}getBookmark(){return dn}}tn.jsonID("all",cn);const dn={map(){return this},resolve:e=>new cn(e)};function pn(e,t,n,r,i,o=!1){if(t.inlineContent)return sn.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&ln.isSelectable(r))return ln.create(e,n-(i<0?r.nodeSize:0))}else{let t=pn(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function hn(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,o=e.steps[r];(o instanceof Nt||o instanceof _t)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(tn.near(e.doc.resolve(i),n)))}const fn=1,mn=2,gn=4;class yn extends Zt{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|fn)&~mn,this.storedMarks=null,this}get selectionSet(){return(this.updated&fn)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=mn,this}ensureMarks(e){return pe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&mn)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~mn,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||pe.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(tn.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=gn,this}get scrolledIntoView(){return(this.updated&gn)>0}}function bn(e,t){return t&&e?e.bind(t):e}class vn{constructor(e,t,n){this.name=e,this.init=bn(t.init,n),this.apply=bn(t.apply,n)}}const wn=[new vn("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new vn("selection",{init:(e,t)=>e.selection||tn.atStart(t.doc),apply:e=>e.selection}),new vn("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new vn("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class xn{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=wn.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new vn(e.key,e.spec.state,e))}))}}class Mn{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,u=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(u&&n.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(u),n=n.applyInner(u),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Mn(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new yn(this)}static create(e){let t=new xn(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Mn(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new xn(this.schema,e.plugins),n=t.fields,r=new Mn(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new xn(e.schema,e.plugins),i=new Mn(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=_e.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=tn.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=a.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function Dn(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=Dn(i,t,{})),n[r]=i}return n}class kn{constructor(e){this.spec=e,this.props={},e.props&&Dn(e.props,this,this.props),this.key=e.key?e.key.key:Cn("plugin")}getState(e){return e[this.key]}}const En=Object.create(null);function Cn(e){return e in En?e+"$"+ ++En[e]:(En[e]=0,e+"$")}class Tn{constructor(e="key"){this.key=Cn(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const On="undefined"!=typeof navigator?navigator:null,Sn="undefined"!=typeof document?document:null,An=On&&On.userAgent||"",Nn=/Edge\/(\d+)/.exec(An),_n=/MSIE \d/.exec(An),jn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(An),In=!!(_n||jn||Nn),Ln=_n?document.documentMode:jn?+jn[1]:Nn?+Nn[1]:0,zn=!In&&/gecko\/(\d+)/i.test(An);zn&&(/Firefox\/(\d+)/.exec(An)||[0,0])[1];const Pn=!In&&/Chrome\/(\d+)/.exec(An),Fn=!!Pn,Rn=Pn?+Pn[1]:0,Bn=!In&&!!On&&/Apple Computer/.test(On.vendor),Un=Bn&&(/Mobile\/\w+/.test(An)||!!On&&On.maxTouchPoints>2),Hn=Un||!!On&&/Mac/.test(On.platform),$n=/Android \d/.test(An),Vn=!!Sn&&"webkitFontSmoothing"in Sn.documentElement.style,Wn=Vn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,qn=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Yn=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let Qn=null;const Kn=function(e,t,n){let r=Qn||(Qn=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Gn=function(e,t,n,r){return n&&(Xn(e,t,n,r,-1)||Xn(e,t,n,r,1))},Jn=/^(img|br|input|textarea|hr)$/i;function Xn(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Zn(e))){let n=e.parentNode;if(!n||1!=n.nodeType||er(e)||Jn.test(e.nodeName)||"false"==e.contentEditable)return!1;t=qn(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?Zn(e):0}}}function Zn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function er(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const tr=function(e){let t=e.isCollapsed;return t&&Fn&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function nr(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function rr(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function ir(e,t){return"number"==typeof e?e:e[t]}function or(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function sr(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Yn(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?rr(o):or(e),l=0,u=0;if(t.top<a.top+ir(r,"top")?u=-(a.top-t.top+ir(i,"top")):t.bottom>a.bottom-ir(r,"bottom")&&(u=t.bottom-a.bottom+ir(i,"bottom")),t.left<a.left+ir(r,"left")?l=-(a.left-t.left+ir(i,"left")):t.right>a.right-ir(r,"right")&&(l=t.right-a.right+ir(i,"right")),l||u)if(n)o.defaultView.scrollBy(l,u);else{let n=e.scrollLeft,r=e.scrollTop;u&&(e.scrollTop+=u),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n)break}}function ar(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Yn(r));return t}function lr(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let ur=null;function cr(e,t){let n,r,i=2e8,o=0,s=t.top,a=t.top;for(let l=e.firstChild,u=0;l;l=l.nextSibling,u++){let e;if(1==l.nodeType)e=l.getClientRects();else{if(3!=l.nodeType)continue;e=Kn(l).getClientRects()}for(let c=0;c<e.length;c++){let d=e[c];if(d.top<=s&&d.bottom>=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let e=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(e<i){n=l,i=e,r=e&&3==n.nodeType?{left:d.right<t.left?d.right:d.left,top:t.top}:t,1==l.nodeType&&e&&(o=u+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=u+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=fr(r,1);if(n.top!=n.bottom&&dr(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:o}:cr(n,r)}function dr(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function pr(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(dr(t,i))return pr(n,t,i)}}if((o=(o+1)%r)==i)break}return e}function hr(e,t){let n,r=e.dom.ownerDocument,i=0;if(r.caretPositionFromPoint)try{let e=r.caretPositionFromPoint(t.left,t.top);e&&({offsetNode:n,offset:i}=e)}catch(e){}if(!n&&r.caretRangeFromPoint){let e=r.caretRangeFromPoint(t.left,t.top);e&&({startContainer:n,startOffset:i}=e)}let o,s=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top+1);if(!s||!e.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=e.dom.getBoundingClientRect();if(!dr(t,n))return null;if(s=pr(e.dom,t,n),!s)return null}if(Bn)for(let e=s;n&&e;e=Yn(e))e.draggable&&(n=void 0);if(s=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(s,t),n){if(zn&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(o=function(e,t,n,r){let i=-1;for(let n=t;n!=e.dom;){let t=e.docView.nearestDesc(n,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>r.left||e.top>r.top)i=t.posBefore;else{if(!(e.right<r.left||e.bottom<r.top))break;i=t.posAfter}}n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,1)}(e,n,i,t))}null==o&&(o=function(e,t,n){let{node:r,offset:i}=cr(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:o,inside:a?a.posAtStart-a.border:-1}}function fr(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const mr=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function gr(e,t,n){let{node:r,offset:i}=e.docView.domFromPos(t,n<0?-1:1),o=Vn||zn;if(3==r.nodeType){if(!o||!mr.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,yr(fr(Kn(r,e,t),o),o<0)}{let e=fr(Kn(r,i,i),n);if(zn&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=fr(Kn(r,i-1,i-1),-1);if(t.top==e.top){let n=fr(Kn(r,i,i+1),-1);if(n.top!=e.top)return yr(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(n<0||i==Zn(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return br(e.getBoundingClientRect(),!1)}if(i<Zn(r)){let e=r.childNodes[i];if(1==e.nodeType)return br(e.getBoundingClientRect(),!0)}return br(r.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==Zn(r))){let e=r.childNodes[i-1],t=3==e.nodeType?Kn(e,Zn(e)-(o?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return yr(fr(t,1),!1)}if(i<Zn(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Kn(e,0,o?0:1):1==e.nodeType?e:null:null;if(t)return yr(fr(t,-1),!0)}return yr(fr(3==r.nodeType?Kn(r):r,-n),n>=0)}function yr(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function br(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function vr(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const wr=/[\u0590-\u08ac]/;let xr=null,Mr=null,Dr=!1;function kr(e,t,n){return xr==t&&Mr==n?Dr:(xr=t,Mr=n,Dr="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return vr(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let r=gr(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=Kn(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return wr.test(r.parent.textContent)&&a.modify?vr(e,t,(()=>{let t=a.getRangeAt(0),i=a.focusNode,o=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||i==a.focusNode&&o==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?o:s}(e,t,n))}const Er=0,Cr=1,Tr=2,Or=3;class Sr{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Er,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>qn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0};let n,r=0,i=0;for(let t=0;r<this.children.length;r++){let n=this.children[r],o=t+n.size;if(o>e||n instanceof zr){i=e-t;break}t=o}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Ar&&n.side>=0;r--);if(t<=0){let e,n=!0;for(;e=r?this.children[r-1]:null,e&&e.dom.parentNode!=this.contentDOM;r--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?qn(e.dom)+1:0}}{let e,n=!0;for(;e=r<this.children.length?this.children[r]:null,e&&e.dom.parentNode!=this.contentDOM;r++,n=!1);return e&&n&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?qn(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==r&&e<=a){let i=o+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=qn(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=qn(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],u=a+l.size;if(i>a&&o<u)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=u}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),u=!1;if((zn||Bn)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(u=!(!t||"\n"!=e.nodeValue[t-1]),u&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(s=a={node:t.parentNode,offset:qn(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(zn&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let e=l.focusNode.childNodes[l.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||u&&Bn)&&Gn(s.node,s.offset,l.anchorNode,l.anchorOffset)&&Gn(a.node,a.offset,l.focusNode,l.focusOffset))return;let c=!1;if((l.extend||e==t)&&!u){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),c=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!c){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?Tr:Cr,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=Or);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?Or:Tr}n=o}this.dirty=Tr}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?Tr:Cr;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Ar extends Sr{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,(()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Er&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Nr extends Sr{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class _r extends Sr{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=dt.renderSpec(document,t.type.spec.toDOM(t,n))),new _r(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return this.dirty&Or||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=Or&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Er){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=Er}}slice(e,t,n){let r=_r.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=Kr(i,t,o,n)),e>0&&(i=Kr(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}}class jr extends Sr{constructor(e,t,n,r,i,o,s,a,l){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s,o&&this.updateChildren(a,l)}static create(e,t,n,r,i,o){let s,a=i.nodeViews[t.type.name],l=a&&a(t,i,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),u=l&&l.dom,c=l&&l.contentDOM;if(t.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(t.text);else u||({dom:u,contentDOM:c}=dt.renderSpec(document,t.type.spec.toDOM(t)));c||t.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let d=u;return u=Vr(u,n,t),l?s=new Pr(e,t,n,r,u,c||null,d,l,i,o+1):t.isText?new Lr(e,t,n,r,u,d,i):new jr(e,t,n,r,u,c||null,d,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>le.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return this.dirty==Er&&e.eq(this.node)&&Wr(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new Yr(this,o&&o.node);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],l=null;for(let u=0;;){if(s<i.length&&i[s].to==o){let e,t=i[s++];for(;s<i.length&&i[s].to==o;)(e||(e=[t])).push(i[s++]);if(e){e.sort(Qr);for(let t=0;t<e.length;t++)n(e[t],u,!!l)}else n(t,u,!!l)}let c,d;if(l)d=-1,c=l,l=null;else{if(!(u<e.childCount))break;d=u,c=e.child(u++)}for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let p=o+c.nodeSize;if(c.isText){let e=p;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<p&&(l=c.cut(e-o),c=c.cut(0,e-o),p=e,d=-1)}let h=c.isInline&&!c.isLeaf?a.filter((e=>!e.inline)):a.slice();r(c,h,t.forChild(o,c),d),o=p}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?pe.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,l,u)=>{let c;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,l,u)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(c=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,l,c,e)||a.updateNextNode(t,o,l,e,u)||a.addNode(t,o,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Tr)&&(o&&this.protectLocalComposition(e,o),Fr(this.contentDOM,this.children,e),Un&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof sn)||n<t||r>t+this.node.content.size)return null;let i=e.domSelection(),o=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=Zn(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(i.focusNode,i.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;l+=t.text}if(o>=n){let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new Nr(this,i,t,r);e.input.compositionNodes.push(o),this.children=Kr(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(this.dirty==Or||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Er}updateOuterDeco(e){if(Wr(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Hr(this.dom,this.nodeDOM,Ur(this.outerDeco,this.node,t),Ur(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Ir(e,t,n,r,i){return Vr(r,t,e),new jr(void 0,e,t,n,r,r,r,i,0)}class Lr extends jr{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(this.dirty==Or||this.dirty!=Er&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==Er&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Er,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new Lr(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=Or)}get domAtom(){return!1}}class zr extends Sr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Er&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Pr extends jr{constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r,i,o,s,l,u),this.spec=a}update(e,t,n,r){if(this.dirty==Or)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Fr(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=qr(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof _r){let t=r?r.previousSibling:e.lastChild;Fr(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=qr(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Rr=function(e){e&&(this.nodeName=e)};Rr.prototype=Object.create(null);const Br=[new Rr];function Ur(e,t,n){if(0==e.length)return Br;let r=n?Br[0]:new Rr,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Rr(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new Rr(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}}return i}function Hr(e,t,n,r){if(n==Br&&r==Br)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||(t=document.createElement(o.nodeName),t.pmIsDeco=!0,t.appendChild(i),s=Br[0]),i=t}$r(i,s||Br[0],o)}return i}function $r(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function Vr(e,t,n){return Hr(e,e,Br,Ur(t,n,1!=e.nodeType))}function Wr(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function qr(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Yr{constructor(e,t){this.lock=t,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof _r)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,i=this.stack.length>>1,o=Math.min(i,e.length);for(;r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=Er,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++)if(this.top.children[t].matchesMark(e[i])){r=t;break}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=_r.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let r=this.index,i=Math.min(this.top.children.length,r+5);r<i;r++){let i=this.top.children[r];if(i.matchesNode(e,t,n)&&!this.preMatch.matched.has(i)){o=r;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return o.dirty==Or&&o.dom==o.contentDOM&&(o.dirty=Tr),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index=r+1,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,i){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof jr){let a=this.preMatch.matched.get(s);if(null!=a&&a!=i)return!1;let l=s.dom;if(!(this.lock&&(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Or&&Wr(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(e,t,n,r,i){this.top.children.splice(this.index++,0,jr.create(this.top,e,t,n,r,i)),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new Ar(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof _r;)t=e,e=t.children[t.children.length-1];e&&e instanceof Lr&&!/\n$/.test(e.node.text)||((Bn||Fn)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new zr(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}function Qr(e,t){return e.type.side-t.type.side}function Kr(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],u=a,c=a+=l.size;u>=n||c<=t?o.push(l):(u<t&&o.push(l.slice(0,t-u,r)),i&&(o.push(i),i=void 0),c>n&&o.push(l.slice(n-u,l.size,r)))}return o}function Gr(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,u=r.resolve(s);if(tr(n)){for(a=u;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&ln.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==Zn(e);r||i;){if(e==n)return!0;let t=qn(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==Zn(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new ln(s==e?u:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=oi(e,a,u,"pointer"==t||e.state.selection.head<u.pos&&!o?1:-1)}return l}function Jr(e){return e.editable?e.hasFocus():ai(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Xr(e,t=!1){let n=e.state.selection;if(ri(e,n),Jr(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Fn){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Gn(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,qn(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&In&&Ln<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,i,{anchor:o,head:s}=n;!Zr||n instanceof sn||(n.$from.parent.inlineContent||(r=ei(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=ei(e,n.to))),e.docView.setSelection(o,s,e.root,t),Zr&&(r&&ni(r),i&&ni(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Jr(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Zr=Bn||Fn&&Rn<63;function ei(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Bn&&i&&"false"==i.contentEditable)return ti(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return ti(i);if(o)return ti(o)}}function ti(e){return e.contentEditable="true",Bn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function ni(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function ri(e,t){if(t instanceof ln){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(ii(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else ii(e)}function ii(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function oi(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||sn.between(t,n,r)}function si(e){return(!e.editable||e.root.activeElement==e.dom)&&ai(e)}function ai(e){let t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function li(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&tn.findFrom(o,t)}function ui(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function ci(e,t,n){let r=e.state.selection;if(!(r instanceof sn)){if(r instanceof ln&&r.node.isInline)return ui(e,new sn(t>0?r.$to:r.$from));{let n=li(e.state,t);return!!n&&ui(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=li(e.state,t);return!!(n&&n instanceof ln)&&ui(e,n)}if(!(Hn&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(ln.isSelectable(o)?ui(e,new ln(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!Vn&&ui(e,new sn(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function di(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function pi(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function hi(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(zn&&1==n.nodeType&&r<di(n)&&pi(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(pi(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(mi(n))break;{let t=n.previousSibling;for(;t&&pi(t);)i=n.parentNode,o=qn(t),t=t.previousSibling;if(t)n=t,r=di(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?gi(e,t,n,r):i&&gi(e,t,i,o)}function fi(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=di(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!pi(n.childNodes[r]))break;i=n,o=++r}else{if(mi(n))break;{let t=n.nextSibling;for(;t&&pi(t);)i=t.parentNode,o=qn(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=di(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&gi(e,t,i,o)}function mi(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function gi(e,t,n,r){if(tr(t)){let e=document.createRange();e.setEnd(n,r),e.setStart(n,r),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&Xr(e)}),50)}function yi(e,t,n){let r=e.state.selection;if(r instanceof sn&&!r.empty||n.indexOf("s")>-1)return!1;if(Hn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=li(e.state,t);if(n&&n instanceof ln)return ui(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof cn?tn.near(n,t):tn.findFrom(n,t);return!!s&&ui(e,s)}return!1}function bi(e,t){if(!(e.state.selection instanceof sn))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function vi(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function wi(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||Hn&&72==n&&"c"==r?bi(e,-1)||hi(e):46==n||Hn&&68==n&&"c"==r?bi(e,1)||fi(e):13==n||27==n||(37==n||Hn&&66==n&&"c"==r?ci(e,-1,r)||hi(e):39==n||Hn&&70==n&&"c"==r?ci(e,1,r)||fi(e):38==n||Hn&&80==n&&"c"==r?yi(e,-1,r)||hi(e):40==n||Hn&&78==n&&"c"==r?function(e){if(!Bn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;vi(e,n,"true"),setTimeout((()=>vi(e,n,"false")),20)}return!1}(e)||yi(e,1,r)||fi(e):r==(Hn?"m":"c")&&(66==n||73==n||89==n||90==n))}function xi(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||dt.fromSchema(e.state.schema),a=Ni(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&1==c.nodeType&&(u=Si[c.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=a.createElement(u[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}c=l.firstChild}c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n");return{dom:l,text:p}}function Mi(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new fe(le.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):fe.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=dt.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Ni().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&Si[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=e,n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),Vn&&function(e){let t=e.querySelectorAll(Fn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let e=+c[3];e>0&&o.firstChild;e--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Xe.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!c),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Di.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(c)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=le.from(t.create(n[e+1],i)),o++,s++}return new fe(i,o,s)}(Oi(s,+c[1],+c[2]),c[4]);else if(s=fe.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&Ei(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Ci(o[o.length-1],r.length));let t=ki(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return le.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Oi(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const Di=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function ki(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,le.from(e));return e}function Ei(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=Ei(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(le.from(ki(n,e,i+1))))}}function Ci(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Ci(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(le.empty,!0);return e.copy(n.append(r))}function Ti(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return i<r-1&&(a=Ti(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(le.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Oi(e,t,n){return t<e.openStart&&(e=new fe(Ti(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new fe(Ti(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Si={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Ai=null;function Ni(){return Ai||(Ai=document.implementation.createHTMLDocument("title"))}const _i={};let ji={};class Ii{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Li(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function zi(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Pi(e,t))}))}function Pi(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Fi(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Ri(e){return{left:e.clientX,top:e.clientY}}function Bi(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,(t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1))))return!0;return!1}function Ui(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Hi(e,t,n,r,i){return Bi(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof ln&&(n=i.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(ln.isSelectable(t)){r=n&&i.$from.depth>0&&e>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(e);break}}return null!=r&&(Ui(e,ln.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&ln.isSelectable(r))&&(Ui(e,new ln(n),"pointer"),!0)}(e,n))}function $i(e,t,n,r){return Bi(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Vi(e,t,n,r){return Bi(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Ui(e,sn.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)Ui(e,sn.create(r,o+1,o+1+n.content.size),"pointer");else{if(!ln.isSelectable(n))continue;Ui(e,ln.create(r,o),"pointer")}return!0}}(e,n,r)}function Wi(e){return Xi(e)}ji.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Qi(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!$n||!Fn||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Un||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||wi(e,n)?n.preventDefault():Li(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,nr(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},ji.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},ji.keypress=(e,t)=>{let n=t;if(Qi(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Hn&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof sn&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const qi=Hn?"metaKey":"ctrlKey";_i.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Wi(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[qi]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(Ri(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Yi(e,s,n,!!r)):("doubleClick"==o?$i:Vi)(e,s.pos,s.inside,n)?n.preventDefault():Li(e,"pointer"))};class Yi{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[qi],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof ln&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!zn||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Li(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>Xr(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Ri(e))),this.allowDefault||!t?Li(this.view,"pointer"):Hi(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Bn&&this.mightDrag&&!this.mightDrag.node.isAtom||Fn&&!(this.view.state.selection instanceof sn)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ui(this.view,tn.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Li(this.view,"pointer")}move(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),Li(this.view,"pointer"),0==e.buttons&&this.done()}}function Qi(e,t){return!!e.composing||!!(Bn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}_i.touchdown=e=>{Wi(e),Li(e,"pointer")},_i.contextmenu=e=>Wi(e);const Ki=$n?5e3:-1;function Gi(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Xi(e)),t))}function Ji(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Xi(e,t=!1){if(!($n&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Ji(e),t||e.docView&&e.docView.dirty){let t=Gr(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}ji.compositionstart=ji.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),Xi(e,!0),e.markCursor=null;else if(Xi(e),zn&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}Gi(e,Ki)},ji.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Gi(e,20))};const Zi=In&&Ln<15||Un&&Wn<604;function eo(e,t,n,r){let i=Mi(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||fe.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}_i.copy=ji.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=Zi?null:n.clipboardData,s=r.content(),{dom:a,text:l}=xi(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},ji.paste=(e,t)=>{let n=t;if(e.composing&&!$n)return;let r=Zi?null:n.clipboardData;r&&eo(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?eo(e,r.value,null,t):eo(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class to{constructor(e,t){this.slice=e,this.move=t}}const no=Hn?"altKey":"ctrlKey";_i.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Ri(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof ln?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(ln.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(ln.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=xi(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Zi?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Zi||n.dataTransfer.setData("text/plain",l),e.dragging=new to(s,!n[no])},_i.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},ji.dragover=ji.dragenter=(e,t)=>t.preventDefault(),ji.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Ri(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Mi(e,n.dataTransfer.getData(Zi?"Text":"text/plain"),Zi?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[no]);if(e.someProp("handleDrop",(t=>t(e,n,s||fe.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?Bt(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let u=e.state.tr;a&&u.deleteSelection();let c=u.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(p))return;let h=u.doc.resolve(c);if(d&&ln.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new ln(h));else{let t=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),u.setSelection(oi(e,h,u.doc.resolve(t)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))},_i.focus=e=>{e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&Xr(e)}),20))},_i.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},_i.beforeinput=(e,t)=>{if(Fn&&$n&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,nr(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in ji)_i[e]=ji[e];function ro(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class io{constructor(e,t){this.toDOM=e,this.spec=t||uo,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new ao(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof io&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ro(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class oo{constructor(e,t){this.attrs=e,this.spec=t||uo}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new ao(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof oo&&ro(this.attrs,e.attrs)&&ro(this.spec,e.spec)}static is(e){return e.type instanceof oo}destroy(){}}class so{constructor(e,t){this.attrs=e,this.spec=t||uo}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new ao(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof so&&ro(this.attrs,e.attrs)&&ro(this.spec,e.spec)}destroy(){}}class ao{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new ao(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new ao(e,e,new io(t,n))}static inline(e,t,n,r){return new ao(e,t,new oo(n,r))}static node(e,t,n,r){return new ao(e,t,new so(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof oo}}const lo=[],uo={};class co{constructor(e,t){this.local=e.length?e:lo,this.children=t.length?t:lo}static create(e,t){return t.length?yo(t,e,0,uo):po}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==po||0==e.maps.length?this:this.mapInner(e,t,0,0,n||uo)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice(),l=(e,t,n,r)=>{for(let s=0;s<a.length;s+=3){let l,u=a[s+1];if(u<0||e>u+o)continue;let c=a[s]+o;t>=c?a[s+1]=e<=c?-2:-1:n>=i&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l)}};for(let e=0;e<n.maps.length;e++)n.maps[e].forEach(l);let u=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){u=!0,a[t+1]=-1;continue}let l=n.map(e[t]+o),c=l-i;if(c<0||c>=r.content.size){u=!0;continue}let d=n.map(e[t+1]+o,-1)-i,{index:p,offset:h}=r.content.findIndex(c),f=r.maybeChild(p);if(f&&h==c&&h+f.nodeSize==d){let r=a[t+2].mapInner(n,f,l+1,e[t]+o+1,s);r!=po?(a[t]=c,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,u=!0)}else u=!0}if(u){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(r,i,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+o+1);return n}(a,e,t,n,i,o,s),u=yo(l,r,0,s);t=u.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<u.children.length;e+=3){let n=u.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,u.children[e],u.children[e+1],u.children[e+2])}}return new co(t.sort(bo),a)}(this.children,o||[],e,t,n,r,i):o?new co(o.sort(bo),lo):po}add(e,t){return t.length?this==po?co.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,a=o+n;if(s=mo(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,a+1):r.splice(i,0,o,o+e.nodeSize,yo(s,e,a+1,uo)),i+=3}}));let o=fo(i?go(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new co(o.length?this.local.concat(o).sort(bo):this.local,r||this.children)}remove(e){return 0==e.length||this==po?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(i||(i=[])).push(t));if(!i)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(i,o+1);a!=po?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,i=0;i<e.length;i++)if(n=e[i])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new co(r,n):po}forChild(e,t){if(this==po)return this;if(t.isLeaf)return co.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof oo){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new co(r.sort(bo),lo);return n?new ho([e,n]):e}return n||po}eq(e){if(this==e)return!0;if(!(e instanceof co)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return vo(this.localsInner(e))}localsInner(e){if(this==po)return lo;if(e.inlineContent||!this.local.some(oo.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof oo||t.push(this.local[e]);return t}}co.empty=new co([],[]),co.removeOverlap=vo;const po=co.empty;class ho{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,uo)));return ho.from(n)}forChild(e,t){if(t.isLeaf)return co.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=po&&(i instanceof ho?n=n.concat(i.members):n.push(i))}return ho.from(n)}eq(e){if(!(e instanceof ho)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?vo(n?t:t.sort(bo)):lo}static from(e){switch(e.length){case 0:return po;case 1:return e[0];default:return new ho(e)}}}function fo(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new ao(i.from+t,i.to+t,i.type))}return n}function mo(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t,o=0;o<e.length;o++)(t=e[o])&&t.from>n&&t.to<r&&((i||(i=[])).push(t),e[o]=null);return i}function go(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function yo(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=mo(e,t,s+n);if(a){o=!0;let e=yo(a,t,n+s+1,r);e!=po&&i.push(s,s+t.nodeSize,e)}}));let s=fo(o?go(e):e,-n).sort(bo);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new co(s,i):po}function bo(e,t){return e.from-t.from||e.to-t.to}function vo(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),wo(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),wo(t,i+1,o.copy(r.to,o.to)))}}return t}function wo(e,t,n){for(;t<e.length&&bo(n,e[t])>0;)t++;e.splice(t,0,n)}function xo(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=po&&t.push(r)})),e.cursorWrapper&&t.push(co.create(e.state.doc,[e.cursorWrapper.deco])),ho.from(t)}const Mo={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Do=In&&Ln<=11;class ko{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Eo{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ko,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);In&&Ln<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),Do&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&this.observer.observe(this.view.dom,Mo),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(si(this.view)){if(this.suppressingSelectionUpdates)return Xr(this.view);if(In&&Ln<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&Gn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&si(this.view)&&!this.ignoreSelectionChange(t),r=-1,i=-1,o=!1,s=[];if(this.view.editable)for(let t=0;t<e.length;t++){let n=this.registerMutation(e[t],s);n&&(r=r<0?n.from:Math.min(n.from,r),i=i<0?n.to:Math.max(n.to,i),n.typeOver&&(o=!0))}if(zn&&s.length>1){let e=s.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,i),function(e){if(Co)return;Co=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&console["warn"]("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,i,o,s),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||Xr(this.view),this.currentSelection.set(t))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(In&&Ln<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==e.target?qn(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?qn(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let Co=!1;function To(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Bn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Bn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function Oo(e,t,n,r,i){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Gr(e,t);if(n&&!e.state.selection.eq(n)){let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let a=e.state.selection,l=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),u=e.domSelection(),c=u.anchorNode;if(c&&e.dom.contains(1==c.nodeType?c:c.parentNode)&&(r=[{node:c,offset:u.anchorOffset}],tr(u)||r.push({node:u.focusNode,offset:u.focusOffset})),Fn&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let d=e.state.doc,p=e.someProp("domParser")||Xe.fromSchema(e.state.schema),h=d.resolve(a),f=null,m=p.parse(i,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:To,context:h});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n);if(Fn&&e.cursorWrapper&&l.sel&&l.sel.anchor==e.cursorWrapper.deco.from){let t=e.cursorWrapper.deco.type.toDOM.nextSibling,n=t&&t.nodeValue?t.nodeValue.length:1;l.sel={anchor:l.sel.anchor+n,head:l.sel.anchor+n}}let u,c,d=e.state.doc,p=d.slice(l.from,l.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(u=e.state.selection.to,c="end"):(u=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let h=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){r-=s+Math.max(0,o-Math.min(s,a))-o}if(s<o&&e.size<t.size){o-=r<=o&&r>=s?o-r:0,a=o+(a-s),s=o}else if(a<o){o-=r<=o&&r>=a?o-r:0,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(p.content,l.doc.content,l.from,u,c);if((Un&&e.input.lastIOSEnter>Date.now()-225||$n)&&i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",(t=>t(e,nr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!h){if(!(r&&a instanceof sn&&!a.empty&&a.$head.sameParent(a.$anchor))||e.composing||l.sel&&l.sel.anchor!=l.sel.head){if(l.sel){let t=So(e,e.state.doc,l.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}h={start:a.from,endA:a.to,endB:a.to}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&h.start==h.endB&&e.state.selection instanceof sn&&(h.start>e.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?h.start=e.state.selection.from:h.endA<e.state.selection.to&&h.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),In&&Ln<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>l.from&&"  "==l.doc.textBetween(h.start-l.from-1,h.start-l.from+1)&&(h.start--,h.endA--,h.endB--);let f,m=l.doc.resolveNoCache(h.start-l.from),g=l.doc.resolveNoCache(h.endB-l.from),y=d.resolve(h.start),b=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=h.endA;if((Un&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!b&&m.pos<l.doc.content.size&&(f=tn.findFrom(l.doc.resolve(m.pos+1),1,!0))&&f.head==g.pos)&&e.someProp("handleKeyDown",(t=>t(e,nr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>h.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||Ao(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(Ao(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Ao(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(d,h.start,h.endA,m,g)&&e.someProp("handleKeyDown",(t=>t(e,nr(8,"Backspace")))))return void($n&&Fn&&e.domObserver.suppressSelectionUpdates());Fn&&$n&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),$n&&!b&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==h.endA&&(h.endB-=2,g=l.doc.resolveNoCache(h.endB-l.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,nr(13,"Enter"))}))}),20));let v,w,x,M=h.start,D=h.endA;if(b)if(m.pos==g.pos)In&&Ln<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Xr(e)),20)),v=e.state.tr.delete(M,D),w=d.resolve(h.start).marksAcross(d.resolve(h.endA));else if(h.endA==h.endB&&(x=function(e,t){let n,r,i,o=e.firstChild.marks,s=t.firstChild.marks,a=o,l=s;for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);for(let e=0;e<o.length;e++)l=o[e].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let u=[];for(let e=0;e<t.childCount;e++)u.push(i(t.child(e)));if(le.from(u).eq(e))return{mark:r,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,h.endA-y.start()))))v=e.state.tr,"add"==x.type?v.addMark(M,D,x.mark):v.removeMark(M,D,x.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,M,D,t))))return;v=e.state.tr.insertText(t,M,D)}if(v||(v=e.state.tr.replace(M,D,l.doc.slice(h.start-l.from,h.endB-l.from))),l.sel){let t=So(e,v.doc,l.sel);t&&!(Fn&&$n&&e.composing&&t.empty&&(h.start!=h.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==M||t.head==v.mapping.map(D)-1)||In&&t.empty&&t.head==M)&&v.setSelection(t)}w&&v.ensureMarks(w),e.dispatch(v.scrollIntoView())}function So(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:oi(e,t.resolve(n.anchor),t.resolve(n.head))}function Ao(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class No{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Ii,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(zo),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Io(this),jo(this),this.nodeViews=Lo(this),this.docView=Ir(this.state.doc,_o(this),xo(this),this.dom,this),this.domObserver=new Eo(this,((e,t,n,r)=>Oo(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in _i){let n=_i[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Fi(e,t)||Pi(e,t)||!e.editable&&t.type in ji||n(e,t)})}Bn&&e.dom.addEventListener("input",(()=>null)),zi(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&zi(this),this._props=e,e.plugins&&(e.plugins.forEach(zo),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;if(e.storedMarks&&this.composing&&(Ji(this),i=!0),this.state=e,t){let e=Lo(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,r=!0),zi(this)}this.editable=Io(this),jo(this);let o=xo(this),s=_o(this),a=t?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",l=r||!this.docView.matchesNode(e.doc,s,o);!l&&e.selection.eq(n.selection)||(i=!0);let u="preserve"==a&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:ar(e.dom)}}(this);if(i){this.domObserver.stop();let t=l&&(In||Fn)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(l){let n=Fn?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(e.doc,s,o,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Ir(e.doc,s,o,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return Gn(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Xr(this,t):(ri(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(n),"reset"==a)this.dom.scrollTop=0;else if("to selection"==a){let t=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(e.selection instanceof ln){let n=this.docView.domAfterPos(e.selection.from);1==n.nodeType&&sr(this,n.getBoundingClientRect(),t)}else sr(this,this.coordsAtPos(e.selection.head,1),t)}else u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;lr(n,0==r?0:r-t)}(u)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let i=this.directPlugins[r].props[e];if(null!=i&&(n=t?t(i):i))return n}let i=this.state.plugins;if(i)for(let r=0;r<i.length;r++){let o=i[r].props[e];if(null!=o&&(n=t?t(o):o))return n}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(ur)return e.focus(ur);let t=ar(e);e.focus(null==ur?{get preventScroll(){return ur={preventScroll:!0},!0}}:void 0),ur||(ur=!1,lr(t,0))}(this.dom),Xr(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}posAtCoords(e){return hr(this,e)}coordsAtPos(e,t=1){return gr(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return kr(this,t||this.state,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],xo(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Pi(e,t)||!_i[t.type]||!e.editable&&t.type in ji||_i[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function _o(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e&&(t.class+=" "+n[e]),"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),[ao.node(0,e.state.doc.content.size,t)]}function jo(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:ao.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Io(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Lo(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function zo(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Po={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Fo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ro="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Bo="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Uo="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Ho="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),$o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Vo=Ro&&(Ho||+Ro[1]<57)||Uo&&Ho,Wo=0;Wo<10;Wo++)Po[48+Wo]=Po[96+Wo]=String(Wo);for(Wo=1;Wo<=24;Wo++)Po[Wo+111]="F"+Wo;for(Wo=65;Wo<=90;Wo++)Po[Wo]=String.fromCharCode(Wo+32),Fo[Wo]=String.fromCharCode(Wo);for(var qo in Po)Fo.hasOwnProperty(qo)||(Fo[qo]=Po[qo]);const Yo="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Qo(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);Yo?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Ko(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function Go(e){let t=function(e){let t=Object.create(null);for(let n in e)t[Qo(n)]=e[n];return t}(e);return function(e,n){let r,i=function(e){var t=!(Vo&&(e.ctrlKey||e.altKey||e.metaKey)||(Bo||$o)&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Fo:Po)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),o=1==i.length&&" "!=i,s=t[Ko(i,n,!o)];if(s&&s(e.state,e.dispatch,e))return!0;if(o&&(n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=Po[n.keyCode])&&r!=i){let i=t[Ko(r,n,!0)];if(i&&i(e.state,e.dispatch,e))return!0}else if(o&&n.shiftKey){let r=t[Ko(i,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}function Jo(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function Xo(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Zo(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function es(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function ts(e,t,n){let r,i,o=t.nodeBefore,s=t.nodeAfter;if(o.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!i.isTextblock&&!Rt(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(r[0]||s.type).validEnd){if(n){let i=t.pos+s.nodeSize,a=le.empty;for(let e=r.length-1;e>=0;e--)a=le.from(r[e].create(null,a));a=le.from(o.copy(a));let l=e.tr.step(new _t(t.pos-1,i,t.pos,i,new fe(a,1,0),r.length,!0)),u=i+2*r.length;Rt(l.doc,u)&&l.join(u),n(l.scrollIntoView())}return!0}let l=tn.findFrom(t,1),u=l&&l.$from.blockRange(l.$to),c=u&&Lt(u);if(null!=c&&c>=t.depth)return n&&n(e.tr.lift(u,c).scrollIntoView()),!0;if(a&&Jo(s,"start",!0)&&Jo(o,"end")){let r=o,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=le.empty;for(let e=i.length-1;e>=0;e--)r=le.from(i[e].copy(r));n(e.tr.step(new _t(t.pos-i.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new fe(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ns(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(sn.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const rs=ns(-1),is=ns(1);function ss(e,t=null){return function(n,r){let{from:i,to:o}=n.selection,s=!1;return n.doc.nodesBetween(i,o,((r,i)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(i),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0)}}function as(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);l=new Ae(e,e,s.depth),s.endIndex<s.parent.childCount&&(s=new Ae(i,n.doc.resolve(o.end(s.depth)),s.depth)),a=!0}let u=zt(l,e,t,s);return!!u&&(r&&r(function(e,t,n,r,i){let o=le.empty;for(let e=n.length-1;e>=0;e--)o=le.from(n[e].type.create(n[e].attrs,o));e.step(new _t(t.start-(r?2:0),t.end,t.start,t.end,new fe(o,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==i&&(s=e+1);let a=n.length-s,l=t.start+n.length-(r?2:0),u=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&Ft(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=u.child(n).nodeSize;return e}(n.tr,s,u,a,e).scrollIntoView()),!0)}}function ls(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));return!!o&&(!n||(r.node(o.depth-1).type==e?function(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new _t(o-1,s,o,s,new fe(le.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ae(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));return t(i.lift(r,Lt(r)).scrollIntoView()),!0}(t,n,e,o):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,o=n.startIndex;t>o;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?le.empty:le.from(i))))return!1;let d=o.pos,p=d+s.nodeSize;return r.step(new _t(d-(a?1:0),p+(l?1:0),d+1,p-1,new fe((a?le.empty:le.from(i.copy(le.empty))).append(l?le.empty:le.from(i.copy(le.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,o)))}}function us(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class cs{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,l=e||i.tr,u={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return s.push(i),u}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(l),s.every((e=>!0===e)))};return u}createCan(e){const{rawCommands:t,state:n}=this,r=void 0,i=e||n.tr,o=this.buildProps(i,r),s=Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:r})])));return{...s,chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r;i.storedMarks&&e.setStoredMarks(i.storedMarks);const s={tr:e,editor:r,view:o,state:us({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(s)])))}};return s}}function ds(e,t,n){if(void 0===e.config[t]&&e.parent)return ds(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?ds(e.parent,t,n):null})}return e.config[t]}function ps(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function hs(e){const t=[],{nodeExtensions:n,markExtensions:r}=ps(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=ds(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=ds(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...o,...r};r.isRequired&&void 0===r.default&&delete i.default,t.push({type:e.name,name:n,attribute:i})}))})),t}function fs(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function ms(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]="class"===e?[n[e],t].join(" "):"style"===e?[n[e],t].join("; "):t:n[e]=t})),n}),{})}function gs(e,t){return t.filter((e=>e.attribute.rendered)).map((t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]})).reduce(((e,t)=>ms(e,t)),{})}function ys(e){return"function"==typeof e}function bs(e,t=void 0,...n){return ys(e)?t?e.bind(t)(...n):e(...n):e}function vs(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function ws(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function xs(e,t){return t.nodes[e]||t.marks[e]||null}function Ms(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function Ds(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class ks{constructor(e){this.find=e.find,this.handler=e.handler}}function Es(e){var t;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(null===(t=u.nodeBefore||u.nodeAfter)||void 0===t?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let c=!1;const d=((e,t=500)=>{let n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,((t,r,i,o)=>{var s,a,l;n+=(null===(a=(s=t.type.spec).toText)||void 0===a?void 0:a.call(s,{node:t,pos:r,parent:i,index:o}))||(null===(l=e.nodeBefore)||void 0===l?void 0:l.text)||"%leaf%"})),n})(u)+o;return s.forEach((e=>{if(c)return;const t=((e,t)=>{if(Ds(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[];return r.push(n.text),r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(d,e.find);if(!t)return;const s=l.state.tr,u=us({state:l.state,transaction:s}),p={from:r-(t[0].length-o.length),to:i},{commands:h,chain:f,can:m}=new cs({editor:n,state:u});null!==e.handler({state:u,range:p,match:t,commands:h,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:i,text:o}),l.dispatch(s),c=!0)})),c}function Cs(e){const{editor:t,rules:n}=e,r=new kn({state:{init:()=>null,apply(e,t){const n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(e,i,o,s)=>Es({editor:t,from:i,to:o,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&Es({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:o}=e.state.selection;return!!o&&Es({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class Ts{constructor(e){this.find=e.find,this.handler=e.handler}}function Os(e){const{editor:t,state:n,from:r,to:i,rule:o}=e,{commands:s,chain:a,can:l}=new cs({editor:t,state:n}),u=[];n.doc.nodesBetween(r,i,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const c=Math.max(r,t),d=Math.min(i,t+e.content.size),p=((e,t)=>{if(Ds(t))return[...e.matchAll(t)];const n=t(e);return n?n.map((t=>{const n=[];return n.push(t.text),n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]})(e.textBetween(c-t,d-t,void 0,""),o.find);p.forEach((e=>{if(void 0===e.index)return;const t=c+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},d=o.handler({state:n,range:i,match:e,commands:s,chain:a,can:l});u.push(d)}))}));return u.every((e=>null!==e))}function Ss(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1;return n.map((e=>new kn({view(e){const t=t=>{var n;r=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:e=>(o=r===e.dom.parentElement,!1),paste:(e,t)=>{var n;const r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!i,u="drop"===a.getMeta("uiEvent")&&!o;if(!l&&!u)return;const c=r.doc.content.findDiffStart(s.doc.content),d=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof c||!d||c===d.b)return;const p=s.tr,h=us({state:s,transaction:p});return Os({editor:t,state:h,from:Math.max(c-1,0),to:d.b,rule:e})&&p.steps.length?p:void 0}})))}class As{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=As.resolve(e),this.schema=function(e){var t;const n=hs(e),{nodeExtensions:r,markExtensions:i}=ps(e),o=null===(t=r.find((e=>ds(e,"topNode"))))||void 0===t?void 0:t.name,s=Object.fromEntries(r.map((t=>{const r=n.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage},o=e.reduce(((e,n)=>{const r=ds(n,"extendNodeSchema",i);return{...e,...r?r(t):{}}}),{}),s=ws({...o,content:bs(ds(t,"content",i)),marks:bs(ds(t,"marks",i)),group:bs(ds(t,"group",i)),inline:bs(ds(t,"inline",i)),atom:bs(ds(t,"atom",i)),selectable:bs(ds(t,"selectable",i)),draggable:bs(ds(t,"draggable",i)),code:bs(ds(t,"code",i)),defining:bs(ds(t,"defining",i)),isolating:bs(ds(t,"isolating",i)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=bs(ds(t,"parseHTML",i));a&&(s.parseDOM=a.map((e=>vs(e,r))));const l=ds(t,"renderHTML",i);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:gs(e,r)}));const u=ds(t,"renderText",i);return u&&(s.toText=u),[t.name,s]}))),a=Object.fromEntries(i.map((t=>{const r=n.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage},o=e.reduce(((e,n)=>{const r=ds(n,"extendMarkSchema",i);return{...e,...r?r(t):{}}}),{}),s=ws({...o,inclusive:bs(ds(t,"inclusive",i)),excludes:bs(ds(t,"excludes",i)),group:bs(ds(t,"group",i)),spanning:bs(ds(t,"spanning",i)),code:bs(ds(t,"code",i)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=bs(ds(t,"parseHTML",i));a&&(s.parseDOM=a.map((e=>vs(e,r))));const l=ds(t,"renderHTML",i);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:gs(e,r)})),[t.name,s]})));return new Ge({topNode:o,nodes:s,marks:a})}(this.extensions),this.extensions.forEach((e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:xs(e.name,this.schema)};if("mark"===e.type){(null===(t=bs(ds(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const r=ds(e,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const i=ds(e,"onCreate",n);i&&this.editor.on("create",i);const o=ds(e,"onUpdate",n);o&&this.editor.on("update",o);const s=ds(e,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=ds(e,"onTransaction",n);a&&this.editor.on("transaction",a);const l=ds(e,"onFocus",n);l&&this.editor.on("focus",l);const u=ds(e,"onBlur",n);u&&this.editor.on("blur",u);const c=ds(e,"onDestroy",n);c&&this.editor.on("destroy",c)}))}static resolve(e){const t=As.sort(As.flatten(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return[...new Set(t)]}(t.map((e=>e.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e=>`'${e}'`)).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map((e=>{const t=ds(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e})).flat(10)}static sort(e){const t=100;return e.sort(((e,n)=>{const r=ds(e,"priority")||t,i=ds(n,"priority")||t;return r>i?-1:r<i?1:0}))}get commands(){return this.extensions.reduce(((e,t)=>{const n=ds(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:xs(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=As.sort([...this.extensions].reverse()),n=[],r=[],i=t.map((t=>{const i={name:t.name,options:t.options,storage:t.storage,editor:e,type:xs(t.name,this.schema)},o=[],s=ds(t,"addKeyboardShortcuts",i);if(s){const t=function(e){return new kn({props:{handleKeyDown:Go(e)}})}(Object.fromEntries(Object.entries(s()).map((([t,n])=>[t,()=>n({editor:e})]))));o.push(t)}const a=ds(t,"addInputRules",i);Ms(t,e.options.enableInputRules)&&a&&n.push(...a());const l=ds(t,"addPasteRules",i);Ms(t,e.options.enablePasteRules)&&l&&r.push(...l());const u=ds(t,"addProseMirrorPlugins",i);if(u){const e=u();o.push(...e)}return o})).flat();return[Cs({editor:e,rules:n}),...Ss({editor:e,rules:r}),...i]}get attributes(){return hs(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=ps(this.extensions);return Object.fromEntries(t.filter((e=>!!ds(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:fs(t.name,this.schema)},i=ds(t,"addNodeView",r);if(!i)return[];return[t.name,(r,o,s,a)=>{const l=gs(r,n);return i()({editor:e,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:t})}]})))}}function Ns(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function _s(e,t){const n={...e};return Ns(e)&&Ns(t)&&Object.keys(t).forEach((r=>{Ns(t[r])?r in e?n[r]=_s(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})})),n}class js{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=bs(ds(this,"addOptions",{name:this.name}))),this.storage=bs(ds(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new js(e)}configure(e={}){const t=this.extend();return t.options=_s(this.options,e),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new js(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=bs(ds(t,"addOptions",{name:t.name})),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}}function Is(e,t,n){const{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return e.nodesBetween(r,i,((e,n,u,c)=>{var d;const p=null==s?void 0:s[e.type.name];p?(e.isBlock&&!l&&(a+=o,l=!0),u&&(a+=p({node:e,pos:n,parent:u,index:c,range:t}))):e.isText?(a+=null===(d=null==e?void 0:e.text)||void 0===d?void 0:d.slice(Math.max(r,n)-n,i-n),l=!1):e.isBlock&&!l&&(a+=o,l=!0)})),a}function Ls(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}const zs=js.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new kn({key:new Tn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map((e=>e.$from.pos))),a=Math.max(...o.map((e=>e.$to.pos)));return Is(r,{from:s,to:a},{textSerializers:Ls(n)})}}})]}});function Ps(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:Ds(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Fs(e,t,n={}){return e.find((e=>e.type===t&&Ps(e.attrs,n)))}function Rs(e,t,n={}){return!!Fs(e,t,n)}function Bs(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=Fs([...r.node.marks],t,n);if(!i)return;let o=r.index,s=e.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(Fs([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,s-=e.parent.child(o).nodeSize;for(;a<e.parent.childCount&&Rs([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Us(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function Hs(e){return e&&"object"==typeof e&&!Array.isArray(e)&&!function(e){var t;return"class"===(null===(t=e.constructor)||void 0===t?void 0:t.toString().substring(0,5))}(e)}function $s(e){return Hs(e)&&e instanceof sn}function Vs(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Ws(e,t=null){if(!t)return null;const n=tn.atStart(e),r=tn.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const i=n.from,o=r.to;return"all"===t?sn.create(e,Vs(0,i,o),Vs(e.content.size,i,o)):sn.create(e,Vs(t,i,o),Vs(t,i,o))}function qs(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ys(e){const t=`<body>${e}</body>`;return(new window.DOMParser).parseFromString(t,"text/html").body}function Qs(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)?le.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Qs("",t,n)}if("string"==typeof e){const r=Xe.fromSchema(t);return n.slice?r.parseSlice(Ys(e),n.parseOptions).content:r.parse(Ys(e),n.parseOptions)}return Qs("",t,n)}function Ks(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Gs(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,s=t?fs(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:o})}));const l=i-r,u=a.filter((e=>!s||s.name===e.node.type.name)).filter((e=>Ps(e.node.attrs,n,{strict:!1})));if(o)return!!u.length;return u.reduce(((e,t)=>e+t.to-t.from),0)>=l}function Js(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Xs(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}function Zs(e,t,n={}){return Qs(e,t,{slice:!1,parseOptions:n})}function ea(e,t){const n=Us(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function ta(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}function na(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}function ra(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function ia(e,t){const{nodeExtensions:n}=ps(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=bs(ds(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}const oa=(e,t)=>{const n=ra((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!Rt(e.doc,n.pos)||(e.join(n.pos),!0)},sa=(e,t)=>{const n=ra((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!Rt(e.doc,r)||(e.join(r),!0)};function aa(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Us(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!o||o.name===e.type.name)).find((e=>Ps(e.attrs,n,{strict:!1})));let s=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);s+=o-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:o}))))}))})),0===s)return!1;const l=a.filter((e=>!o||o.name===e.mark.type.name)).filter((e=>Ps(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),u=a.filter((e=>!o||e.mark.type!==o&&e.mark.type.excludes(o))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+u:l)>=s}var la=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return!n||(i.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),a=o.blockRange(s);if(!a)return;const l=Lt(a);if(e.type.isTextblock){const{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof cn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=es(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(sn.create(s.doc,n+1)),t(s.scrollIntoView())}return!0})(e,t),deleteNode:e=>({tr:t,state:n,dispatch:r})=>{const i=fs(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1){if(o.node(e).type===i){if(r){const n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},deleteSelection:()=>({state:e,dispatch:t})=>((e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0))(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=es(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(tn.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0})(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Us(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const e=Bs(l,o,t);if(e&&e.from<=u&&e.to>=c){const t=sn.create(s,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},focus:(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{qs()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(o&&null===e&&!$s(n.state.selection))return s(),!0;const a=Ws(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const i=Qs(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===i.toString())return!0;let{from:s,to:a}="number"==typeof e?{from:e,to:e}:e,l=!0,u=!0;if((i.toString().startsWith("<")?i:[i]).forEach((e=>{e.check(),l=!!l&&(e.isText&&0===e.marks.length),u=!!u&&e.isBlock})),s===a&&u){const{parent:e}=r.doc.resolve(s);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(s-=1,a+=1)}l?r.insertText(t,s,a):r.replaceWith(s,a,i),n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Nt||i instanceof _t))return;const o=e.mapping.maps[r];let s=0;o.forEach(((e,t,n,r)=>{0===s&&(s=r)})),e.setSelection(tn.near(e.doc.resolve(s),n))}(r,r.steps.length-1,-1)}return!0},joinBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=Xo(r);if(!i){let n=r.blockRange(),i=n&&Lt(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&ts(e,i,t))return!0;if(0==r.parent.content.size&&(Jo(o,"end")||ln.isSelectable(o))){let n=Ut(e.doc,r.before(),r.after(),fe.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Jo(o,"end")?tn.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):ln.create(r.doc,i.pos-o.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),0))})(e,t),joinForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;let i=Zo(r);if(!i)return!1;let o=i.nodeAfter;if(ts(e,i,t))return!0;if(0==r.parent.content.size&&(Jo(o,"start")||ln.isSelectable(o))){let n=Ut(e.doc,r.before(),r.after(),fe.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Jo(o,"start")?tn.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):ln.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),0))})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=function(e){const t=e.split(/-(?!$)/);let n,r,i,o,s=t[t.length-1];"Space"===s&&(s=" ");for(let e=0;e<t.length-1;e+=1){const s=t[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);qs()||Ks()?o=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),o&&(s=`Meta-${s}`),i&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=o.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:r})=>!!Gs(n,fs(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Lt(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:e,dispatch:t})=>((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Ft(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Lt(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)})(e,t),liftListItem:e=>({state:t,dispatch:n})=>ls(fs(e,t.schema))(t,n),newlineInCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))})(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Js("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=fs(e,r.schema)),"mark"===a&&(s=Us(e,r.schema)),i&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,Xs(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((i=>{s===i.type&&n.addMark(r,r+e.nodeSize,s.create(Xs(i.attrs,t)))}))}))})),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),selectNodeBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=Xo(r)}let s=o&&o.nodeBefore;return!(!s||!ln.isSelectable(s)||(t&&t(e.tr.setSelection(ln.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),0))})(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=Zo(r)}let s=o&&o.nodeAfter;return!(!s||!ln.isSelectable(s)||(t&&t(e.tr.setSelection(ln.create(e.doc,o.pos)).scrollIntoView()),0))})(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:i}=e.selection,o=r.sharedDepth(i);return 0!=o&&(n=r.before(o),t&&t(e.tr.setSelection(ln.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>is(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>rs(e,t),setContent:(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,a=Zs(e,i.schema,n);return o&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Us(e,r.schema);if(i)if(s){const e=ea(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,((e,r)=>{const s=Math.max(r,i),a=Math.min(r+e.nodeSize,o);e.marks.find((e=>e.type===l))?e.marks.forEach((e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))})):n.addMark(s,a,l.create(t))}))}));return!0},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=fs(e,n.schema);return o.isTextblock?i().command((({commands:e})=>!!ss(o,t)(n)||e.clearNodes())).command((({state:e})=>ss(o,t)(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=tn.atStart(n).from,i=tn.atEnd(n).to,o=Vs(e,r,i),s=ln.create(n,o);t.setSelection(s)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=sn.atStart(n).from,s=sn.atEnd(n).to,a=Vs(r,o,s),l=Vs(i,o,s),u=sn.create(n,a,l);t.setSelection(u)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const r=fs(e,t.schema);return(i=r,function(e,t){let{$from:n,$to:r}=e.selection,o=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==i));if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=i)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,r=le.from(n?i.create():null),s=new fe(le.from(i.create(null,le.from(a.type.create(null,r)))),n?3:1,0),u=o.start,c=o.end;t(e.tr.step(new _t(u-(n?3:1),c,u,c,s,1,!0)).scrollIntoView())}return!0})(t,n);var i},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=t,{$from:a,$to:l}=o,u=ta(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(o instanceof ln&&o.node.isBlock)return!(!a.parentOffset||!Ft(s,a.pos))&&(r&&(e&&na(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;o instanceof sn&&t.deleteSelection();const s=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let c=r&&s?[{type:s,attrs:u}]:void 0,d=Ft(t.doc,t.mapping.map(a.pos),1,c);if(c||d||!Ft(t.doc,t.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(d=!0,c=s?[{type:s,attrs:u}]:void 0),d&&(t.split(t.mapping.map(a.pos),1,c),s&&!r&&!a.parentOffset&&a.parent.type!==s)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&t.setNodeMarkup(t.mapping.map(a.before()),s)}e&&na(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},splitListItem:e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const s=fs(e,n.schema),{$from:a,$to:l}=n.selection,u=n.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const d=i.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let e=le.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-n;t>=a.depth-3;t-=1)e=le.from(a.node(t).copy(e));const r=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,i=ta(d,a.node().type.name,a.node().attrs),l=(null===(o=s.contentMatch.defaultType)||void 0===o?void 0:o.createAndFill(i))||void 0;e=e.append(le.from(s.createAndFill(null,l)||void 0));const u=a.before(a.depth-(n-1));t.replace(u,a.after(-r),new fe(e,4-n,0));let c=-1;t.doc.nodesBetween(u,t.doc.content.size,((e,t)=>{if(c>-1)return!1;e.isTextblock&&0===e.content.size&&(c=t+1)})),c>-1&&t.setSelection(sn.near(t.doc.resolve(c))),t.scrollIntoView()}return!0}const p=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,h=ta(d,c.type.name,c.attrs),f=ta(d,a.node().type.name,a.node().attrs);t.delete(a.pos,l.pos);const m=p?[{type:s,attrs:h},{type:p,attrs:f}]:[{type:s,attrs:h}];return!!Ft(t.doc,a.pos,2)&&(r&&t.split(a.pos,2,m).scrollIntoView(),!0)},toggleList:(e,t)=>({editor:n,tr:r,state:i,dispatch:o,chain:s,commands:a,can:l})=>{const{extensions:u}=n.extensionManager,c=fs(e,i.schema),d=fs(t,i.schema),{selection:p}=i,{$from:h,$to:f}=p,m=h.blockRange(f);if(!m)return!1;const g=ra((e=>ia(e.type.name,u)))(p);if(m.depth>=1&&g&&m.depth-g.depth<=1){if(g.node.type===c)return a.liftListItem(d);if(ia(g.node.type.name,u)&&c.validContent(g.node.content)&&o)return s().command((()=>(r.setNodeMarkup(g.pos,c),!0))).command((()=>oa(r,c))).command((()=>sa(r,c))).run()}return s().command((()=>!!l().wrapInList(c)||a.clearNodes())).wrapInList(c).command((()=>oa(r,c))).command((()=>sa(r,c))).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Us(e,r.schema);return aa(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=fs(e,r.schema),s=fs(t,r.schema);return Gs(r,o,n)?i.setNode(s):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=fs(e,n.schema);return Gs(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const t=e.tr,n=o.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(o.text){const n=t.doc.resolve(o.from).marks();t.replaceWith(o.from,o.to,e.schema.text(o.text,n))}else t.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=Us(e,r.schema),{$from:u,empty:c,ranges:d}=a;if(!i)return!0;if(c&&s){let{from:e,to:t}=a;const r=null===(o=u.marks().find((e=>e.type===l)))||void 0===o?void 0:o.attrs,i=Bs(u,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else d.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Js("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=fs(e,r.schema)),"mark"===a&&(s=Us(e,r.schema)),i&&n.selection.ranges.forEach((e=>{const i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach((o=>{if(s===o.type){const l=Math.max(r,i),u=Math.min(r+e.nodeSize,a);n.addMark(l,u,s.create({...o.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&zt(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(fs(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>as(fs(e,n.schema),t)(n,r)});const ua=js.create({name:"commands",addCommands:()=>({...la})}),ca=js.create({name:"editable",addProseMirrorPlugins(){return[new kn({key:new Tn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),da=js.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new kn({key:new Tn("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),pa=js.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:a}=o,l=tn.atStart(r).from===s;return!(!(i&&l&&a.type.isTextblock)||a.textContent.length)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>e.joinForward(),()=>e.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return qs()||Ks()?i:r},addProseMirrorPlugins(){return[new kn({key:new Tn("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:r,from:i,to:o}=t.selection,s=tn.atStart(t.doc).from,a=tn.atEnd(t.doc).to,l=i===s&&o===a,u=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(r||!l||!u)return;const c=n.tr,d=us({state:n,transaction:c}),{commands:p}=new cs({editor:this.editor,state:d});return p.clearNodes(),c.steps.length?c:void 0}})]}}),ha=js.create({name:"tabindex",addProseMirrorPlugins(){return[new kn({key:new Tn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var fa=Object.freeze({__proto__:null,ClipboardTextSerializer:zs,Commands:ua,Editable:ca,FocusEvents:da,Keymap:pa,Tabindex:ha});function ma(e,t){const n=Js("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=fs(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,(e=>{o.push(e)}));const s=o.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?ea(e,t):{}}const ga=`.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}`;function ya(e,t){const n=[];return e.descendants(((e,r)=>{t(e)&&n.push({node:e,pos:r})})),n}function ba(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.some((t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}))}function va(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const i=Bs(n.resolve(e-1),t.type);i&&r.push({mark:t,...i})})):n.nodesBetween(e,t,((e,t)=>{r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function wa(e,t,n){const r=0,i=e.state.doc.content.size,o=Vs(t,r,i),s=Vs(n,r,i),a=e.coordsAtPos(o),l=e.coordsAtPos(s,-1),u=Math.min(a.top,l.top),c=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),p=Math.max(a.right,l.right),h={top:u,bottom:c,left:d,right:p,width:p-d,height:c-u,x:d,y:u};return{...h,toJSON:()=>h}}function xa(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length,d=va(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>u));if(d.length)return null;c<n.to&&o.delete(c,n.to),u>n.from&&o.delete(n.from+r,u),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function Ma(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let a=n.to;if(r[1]){let t=s+r[0].lastIndexOf(r[1]);t>a?t=a:a=t+r[1].length;const n=r[0][r[0].length-1];o.insertText(n,s+r[0].length-1),o.replaceWith(t,a,e.type.create(i))}else r[0]&&o.replaceWith(s,a,e.type.create(i))}})}function Da(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=bs(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function ka(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,o=n.from;const s=n.to;if(r[1]){const e=r[0].lastIndexOf(r[1]);i+=r[0].slice(e+r[1].length),o+=e;const t=o-s;t>0&&(i=r[0].slice(e-t,e)+i,o=s)}t.tr.insertText(i,o,s)}})}function Ea(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),a=s&&zt(s,e.type,i);if(!a)return null;o.wrap(s,a);const l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Rt(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)}})}class Ca{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=bs(ds(this,"addOptions",{name:this.name}))),this.storage=bs(ds(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ca(e)}configure(e={}){const t=this.extend();return t.options=_s(this.options,e),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ca(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=bs(ds(t,"addOptions",{name:t.name})),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}}class Ta{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=bs(ds(this,"addOptions",{name:this.name}))),this.storage=bs(ds(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ta(e)}configure(e={}){const t=this.extend();return t.options=_s(this.options,e),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ta(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=bs(ds(t,"addOptions",{name:t.name})),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}}function Oa(e){return new Ts({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length,d=va(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>u));if(d.length)return null;c<n.to&&o.delete(c,n.to),u>n.from&&o.delete(n.from+r,u),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}var Sa="top",Aa="bottom",Na="right",_a="left",ja="auto",Ia=[Sa,Aa,Na,_a],La="start",za="end",Pa="clippingParents",Fa="viewport",Ra="popper",Ba="reference",Ua=Ia.reduce((function(e,t){return e.concat([t+"-"+La,t+"-"+za])}),[]),Ha=[].concat(Ia,[ja]).reduce((function(e,t){return e.concat([t,t+"-"+La,t+"-"+za])}),[]),$a=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Va(e){return e?(e.nodeName||"").toLowerCase():null}function Wa(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function qa(e){return e instanceof Wa(e).Element||e instanceof Element}function Ya(e){return e instanceof Wa(e).HTMLElement||e instanceof HTMLElement}function Qa(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Wa(e).ShadowRoot||e instanceof ShadowRoot)}var Ka={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];Ya(i)&&Va(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});Ya(r)&&Va(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Ga(e){return e.split("-")[0]}var Ja=Math.max,Xa=Math.min,Za=Math.round;function el(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(Ya(e)&&t){var o=e.offsetHeight,s=e.offsetWidth;s>0&&(r=Za(n.width)/s||1),o>0&&(i=Za(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function tl(e){var t=el(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function nl(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Qa(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function rl(e){return Wa(e).getComputedStyle(e)}function il(e){return["table","td","th"].indexOf(Va(e))>=0}function ol(e){return((qa(e)?e.ownerDocument:e.document)||window.document).documentElement}function sl(e){return"html"===Va(e)?e:e.assignedSlot||e.parentNode||(Qa(e)?e.host:null)||ol(e)}function al(e){return Ya(e)&&"fixed"!==rl(e).position?e.offsetParent:null}function ll(e){for(var t=Wa(e),n=al(e);n&&il(n)&&"static"===rl(n).position;)n=al(n);return n&&("html"===Va(n)||"body"===Va(n)&&"static"===rl(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&Ya(e)&&"fixed"===rl(e).position)return null;var n=sl(e);for(Qa(n)&&(n=n.host);Ya(n)&&["html","body"].indexOf(Va(n))<0;){var r=rl(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function ul(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function cl(e,t,n){return Ja(e,Xa(t,n))}function dl(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function pl(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var hl={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ga(n.placement),l=ul(a),u=[_a,Na].indexOf(a)>=0?"height":"width";if(o&&s){var c=function(e,t){return dl("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:pl(e,Ia))}(i.padding,n),d=tl(o),p="y"===l?Sa:_a,h="y"===l?Aa:Na,f=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],g=ll(o),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=f/2-m/2,v=c[p],w=y-d[u]-c[h],x=y/2-d[u]/2+b,M=cl(v,x,w),D=l;n.modifiersData[r]=((t={})[D]=M,t.centerOffset=M-x,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&nl(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fl(e){return e.split("-")[1]}var ml={top:"auto",right:"auto",bottom:"auto",left:"auto"};function gl(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,p=s.x,h=void 0===p?0:p,f=s.y,m=void 0===f?0:f,g="function"==typeof c?c({x:h,y:m}):{x:h,y:m};h=g.x,m=g.y;var y=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),v=_a,w=Sa,x=window;if(u){var M=ll(n),D="clientHeight",k="clientWidth";if(M===Wa(n)&&"static"!==rl(M=ol(n)).position&&"absolute"===a&&(D="scrollHeight",k="scrollWidth"),i===Sa||(i===_a||i===Na)&&o===za)w=Aa,m-=(d&&M===x&&x.visualViewport?x.visualViewport.height:M[D])-r.height,m*=l?1:-1;if(i===_a||(i===Sa||i===Aa)&&o===za)v=Na,h-=(d&&M===x&&x.visualViewport?x.visualViewport.width:M[k])-r.width,h*=l?1:-1}var E,C=Object.assign({position:a},u&&ml),T=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Za(t*r)/r||0,y:Za(n*r)/r||0}}({x:h,y:m}):{x:h,y:m};return h=T.x,m=T.y,l?Object.assign({},C,((E={})[w]=b?"0":"",E[v]=y?"0":"",E.transform=(x.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",E)):Object.assign({},C,((t={})[w]=b?m+"px":"",t[v]=y?h+"px":"",t.transform="",t))}var yl={passive:!0};var bl={left:"right",right:"left",bottom:"top",top:"bottom"};function vl(e){return e.replace(/left|right|bottom|top/g,(function(e){return bl[e]}))}var wl={start:"end",end:"start"};function xl(e){return e.replace(/start|end/g,(function(e){return wl[e]}))}function Ml(e){var t=Wa(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Dl(e){return el(ol(e)).left+Ml(e).scrollLeft}function kl(e){var t=rl(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function El(e){return["html","body","#document"].indexOf(Va(e))>=0?e.ownerDocument.body:Ya(e)&&kl(e)?e:El(sl(e))}function Cl(e,t){var n;void 0===t&&(t=[]);var r=El(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=Wa(r),s=i?[o].concat(o.visualViewport||[],kl(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(Cl(sl(s)))}function Tl(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ol(e,t){return t===Fa?Tl(function(e){var t=Wa(e),n=ol(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,s=0,a=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:i,height:o,x:s+Dl(e),y:a}}(e)):qa(t)?function(e){var t=el(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):Tl(function(e){var t,n=ol(e),r=Ml(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Ja(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ja(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Dl(e),l=-r.scrollTop;return"rtl"===rl(i||n).direction&&(a+=Ja(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(ol(e)))}function Sl(e,t,n){var r="clippingParents"===t?function(e){var t=Cl(sl(e)),n=["absolute","fixed"].indexOf(rl(e).position)>=0&&Ya(e)?ll(e):e;return qa(n)?t.filter((function(e){return qa(e)&&nl(e,n)&&"body"!==Va(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],s=i.reduce((function(t,n){var r=Ol(e,n);return t.top=Ja(r.top,t.top),t.right=Xa(r.right,t.right),t.bottom=Xa(r.bottom,t.bottom),t.left=Ja(r.left,t.left),t}),Ol(e,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Al(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Ga(i):null,s=i?fl(i):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case Sa:t={x:a,y:n.y-r.height};break;case Aa:t={x:a,y:n.y+n.height};break;case Na:t={x:n.x+n.width,y:l};break;case _a:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=o?ul(o):null;if(null!=u){var c="y"===u?"height":"width";switch(s){case La:t[u]=t[u]-(n[c]/2-r[c]/2);break;case za:t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}function Nl(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,s=void 0===o?Pa:o,a=n.rootBoundary,l=void 0===a?Fa:a,u=n.elementContext,c=void 0===u?Ra:u,d=n.altBoundary,p=void 0!==d&&d,h=n.padding,f=void 0===h?0:h,m=dl("number"!=typeof f?f:pl(f,Ia)),g=c===Ra?Ba:Ra,y=e.rects.popper,b=e.elements[p?g:c],v=Sl(qa(b)?b:b.contextElement||ol(e.elements.popper),s,l),w=el(e.elements.reference),x=Al({reference:w,element:y,strategy:"absolute",placement:i}),M=Tl(Object.assign({},y,x)),D=c===Ra?M:w,k={top:v.top-D.top+m.top,bottom:D.bottom-v.bottom+m.bottom,left:v.left-D.left+m.left,right:D.right-v.right+m.right},E=e.modifiersData.offset;if(c===Ra&&E){var C=E[i];Object.keys(k).forEach((function(e){var t=[Na,Aa].indexOf(e)>=0?1:-1,n=[Sa,Aa].indexOf(e)>=0?"y":"x";k[e]+=C[n]*t}))}return k}function _l(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?Ha:l,c=fl(r),d=c?a?Ua:Ua.filter((function(e){return fl(e)===c})):Ia,p=d.filter((function(e){return u.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=Nl(e,{placement:n,boundary:i,rootBoundary:o,padding:s})[Ga(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var jl={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,g=t.options.placement,y=Ga(g),b=l||(y===g||!f?[vl(g)]:function(e){if(Ga(e)===ja)return[];var t=vl(e);return[xl(e),t,xl(t)]}(g)),v=[g].concat(b).reduce((function(e,n){return e.concat(Ga(n)===ja?_l(t,{placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,x=t.rects.popper,M=new Map,D=!0,k=v[0],E=0;E<v.length;E++){var C=v[E],T=Ga(C),O=fl(C)===La,S=[Sa,Aa].indexOf(T)>=0,A=S?"width":"height",N=Nl(t,{placement:C,boundary:c,rootBoundary:d,altBoundary:p,padding:u}),_=S?O?Na:_a:O?Aa:Sa;w[A]>x[A]&&(_=vl(_));var j=vl(_),I=[];if(o&&I.push(N[T]<=0),a&&I.push(N[_]<=0,N[j]<=0),I.every((function(e){return e}))){k=C,D=!1;break}M.set(C,I)}if(D)for(var L=function(e){var t=v.find((function(t){var n=M.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},z=f?3:1;z>0;z--){if("break"===L(z))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Il(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Ll(e){return[Sa,Na,Aa,_a].some((function(t){return e[t]>=0}))}var zl={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,s=Ha.reduce((function(e,n){return e[n]=function(e,t,n){var r=Ga(e),i=[_a,Sa].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[_a,Na].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,o),e}),{}),a=s[t.placement],l=a.x,u=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}};var Pl={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,p=n.tether,h=void 0===p||p,f=n.tetherOffset,m=void 0===f?0:f,g=Nl(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),y=Ga(t.placement),b=fl(t.placement),v=!b,w=ul(y),x="x"===w?"y":"x",M=t.modifiersData.popperOffsets,D=t.rects.reference,k=t.rects.popper,E="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,C="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(M){if(o){var S,A="y"===w?Sa:_a,N="y"===w?Aa:Na,_="y"===w?"height":"width",j=M[w],I=j+g[A],L=j-g[N],z=h?-k[_]/2:0,P=b===La?D[_]:k[_],F=b===La?-k[_]:-D[_],R=t.elements.arrow,B=h&&R?tl(R):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},H=U[A],$=U[N],V=cl(0,D[_],B[_]),W=v?D[_]/2-z-V-H-C.mainAxis:P-V-H-C.mainAxis,q=v?-D[_]/2+z+V+$+C.mainAxis:F+V+$+C.mainAxis,Y=t.elements.arrow&&ll(t.elements.arrow),Q=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,K=null!=(S=null==T?void 0:T[w])?S:0,G=j+q-K,J=cl(h?Xa(I,j+W-K-Q):I,j,h?Ja(L,G):L);M[w]=J,O[w]=J-j}if(a){var X,Z="x"===w?Sa:_a,ee="x"===w?Aa:Na,te=M[x],ne="y"===x?"height":"width",re=te+g[Z],ie=te-g[ee],oe=-1!==[Sa,_a].indexOf(y),se=null!=(X=null==T?void 0:T[x])?X:0,ae=oe?re:te-D[ne]-k[ne]-se+C.altAxis,le=oe?te+D[ne]+k[ne]-se-C.altAxis:ie,ue=h&&oe?function(e,t,n){var r=cl(e,t,n);return r>n?n:r}(ae,te,le):cl(h?ae:re,te,h?le:ie);M[x]=ue,O[x]=ue-te}t.modifiersData[r]=O}},requiresIfExists:["offset"]};function Fl(e,t,n){void 0===n&&(n=!1);var r,i,o=Ya(t),s=Ya(t)&&function(e){var t=e.getBoundingClientRect(),n=Za(t.width)/e.offsetWidth||1,r=Za(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=ol(t),l=el(e,s),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==Va(t)||kl(a))&&(u=(r=t)!==Wa(r)&&Ya(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:Ml(r)),Ya(t)?((c=el(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=Dl(a))),{x:l.left+u.scrollLeft-c.x,y:l.top+u.scrollTop-c.y,width:l.width,height:l.height}}function Rl(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var Bl={placement:"bottom",modifiers:[],strategy:"absolute"};function Ul(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Hl(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?Bl:i;return function(e,t,n){void 0===n&&(n=o);var i,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Bl,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],u=!1,c={state:a,setOptions:function(n){var i="function"==typeof n?n(a.options):n;d(),a.options=Object.assign({},o,a.options,i),a.scrollParents={reference:qa(e)?Cl(e):e.contextElement?Cl(e.contextElement):[],popper:Cl(t)};var s=function(e){var t=Rl(e);return $a.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,a.options.modifiers)));return a.orderedModifiers=s.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:a,name:t,instance:c,options:r}),s=function(){};l.push(o||s)}})),c.update()},forceUpdate:function(){if(!u){var e=a.elements,t=e.reference,n=e.popper;if(Ul(t,n)){a.rects={reference:Fl(t,ll(n),"fixed"===a.options.strategy),popper:tl(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],o=i.fn,s=i.options,l=void 0===s?{}:s,d=i.name;"function"==typeof o&&(a=o({state:a,options:l,name:d,instance:c})||a)}else a.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){c.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){d(),u=!0}};if(!Ul(e,t))return c;function d(){l.forEach((function(e){return e()})),l=[]}return c.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),c}}var $l=Hl({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,s=r.resize,a=void 0===s||s,l=Wa(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach((function(e){e.addEventListener("scroll",n.update,yl)})),a&&l.addEventListener("resize",n.update,yl),function(){o&&u.forEach((function(e){e.removeEventListener("scroll",n.update,yl)})),a&&l.removeEventListener("resize",n.update,yl)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Al({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,u={placement:Ga(t.placement),variation:fl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,gl(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,gl(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Ka,zl,jl,Pl,hl,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=Nl(t,{elementContext:"reference"}),a=Nl(t,{altBoundary:!0}),l=Il(s,r),u=Il(a,i,o),c=Ll(l),d=Ll(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}}]}),Vl='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',Wl="tippy-box",ql="tippy-content",Yl="tippy-backdrop",Ql="tippy-arrow",Kl="tippy-svg-arrow",Gl={passive:!0,capture:!0},Jl=function(){return document.body};function Xl(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Zl(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function eu(e,t){return"function"==typeof e?e.apply(void 0,t):e}function tu(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function nu(e){return[].concat(e)}function ru(e,t){-1===e.indexOf(t)&&e.push(t)}function iu(e){return[].slice.call(e)}function ou(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function su(){return document.createElement("div")}function au(e){return["Element","Fragment"].some((function(t){return Zl(e,t)}))}function lu(e){return Zl(e,"MouseEvent")}function uu(e){return au(e)?[e]:function(e){return Zl(e,"NodeList")}(e)?iu(e):Array.isArray(e)?e:iu(document.querySelectorAll(e))}function cu(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function du(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function pu(e){var t,n=nu(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function hu(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function fu(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var mu={isTouch:!1},gu=0;function yu(){mu.isTouch||(mu.isTouch=!0,window.performance&&document.addEventListener("mousemove",bu))}function bu(){var e=performance.now();e-gu<20&&(mu.isTouch=!1,document.removeEventListener("mousemove",bu)),gu=e}function vu(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var wu=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,xu=Object.assign({appendTo:Jl,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Mu=Object.keys(xu);function Du(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=xu[i])?r:o);return t}),{});return Object.assign({},e,t)}function ku(e,t){var n=Object.assign({},t,{content:eu(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Du(Object.assign({},xu,{plugins:t}))):Mu).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},xu.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function Eu(e,t){e["innerHTML"]=t}function Cu(e){var t=su();return!0===e?t.className=Ql:(t.className=Kl,au(e)?t.appendChild(e):Eu(t,e)),t}function Tu(e,t){au(t.content)?(Eu(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Eu(e,t.content):e.textContent=t.content)}function Ou(e){var t=e.firstElementChild,n=iu(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(ql)})),arrow:n.find((function(e){return e.classList.contains(Ql)||e.classList.contains(Kl)})),backdrop:n.find((function(e){return e.classList.contains(Yl)}))}}function Su(e){var t=su(),n=su();n.className=Wl,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=su();function i(n,r){var i=Ou(t),o=i.box,s=i.content,a=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Tu(s,e.props),r.arrow?a?n.arrow!==r.arrow&&(o.removeChild(a),o.appendChild(Cu(r.arrow))):o.appendChild(Cu(r.arrow)):a&&o.removeChild(a)}return r.className=ql,r.setAttribute("data-state","hidden"),Tu(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}Su.$$tippy=!0;var Au=1,Nu=[],_u=[];function ju(e,t){var n,r,i,o,s,a,l,u,c=ku(e,Object.assign({},xu,Du(ou(t)))),d=!1,p=!1,h=!1,f=!1,m=[],g=tu(Y,c.interactiveDebounce),y=Au++,b=(u=c.plugins).filter((function(e,t){return u.indexOf(e)===t})),v={id:y,reference:e,popper:su(),popperInstance:null,props:c,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){if(v.state.isDestroyed)return;j("onBeforeUpdate",[v,t]),W();var n=v.props,r=ku(e,Object.assign({},n,ou(t),{ignoreAttributes:!0}));v.props=r,V(),n.interactiveDebounce!==r.interactiveDebounce&&(z(),g=tu(Y,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?nu(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");L(),_(),M&&M(n,r);v.popperInstance&&(J(),Z().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));j("onAfterUpdate",[v,t])},setContent:function(e){v.setProps({content:e})},show:function(){var e=v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=mu.isTouch&&!v.props.touch,i=Xl(v.props.duration,0,xu.duration);if(e||t||n||r)return;if(O().hasAttribute("disabled"))return;if(j("onShow",[v],!1),!1===v.props.onShow(v))return;v.state.isVisible=!0,T()&&(x.style.visibility="visible");_(),B(),v.state.isMounted||(x.style.transition="none");if(T()){var o=A(),s=o.box,l=o.content;cu([s,l],0)}a=function(){var e;if(v.state.isVisible&&!f){if(f=!0,x.offsetHeight,x.style.transition=v.props.moveTransition,T()&&v.props.animation){var t=A(),n=t.box,r=t.content;cu([n,r],i),du([n,r],"visible")}I(),L(),ru(_u,v),null==(e=v.popperInstance)||e.forceUpdate(),j("onMount",[v]),v.props.animation&&T()&&function(e,t){H(e,t)}(i,(function(){v.state.isShown=!0,j("onShown",[v])}))}},function(){var e,t=v.props.appendTo,n=O();e=v.props.interactive&&t===Jl||"parent"===t?n.parentNode:eu(t,[n]);e.contains(x)||e.appendChild(x);v.state.isMounted=!0,J()}()},hide:function(){var e=!v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=Xl(v.props.duration,1,xu.duration);if(e||t||n)return;if(j("onHide",[v],!1),!1===v.props.onHide(v))return;v.state.isVisible=!1,v.state.isShown=!1,f=!1,d=!1,T()&&(x.style.visibility="hidden");if(z(),U(),_(!0),T()){var i=A(),o=i.box,s=i.content;v.props.animation&&(cu([o,s],r),du([o,s],"hidden"))}I(),L(),v.props.animation?T()&&function(e,t){H(e,(function(){!v.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,v.unmount):v.unmount()},hideWithInteractivity:function(e){S().addEventListener("mousemove",g),ru(Nu,g),g(e)},enable:function(){v.state.isEnabled=!0},disable:function(){v.hide(),v.state.isEnabled=!1},unmount:function(){v.state.isVisible&&v.hide();if(!v.state.isMounted)return;X(),Z().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);_u=_u.filter((function(e){return e!==v})),v.state.isMounted=!1,j("onHidden",[v])},destroy:function(){if(v.state.isDestroyed)return;v.clearDelayTimeouts(),v.unmount(),W(),delete e._tippy,v.state.isDestroyed=!0,j("onDestroy",[v])}};if(!c.render)return v;var w=c.render(v),x=w.popper,M=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+v.id,v.popper=x,e._tippy=v,x._tippy=v;var D=b.map((function(e){return e.fn(v)})),k=e.hasAttribute("aria-expanded");return V(),L(),_(),j("onCreate",[v]),c.showOnCreate&&ee(),x.addEventListener("mouseenter",(function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&S().addEventListener("mousemove",g)})),v;function E(){var e=v.props.touch;return Array.isArray(e)?e:[e,0]}function C(){return"hold"===E()[0]}function T(){var e;return!(null==(e=v.props.render)||!e.$$tippy)}function O(){return l||e}function S(){var e=O().parentNode;return e?pu(e):document}function A(){return Ou(x)}function N(e){return v.state.isMounted&&!v.state.isVisible||mu.isTouch||o&&"focus"===o.type?0:Xl(v.props.delay,e?0:1,xu.delay)}function _(e){void 0===e&&(e=!1),x.style.pointerEvents=v.props.interactive&&!e?"":"none",x.style.zIndex=""+v.props.zIndex}function j(e,t,n){var r;(void 0===n&&(n=!0),D.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=v.props)[e].apply(r,t)}function I(){var t=v.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;nu(v.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(v.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function L(){!k&&v.props.aria.expanded&&nu(v.props.triggerTarget||e).forEach((function(e){v.props.interactive?e.setAttribute("aria-expanded",v.state.isVisible&&e===O()?"true":"false"):e.removeAttribute("aria-expanded")}))}function z(){S().removeEventListener("mousemove",g),Nu=Nu.filter((function(e){return e!==g}))}function P(t){if(!mu.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!v.props.interactive||!fu(x,n)){if(nu(v.props.triggerTarget||e).some((function(e){return fu(e,n)}))){if(mu.isTouch)return;if(v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[v,t]);!0===v.props.hideOnClick&&(v.clearDelayTimeouts(),v.hide(),p=!0,setTimeout((function(){p=!1})),v.state.isMounted||U())}}}function F(){h=!0}function R(){h=!1}function B(){var e=S();e.addEventListener("mousedown",P,!0),e.addEventListener("touchend",P,Gl),e.addEventListener("touchstart",R,Gl),e.addEventListener("touchmove",F,Gl)}function U(){var e=S();e.removeEventListener("mousedown",P,!0),e.removeEventListener("touchend",P,Gl),e.removeEventListener("touchstart",R,Gl),e.removeEventListener("touchmove",F,Gl)}function H(e,t){var n=A().box;function r(e){e.target===n&&(hu(n,"remove",r),t())}if(0===e)return t();hu(n,"remove",s),hu(n,"add",r),s=r}function $(t,n,r){void 0===r&&(r=!1),nu(v.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),m.push({node:e,eventType:t,handler:n,options:r})}))}function V(){var e;C()&&($("touchstart",q,{passive:!0}),$("touchend",Q,{passive:!0})),(e=v.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch($(e,q),e){case"mouseenter":$("mouseleave",Q);break;case"focus":$(wu?"focusout":"blur",K);break;case"focusin":$("focusout",K)}}))}function W(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),m=[]}function q(e){var t,n=!1;if(v.state.isEnabled&&!G(e)&&!p){var r="focus"===(null==(t=o)?void 0:t.type);o=e,l=e.currentTarget,L(),!v.state.isVisible&&lu(e)&&Nu.forEach((function(t){return t(e)})),"click"===e.type&&(v.props.trigger.indexOf("mouseenter")<0||d)&&!1!==v.props.hideOnClick&&v.state.isVisible?n=!0:ee(e),"click"===e.type&&(d=!n),n&&!r&&te(e)}}function Y(e){var t=e.target,n=O().contains(t)||x.contains(t);if("mousemove"!==e.type||!n){var r=Z().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:c}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,s=i.placement.split("-")[0],a=i.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,u="top"===s?a.bottom.y:0,c="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=t.top-r+l>o,h=r-t.bottom-u>o,f=t.left-n+c>o,m=n-t.right-d>o;return p||h||f||m}))})(r,e)&&(z(),te(e))}}function Q(e){G(e)||v.props.trigger.indexOf("click")>=0&&d||(v.props.interactive?v.hideWithInteractivity(e):te(e))}function K(e){v.props.trigger.indexOf("focusin")<0&&e.target!==O()||v.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function G(e){return!!mu.isTouch&&C()!==e.type.indexOf("touch")>=0}function J(){X();var t=v.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,s=t.moveTransition,l=T()?Ou(x).arrow:null,u=o?{getBoundingClientRect:o,contextElement:o.contextElement||O()}:e,c={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(T()){var n=A().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},d=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},c];T()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),v.popperInstance=$l(u,x,Object.assign({},n,{placement:r,onFirstUpdate:a,modifiers:d}))}function X(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Z(){return iu(x.querySelectorAll("[data-tippy-root]"))}function ee(e){v.clearDelayTimeouts(),e&&j("onTrigger",[v,e]),B();var t=N(!0),r=E(),i=r[0],o=r[1];mu.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){v.show()}),t):v.show()}function te(e){if(v.clearDelayTimeouts(),j("onUntrigger",[v,e]),v.state.isVisible){if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=N(!1);t?r=setTimeout((function(){v.state.isVisible&&v.hide()}),t):i=requestAnimationFrame((function(){v.hide()}))}}else U()}}function Iu(e,t){void 0===t&&(t={});var n=xu.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",yu,Gl),window.addEventListener("blur",vu);var r=Object.assign({},t,{plugins:n}),i=uu(e).reduce((function(e,t){var n=t&&ju(t,r);return n&&e.push(n),e}),[]);return au(e)?i[0]:i}Iu.defaultProps=xu,Iu.setDefaultProps=function(e){Object.keys(e).forEach((function(t){xu[t]=e[t]}))},Iu.currentInput=mu,Object.assign({},Ka,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});var Lu={clientX:0,clientY:0},zu=[];function Pu(e){var t=e.clientX,n=e.clientY;Lu={clientX:t,clientY:n}}var Fu={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=pu(e.props.triggerTarget||t),r=!1,i=!1,o=!0,s=e.props;function a(){return"initial"===e.props.followCursor&&e.state.isVisible}function l(){n.addEventListener("mousemove",d)}function u(){n.removeEventListener("mousemove",d)}function c(){r=!0,e.setProps({getReferenceClientRect:null}),r=!1}function d(n){var r=!n.target||t.contains(n.target),i=e.props.followCursor,o=n.clientX,s=n.clientY,a=t.getBoundingClientRect(),l=o-a.left,u=s-a.top;!r&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=o,r=s;"initial"===i&&(n=e.left+l,r=e.top+u);var a="horizontal"===i?e.top:r,c="vertical"===i?e.right:n,d="horizontal"===i?e.bottom:r,p="vertical"===i?e.left:n;return{width:c-p,height:d-a,top:a,right:c,bottom:d,left:p}}})}function p(){e.props.followCursor&&(zu.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",Pu)}(n))}function h(){zu=zu.filter((function(t){return t.instance!==e})),0===zu.filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",Pu)}(n)}return{onCreate:p,onDestroy:h,onBeforeUpdate:function(){s=e.props},onAfterUpdate:function(t,n){var o=n.followCursor;r||void 0!==o&&s.followCursor!==o&&(h(),o?(p(),!e.state.isMounted||i||a()||l()):(u(),c()))},onMount:function(){e.props.followCursor&&!i&&(o&&(d(Lu),o=!1),a()||l())},onTrigger:function(e,t){lu(t)&&(Lu={clientX:t.clientX,clientY:t.clientY}),i="focus"===t.type},onHidden:function(){e.props.followCursor&&(c(),u(),o=!0)}}}};Iu.setDefaultProps({render:Su});class Ru{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:r})=>{const{doc:i,selection:o}=t,{empty:s}=o,a=!i.textBetween(n,r).length&&$s(t.selection);return!(!e.hasFocus()||s||a)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=Iu(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,r,i;const{state:o,composing:s}=e,{doc:a,selection:l}=o,u=t&&t.doc.eq(a)&&t.selection.eq(l);if(s||u)return;this.createTooltip();const{ranges:c}=l,d=Math.min(...c.map((e=>e.$from.pos))),p=Math.max(...c.map((e=>e.$to.pos)));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:o,oldState:t,from:d,to:p}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(i=this.tippyOptions)||void 0===i?void 0:i.getReferenceClientRect)||(()=>{if(Hs(t=o.selection)&&t instanceof ln){const t=e.nodeDOM(d);if(t)return t.getBoundingClientRect()}var t;return wa(e,d,p)})}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Bu=e=>new kn({key:"string"==typeof e.pluginKey?new Tn(e.pluginKey):e.pluginKey,view:t=>new Ru({view:t,...e})});js.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[Bu({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class Uu{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{const{selection:n}=t,{$anchor:r,empty:i}=n,o=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;return!!(e.hasFocus()&&i&&o&&s)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=Iu(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,r,i;const{state:o}=e,{doc:s,selection:a}=o,{from:l,to:u}=a;if(t&&t.doc.eq(s)&&t.selection.eq(a))return;this.createTooltip();(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:o,oldState:t}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(i=this.tippyOptions)||void 0===i?void 0:i.getReferenceClientRect)||(()=>wa(e,l,u))}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}js.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[(e={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow},new kn({key:"string"==typeof e.pluginKey?new Tn(e.pluginKey):e.pluginKey,view:t=>new Uu({view:t,...e})}))]:[];var e}});const Hu=e=>{const[n,r]=i(null);return o((()=>{if(!n)return;if(e.editor.isDestroyed)return;const{pluginKey:t="bubbleMenu",editor:r,tippyOptions:i={},shouldShow:o=null}=e,s=Bu({pluginKey:t,editor:r,element:n,tippyOptions:i,shouldShow:o});return r.registerPlugin(s),()=>r.unregisterPlugin(t)}),[e.editor,n]),t.createElement("div",{ref:r,className:e.className,style:{visibility:"hidden"}},e.children)};class $u extends class extends class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(e,t){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}(ga,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e){this.setOptions({editable:e})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=ys(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(e){if(this.isDestroyed)return;const t="string"==typeof e?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((e=>!e.key.startsWith(t)))});this.view.updateState(n)}createExtensionManager(){const e=[...this.options.enableCoreExtensions?Object.values(fa):[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new As(e,this)}createCommandManager(){this.commandManager=new cs({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Zs(this.options.content,this.schema,this.options.parseOptions),t=Ws(e,this.options.autofocus);this.view=new No(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Mn.create({doc:e,selection:t||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews();this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null===(t=this.capturedTransaction)||void 0===t?void 0:t.step(e)})):void(this.capturedTransaction=e);const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const r=e.getMeta("focus"),i=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return ma(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return Gs(e,null,n)||aa(e,null,n);const r=Js(t,e.schema);return"node"===r?Gs(e,t,n):"mark"===r&&aa(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(e,t){const n=dt.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return Is(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...n,...Ls(this.schema)}})}get isEmpty(){return function(e){var t;const n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}{constructor(){super(...arguments),this.contentComponent=null}}const Vu=({renderers:e})=>t.createElement(t.Fragment,null,Array.from(e).map((([e,t])=>h.createPortal(t.reactElement,t.element,e))));class Wu extends t.Component{constructor(e){super(e),this.editorContentRef=t.createRef(),this.state={renderers:new Map}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews()}}componentWillUnmount(){const{editor:e}=this.props;if(!e)return;if(e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild)return;const t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){const{editor:e,...n}=this.props;return t.createElement(t.Fragment,null,t.createElement("div",{ref:this.editorContentRef,...n}),t.createElement(Vu,{renderers:this.state.renderers}))}}const qu=t.memo(Wu),Yu=n({onDragStart:void 0}),Qu=()=>r(Yu),Ku=e=>{const n=e.as||"div",{nodeViewContentRef:r}=Qu();return t.createElement(n,{...e,ref:r,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style}})},Gu=t.forwardRef(((e,n)=>{const{onDragStart:r}=Qu(),i=e.as||"div";return t.createElement(i,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})}));class Ju{constructor(e,{editor:t,props:n={},as:r="div",className:i=""}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.render()}render(){var e;const n=this.component,r=this.props;(function(e){return!("function"!=typeof e||!e.prototype||!e.prototype.isReactComponent)}(n)||function(e){var t;return!("object"!=typeof e||"Symbol(react.forward_ref)"!==(null===(t=e.$$typeof)||void 0===t?void 0:t.toString()))}(n))&&(r.ref=e=>{this.ref=e}),this.reactElement=t.createElement(n,{...r}),(null===(e=this.editor)||void 0===e?void 0:e.contentComponent)&&this.editor.contentComponent.setState({renderers:this.editor.contentComponent.state.renderers.set(this.id,this)})}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;if(null===(e=this.editor)||void 0===e?void 0:e.contentComponent){const{renderers:e}=this.editor.contentComponent.state;e.delete(this.id),this.editor.contentComponent.setState({renderers:e})}}}class Xu extends class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,a;const{view:l}=this.editor,u=e.target,c=3===u.nodeType?null===(t=u.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(u))||!c)return;let d=0,p=0;if(this.dom!==c){const t=this.dom.getBoundingClientRect(),n=c.getBoundingClientRect(),a=null!==(r=e.offsetX)&&void 0!==r?r:null===(i=e.nativeEvent)||void 0===i?void 0:i.offsetX,l=null!==(o=e.offsetY)&&void 0!==o?o:null===(s=e.nativeEvent)||void 0===s?void 0:s.offsetY;d=n.x-t.x+a,p=n.y-t.y+l}null===(a=e.dataTransfer)||void 0===a||a.setDragImage(this.dom,d,p);const h=ln.create(l.state.doc,this.getPos()),f=l.state.tr.setSelection(h);l.dispatch(f)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(n))))return!1;const r="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!r)return!0;const{isEditable:i}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,a=ln.isSelectable(this.node),l="copy"===e.type,u="paste"===e.type,c="cut"===e.type,d="mousedown"===e.type,p=e.type.startsWith("drag");if(!s&&a&&p&&e.preventDefault(),s&&p&&!o)return e.preventDefault(),!1;if(s&&i&&!o&&d){const e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(()=>{this.isDragging=!1}),{once:!0}))}return!(o||r||l||u||c||d&&a)}ignoreMutation(e){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:e});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&qs()&&this.editor.isFocused){if([...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every((e=>e.isContentEditable)))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command((({tr:t})=>{const n=this.getPos();return t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0}))}deleteNode(){const e=this.getPos(),t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}const n=e=>{const n=this.component,r=this.onDragStart.bind(this);return t.createElement(Yu.Provider,{value:{onDragStart:r,nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&e.appendChild(this.contentDOMElement)}}},t.createElement(n,{...e}))};n.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let r=this.node.isInline?"span":"div";this.options.as&&(r=this.options.as);const{className:i=""}=this.options;this.renderer=new Ju(n,{editor:this.editor,props:e,as:r,className:`node-${this.node.type.name} ${i}`.trim()})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null===(e=this.renderer.element.firstElementChild)||void 0===e?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,t){const n=e=>{this.renderer.updateProps(e)};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){const r=this.node,i=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:r,oldDecorations:i,newNode:e,newDecorations:t,updateProps:()=>n({node:e,decorations:t})})}return e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,n({node:e,decorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function Zu(e,t){return n=>n.editor.contentComponent?new Xu(e,n,t):{}}const ec=(e={},t=[])=>{const[n,r]=i(null),s=function(){const[,e]=i(0);return()=>e((e=>e+1))}();return o((()=>{let t=!0;const n=new $u(e);return r(n),n.on("transaction",(()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t&&s()}))}))})),()=>{n.destroy(),t=!1}}),t),n};var tc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function nc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function rc(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var ic,oc={exports:{}};
1
+ import*as e from"react";import t,{createContext as n,useContext as r,useState as i,useEffect as o,forwardRef as s,cloneElement as a,useLayoutEffect as l,useRef as u,useCallback as c,useImperativeHandle as d}from"react";import*as p from"react-dom";import h,{createPortal as f,flushSync as m}from"react-dom";import g from"highlight.js/lib/languages/arduino";import y from"highlight.js/lib/languages/bash";import b from"highlight.js/lib/languages/c";import v from"highlight.js/lib/languages/cpp";import w from"highlight.js/lib/languages/csharp";import x from"highlight.js/lib/languages/css";import M from"highlight.js/lib/languages/diff";import D from"highlight.js/lib/languages/go";import k from"highlight.js/lib/languages/graphql";import E from"highlight.js/lib/languages/ini";import C from"highlight.js/lib/languages/java";import T from"highlight.js/lib/languages/javascript";import O from"highlight.js/lib/languages/json";import S from"highlight.js/lib/languages/kotlin";import A from"highlight.js/lib/languages/less";import N from"highlight.js/lib/languages/lua";import _ from"highlight.js/lib/languages/makefile";import j from"highlight.js/lib/languages/markdown";import I from"highlight.js/lib/languages/objectivec";import L from"highlight.js/lib/languages/perl";import z from"highlight.js/lib/languages/php";import P from"highlight.js/lib/languages/php-template";import F from"highlight.js/lib/languages/plaintext";import R from"highlight.js/lib/languages/python";import B from"highlight.js/lib/languages/python-repl";import U from"highlight.js/lib/languages/r";import H from"highlight.js/lib/languages/ruby";import $ from"highlight.js/lib/languages/rust";import V from"highlight.js/lib/languages/scss";import W from"highlight.js/lib/languages/shell";import q from"highlight.js/lib/languages/sql";import Y from"highlight.js/lib/languages/swift";import Q from"highlight.js/lib/languages/typescript";import K from"highlight.js/lib/languages/vbnet";import G from"highlight.js/lib/languages/wasm";import J from"highlight.js/lib/languages/xml";import X from"highlight.js/lib/languages/yaml";import Z from"highlight.js/lib/core";import ee from"highlight.js/lib/common";var te=[],ne=[];function re(e,t){if(e&&"undefined"!=typeof document){var n,r=!0===t.prepend?"prepend":"append",i=!0===t.singleTag,o="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(i){var s=te.indexOf(o);-1===s&&(s=te.push(o)-1,ne[s]={}),n=ne[s]&&ne[s][r]?ne[s][r]:ne[s][r]=a()}else n=a();65279===e.charCodeAt(0)&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function a(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var n=Object.keys(t.attributes),i=0;i<n.length;i++)e.setAttribute(n[i],t.attributes[n[i]]);var s="prepend"===r?"afterbegin":"beforeend";return o.insertAdjacentElement(s,e),e}}function ie(){return ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ie.apply(this,arguments)}function oe(e){this.content=e}function se(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let e=0;i.text[e]==o.text[e];e++)n++;return n}if(i.content.size||o.content.size){let e=se(i.content,o.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function ae(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let e=ae(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}re('@charset "UTF-8";\n@import url("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/night-owl.min.css");\n/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n/* Document\n ========================================================================== */\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n/* Sections\n ========================================================================== */\n/**\n * Remove the margin in all browsers.\n */\nbody {\n margin: 0;\n}\n/**\n * Render the `main` element consistently in IE.\n */\nmain {\n display: block;\n}\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\n/* Grouping content\n ========================================================================== */\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n/* Text-level semantics\n ========================================================================== */\n/**\n * Remove the gray background on active links in IE 10.\n */\na {\n background-color: transparent;\n}\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted; /* 2 */\n}\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\nb,\nstrong {\n font-weight: bolder;\n}\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n/**\n * Add the correct font size in all browsers.\n */\nsmall {\n font-size: 80%;\n}\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * all browsers.\n */\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\nsub {\n bottom: -0.25em;\n}\nsup {\n top: -0.5em;\n}\n/* Embedded content\n ========================================================================== */\n/**\n * Remove the border on images inside links in IE 10.\n */\nimg {\n border-style: none;\n}\n/* Forms\n ========================================================================== */\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\nbutton,\ninput {\n /* 1 */\n overflow: visible;\n}\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\nbutton,\nselect {\n /* 1 */\n text-transform: none;\n}\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\nbutton,\n[type=button],\n[type=reset],\n[type=submit] {\n -webkit-appearance: button;\n}\n/**\n * Remove the inner border and padding in Firefox.\n */\nbutton::-moz-focus-inner,\n[type=button]::-moz-focus-inner,\n[type=reset]::-moz-focus-inner,\n[type=submit]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n/**\n * Restore the focus styles unset by the previous rule.\n */\nbutton:-moz-focusring,\n[type=button]:-moz-focusring,\n[type=reset]:-moz-focusring,\n[type=submit]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n/**\n * Correct the padding in Firefox.\n */\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * `fieldset` elements in all browsers.\n */\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\nprogress {\n vertical-align: baseline;\n}\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\ntextarea {\n overflow: auto;\n}\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n[type=checkbox],\n[type=radio] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n[type=number]::-webkit-inner-spin-button,\n[type=number]::-webkit-outer-spin-button {\n height: auto;\n}\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n[type=search] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n[type=search]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n/* Interactive\n ========================================================================== */\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\ndetails {\n display: block;\n}\n/*\n * Add the correct display in all browsers.\n */\nsummary {\n display: list-item;\n}\n/* Misc\n ========================================================================== */\n/**\n * Add the correct display in IE 10+.\n */\ntemplate {\n display: none;\n}\n/**\n * Add the correct display in IE 10.\n */\n[hidden] {\n display: none;\n}\nbutton {\n background-color: transparent;\n background-image: none;\n}\nbody {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.3;\n color: #222;\n}\nbody *,\nbody *::after,\nbody *::before {\n box-sizing: border-box;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n@-webkit-keyframes shake {\n 0% {\n transform: translateX(0);\n }\n 10% {\n transform: translateX(-4px);\n }\n 20% {\n transform: translateX(4px);\n }\n 30% {\n transform: translateX(-4px);\n }\n 40% {\n transform: translateX(4px);\n }\n 50% {\n transform: translateX(-4px);\n }\n 60% {\n transform: translateX(4px);\n }\n 70% {\n transform: translateX(-4px);\n }\n 80% {\n transform: translateX(4px);\n }\n 90% {\n transform: translateX(-4px);\n }\n 100% {\n transform: translateX(0);\n }\n}\n@keyframes shake {\n 0% {\n transform: translateX(0);\n }\n 10% {\n transform: translateX(-4px);\n }\n 20% {\n transform: translateX(4px);\n }\n 30% {\n transform: translateX(-4px);\n }\n 40% {\n transform: translateX(4px);\n }\n 50% {\n transform: translateX(-4px);\n }\n 60% {\n transform: translateX(4px);\n }\n 70% {\n transform: translateX(-4px);\n }\n 80% {\n transform: translateX(4px);\n }\n 90% {\n transform: translateX(-4px);\n }\n 100% {\n transform: translateX(0);\n }\n}\n@-webkit-keyframes fade-in {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@-webkit-keyframes spin {\n 0% {\n transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.ne-dropdown__popup {\n width: auto;\n max-height: 445px;\n max-width: 360px;\n overflow-y: auto;\n background-color: #ffffff;\n border-radius: 2px;\n border: thin solid #f8f9f9;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n padding: 4px 0;\n z-index: 99999;\n}\n.ne-dropdown__popup li,\n.ne-dropdown__popup .ne-dropdown--item {\n display: flex;\n cursor: pointer;\n position: relative;\n white-space: nowrap;\n transition: all 0.3s ease-in-out;\n font-size: 14px;\n font-weight: 400;\n color: #2f3941;\n padding: 8px 40px 8px 16px;\n text-decoration: none;\n outline-color: transparent;\n}\n.ne-dropdown__popup li.disabled,\n.ne-dropdown__popup .ne-dropdown--item.disabled {\n cursor: not-allowed;\n color: #87929d;\n}\n.ne-dropdown__popup li:hover, .ne-dropdown__popup li:focus,\n.ne-dropdown__popup .ne-dropdown--item:hover,\n.ne-dropdown__popup .ne-dropdown--item:focus {\n background-color: #e9ebed;\n}\n.ne-dropdown__popup li.loading:not(.active):after,\n.ne-dropdown__popup .ne-dropdown--item.loading:not(.active):after {\n content: "";\n position: absolute;\n right: 16px;\n top: 0;\n bottom: 0;\n margin: auto;\n width: 16px;\n height: 16px;\n display: block;\n border-radius: 50%;\n border: solid 2px #e9ebed;\n border-top-color: #1b1f23;\n border-left-color: #1b1f23;\n -webkit-animation: theme("animation.spin");\n animation: theme("animation.spin");\n}\n.ne-dropdown__popup li.active,\n.ne-dropdown__popup .ne-dropdown--item.active {\n background-color: #2f3941;\n color: #ffffff;\n}\n.ne-avatar--container {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 2px;\n position: relative;\n}\n.ne-avatar--container.ne-avatar--container-round {\n border-radius: 999px;\n}\n.ne-avatar--container .ne-avatar__text {\n font-weight: 600;\n text-align: center;\n text-transform: capitalize;\n font-size: 10px;\n color: #68737d;\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-medium {\n font-size: 12px;\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-large {\n font-size: 18px;\n}\n.ne-avatar--container .ne-avatar__text.ne-avatar__text-xlarge {\n font-size: 24px;\n}\n.ne-avatar--container .ne-avatar__status {\n position: absolute;\n right: 0;\n top: 0;\n width: 0.4rem;\n height: 0.4rem;\n background-color: white;\n border: 0.5px solid white;\n border-radius: 999px;\n transform: translateX(-40%);\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-medium {\n width: 0.465rem;\n height: 0.465rem;\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-large {\n width: 0.563rem;\n height: 0.563rem;\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-xlarge {\n width: 0.75rem;\n height: 0.75rem;\n transform: translateX(-65%);\n}\n.ne-avatar--container .ne-avatar__status.ne-avatar__status-square {\n transform: translate(25%, -25%);\n}\n.ne-avatar--container .ne-avatar__status.online {\n background-color: #00ba88;\n}\n.ne-avatar--container .ne-avatar__status.idle {\n background-color: #f3cd82;\n}\n.ne-avatar--container .ne-avatar__status.offline {\n background-color: #d8dcde;\n}\n.ne-avatar--container .ne-avatar {\n display: inline-block;\n border-radius: 2px;\n height: 1.5rem;\n width: 1.5rem;\n}\n.ne-avatar--container .ne-avatar.hidden {\n display: none;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--medium {\n height: 2rem;\n width: 2rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--large {\n height: 2.5rem;\n width: 2.5rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--xlarge {\n height: 4rem;\n width: 4rem;\n}\n.ne-avatar--container .ne-avatar.ne-avatar--round {\n border-radius: 999px;\n}\n.ne-tab__wrapper {\n width: 100%;\n border-bottom: 1px solid #d8dcde;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n}\n.ne-tab__wrapper--size-large .ne-tab {\n font-size: 20px;\n padding-left: 12px;\n padding-right: 12px;\n}\n.ne-tab__wrapper--underline-none {\n border-bottom: none;\n}\n.ne-tab__wrapper--underline-none .ne-tab::before {\n display: none;\n}\n.ne-tab {\n color: #87929d;\n font-weight: 600;\n font-size: 14px;\n line-height: 1;\n padding: 12px 8px;\n transition: all 0.3s ease-in-out;\n position: relative;\n cursor: pointer;\n text-decoration: none;\n outline: none;\n}\n.ne-tab:hover, .ne-tab:focus, .ne-tab:focus-visible, .ne-tab:active {\n text-decoration: none;\n outline: none;\n}\n.ne-tab__icon {\n margin-right: 12px;\n}\n.ne-tab svg {\n width: 16px;\n height: 16px;\n}\n.ne-tab:hover {\n color: #68737d;\n}\n.ne-tab:before {\n content: "";\n position: absolute;\n width: 100%;\n height: 1px;\n background-color: transparent;\n left: 0;\n right: 0;\n bottom: -1px;\n transition: all 0.3s ease-in-out;\n}\n.ne-tab.active {\n color: #2f3941;\n}\n.ne-tab.active:before {\n background-color: #2f3941;\n}\n.ne-btn {\n display: inline-flex;\n align-items: center;\n font-size: 14px;\n font-weight: 500;\n border-radius: 2px;\n line-height: 1.2;\n transition: all 0.3s ease-in-out;\n border: none;\n cursor: pointer;\n padding: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n padding: 4px 8px;\n min-height: 28px;\n letter-spacing: -0.15px;\n outline: none;\n}\n.ne-btn--icon-only {\n padding-left: 6px;\n padding-right: 6px;\n}\n.ne-btn:focus, .ne-btn:focus-visible {\n outline: none;\n}\n.ne-btn:hover {\n text-decoration: none;\n}\n.ne-btn.disabled {\n cursor: not-allowed;\n opacity: 0.4;\n}\n.ne-btn .ne-btn__icon:last-child:not(:first-child),\n.ne-btn .ne-btn__spinner:last-child:not(:first-child) {\n margin-left: 8px;\n}\n.ne-btn--icon-left {\n flex-direction: row-reverse;\n}\n.ne-btn--icon-left .ne-btn__icon:last-child:not(:first-child),\n.ne-btn--icon-left .ne-btn__spinner:last-child:not(:first-child) {\n margin-right: 8px;\n margin-left: 0;\n}\n.ne-btn__icon,\n.ne-btn__spinner,\n.ne-btn__spinner-wrapper {\n color: inherit;\n}\n.ne-btn__icon svg,\n.ne-btn__spinner svg,\n.ne-btn__spinner-wrapper svg {\n color: inherit !important;\n}\n.ne-btn--width-full {\n width: 100% !important;\n justify-content: center;\n}\n.ne-btn--size-large {\n font-size: 16px;\n padding: 6px 12px;\n min-height: 32px;\n}\n.ne-btn--size-large.ne-btn--icon-only {\n padding-left: 8px;\n padding-right: 8px;\n}\n.ne-btn--style-primary {\n color: #ffffff;\n background-color: #2f3941;\n}\n.ne-btn--style-primary:hover:not(:disabled), .ne-btn--style-primary:active {\n color: #ffffff;\n background-color: #49545c;\n}\n.ne-btn--style-primary:focus-visible {\n color: #ffffff;\n box-shadow: 0 0 0 3px #e5e5e5;\n}\n.ne-btn--style-secondary {\n color: #2f3941;\n background-color: #e9ebed;\n}\n.ne-btn--style-secondary:hover:not(:disabled), .ne-btn--style-secondary:active {\n color: #2f3941;\n background-color: #c2c8cc;\n}\n.ne-btn--style-secondary:focus-visible {\n color: #2f3941;\n box-shadow: 0 0 0 3px #e5e5e5;\n}\n.ne-btn--style-text {\n color: #2f3941;\n}\n.ne-btn--style-text:hover:not(:disabled), .ne-btn--style-text:active {\n color: #2f3941;\n background-color: #e9ebed;\n}\n.ne-btn--style-text:focus-visible {\n color: #2f3941;\n box-shadow: 0 0 0 3px #e5e5e5;\n}\n.ne-btn--style-link {\n color: #5e5ce6;\n min-height: initial;\n padding: 0;\n}\n.ne-btn--style-link:hover:not(:disabled), .ne-btn--style-link:active, .ne-btn--style-link:focus {\n opacity: 0.8;\n color: #5e5ce6;\n}\n.ne-btn--style-link:focus-visible {\n color: #1c1aa9;\n}\n.ne-btn--style-danger {\n color: #f56a58;\n background-color: #ffefed;\n}\n.ne-btn--style-danger:hover:not(:disabled), .ne-btn--style-danger:active {\n color: #f56a58;\n background-color: #ffe4e0;\n}\n.ne-btn--style-danger:focus-visible {\n color: #f56a58;\n box-shadow: 0 0 0 3px #ffe4e0;\n}\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0;\n}\n[data-tippy-root] {\n max-width: calc(100vw - 10px);\n}\n.tippy-box {\n position: relative;\n background-color: #2f3941;\n color: #ffffff;\n border-radius: 2px;\n font-size: 12px;\n line-height: 1.4;\n outline: 0;\n transition-property: transform, visibility, opacity;\n}\n.tippy-box[data-placement^=top] > .tippy-arrow {\n bottom: 0;\n}\n.tippy-box[data-placement^=top] > .tippy-arrow:before {\n bottom: -7px;\n left: 0;\n border-width: 8px 8px 0;\n border-top-color: initial;\n transform-origin: center top;\n}\n.tippy-box[data-placement^=bottom] > .tippy-arrow {\n top: 0;\n}\n.tippy-box[data-placement^=bottom] > .tippy-arrow:before {\n top: -7px;\n left: 0;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n transform-origin: center bottom;\n}\n.tippy-box[data-placement^=left] > .tippy-arrow {\n right: 0;\n}\n.tippy-box[data-placement^=left] > .tippy-arrow:before {\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n right: -7px;\n transform-origin: center left;\n}\n.tippy-box[data-placement^=right] > .tippy-arrow {\n left: 0;\n}\n.tippy-box[data-placement^=right] > .tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n transform-origin: center right;\n}\n.tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);\n}\n.tippy-arrow {\n width: 16px;\n height: 16px;\n color: #2f3941;\n}\n.tippy-arrow:before {\n content: "";\n position: absolute;\n border-color: transparent;\n border-style: solid;\n}\n.tippy-content {\n position: relative;\n padding: 5px 9px;\n z-index: 1;\n}\n.tippy-box[data-placement^=top] > .tippy-svg-arrow {\n bottom: 0;\n}\n.tippy-box[data-placement^=top] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=top] > .tippy-svg-arrow > svg {\n top: 16px;\n transform: rotate(180deg);\n}\n.tippy-box[data-placement^=bottom] > .tippy-svg-arrow {\n top: 0;\n}\n.tippy-box[data-placement^=bottom] > .tippy-svg-arrow > svg {\n bottom: 16px;\n}\n.tippy-box[data-placement^=left] > .tippy-svg-arrow {\n right: 0;\n}\n.tippy-box[data-placement^=left] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=left] > .tippy-svg-arrow > svg {\n transform: rotate(90deg);\n top: calc(50% - 3px);\n left: 13px;\n}\n.tippy-box[data-placement^=right] > .tippy-svg-arrow {\n left: 0;\n}\n.tippy-box[data-placement^=right] > .tippy-svg-arrow:after,\n.tippy-box[data-placement^=right] > .tippy-svg-arrow > svg {\n transform: rotate(-90deg);\n top: calc(50% - 3px);\n right: 13px;\n}\n.tippy-svg-arrow {\n width: 16px;\n height: 16px;\n fill: #2f3941;\n text-align: initial;\n}\n.tippy-svg-arrow,\n.tippy-svg-arrow > svg {\n position: absolute;\n}\n.tippy-svg-arrow > svg > path {\n fill: #2f3941;\n}\n.tippy-box[data-theme~=light] .tippy-svg-arrow > svg > path {\n fill: #ffffff;\n}\n.tippy-box[data-theme~=light] {\n color: #2f3941;\n box-shadow: 0 0 20px 4px rgba(154, 161, 177, 0.15), 0 4px 80px -8px rgba(36, 40, 47, 0.25), 0 4px 4px -2px rgba(91, 94, 105, 0.15);\n background-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=top] > .tippy-arrow:before {\n border-top-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=bottom] > .tippy-arrow:before {\n border-bottom-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=left] > .tippy-arrow:before {\n border-left-color: #ffffff;\n}\n.tippy-box[data-theme~=light][data-placement^=right] > .tippy-arrow:before {\n border-right-color: #ffffff;\n}\n.tippy-box[data-theme~=light] > .tippy-backdrop {\n background-color: #ffffff;\n}\n.tippy-box[data-theme~=light] > .tippy-svg-arrow {\n fill: #ffffff;\n}\n.ne-input__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n flex-grow: 1;\n}\n.ne-input__wrapper .ne-label {\n margin-bottom: 4px;\n}\n.ne-input__wrapper .ne-input {\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n font-size: 14px;\n line-height: 1.6;\n transition: all 0.3s ease-in-out;\n border-radius: 2px;\n border: thin solid #c2c8cc;\n background-color: #ffffff;\n color: #2f3941;\n overflow: hidden;\n}\n.ne-input__wrapper .ne-input.ne-input--textarea {\n padding: 8px;\n}\n.ne-input__wrapper .ne-input input,\n.ne-input__wrapper .ne-input textarea {\n width: 100%;\n background-color: transparent;\n color: inherit;\n border: none;\n font-size: inherit;\n line-height: inherit;\n box-shadow: none;\n outline: none;\n}\n.ne-input__wrapper .ne-input input::-moz-placeholder, .ne-input__wrapper .ne-input textarea::-moz-placeholder {\n color: #c2c8cc;\n}\n.ne-input__wrapper .ne-input input::placeholder,\n.ne-input__wrapper .ne-input textarea::placeholder {\n color: #c2c8cc;\n}\n.ne-input__wrapper .ne-input input:focus,\n.ne-input__wrapper .ne-input textarea:focus {\n outline-color: transparent;\n}\n.ne-input__wrapper .ne-input input {\n padding: 8px;\n}\n.ne-input__wrapper .ne-input textarea {\n padding: 0;\n max-height: 224px;\n overflow-y: auto;\n}\n.ne-input__wrapper .ne-input:focus-within:not(.ne-input--naked, .ne-input--error) {\n border-color: #2f3941;\n box-shadow: 0px 0px 0px 3px #e9ebed;\n}\n.ne-input__wrapper .ne-input:hover:not(.ne-input--naked, .ne-input--error, .ne-input--disabled) {\n border-color: #49545c;\n}\n.ne-input__wrapper .ne-input.ne-input--error {\n border-color: #f56a58;\n}\n.ne-input__wrapper .ne-input.ne-input--error:focus-within:not(.ne-input--naked) {\n box-shadow: 0 0 0 3px #ffefed;\n}\n.ne-input__wrapper .ne-input.ne-input--error textarea {\n resize: none;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled {\n background-color: #f8f9f9;\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled input {\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--disabled textarea {\n cursor: not-allowed;\n}\n.ne-input__wrapper .ne-input.ne-input--small input {\n padding: 6px 8px;\n line-height: 1.3;\n}\n.ne-input__wrapper .ne-input.ne-input--naked {\n padding: 0;\n border: none;\n box-shadow: none;\n}\n.ne-input__wrapper .ne-input.ne-input--naked .ne-input__prefix {\n margin-left: 0;\n}\n.ne-input__wrapper .ne-input.ne-input--naked .ne-input__suffix {\n margin-right: 0;\n}\n.ne-input__wrapper .ne-input__prefix,\n.ne-input__wrapper .ne-input__suffix {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n font-size: 14px;\n color: #68737d;\n}\n.ne-input__wrapper .ne-input__prefix svg,\n.ne-input__wrapper .ne-input__suffix svg {\n width: 16px;\n height: 16px;\n}\n.ne-input__wrapper .ne-input__prefix {\n margin-left: 10px;\n}\n.ne-input__wrapper .ne-input__suffix {\n margin-right: 10px;\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__prefix,\n.ne-input__wrapper .ne-input--block-add-on .ne-input__suffix {\n margin: 0;\n padding: 8px 10px;\n background-color: #f8f9f9;\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__prefix {\n border-right: thin solid #d8dcde;\n}\n.ne-input__wrapper .ne-input--block-add-on .ne-input__suffix {\n border-left: thin solid #d8dcde;\n}\n.ne-input__help-text {\n margin-top: 8px;\n font-size: 12px;\n color: #87929d;\n line-height: 1.6;\n}\n.ne-input__error {\n margin-top: 4px;\n font-size: 12px;\n color: #f56a58;\n}\n.ne-modal__backdrop {\n position: fixed;\n z-index: 99999;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n overflow: auto;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n transition: all 0.3s ease-in-out;\n background-color: rgba(135, 146, 157, 0.5);\n}\n.ne-modal__backdrop .ne-modal__wrapper {\n width: 50%;\n max-width: 100%;\n max-height: 100vh;\n overflow-y: auto;\n position: relative;\n background-color: #ffffff;\n border-radius: 2px;\n}\n.ne-modal__backdrop .ne-modal__wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.ne-modal__backdrop .ne-modal__wrapper::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.ne-modal__backdrop .ne-modal__wrapper::-webkit-scrollbar-track {\n background: "transparent";\n}\n.ne-modal__backdrop .ne-modal__wrapper .ne-modal__close {\n position: absolute;\n top: 12px;\n right: 12px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--xs {\n width: 320px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--sm {\n width: 480px;\n}\n.ne-modal__backdrop .ne-modal__wrapper.ne-modal__wrapper--md {\n width: 720px;\n}\n.ne-modal__backdrop .ne-icon__wrapper {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n margin-bottom: 32px;\n padding: 10px 0 0 2px;\n}\n.neeto-editor-loader {\n width: 100%;\n height: 32px;\n display: flex;\n align-items: center;\n text-align: center;\n}\n.neeto-editor-loader__spinner-icon {\n width: 16px;\n height: 16px;\n display: inline-block;\n border-radius: 999px;\n border: solid 2px #e9ebed;\n border-top-color: #2f3941;\n border-left-color: #2f3941;\n -webkit-animation: spin 600ms linear infinite;\n animation: spin 600ms linear infinite;\n margin: 1px auto;\n}\n.neeto-editor-slash-commands__wrapper {\n padding: 12px;\n overflow-y: auto;\n max-height: 384px;\n width: 320px;\n max-width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n gap: 4px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-slash-commands__wrapper::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item {\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n padding: 8px 12px;\n gap: 12px;\n border-radius: 4px;\n transition: all 0.3s ease-in-out;\n cursor: pointer;\n color: #ffffff;\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item:hover, .neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item.active {\n background-color: #49545c;\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item .neeto-editor-slash-commands__item-content h5 {\n font-size: 14px;\n font-weight: 600;\n line-height: 1.5;\n}\n.neeto-editor-slash-commands__wrapper .neeto-editor-slash-commands__item .neeto-editor-slash-commands__item-content p {\n font-size: 12px;\n color: #d8dcde;\n}\n.neeto-editor-mentions__wrapper {\n padding: 8px;\n width: 208px;\n max-height: 256px;\n overflow-y: auto;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-mentions__wrapper::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n padding: 8px;\n transition: all 0.3s ease-in-out;\n cursor: pointer;\n font-size: 12px;\n color: #ffffff;\n border-radius: 4px;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item p {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item .ne-avatar--container {\n margin-right: 8px;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item:hover, .neeto-editor-mentions__wrapper .neeto-editor-mentions__item.active {\n background-color: #49545c;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item.neeto-editor-mentions__item--light {\n color: #2f3941;\n}\n.neeto-editor-mentions__wrapper .neeto-editor-mentions__item.neeto-editor-mentions__item--light:hover, .neeto-editor-mentions__wrapper .neeto-editor-mentions__item.neeto-editor-mentions__item--light.active {\n background-color: #e9ebed;\n}\n.neeto-editor-mentions__wrapper.neeto-editor-mentions__wrapper--small {\n width: 176px;\n padding: 0 4px;\n}\n.ProseMirror.slash-active p.is-empty:last-child::before {\n content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkwIiBoZWlnaHQ9IjIzIiB2aWV3Qm94PSIwIDAgMTkwIDIz IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmci Pgo8cmVjdCB4PSIzNCIgeT0iNCIgd2lkdGg9IjE5IiBoZWlnaHQ9IjE5IiByeD0i NCIgZmlsbD0iI0YzRjRGNiIvPgo8cGF0aCBkPSJNNDEuNTA3OCAxOS45NzY2SDQw LjAxNTZMNDQuNDkyMiA3LjYyNUg0NS45ODQ0TDQxLjUwNzggMTkuOTc2NloiIGZp bGw9IiM2QjcyODAiLz4KPHBhdGggZD0iTTguMDMyMjMgOS4xMjY5NUg0LjgzMzAx VjE4SDMuNTI3MzRWOS4xMjY5NUgwLjMzNDk2MVY4LjA0Njg4SDguMDMyMjNWOS4x MjY5NVpNMTEuMjM4MyAxNi4xNDc1TDEyLjk2MDkgMTAuNjAzNUgxNC4zMTQ1TDEx LjM0MDggMTkuMTQxNkMxMC44ODA1IDIwLjM3MjEgMTAuMTQ5MSAyMC45ODczIDku MTQ2NDggMjAuOTg3M0w4LjkwNzIzIDIwLjk2NjhMOC40MzU1NSAyMC44Nzc5VjE5 Ljg1MjVMOC43NzczNCAxOS44Nzk5QzkuMjA1NzMgMTkuODc5OSA5LjUzODQxIDE5 Ljc5MzMgOS43NzUzOSAxOS42MjAxQzEwLjAxNjkgMTkuNDQ2OSAxMC4yMTUyIDE5 LjEzMDIgMTAuMzcwMSAxOC42Njk5TDEwLjY1MDQgMTcuOTE4TDguMDExNzIgMTAu NjAzNUg5LjM5MjU4TDExLjIzODMgMTYuMTQ3NVpNMjEuNjk3MyAxNC4zODM4QzIx LjY5NzMgMTUuNTA5NCAyMS40Mzk4IDE2LjQxNjMgMjAuOTI0OCAxNy4xMDQ1QzIw LjQwOTggMTcuNzkyNiAxOS43MTI2IDE4LjEzNjcgMTguODMzIDE4LjEzNjdDMTcu OTM1MiAxOC4xMzY3IDE3LjIyODggMTcuODUxOSAxNi43MTM5IDE3LjI4MjJWMjAu ODQzOEgxNS40NDkyVjEwLjYwMzVIMTYuNjA0NUwxNi42NjYgMTEuNDIzOEMxNy4x ODEgMTAuNzg1OCAxNy44OTY1IDEwLjQ2NjggMTguODEyNSAxMC40NjY4QzE5Ljcw MTIgMTAuNDY2OCAyMC40MDMgMTAuODAxOCAyMC45MTggMTEuNDcxN0MyMS40Mzc1 IDEyLjE0MTYgMjEuNjk3MyAxMy4wNzM2IDIxLjY5NzMgMTQuMjY3NlYxNC4zODM4 Wk0yMC40MzI2IDE0LjI0MDJDMjAuNDMyNiAxMy40MDYyIDIwLjI1NDkgMTIuNzQ3 NyAxOS44OTk0IDEyLjI2NDZDMTkuNTQzOSAxMS43ODE2IDE5LjA1NjMgMTEuNTQg MTguNDM2NSAxMS41NEMxNy42NzA5IDExLjU0IDE3LjA5NjcgMTEuODc5NiAxNi43 MTM5IDEyLjU1ODZWMTYuMDkyOEMxNy4wOTIxIDE2Ljc2NzMgMTcuNjcwOSAxNy4x MDQ1IDE4LjQ1MDIgMTcuMTA0NUMxOS4wNTYzIDE3LjEwNDUgMTkuNTM3MSAxNi44 NjUyIDE5Ljg5MjYgMTYuMzg2N0MyMC4yNTI2IDE1LjkwMzYgMjAuNDMyNiAxNS4x ODgyIDIwLjQzMjYgMTQuMjQwMlpNMjYuMzc5OSAxOC4xMzY3QzI1LjM3NzMgMTgu MTM2NyAyNC41NjE1IDE3LjgwODYgMjMuOTMyNiAxNy4xNTIzQzIzLjMwMzcgMTYu NDkxNSAyMi45ODkzIDE1LjYwOTcgMjIuOTg5MyAxNC41MDY4VjE0LjI3NDRDMjIu OTg5MyAxMy41NDA3IDIzLjEyODMgMTIuODg2NyAyMy40MDYyIDEyLjMxMjVDMjMu Njg4OCAxMS43MzM3IDI0LjA4MDcgMTEuMjgyNiAyNC41ODIgMTAuOTU5QzI1LjA4 NzkgMTAuNjMwOSAyNS42MzQ4IDEwLjQ2NjggMjYuMjIyNyAxMC40NjY4QzI3LjE4 NDIgMTAuNDY2OCAyNy45MzE2IDEwLjc4MzUgMjguNDY0OCAxMS40MTdDMjguOTk4 IDEyLjA1MDUgMjkuMjY0NiAxMi45NTc0IDI5LjI2NDYgMTQuMTM3N1YxNC42NjQx SDI0LjI1MzlDMjQuMjcyMSAxNS4zOTMyIDI0LjQ4NCAxNS45ODM0IDI0Ljg4OTYg MTYuNDM0NkMyNS4yOTk4IDE2Ljg4MTIgMjUuODE5MyAxNy4xMDQ1IDI2LjQ0ODIg MTcuMTA0NUMyNi44OTQ5IDE3LjEwNDUgMjcuMjczMSAxNy4wMTMzIDI3LjU4MyAx Ni44MzExQzI3Ljg5MjkgMTYuNjQ4OCAyOC4xNjQxIDE2LjQwNzIgMjguMzk2NSAx Ni4xMDY0TDI5LjE2ODkgMTYuNzA4QzI4LjU0OTIgMTcuNjYwNSAyNy42MTk1IDE4 LjEzNjcgMjYuMzc5OSAxOC4xMzY3Wk0yNi4yMjI3IDExLjUwNTlDMjUuNzEyMiAx MS41MDU5IDI1LjI4MzkgMTEuNjkyNyAyNC45Mzc1IDEyLjA2NjRDMjQuNTkxMSAx Mi40MzU1IDI0LjM3NyAxMi45NTUxIDI0LjI5NDkgMTMuNjI1SDI4VjEzLjUyOTND MjcuOTYzNSAxMi44ODY3IDI3Ljc5MDQgMTIuMzkgMjcuNDgwNSAxMi4wMzkxQzI3 LjE3MDYgMTEuNjgzNiAyNi43NTEzIDExLjUwNTkgMjYuMjIyNyAxMS41MDU5WiIg ZmlsbD0iIzZCNzI4MCIvPgo8cGF0aCBkPSJNNTkuNjcyOSA4LjgxMjVWMTAuNjAz NUg2MS4wNTM3VjExLjU4MTFINTkuNjcyOVYxNi4xNjhDNTkuNjcyOSAxNi40NjQy IDU5LjczNDQgMTYuNjg3NSA1OS44NTc0IDE2LjgzNzlDNTkuOTgwNSAxNi45ODM3 IDYwLjE5MDEgMTcuMDU2NiA2MC40ODYzIDE3LjA1NjZDNjAuNjMyMiAxNy4wNTY2 IDYwLjgzMjcgMTcuMDI5MyA2MS4wODc5IDE2Ljk3NDZWMThDNjAuNzU1MiAxOC4w OTExIDYwLjQzMTYgMTguMTM2NyA2MC4xMTcyIDE4LjEzNjdDNTkuNTUyMSAxOC4x MzY3IDU5LjEyNiAxNy45NjU4IDU4LjgzODkgMTcuNjI0QzU4LjU1MTggMTcuMjgy MiA1OC40MDgyIDE2Ljc5NjkgNTguNDA4MiAxNi4xNjhWMTEuNTgxMUg1Ny4wNjE1 VjEwLjYwMzVINTguNDA4MlY4LjgxMjVINTkuNjcyOVpNNjIuMDY1NCAxNC4yMzM0 QzYyLjA2NTQgMTMuNTA4OCA2Mi4yMDY3IDEyLjg1NzEgNjIuNDg5MyAxMi4yNzgz QzYyLjc3NjQgMTEuNjk5NSA2My4xNzI5IDExLjI1MjkgNjMuNjc4NyAxMC45Mzg1 QzY0LjE4OTEgMTAuNjI0IDY0Ljc3MDIgMTAuNDY2OCA2NS40MjE5IDEwLjQ2NjhD NjYuNDI5IDEwLjQ2NjggNjcuMjQyNSAxMC44MTU0IDY3Ljg2MjMgMTEuNTEyN0M2 OC40ODY3IDEyLjIxIDY4Ljc5ODggMTMuMTM3NCA2OC43OTg4IDE0LjI5NDlWMTQu MzgzOEM2OC43OTg4IDE1LjEwMzggNjguNjU5OCAxNS43NTEgNjguMzgxOCAxNi4z MjUyQzY4LjEwODQgMTYuODk0OSA2Ny43MTQyIDE3LjMzOTIgNjcuMTk5MiAxNy42 NTgyQzY2LjY4ODggMTcuOTc3MiA2Ni4xMDA5IDE4LjEzNjcgNjUuNDM1NSAxOC4x MzY3QzY0LjQzMjkgMTguMTM2NyA2My42MTk1IDE3Ljc4ODEgNjIuOTk1MSAxNy4w OTA4QzYyLjM3NTMgMTYuMzkzNiA2Mi4wNjU0IDE1LjQ3MDcgNjIuMDY1NCAxNC4z MjIzVjE0LjIzMzRaTTYzLjMzNjkgMTQuMzgzOEM2My4zMzY5IDE1LjIwNDEgNjMu NTI2IDE1Ljg2MjYgNjMuOTA0MyAxNi4zNTk0QzY0LjI4NzEgMTYuODU2MSA2NC43 OTc1IDE3LjEwNDUgNjUuNDM1NSAxNy4xMDQ1QzY2LjA3ODEgMTcuMTA0NSA2Ni41 ODg1IDE2Ljg1MzggNjYuOTY2OCAxNi4zNTI1QzY3LjM0NTEgMTUuODQ2NyA2Ny41 MzQyIDE1LjE0MDMgNjcuNTM0MiAxNC4yMzM0QzY3LjUzNDIgMTMuNDIyMiA2Ny4z NDA1IDEyLjc2NiA2Ni45NTMxIDEyLjI2NDZDNjYuNTcwMyAxMS43NTg4IDY2LjA1 OTkgMTEuNTA1OSA2NS40MjE5IDExLjUwNTlDNjQuNzk3NSAxMS41MDU5IDY0LjI5 MzkgMTEuNzU0MiA2My45MTExIDEyLjI1MUM2My41MjgzIDEyLjc0NzcgNjMuMzM2 OSAxMy40NTg3IDYzLjMzNjkgMTQuMzgzOFpNNzYuODI0MiAxNy4xMDQ1Qzc3LjI3 NTQgMTcuMTA0NSA3Ny42Njk2IDE2Ljk2NzggNzguMDA2OCAxNi42OTQzQzc4LjM0 NDEgMTYuNDIwOSA3OC41MzA5IDE2LjA3OTEgNzguNTY3NCAxNS42Njg5SDc5Ljc2 MzdDNzkuNzQwOSAxNi4wOTI4IDc5LjU5NTEgMTYuNDk2MSA3OS4zMjYyIDE2Ljg3 ODlDNzkuMDU3MyAxNy4yNjE3IDc4LjY5NzMgMTcuNTY3MSA3OC4yNDYxIDE3Ljc5 NDlDNzcuNzk5NSAxOC4wMjI4IDc3LjMyNTUgMTguMTM2NyA3Ni44MjQyIDE4LjEz NjdDNzUuODE3MSAxOC4xMzY3IDc1LjAxNSAxNy44MDE4IDc0LjQxOCAxNy4xMzE4 QzczLjgyNTUgMTYuNDU3NCA3My41MjkzIDE1LjUzNjggNzMuNTI5MyAxNC4zNzAx VjE0LjE1ODJDNzMuNTI5MyAxMy40MzgyIDczLjY2MTUgMTIuNzk3OSA3My45MjU4 IDEyLjIzNzNDNzQuMTkwMSAxMS42NzY4IDc0LjU2ODQgMTEuMjQxNSA3NS4wNjA1 IDEwLjkzMTZDNzUuNTU3MyAxMC42MjE3IDc2LjE0MjkgMTAuNDY2OCA3Ni44MTc0 IDEwLjQ2NjhDNzcuNjQ2OCAxMC40NjY4IDc4LjMzNSAxMC43MTUyIDc4Ljg4MTgg MTEuMjExOUM3OS40MzMzIDExLjcwODcgNzkuNzI3MiAxMi4zNTM1IDc5Ljc2Mzcg MTMuMTQ2NUg3OC41Njc0Qzc4LjUzMDkgMTIuNjY4IDc4LjM0ODYgMTIuMjc2IDc4 LjAyMDUgMTEuOTcwN0M3Ny42OTY5IDExLjY2MDggNzcuMjk1OSAxMS41MDU5IDc2 LjgxNzQgMTEuNTA1OUM3Ni4xNzQ4IDExLjUwNTkgNzUuNjc1OCAxMS43MzgzIDc1 LjMyMDMgMTIuMjAzMUM3NC45Njk0IDEyLjY2MzQgNzQuNzkzOSAxMy4zMzExIDc0 Ljc5MzkgMTQuMjA2MVYxNC40NDUzQzc0Ljc5MzkgMTUuMjk3NSA3NC45Njk0IDE1 Ljk1MzggNzUuMzIwMyAxNi40MTQxQzc1LjY3MTIgMTYuODc0MyA3Ni4xNzI1IDE3 LjEwNDUgNzYuODI0MiAxNy4xMDQ1Wk04Mi40NTAyIDExLjQ5OUM4My4wMTA3IDEw LjgxMDkgODMuNzM5OSAxMC40NjY4IDg0LjYzNzcgMTAuNDY2OEM4Ni4yMDA4IDEw LjQ2NjggODYuOTg5MyAxMS4zNDg2IDg3LjAwMjkgMTMuMTEyM1YxOEg4NS43Mzgz VjEzLjEwNTVDODUuNzMzNyAxMi41NzIzIDg1LjYxMDcgMTIuMTc4MSA4NS4zNjkx IDExLjkyMjlDODUuMTMyMiAxMS42Njc2IDg0Ljc2MDcgMTEuNTQgODQuMjU0OSAx MS41NEM4My44NDQ3IDExLjU0IDgzLjQ4NDcgMTEuNjQ5NCA4My4xNzQ4IDExLjg2 ODJDODIuODY0OSAxMi4wODY5IDgyLjYyMzQgMTIuMzc0IDgyLjQ1MDIgMTIuNzI5 NVYxOEg4MS4xODU1VjcuNUg4Mi40NTAyVjExLjQ5OVpNOTMuNDYyOSAxOEM5My4z OSAxNy44NTQyIDkzLjMzMDcgMTcuNTk0NCA5My4yODUyIDE3LjIyMDdDOTIuNjk3 MyAxNy44MzE0IDkxLjk5NTQgMTguMTM2NyA5MS4xNzk3IDE4LjEzNjdDOTAuNDUw NSAxOC4xMzY3IDg5Ljg1MTIgMTcuOTMxNiA4OS4zODE4IDE3LjUyMTVDODguOTE3 IDE3LjEwNjggODguNjg0NiAxNi41ODI3IDg4LjY4NDYgMTUuOTQ5MkM4OC42ODQ2 IDE1LjE3OSA4OC45NzYyIDE0LjU4MiA4OS41NTk2IDE0LjE1ODJDOTAuMTQ3NSAx My43Mjk4IDkwLjk3MjMgMTMuNTE1NiA5Mi4wMzQyIDEzLjUxNTZIOTMuMjY0NlYx Mi45MzQ2QzkzLjI2NDYgMTIuNDkyNSA5My4xMzI1IDEyLjE0MTYgOTIuODY4MiAx MS44ODE4QzkyLjYwMzggMTEuNjE3NSA5Mi4yMTQyIDExLjQ4NTQgOTEuNjk5MiAx MS40ODU0QzkxLjI0OCAxMS40ODU0IDkwLjg2OTggMTEuNTk5MyA5MC41NjQ1IDEx LjgyNzFDOTAuMjU5MSAxMi4wNTUgOTAuMTA2NCAxMi4zMzA3IDkwLjEwNjQgMTIu NjU0M0g4OC44MzVDODguODM1IDEyLjI4NTIgODguOTY0OCAxMS45Mjk3IDg5LjIy NDYgMTEuNTg3OUM4OS40ODg5IDExLjI0MTUgODkuODQ0NCAxMC45NjgxIDkwLjI5 MSAxMC43Njc2QzkwLjc0MjIgMTAuNTY3MSA5MS4yMzY3IDEwLjQ2NjggOTEuNzc0 NCAxMC40NjY4QzkyLjYyNjYgMTAuNDY2OCA5My4yOTQzIDEwLjY4MSA5My43Nzcz IDExLjEwOTRDOTQuMjYwNCAxMS41MzMyIDk0LjUxMTEgMTIuMTE4OCA5NC41Mjkz IDEyLjg2NjJWMTYuMjcwNUM5NC41MjkzIDE2Ljk0OTUgOTQuNjE1OSAxNy40ODk2 IDk0Ljc4OTEgMTcuODkwNlYxOEg5My40NjI5Wk05MS4zNjQzIDE3LjAzNjFDOTEu NzYwNyAxNy4wMzYxIDkyLjEzNjcgMTYuOTMzNiA5Mi40OTIyIDE2LjcyODVDOTIu ODQ3NyAxNi41MjM0IDkzLjEwNTEgMTYuMjU2OCA5My4yNjQ2IDE1LjkyODdWMTQu NDExMUg5Mi4yNzM0QzkwLjcyNCAxNC40MTExIDg5Ljk0OTIgMTQuODY0NiA4OS45 NDkyIDE1Ljc3MTVDODkuOTQ5MiAxNi4xNjggOTAuMDgxNCAxNi40Nzc5IDkwLjM0 NTcgMTYuNzAxMkM5MC42MSAxNi45MjQ1IDkwLjk0OTUgMTcuMDM2MSA5MS4zNjQz IDE3LjAzNjFaTTk3LjcwOCAxMC42MDM1TDk3Ljc0OSAxMS41MzMyQzk4LjMxNDEg MTAuODIyMyA5OS4wNTI0IDEwLjQ2NjggOTkuOTYzOSAxMC40NjY4QzEwMS41Mjcg MTAuNDY2OCAxMDIuMzE1IDExLjM0ODYgMTAyLjMyOSAxMy4xMTIzVjE4SDEwMS4w NjRWMTMuMTA1NUMxMDEuMDYgMTIuNTcyMyAxMDAuOTM3IDEyLjE3ODEgMTAwLjY5 NSAxMS45MjI5QzEwMC40NTggMTEuNjY3NiAxMDAuMDg3IDExLjU0IDk5LjU4MTEg MTEuNTRDOTkuMTcwOSAxMS41NCA5OC44MTA5IDExLjY0OTQgOTguNTAxIDExLjg2 ODJDOTguMTkxMSAxMi4wODY5IDk3Ljk0OTUgMTIuMzc0IDk3Ljc3NjQgMTIuNzI5 NVYxOEg5Ni41MTE3VjEwLjYwMzVIOTcuNzA4Wk0xMDMuOTM2IDE0LjI0MDJDMTAz LjkzNiAxMy4wODcyIDEwNC4yMDIgMTIuMTcxMiAxMDQuNzM1IDExLjQ5MjJDMTA1 LjI2OSAxMC44MDg2IDEwNS45NzUgMTAuNDY2OCAxMDYuODU0IDEwLjQ2NjhDMTA3 Ljc1NyAxMC40NjY4IDEwOC40NjEgMTAuNzg1OCAxMDguOTY3IDExLjQyMzhMMTA5 LjAyOCAxMC42MDM1SDExMC4xODRWMTcuODIyM0MxMTAuMTg0IDE4Ljc3OTMgMTA5 Ljg5OSAxOS41MzM1IDEwOS4zMjkgMjAuMDg1QzEwOC43NjQgMjAuNjM2NCAxMDgu MDAzIDIwLjkxMjEgMTA3LjA0NiAyMC45MTIxQzEwNi41MTMgMjAuOTEyMSAxMDUu OTkxIDIwLjc5ODIgMTA1LjQ4IDIwLjU3MDNDMTA0Ljk3IDIwLjM0MjQgMTA0LjU4 IDIwLjAzMDMgMTA0LjMxMiAxOS42MzM4TDEwNC45NjggMTguODc1QzEwNS41MSAx OS41NDQ5IDEwNi4xNzMgMTkuODc5OSAxMDYuOTU3IDE5Ljg3OTlDMTA3LjU3MiAx OS44Nzk5IDEwOC4wNTEgMTkuNzA2NyAxMDguMzkzIDE5LjM2MDRDMTA4LjczOSAx OS4wMTQgMTA4LjkxMiAxOC41MjY0IDEwOC45MTIgMTcuODk3NVYxNy4yNjE3QzEw OC40MDYgMTcuODQ1MSAxMDcuNzE2IDE4LjEzNjcgMTA2Ljg0MSAxOC4xMzY3QzEw NS45NzUgMTguMTM2NyAxMDUuMjczIDE3Ljc4ODEgMTA0LjczNSAxNy4wOTA4QzEw NC4yMDIgMTYuMzkzNiAxMDMuOTM2IDE1LjQ0MzQgMTAzLjkzNiAxNC4yNDAyWk0x MDUuMjA3IDE0LjM4MzhDMTA1LjIwNyAxNS4yMTc4IDEwNS4zNzggMTUuODc0IDEw NS43MiAxNi4zNTI1QzEwNi4wNjIgMTYuODI2NSAxMDYuNTQgMTcuMDYzNSAxMDcu MTU1IDE3LjA2MzVDMTA3Ljk1MyAxNy4wNjM1IDEwOC41MzggMTYuNzAxMiAxMDgu OTEyIDE1Ljk3NjZWMTIuNTk5NkMxMDguNTI1IDExLjg5MzIgMTA3Ljk0NCAxMS41 NCAxMDcuMTY5IDExLjU0QzEwNi41NTQgMTEuNTQgMTA2LjA3MyAxMS43NzkzIDEw NS43MjcgMTIuMjU3OEMxMDUuMzggMTIuNzM2MyAxMDUuMjA3IDEzLjQ0NSAxMDUu MjA3IDE0LjM4MzhaTTExNS4xNjcgMTguMTM2N0MxMTQuMTY0IDE4LjEzNjcgMTEz LjM0OSAxNy44MDg2IDExMi43MiAxNy4xNTIzQzExMi4wOTEgMTYuNDkxNSAxMTEu Nzc2IDE1LjYwOTcgMTExLjc3NiAxNC41MDY4VjE0LjI3NDRDMTExLjc3NiAxMy41 NDA3IDExMS45MTUgMTIuODg2NyAxMTIuMTkzIDEyLjMxMjVDMTEyLjQ3NiAxMS43 MzM3IDExMi44NjggMTEuMjgyNiAxMTMuMzY5IDEwLjk1OUMxMTMuODc1IDEwLjYz MDkgMTE0LjQyMiAxMC40NjY4IDExNS4wMSAxMC40NjY4QzExNS45NzEgMTAuNDY2 OCAxMTYuNzE5IDEwLjc4MzUgMTE3LjI1MiAxMS40MTdDMTE3Ljc4NSAxMi4wNTA1 IDExOC4wNTIgMTIuOTU3NCAxMTguMDUyIDE0LjEzNzdWMTQuNjY0MUgxMTMuMDQx QzExMy4wNTkgMTUuMzkzMiAxMTMuMjcxIDE1Ljk4MzQgMTEzLjY3NyAxNi40MzQ2 QzExNC4wODcgMTYuODgxMiAxMTQuNjA2IDE3LjEwNDUgMTE1LjIzNSAxNy4xMDQ1 QzExNS42ODIgMTcuMTA0NSAxMTYuMDYgMTcuMDEzMyAxMTYuMzcgMTYuODMxMUMx MTYuNjggMTYuNjQ4OCAxMTYuOTUxIDE2LjQwNzIgMTE3LjE4NCAxNi4xMDY0TDEx Ny45NTYgMTYuNzA4QzExNy4zMzYgMTcuNjYwNSAxMTYuNDA3IDE4LjEzNjcgMTE1 LjE2NyAxOC4xMzY3Wk0xMTUuMDEgMTEuNTA1OUMxMTQuNDk5IDExLjUwNTkgMTE0 LjA3MSAxMS42OTI3IDExMy43MjUgMTIuMDY2NEMxMTMuMzc4IDEyLjQzNTUgMTEz LjE2NCAxMi45NTUxIDExMy4wODIgMTMuNjI1SDExNi43ODdWMTMuNTI5M0MxMTYu NzUxIDEyLjg4NjcgMTE2LjU3NyAxMi4zOSAxMTYuMjY4IDEyLjAzOTFDMTE1Ljk1 OCAxMS42ODM2IDExNS41MzggMTEuNTA1OSAxMTUuMDEgMTEuNTA1OVpNMTI5LjI1 NiAxNC4zODM4QzEyOS4yNTYgMTUuNTE0IDEyOC45OTYgMTYuNDIzMiAxMjguNDc3 IDE3LjExMTNDMTI3Ljk1NyAxNy43OTQ5IDEyNy4yNiAxOC4xMzY3IDEyNi4zODUg MTguMTM2N0MxMjUuNDUxIDE4LjEzNjcgMTI0LjcyOCAxNy44MDYzIDEyNC4yMTgg MTcuMTQ1NUwxMjQuMTU2IDE4SDEyMi45OTRWNy41SDEyNC4yNTlWMTEuNDE3QzEy NC43NjkgMTAuNzgzNSAxMjUuNDczIDEwLjQ2NjggMTI2LjM3MSAxMC40NjY4QzEy Ny4yNjkgMTAuNDY2OCAxMjcuOTczIDEwLjgwNjMgMTI4LjQ4MyAxMS40ODU0QzEy OC45OTggMTIuMTY0NCAxMjkuMjU2IDEzLjA5NDEgMTI5LjI1NiAxNC4yNzQ0VjE0 LjM4MzhaTTEyNy45OTEgMTQuMjQwMkMxMjcuOTkxIDEzLjM3ODkgMTI3LjgyNSAx Mi43MTM1IDEyNy40OTIgMTIuMjQ0MUMxMjcuMTYgMTEuNzc0NyAxMjYuNjgxIDEx LjU0IDEyNi4wNTcgMTEuNTRDMTI1LjIyMyAxMS41NCAxMjQuNjIzIDExLjkyNzQg MTI0LjI1OSAxMi43MDIxVjE1LjkwMTRDMTI0LjY0NiAxNi42NzYxIDEyNS4yNSAx Ny4wNjM1IDEyNi4wNyAxNy4wNjM1QzEyNi42NzYgMTcuMDYzNSAxMjcuMTQ4IDE2 LjgyODggMTI3LjQ4NSAxNi4zNTk0QzEyNy44MjMgMTUuODkgMTI3Ljk5MSAxNS4x ODM2IDEyNy45OTEgMTQuMjQwMlpNMTMyLjIyOSAxOEgxMzAuOTY1VjcuNUgxMzIu MjI5VjE4Wk0xMzMuOTI1IDE0LjIzMzRDMTMzLjkyNSAxMy41MDg4IDEzNC4wNjYg MTIuODU3MSAxMzQuMzQ5IDEyLjI3ODNDMTM0LjYzNiAxMS42OTk1IDEzNS4wMzIg MTEuMjUyOSAxMzUuNTM4IDEwLjkzODVDMTM2LjA0OSAxMC42MjQgMTM2LjYzIDEw LjQ2NjggMTM3LjI4MSAxMC40NjY4QzEzOC4yODggMTAuNDY2OCAxMzkuMTAyIDEw LjgxNTQgMTM5LjcyMiAxMS41MTI3QzE0MC4zNDYgMTIuMjEgMTQwLjY1OCAxMy4x Mzc0IDE0MC42NTggMTQuMjk0OVYxNC4zODM4QzE0MC42NTggMTUuMTAzOCAxNDAu NTE5IDE1Ljc1MSAxNDAuMjQxIDE2LjMyNTJDMTM5Ljk2OCAxNi44OTQ5IDEzOS41 NzQgMTcuMzM5MiAxMzkuMDU5IDE3LjY1ODJDMTM4LjU0OCAxNy45NzcyIDEzNy45 NiAxOC4xMzY3IDEzNy4yOTUgMTguMTM2N0MxMzYuMjkyIDE4LjEzNjcgMTM1LjQ3 OSAxNy43ODgxIDEzNC44NTQgMTcuMDkwOEMxMzQuMjM1IDE2LjM5MzYgMTMzLjky NSAxNS40NzA3IDEzMy45MjUgMTQuMzIyM1YxNC4yMzM0Wk0xMzUuMTk2IDE0LjM4 MzhDMTM1LjE5NiAxNS4yMDQxIDEzNS4zODUgMTUuODYyNiAxMzUuNzY0IDE2LjM1 OTRDMTM2LjE0NiAxNi44NTYxIDEzNi42NTcgMTcuMTA0NSAxMzcuMjk1IDE3LjEw NDVDMTM3LjkzOCAxNy4xMDQ1IDEzOC40NDggMTYuODUzOCAxMzguODI2IDE2LjM1 MjVDMTM5LjIwNCAxNS44NDY3IDEzOS4zOTQgMTUuMTQwMyAxMzkuMzk0IDE0LjIz MzRDMTM5LjM5NCAxMy40MjIyIDEzOS4yIDEyLjc2NiAxMzguODEyIDEyLjI2NDZD MTM4LjQzIDExLjc1ODggMTM3LjkxOSAxMS41MDU5IDEzNy4yODEgMTEuNTA1OUMx MzYuNjU3IDExLjUwNTkgMTM2LjE1MyAxMS43NTQyIDEzNS43NzEgMTIuMjUxQzEz NS4zODggMTIuNzQ3NyAxMzUuMTk2IDEzLjQ1ODcgMTM1LjE5NiAxNC4zODM4Wk0x NDUuMjExIDE3LjEwNDVDMTQ1LjY2MiAxNy4xMDQ1IDE0Ni4wNTYgMTYuOTY3OCAx NDYuMzk0IDE2LjY5NDNDMTQ2LjczMSAxNi40MjA5IDE0Ni45MTggMTYuMDc5MSAx NDYuOTU0IDE1LjY2ODlIMTQ4LjE1QzE0OC4xMjggMTYuMDkyOCAxNDcuOTgyIDE2 LjQ5NjEgMTQ3LjcxMyAxNi44Nzg5QzE0Ny40NDQgMTcuMjYxNyAxNDcuMDg0IDE3 LjU2NzEgMTQ2LjYzMyAxNy43OTQ5QzE0Ni4xODYgMTguMDIyOCAxNDUuNzEyIDE4 LjEzNjcgMTQ1LjIxMSAxOC4xMzY3QzE0NC4yMDQgMTguMTM2NyAxNDMuNDAyIDE3 LjgwMTggMTQyLjgwNSAxNy4xMzE4QzE0Mi4yMTIgMTYuNDU3NCAxNDEuOTE2IDE1 LjUzNjggMTQxLjkxNiAxNC4zNzAxVjE0LjE1ODJDMTQxLjkxNiAxMy40MzgyIDE0 Mi4wNDggMTIuNzk3OSAxNDIuMzEyIDEyLjIzNzNDMTQyLjU3NyAxMS42NzY4IDE0 Mi45NTUgMTEuMjQxNSAxNDMuNDQ3IDEwLjkzMTZDMTQzLjk0NCAxMC42MjE3IDE0 NC41MyAxMC40NjY4IDE0NS4yMDQgMTAuNDY2OEMxNDYuMDM0IDEwLjQ2NjggMTQ2 LjcyMiAxMC43MTUyIDE0Ny4yNjkgMTEuMjExOUMxNDcuODIgMTEuNzA4NyAxNDgu MTE0IDEyLjM1MzUgMTQ4LjE1IDEzLjE0NjVIMTQ2Ljk1NEMxNDYuOTE4IDEyLjY2 OCAxNDYuNzM1IDEyLjI3NiAxNDYuNDA3IDExLjk3MDdDMTQ2LjA4NCAxMS42NjA4 IDE0NS42ODMgMTEuNTA1OSAxNDUuMjA0IDExLjUwNTlDMTQ0LjU2MiAxMS41MDU5 IDE0NC4wNjIgMTEuNzM4MyAxNDMuNzA3IDEyLjIwMzFDMTQzLjM1NiAxMi42NjM0 IDE0My4xODEgMTMuMzMxMSAxNDMuMTgxIDE0LjIwNjFWMTQuNDQ1M0MxNDMuMTgx IDE1LjI5NzUgMTQzLjM1NiAxNS45NTM4IDE0My43MDcgMTYuNDE0MUMxNDQuMDU4 IDE2Ljg3NDMgMTQ0LjU1OSAxNy4xMDQ1IDE0NS4yMTEgMTcuMTA0NVpNMTUxLjYz NyAxNC41NzUyTDE1MC44NDQgMTUuNDAyM1YxOEgxNDkuNTc5VjcuNUgxNTAuODQ0 VjEzLjg1MDZMMTUxLjUyMSAxMy4wMzcxTDE1My44MjQgMTAuNjAzNUgxNTUuMzYy TDE1Mi40ODQgMTMuNjkzNEwxNTUuNjk3IDE4SDE1NC4yMTRMMTUxLjYzNyAxNC41 NzUyWk0xNjEuODU2IDguODEyNVYxMC42MDM1SDE2My4yMzdWMTEuNTgxMUgxNjEu ODU2VjE2LjE2OEMxNjEuODU2IDE2LjQ2NDIgMTYxLjkxOCAxNi42ODc1IDE2Mi4w NDEgMTYuODM3OUMxNjIuMTY0IDE2Ljk4MzcgMTYyLjM3NCAxNy4wNTY2IDE2Mi42 NyAxNy4wNTY2QzE2Mi44MTYgMTcuMDU2NiAxNjMuMDE2IDE3LjAyOTMgMTYzLjI3 MSAxNi45NzQ2VjE4QzE2Mi45MzkgMTguMDkxMSAxNjIuNjE1IDE4LjEzNjcgMTYy LjMwMSAxOC4xMzY3QzE2MS43MzYgMTguMTM2NyAxNjEuMzEgMTcuOTY1OCAxNjEu MDIyIDE3LjYyNEMxNjAuNzM1IDE3LjI4MjIgMTYwLjU5MiAxNi43OTY5IDE2MC41 OTIgMTYuMTY4VjExLjU4MTFIMTU5LjI0NVYxMC42MDM1SDE2MC41OTJWOC44MTI1 SDE2MS44NTZaTTE2Ny4xNDEgMTYuMTQ3NUwxNjguODYzIDEwLjYwMzVIMTcwLjIx N0wxNjcuMjQzIDE5LjE0MTZDMTY2Ljc4MyAyMC4zNzIxIDE2Ni4wNTEgMjAuOTg3 MyAxNjUuMDQ5IDIwLjk4NzNMMTY0LjgxIDIwLjk2NjhMMTY0LjMzOCAyMC44Nzc5 VjE5Ljg1MjVMMTY0LjY4IDE5Ljg3OTlDMTY1LjEwOCAxOS44Nzk5IDE2NS40NDEg MTkuNzkzMyAxNjUuNjc4IDE5LjYyMDFDMTY1LjkxOSAxOS40NDY5IDE2Ni4xMTgg MTkuMTMwMiAxNjYuMjcyIDE4LjY2OTlMMTY2LjU1MyAxNy45MThMMTYzLjkxNCAx MC42MDM1SDE2NS4yOTVMMTY3LjE0MSAxNi4xNDc1Wk0xNzcuNiAxNC4zODM4QzE3 Ny42IDE1LjUwOTQgMTc3LjM0MiAxNi40MTYzIDE3Ni44MjcgMTcuMTA0NUMxNzYu MzEyIDE3Ljc5MjYgMTc1LjYxNSAxOC4xMzY3IDE3NC43MzUgMTguMTM2N0MxNzMu ODM4IDE4LjEzNjcgMTczLjEzMSAxNy44NTE5IDE3Mi42MTYgMTcuMjgyMlYyMC44 NDM4SDE3MS4zNTJWMTAuNjAzNUgxNzIuNTA3TDE3Mi41NjggMTEuNDIzOEMxNzMu MDgzIDEwLjc4NTggMTczLjc5OSAxMC40NjY4IDE3NC43MTUgMTAuNDY2OEMxNzUu NjA0IDEwLjQ2NjggMTc2LjMwNSAxMC44MDE4IDE3Ni44MiAxMS40NzE3QzE3Ny4z NCAxMi4xNDE2IDE3Ny42IDEzLjA3MzYgMTc3LjYgMTQuMjY3NlYxNC4zODM4Wk0x NzYuMzM1IDE0LjI0MDJDMTc2LjMzNSAxMy40MDYyIDE3Ni4xNTcgMTIuNzQ3NyAx NzUuODAyIDEyLjI2NDZDMTc1LjQ0NiAxMS43ODE2IDE3NC45NTkgMTEuNTQgMTc0 LjMzOSAxMS41NEMxNzMuNTczIDExLjU0IDE3Mi45OTkgMTEuODc5NiAxNzIuNjE2 IDEyLjU1ODZWMTYuMDkyOEMxNzIuOTk0IDE2Ljc2NzMgMTczLjU3MyAxNy4xMDQ1 IDE3NC4zNTMgMTcuMTA0NUMxNzQuOTU5IDE3LjEwNDUgMTc1LjQzOSAxNi44NjUy IDE3NS43OTUgMTYuMzg2N0MxNzYuMTU1IDE1LjkwMzYgMTc2LjMzNSAxNS4xODgy IDE3Ni4zMzUgMTQuMjQwMlpNMTgyLjI4MiAxOC4xMzY3QzE4MS4yOCAxOC4xMzY3 IDE4MC40NjQgMTcuODA4NiAxNzkuODM1IDE3LjE1MjNDMTc5LjIwNiAxNi40OTE1 IDE3OC44OTIgMTUuNjA5NyAxNzguODkyIDE0LjUwNjhWMTQuMjc0NEMxNzguODky IDEzLjU0MDcgMTc5LjAzMSAxMi44ODY3IDE3OS4zMDkgMTIuMzEyNUMxNzkuNTkx IDExLjczMzcgMTc5Ljk4MyAxMS4yODI2IDE4MC40ODQgMTAuOTU5QzE4MC45OSAx MC42MzA5IDE4MS41MzcgMTAuNDY2OCAxODIuMTI1IDEwLjQ2NjhDMTgzLjA4NyAx MC40NjY4IDE4My44MzQgMTAuNzgzNSAxODQuMzY3IDExLjQxN0MxODQuOSAxMi4w NTA1IDE4NS4xNjcgMTIuOTU3NCAxODUuMTY3IDE0LjEzNzdWMTQuNjY0MUgxODAu MTU2QzE4MC4xNzQgMTUuMzkzMiAxODAuMzg2IDE1Ljk4MzQgMTgwLjc5MiAxNi40 MzQ2QzE4MS4yMDIgMTYuODgxMiAxODEuNzIyIDE3LjEwNDUgMTgyLjM1MSAxNy4x MDQ1QzE4Mi43OTcgMTcuMTA0NSAxODMuMTc1IDE3LjAxMzMgMTgzLjQ4NSAxNi44 MzExQzE4My43OTUgMTYuNjQ4OCAxODQuMDY2IDE2LjQwNzIgMTg0LjI5OSAxNi4x MDY0TDE4NS4wNzEgMTYuNzA4QzE4NC40NTEgMTcuNjYwNSAxODMuNTIyIDE4LjEz NjcgMTgyLjI4MiAxOC4xMzY3Wk0xODIuMTI1IDExLjUwNTlDMTgxLjYxNSAxMS41 MDU5IDE4MS4xODYgMTEuNjkyNyAxODAuODQgMTIuMDY2NEMxODAuNDkzIDEyLjQz NTUgMTgwLjI3OSAxMi45NTUxIDE4MC4xOTcgMTMuNjI1SDE4My45MDJWMTMuNTI5 M0MxODMuODY2IDEyLjg4NjcgMTgzLjY5MyAxMi4zOSAxODMuMzgzIDEyLjAzOTFD MTgzLjA3MyAxMS42ODM2IDE4Mi42NTQgMTEuNTA1OSAxODIuMTI1IDExLjUwNTla IiBmaWxsPSIjNkI3MjgwIi8+Cjwvc3ZnPgo=");\n position: absolute;\n top: -2px;\n height: 0;\n pointer-events: none;\n}\n.neeto-editor {\n max-width: 100% !important;\n border-radius: 2px;\n white-space: pre-wrap;\n padding: 12px;\n color: #2f3941;\n}\n.neeto-editor p {\n line-height: 1.625;\n margin-bottom: 16px;\n}\n.neeto-editor:focus {\n outline: none;\n}\n.neeto-editor a {\n pointer-events: none;\n}\n.neeto-editor mark {\n background: #c9e4cc;\n border-radius: 2px;\n padding: 0px 4px;\n color: inherit;\n}\n.neeto-editor [data-variable] {\n display: inline-flex;\n color: #49545c;\n background-color: rgba(233, 235, 237, 0.5);\n border-radius: 2px;\n line-height: 1;\n padding: 4px 6px;\n}\n.neeto-editor [data-mention] {\n opacity: 0.6;\n}\n.neeto-editor .ProseMirror-separator {\n display: none;\n}\n.neeto-editor.fixed-menu-active {\n border: thin solid #e9ebed;\n border-radius: 0px 0px 2px 2px;\n}\n.neeto-editor .is-empty {\n position: relative;\n}\n.neeto-editor.placeholder-active:not(.force-title) .is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title h1:first-child {\n position: relative;\n margin-bottom: 20px;\n}\n.neeto-editor.force-title .is-empty:first-child::before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title.placeholder-active .is-empty:nth-child(2):last-child:before {\n content: attr(data-placeholder);\n float: left;\n color: #ced4da;\n pointer-events: none;\n height: 0;\n}\n.neeto-editor.force-title.force-title--error .is-empty:first-child::after {\n position: absolute;\n content: "Title can\'t be blank";\n left: 0;\n bottom: -12px;\n color: #f56a58;\n pointer-events: none;\n font-size: 12px;\n}\n.neeto-editor hr {\n margin: 8px 0;\n}\n.neeto-editor .ProseMirror-selectednode {\n outline: 3px solid #eaf3fc;\n}\n.neeto-editor-character-count {\n padding: 4px;\n color: #68737d;\n font-size: 12px;\n text-align: right;\n}\n.neeto-editor-error {\n color: #f56a58;\n border-width: 1px;\n border-color: #f56a58;\n}\n.neeto-editor-error:focus-within {\n border-color: #f56a58;\n}\n.neeto-editor-content, .neeto-editor {\n white-space: pre-wrap;\n word-break: break-word;\n}\n.neeto-editor-content h1, .neeto-editor h1,\n.neeto-editor-content h2,\n.neeto-editor h2,\n.neeto-editor-content h3,\n.neeto-editor h3,\n.neeto-editor-content h4,\n.neeto-editor h4,\n.neeto-editor-content h5,\n.neeto-editor h5,\n.neeto-editor-content h6,\n.neeto-editor h6 {\n font-size: revert;\n}\n.neeto-editor-content p, .neeto-editor p {\n line-height: 1.625;\n margin-bottom: 16px;\n}\n.neeto-editor-content p:empty::after, .neeto-editor p:empty::after {\n content: " ";\n}\n.neeto-editor-content p:last-child, .neeto-editor p:last-child {\n margin-bottom: 0;\n}\n.neeto-editor-content code, .neeto-editor code {\n padding: 0.2em 0.4em;\n font-size: 85%;\n border-radius: 6px;\n background-color: rgba(175, 184, 193, 0.2);\n font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;\n}\n.neeto-editor-content pre, .neeto-editor pre {\n color: #ffffff;\n background-color: #1f2937;\n overflow-x: auto;\n font-size: 12px;\n line-height: 20px;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 2px;\n padding: 16px;\n}\n.neeto-editor-content pre > code, .neeto-editor pre > code {\n background-color: transparent;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-weight: 400;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n line-height: inherit;\n}\n.neeto-editor-content blockquote, .neeto-editor blockquote {\n font-weight: 500;\n color: #1b1f23;\n border-left-width: 4px;\n border-left-color: #e5e7eb;\n quotes: "“" "”" "‘" "’";\n margin: 8px 0;\n padding-left: 12px;\n}\n.neeto-editor-content blockquote > p::before, .neeto-editor blockquote > p::before {\n content: "" !important;\n}\n.neeto-editor-content blockquote > p::after, .neeto-editor blockquote > p::after {\n content: "" !important;\n}\n.neeto-editor-content ul, .neeto-editor ul,\n.neeto-editor-content ol,\n.neeto-editor ol {\n list-style: revert;\n margin: revert;\n padding: revert;\n}\n.neeto-editor-content ul > li > p, .neeto-editor ul > li > p,\n.neeto-editor-content ol > li > p,\n.neeto-editor ol > li > p {\n margin-top: 0 !important;\n margin-bottom: 0.375rem !important;\n}\n.neeto-editor-content ul li::before, .neeto-editor ul li::before,\n.neeto-editor-content ol li::before,\n.neeto-editor ol li::before {\n background-color: #1b1f23;\n}\n.neeto-editor-content a[href], .neeto-editor a[href] {\n color: #276ef1;\n}\n.neeto-editor-content .video-wrapper, .neeto-editor .video-wrapper {\n width: 560px;\n height: 315px;\n margin: auto;\n}\n.neeto-editor-content mark, .neeto-editor mark {\n background: #c9e4cc;\n border-radius: 2px;\n padding: 0px 4px;\n color: inherit;\n}\n.neeto-editor-content [data-variable], .neeto-editor [data-variable] {\n display: inline-flex;\n color: #49545c;\n background-color: rgba(233, 235, 237, 0.5);\n border-radius: 2px;\n line-height: 1;\n padding: 4px 6px;\n}\n.neeto-editor-content [data-mention], .neeto-editor [data-mention] {\n opacity: 0.6;\n}\n.neeto-editor-content--hidden {\n display: none;\n}\n.neeto-editor__image {\n display: inline-block;\n border: 1.5px solid #eaf3fc;\n margin: 0 12px;\n}\n.neeto-editor__image figure {\n margin: 16px 12px;\n outline: none;\n}\n.neeto-editor__image figure img {\n height: 100%;\n width: 100%;\n -webkit-user-select: auto;\n -moz-user-select: auto;\n user-select: auto;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.neeto-editor__image figure figcaption {\n color: #49545c;\n text-align: center;\n}\n.neeto-editor__image-defaults {\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n}\n.neeto-editor__image--none {\n display: flex;\n justify-content: center;\n}\n.neeto-editor__image--left {\n float: left;\n margin-left: 0;\n}\n.neeto-editor__image--right {\n float: right;\n margin-right: 0;\n}\n.neeto-editor__image--center {\n margin: 0 auto;\n}\n.neeto-editor-fixed-menu {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n overflow-x: auto;\n border-radius: 2px 2px 0px 0px;\n background-color: #e9ebed;\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-fixed-menu::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 10px;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item:hover, .neeto-editor-fixed-menu .neeto-editor-fixed-menu__item:focus, .neeto-editor-fixed-menu .neeto-editor-fixed-menu__item:active, .neeto-editor-fixed-menu .neeto-editor-fixed-menu__item.active {\n background-color: #d8dcde;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu__item input[type=color] {\n visibility: hidden;\n height: 0;\n width: 0;\n}\n.neeto-editor-fixed-menu .neeto-editor-fixed-menu-addons {\n display: flex;\n align-items: center;\n margin-left: auto;\n}\n.neeto-editor-variables-suggestion {\n padding: 4px 0;\n}\n.neeto-editor-variables-list {\n padding: 4px 8px;\n min-width: 184px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block:not(:last-child) {\n margin-bottom: 12px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block h6 {\n font-size: 12px;\n font-weight: 500;\n color: #68737d;\n margin-bottom: 4px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row .neeto-editor-variable {\n padding: 4px 6px;\n font-size: 12px;\n color: #49545c;\n line-height: 1;\n background-color: #eaf3fc;\n border-radius: 2px;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-variables-list .neeto-editor-variables-block .neeto-editor-variables-row .neeto-editor-variable:hover {\n background-color: #d4e6f9;\n}\n.neeto-editor-link-wrapper .ne-dropdown__popup {\n padding: 8px;\n width: 100%;\n max-width: 400px;\n}\n.neeto-editor-link-wrapper .ne-dropdown__popup .neeto-editor-link__item {\n display: flex !important;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n gap: 12px;\n}\n.neeto-editor-font-size-wrapper .ne-dropdown__popup {\n display: flex !important;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n gap: 8px;\n padding: 4px;\n}\n.neeto-editor-font-size-wrapper .ne-dropdown__popup li {\n padding: 6px 8px;\n}\n.neeto-editor-bubble-menu {\n position: relative;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n overflow: hidden;\n border-radius: 4px;\n background: #2f3941;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item {\n padding: 8px;\n cursor: pointer;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:hover, .neeto-editor-bubble-menu .neeto-editor-bubble-menu__item:active, .neeto-editor-bubble-menu .neeto-editor-bubble-menu__item.active {\n background-color: #49545c;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link {\n display: flex;\n align-items: center;\n padding: 8px;\n gap: 8px;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input {\n background-color: transparent;\n outline: none;\n line-height: 20px;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input::-moz-placeholder {\n color: rgba(255, 255, 255, 0.4);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .neeto-editor-bubble-menu-link__input::placeholder {\n color: rgba(255, 255, 255, 0.4);\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .ne-btn--icon-only {\n padding: 0;\n min-height: 0;\n opacity: 0.8;\n}\n.neeto-editor-bubble-menu .neeto-editor-bubble-menu__link .ne-btn--icon-only:hover {\n opacity: 1;\n}\n.neeto-editor-bubble-menu-animate-shake {\n -webkit-animation: 1s linear infinite alternate both shake;\n animation: 1s linear infinite alternate both shake;\n}\n.neeto-editor-image-uploader {\n display: flex;\n flex-direction: column;\n min-height: 184px;\n}\n.neeto-editor-image-uploader .ne-tab__wrapper .ne-tab {\n min-width: 88px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__content {\n flex-grow: 1;\n display: flex;\n padding: 16px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n text-align: center;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress-title, .neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-label {\n color: #49545c;\n font-size: 14px;\n margin-bottom: 4px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__progress-file, .neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-note {\n color: #c2c8cc;\n font-size: 12px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n border: 1px dashed #c2c8cc;\n box-sizing: border-box;\n border-radius: 2px;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-container {\n width: 100%;\n height: 100%;\n background-color: #ffffff;\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-container::-moz-focus-inner {\n border: 0;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-inner {\n display: flex;\n flex-direction: column;\n justify-content: center;\n line-height: 1.4;\n text-align: center;\n font-weight: 400;\n margin: 0;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-arrow {\n visibility: hidden;\n display: none;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop--isDraggingOver {\n background-color: #e9ebed;\n border: 2px dashed #5e5ce6;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd .uppy-DragDrop-browse {\n color: #5e5ce6;\n font-size: 14px;\n font-weight: 600;\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-image-uploader__dnd-wrapper .neeto-editor-image-uploader__dnd--error {\n color: #f56a58;\n font-size: 12px;\n margin-top: 12px;\n text-align: center;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper {\n width: 100%;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .ne-input__wrapper {\n width: 100%;\n flex-grow: 0;\n margin-bottom: 16px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container {\n max-height: 50vh;\n overflow-y: auto;\n overflow-x: hidden;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-container::-webkit-scrollbar-track {\n background: "transparent";\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery {\n width: 100%;\n right: -8px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item {\n width: 33.3%;\n padding-right: 16px;\n padding-bottom: 16px;\n float: left;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder {\n width: 100%;\n position: relative;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner {\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: #f8f9f9;\n border-radius: 2px;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner img {\n height: 100%;\n width: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n -webkit-animation: fade-in 1.2s 1s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n animation: fade-in 1.2s 1s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n border-radius: 2px;\n position: relative;\n cursor: pointer;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner a {\n opacity: 0;\n position: absolute;\n left: 8px;\n bottom: 8px;\n margin: auto;\n color: #ffffff;\n font-size: 12px;\n font-weight: 400;\n line-height: 1;\n text-transform: capitalize;\n transition: all 0.3s ease-in-out;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner a:hover {\n text-decoration: underline;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__item-placeholder .neeto-editor-unsplash-gallery__item-inner:hover a {\n opacity: 1;\n}\n.neeto-editor-image-uploader .neeto-editor-unsplash-wrapper .neeto-editor-unsplash-gallery__text {\n font-size: 12px;\n color: #2f3941;\n text-align: center;\n margin-top: 12px;\n}\n.neeto-editor-progress-bar__wrapper {\n width: 100%;\n max-width: 256px;\n margin-top: 10px;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__percent {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__percent p {\n font-size: 12px;\n color: #2f3941;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__indicator {\n position: relative;\n width: 100%;\n height: 6px;\n border-radius: 999px;\n overflow: hidden;\n background-color: rgba(94, 92, 230, 0.2);\n margin-top: 4px;\n}\n.neeto-editor-progress-bar__wrapper .neeto-editor-progress-bar__indicator-inner {\n height: 100%;\n background-color: #5e5ce6;\n}\n.neeto-editor-url-form__wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-grow: 1;\n padding: 0 24px;\n}\n.neeto-editor-url-form__wrapper .ne-input__wrapper {\n width: 100%;\n flex-grow: 0;\n margin-bottom: 16px;\n}\n.neeto-editor-emoji {\n font-family: apple color emoji, segoe ui emoji, noto color emoji, android emoji, emojisymbols, emojione mozilla, twemoji mozilla, segoe ui symbol;\n}\n.emoji-mart.emoji-mart-light {\n font-size: 14px;\n color: #2f3941;\n border: none;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor {\n color: #87929d;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor svg {\n margin: auto;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor .emoji-mart-anchor-bar {\n background-color: #2f3941 !important;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-bar .emoji-mart-anchors .emoji-mart-anchor.emoji-mart-anchor-selected {\n color: #2f3941 !important;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-search input {\n border-radius: 2px;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-category-label span {\n padding-top: 8px;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-emoji span {\n cursor: pointer;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-category .emoji-mart-emoji:hover::before {\n background-color: #e9ebed;\n border-radius: 2px;\n}\n.emoji-mart.emoji-mart-light .emoji-mart-scroll {\n height: 264px;\n padding-bottom: 0px;\n}\n.neeto-editor-emoji-suggestion {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n padding: 4px;\n gap: 2px;\n font-family: apple color emoji, segoe ui emoji, noto color emoji, android emoji, emojisymbols, emojione mozilla, twemoji mozilla, segoe ui symbol;\n}\n.neeto-editor-emoji-suggestion p {\n font-size: 12px;\n color: #2f3941;\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item {\n padding: 6px;\n font-size: 24px;\n transition: all 0.3s ease-in-out;\n border-radius: 2px;\n line-height: 1;\n cursor: pointer;\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item:hover {\n background-color: #e9ebed;\n}\n.neeto-editor-emoji-suggestion .neeto-editor-emoji-suggestion__item--selected {\n background-color: #e9ebed;\n}\n.neeto-editor-image-editor {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1.25rem;\n}\n.neeto-editor-image-editor figure {\n display: flex;\n flex-direction: column;\n justify-content: center;\n min-height: 208px;\n max-height: 400px;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n}\n.neeto-editor-image-editor figure img {\n height: 100%;\n width: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.neeto-editor-image-editor .ne-input__wrapper {\n width: 100%;\n}\n.neeto-editor-image-editor .neeto-editor-image-editor__footer {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 0.5rem;\n}\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;\n}\n.ProseMirror {\n overflow-y: auto;\n height: 100%;\n white-space: break-spaces;\n}\n.ProseMirror::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n}\n.ProseMirror::-webkit-scrollbar-thumb {\n background: #d8dcde;\n border-radius: 50px;\n}\n.ProseMirror::-webkit-scrollbar-track {\n background: "transparent";\n}\n.ProseMirror:focus {\n outline: none;\n}',{}),oe.prototype={constructor:oe,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return-1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new oe(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new oe(n)},addToStart:function(e,t){return new oe([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new oe(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new oe(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=oe.from(e)).size?new oe(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=oe.from(e)).size?new oe(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=oe.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},oe.from=function(e){if(e instanceof oe)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new oe(t)};class le{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(e,a)-a,t-a),o=!n):s.isLeaf?(r?i+="function"==typeof r?r(s):r:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new le(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new le(n,r)}cutByIndex(e,t){return e==t?le.empty:0==e&&t==this.content.length?this:new le(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new le(r,i)}addToStart(e){return new le([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new le(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return se(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return ae(this,e,t,n)}findIndex(e,t=-1){if(0==e)return ce(0,e);if(e==this.size)return ce(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?ce(n+1,i):ce(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return le.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new le(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return le.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new le(t||e,n)}static from(e){if(!e)return le.empty;if(e instanceof le)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new le([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}le.empty=new le([],0);const ue={index:0,offset:0};function ce(e,t){return ue.index=e,ue.offset=t,ue}function de(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!de(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!de(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class pe{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&de(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return pe.none;if(e instanceof pe)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}pe.none=[];class he extends Error{}class fe{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=ge(this.content,e+this.openStart,t);return n&&new fe(n,this.openStart,this.openEnd)}removeBetween(e,t){return new fe(me(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return fe.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new fe(le.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new fe(e,n,r)}}function me(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(me(o.content,t-i-1,n-i-1)))}function ge(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=ge(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function ye(e,t,n){if(n.openStart>e.depth)throw new he("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new he("Inconsistent open depths");return be(e,t,n,0)}function be(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=be(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(le.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return De(o,ke(e,i,s,t,r))}{let r=e.parent,i=r.content;return De(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return De(o,Ee(e,t,r))}function ve(e,t){if(!t.type.compatibleContent(e.type))throw new he("Cannot join "+t.type.name+" onto "+e.type.name)}function we(e,t,n){let r=e.node(n);return ve(r,t.node(n)),r}function xe(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Me(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(xe(e.nodeAfter,r),o++));for(let e=o;e<s;e++)xe(i.child(e),r);t&&t.depth==n&&t.textOffset&&xe(t.nodeBefore,r)}function De(e,t){if(!e.type.validContent(t))throw new he("Invalid content for node "+e.type.name);return e.copy(t)}function ke(e,t,n,r,i){let o=e.depth>i&&we(e,t,i+1),s=r.depth>i&&we(n,r,i+1),a=[];return Me(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(ve(o,s),xe(De(o,ke(e,t,n,r,i+1)),a)):(o&&xe(De(o,Ee(e,t,i+1)),a),Me(t,n,i,a),s&&xe(De(s,Ee(n,r,i+1)),a)),Me(r,null,i,a),new le(a)}function Ee(e,t,n){let r=[];if(Me(null,e,n,r),e.depth>n){xe(De(we(e,t,n+1),Ee(e,t,n+1)),r)}return Me(t,null,n,r),new le(r)}fe.empty=new fe(le.empty,0,0);class Ce{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return pe.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ae(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s)break;if(t=t.child(e),t.isText)break;i=s-1,r+=o+1}return new Ce(t,n,i)}static resolveCached(e,t){for(let n=0;n<Te.length;n++){let r=Te[n];if(r.pos==t&&r.doc==e)return r}let n=Te[Oe]=Ce.resolve(e,t);return Oe=(Oe+1)%Se,n}}let Te=[],Oe=0,Se=12;class Ae{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Ne=Object.create(null);class _e{constructor(e,t,n,r=pe.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||le.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&de(this.attrs,t||e.defaultAttrs||Ne)&&pe.sameSet(this.marks,n||pe.none)}copy(e=null){return e==this.content?this:new _e(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new _e(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return fe.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.node(o).content.cut(r.pos-s,i.pos-s);return new fe(a,r.depth-o,i.depth-o)}replace(e,t,n){return ye(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Ce.resolveCached(this,e)}resolveNoCache(e){return Ce.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ie(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=le.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let e=pe.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!pe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=le.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}_e.prototype.text=void 0;class je extends _e{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ie(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new je(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new je(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ie(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Le{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new ze(e,t);if(null==n.next)return Le.empty;let r=Pe(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n($e(e,0));function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);$e(e,n).forEach((e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new Le(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(He);o.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return o}}(function(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach((e=>e.to=t))}function o(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(o(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),i(o(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return i(o(e.expr,t),s),i(o(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(o(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();i(o(e.expr,s),t),s=t}if(-1==e.max)i(o(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),i(o(e.expr,s),t),s=t}return[r(s)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=o(e.exprs[r],t);if(r==e.exprs.length-1)return s;i(s,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return le.from(s.map((e=>e.createAndFill())));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r})).join("\n")}}Le.empty=new Le(!0);class ze{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Pe(e){let t=[];do{t.push(Fe(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Fe(e){let t=[];do{t.push(Re(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Re(e){let t=function(e){if(e.eat("(")){let t=Pe(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&i.push(r)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=Ue(e,t)}return t}function Be(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Ue(e,t){let n=Be(e),r=n;return e.eat(",")&&(r="}"!=e.next?Be(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function He(e,t){return t-e}function $e(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(He)}function Ve(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function We(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function qe(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Qe(e[n]);return t}class Ye{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=qe(n.attrs),this.defaultAttrs=Ve(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Le.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:We(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new _e(this,this.computeAttrs(e),le.from(t),pe.setFrom(n))}createChecked(e=null,t,n){if(t=le.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new _e(this,this.computeAttrs(e),t,pe.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=le.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(le.empty,!0);return i?new _e(this,e,t.append(i),pe.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:pe.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new Ye(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class Qe{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Ke{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=qe(r.attrs),this.excluded=null;let i=Ve(this.attrs);this.instance=i?new pe(this,i):null}create(e=null){return!e&&this.instance?this.instance:new pe(this,We(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new Ke(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class Ge{constructor(e){this.cached=Object.create(null),this.spec={nodes:oe.from(e.nodes),marks:oe.from(e.marks||{}),topNode:e.topNode},this.nodes=Ye.compile(this.spec.nodes,this),this.marks=Ke.compile(this.spec.marks,this);let t=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let n=this.nodes[e],r=n.spec.content||"",i=n.spec.marks;n.contentMatch=t[r]||(t[r]=Le.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==i?null:i?Je(this,i.split(" ")):""!=i&&n.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Je(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof Ye))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new je(n,n.defaultAttrs,e,pe.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return _e.fromJSON(this,e)}markFromJSON(e){return pe.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Je(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Xe{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new at(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new at(this,t,!0);return n.addAll(e,t.from,t.to),fe.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(lt(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ut(e)),e.mark=t}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=ut(e)),e.node=t}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Xe(e,Xe.schemaRules(e)))}}const Ze={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},et={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},tt={ol:!0,ul:!0},nt=1,rt=2,it=4;function ot(e,t,n){return null!=t?(t?nt:0)|("full"===t?rt:0):e&&"pre"==e.whitespace?nt|rt:n&~it}class st{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=pe.none,this.stashMarks=[],this.match=o||(s&it?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(le.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&nt)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=le.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(le.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):ct(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ze.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class at{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,o=ot(null,t.preserveWhitespace,0)|(n?it:0);r=i?new st(i.type,i.attrs,pe.none,pe.none,!0,t.topMatch||i.type.contentMatch,o):new st(n?null:e.schema.topNodeType,null,pe.none,pe.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style"),n=t?this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(let e=0;e<n.length;e++)this.addPendingMark(n[e]);if(this.addElement(e),null!=n)for(let e=0;e<n.length;e++)this.removePendingMark(n[e],r)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(n.options&rt||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&nt)t=n.options&rt?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();tt.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&tt.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:et.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let t,n=this.top,o=this.needsBlock;if(Ze.hasOwnProperty(r))t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=o}else this.addElementByRule(e,i,!1===i.consuming?n:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=pe.none;e:for(let n=0;n<e.length;n+=2)for(let r;;){let i=this.parser.matchStyle(e[n],e[n+1],this,r);if(!i)continue e;if(i.ignore)return null;if(t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;r=i}return t}addElementByRule(e,t,n){let r,i,o;if(t.node)i=this.parser.schema.nodes[t.node],i.isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace);else{o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o)}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let e=0;e<t.length;e++)this.enterInner(t[e],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let o=ot(e,r,i.options);i.options&it&&0==i.content.length&&(o|=it),this.nodes.push(new st(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)){t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function lt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ut(e){let t={};for(let n in e)t[n]=e[n];return t}function ct(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(o.indexOf(i)<0&&s(i))return!0}};if(s(i.contentMatch))return!0}}class dt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=ht(t).createDocumentFragment());let r=n,i=[];return e.forEach((e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=dt.renderSpec(ht(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&dt.renderSpec(ht(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let i=l;i<t.length;i++){let o=t[i];if(0===o){if(i<t.length-1||i>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:i}=dt.renderSpec(e,o,n);if(s.appendChild(t),i){if(r)throw new RangeError("Multiple content holes");r=i}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new dt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=pt(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return pt(e.marks)}}function pt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ht(e){return e.document||window.document}const ft=65535,mt=Math.pow(2,16);function gt(e,t){return e+t*mt}function yt(e){return e&ft}const bt=1,vt=2,wt=4,xt=8;class Mt{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&xt)>0}get deletedBefore(){return(this.delInfo&(bt|wt))>0}get deletedAfter(){return(this.delInfo&(vt|wt))>0}get deletedAcross(){return(this.delInfo&wt)>0}}class Dt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Dt.empty)return Dt.empty}recover(e){let t=0,n=yt(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(e&ft))/mt}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+i],u=this.ranges[s+o],c=a+l;if(e<=c){let i=a+r+((l?e==a?-1:e==c?1:t:t)<0?0:u);if(n)return i;let o=e==(t<0?a:c)?null:gt(s/3,e-a),d=e==a?vt:e==c?bt:wt;return(t<0?e!=a:e!=c)&&(d|=xt),new Mt(i,d,o)}r+=u-l}return n?e+r:new Mt(e+r,0,null)}touches(e,t){let n=0,r=yt(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+i];if(e<=s+a&&t==3*r)return!0;n+=this.ranges[t+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+t],u=this.ranges[r+n];e(s,s+l,a,a+u),i+=u-l}}invert(){return new Dt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Dt.empty:new Dt(e<0?[0,-e,0]:[0,0,e])}}Dt.empty=new Dt([]);class kt{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new kt(this.maps,this.mirror,e,t)}copy(){return new kt(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new kt;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this.maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this.maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Mt(e,r,null)}}const Et=Object.create(null);class Ct{getMap(){return Dt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Et[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Et)throw new RangeError("Duplicate use of step JSON ID "+e);return Et[e]=t,t.prototype.jsonID=e,t}}class Tt{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Tt(e,null)}static fail(e){return new Tt(null,e)}static fromReplace(e,t,n,r){try{return Tt.ok(e.replace(t,n,r))}catch(e){if(e instanceof he)return Tt.fail(e.message);throw e}}}function Ot(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(Ot(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return le.fromArray(r)}class St extends Ct{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new fe(Ot(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Tt.fromReplace(e,this.from,this.to,i)}invert(){return new At(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new St(t.pos,n.pos,this.mark)}merge(e){return e instanceof St&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new St(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new St(t.from,t.to,e.markFromJSON(t.mark))}}Ct.jsonID("addMark",St);class At extends Ct{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new fe(Ot(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Tt.fromReplace(e,this.from,this.to,n)}invert(){return new St(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new At(t.pos,n.pos,this.mark)}merge(e){return e instanceof At&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new At(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new At(t.from,t.to,e.markFromJSON(t.mark))}}Ct.jsonID("removeMark",At);class Nt extends Ct{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&jt(e,this.from,this.to)?Tt.fail("Structure replace would overwrite content"):Tt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Dt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Nt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Nt(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof Nt)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?fe.empty:new fe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Nt(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?fe.empty:new fe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Nt(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Nt(t.from,t.to,fe.fromJSON(e,t.slice),!!t.structure)}}Ct.jsonID("replace",Nt);class _t extends Ct{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(jt(e,this.from,this.gapFrom)||jt(e,this.gapTo,this.to)))return Tt.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Tt.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Tt.fromReplace(e,this.from,this.to,n):Tt.fail("Content does not fit in gap")}getMap(){return new Dt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new _t(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new _t(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new _t(t.from,t.to,t.gapFrom,t.gapTo,fe.fromJSON(e,t.slice),t.insert,!!t.structure)}}function jt(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function It(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Lt(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!It(r,i,o))break}return null}function zt(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<i;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return o?i.map(Pt).concat({type:t,attrs:n}).concat(o.map(Pt)):null}function Pt(e){return{type:e,attrs:null}}function Ft(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=r&&r[t]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function Rt(e,t){let n=e.resolve(t),r=n.index();return function(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Bt(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(o,o,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Ut(e,t,n=t,r=fe.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return Ht(i,o,r)?new Nt(t,n,r):new $t(i,o,r).fit()}function Ht(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Ct.jsonID("replaceAround",_t);class $t{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=le.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=le.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new fe(i,o,s);return e>-1?new _t(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Nt(n.pos,r.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,r=null;t?(r=qt(this.unplaced.content,t-1).firstChild,n=r.content):n=this.unplaced.content;let i=n.firstChild;for(let n=this.depth;n>=0;n--){let o,{type:s,match:a}=this.frontier[n],l=null;if(1==e&&(i?a.matchType(i.type)||(l=a.fillBefore(le.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:t,frontierDepth:n,parent:r,inject:l};if(2==e&&i&&(o=a.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:n,parent:r,wrap:o};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=qt(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new fe(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=qt(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new fe(Vt(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new fe(Vt(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,l=0,u=[],{match:c,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)u.push(r.child(e));c=c.matchFragment(r)}let p=s.size+e-(o.content.size-o.openEnd);for(;l<s.childCount;){let e=s.child(l),t=c.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(c=t,u.push(Yt(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?p:-1)))}let h=l==s.childCount;h||(p=-1),this.placed=Wt(this.placed,t,le.from(u)),this.frontier[t].match=c,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<p;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=h?0==e?fe.empty:new fe(Vt(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new fe(Vt(o.content,e,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Qt(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=Qt(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Qt(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Wt(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Wt(this.placed,this.depth,le.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(le.empty,!0);e.childCount&&(this.placed=Wt(this.placed,this.frontier.length,e))}}function Vt(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Vt(e.firstChild.content,t-1,n)))}function Wt(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Wt(e.lastChild.content,t-1,n)))}function qt(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Yt(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Yt(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(le.empty,!0)))),e.copy(r)}function Qt(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function Kt(e){return e.spec.defining||e.spec.definingForContent}function Gt(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Gt(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(le.empty,!0))}return e}function Jt(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}let Xt=class extends Error{};Xt=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Xt.prototype=Object.create(Error.prototype)).constructor=Xt,Xt.prototype.name="TransformError";class Zt{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new kt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Xt(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=fe.empty){let r=Ut(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new fe(le.from(n),0,0))}delete(e,t){return this.replace(e,t,fe.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(Ht(i,o,r))return e.step(new Nt(t,n,r));let s=Jt(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:i.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),u=[],c=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(u.push(n),t==r.openStart)break;e=n.content}for(let e=c-1;e>=0;e--){let t=u[e].type,n=Kt(t);if(n&&i.node(l).type!=t)c=e;else if(n||!t.isTextblock)break}for(let t=r.openStart;t>=0;t--){let a=(t+c+1)%(r.openStart+1),d=u[a];if(d)for(let t=0;t<s.length;t++){let u=s[(t+l)%s.length],c=!0;u<0&&(c=!1,u=-u);let p=i.node(u-1),h=i.index(u-1);if(p.canReplaceWith(h,h,d.type,d.marks))return e.replace(i.before(u),c?o.after(u):n,new fe(Gt(r.content,0,r.openStart,a),a,r.openEnd))}}let d=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,r),!(e.steps.length>d));a--){let e=s[a];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}(e.doc,t,r.type);null!=i&&(t=n=i)}e.replaceRange(t,n,new fe(le.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=Jt(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o)return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,u=a,c=le.empty,d=0;for(let e=o,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,c=le.from(r.node(e).copy(c)),d++):l--;let p=le.empty,h=0;for(let e=o,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,p=le.from(i.node(e).copy(p)),h++):u++;e.step(new _t(l,u,s,a,new fe(c.append(p),d,h),c.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=new Nt(t-n,t+n,fe.empty,!0);e.step(r)}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=le.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=le.from(n[e].type.create(n[e].attrs,r))}let i=t.start,o=t.end;e.step(new _t(i,o,i,o,new fe(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),r)){e.clearIncompatible(e.mapping.slice(o).map(n,1),r);let s=e.mapping.slice(o),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new _t(a,l,a+1,l-1,new fe(le.from(r.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r=[]){return function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new _t(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new fe(le.from(s),0,0),1,!0))}(this,e,t,n,r),this}split(e,t=1,n){return function(e,t,n=1,r){let i=e.doc.resolve(t),o=le.empty,s=le.empty;for(let e=i.depth,t=i.depth-n,a=n-1;e>t;e--,a--){o=le.from(i.node(e).copy(o));let t=r&&r[a];s=le.from(t?t.type.create(t.attrs,s):i.node(e).copy(s))}e.step(new Nt(t,t,new fe(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,u)=>{if(!e.isInline)return;let c=e.marks;if(!r.isInSet(c)&&u.type.allowsMarkType(r.type)){let u=Math.max(l,t),d=Math.min(l+e.nodeSize,n),p=r.addToSet(c);for(let e=0;e<c.length;e++)c[e].isInSet(p)||(i&&i.to==u&&i.mark.eq(c[e])?i.to=d:s.push(i=new At(u,d,c[e])));o&&o.to==u?o.to=d:a.push(o=new St(u,d,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;o++;let a=null;if(r instanceof Ke){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&l.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=o):i.push({style:l,from:Math.max(s,t),to:r,step:o})}}})),i.forEach((t=>e.step(new At(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<i.childCount;t++){let a=i.child(t),l=s+a.nodeSize,u=r.matchType(a.type);if(u){r=u;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new At(s,l,a.marks[t]))}else o.push(new Nt(s,l,fe.empty));s=l}if(!r.validEnd){let t=r.fillBefore(le.empty,!0);e.replace(s,s,new fe(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}(this,e,t,n),this}}const en=Object.create(null);class tn{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new nn(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=fe.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],u=e.mapping.slice(i);e.replaceRange(u.map(a.pos),u.map(l.pos),s?fe.empty:t),0==s&&hn(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=e.mapping.slice(n),l=a.map(o.pos),u=a.map(s.pos);i?e.deleteRange(l,u):(e.replaceRangeWith(l,u,t),hn(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new sn(e):pn(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?pn(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):pn(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new cn(e.node(0))}static atStart(e){return pn(e,e,0,0,1)||new cn(e)}static atEnd(e){return pn(e,e,e.content.size,e.childCount,-1)||new cn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=en[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in en)throw new RangeError("Duplicate use of selection JSON ID "+e);return en[e]=t,t.prototype.jsonID=e,t}getBookmark(){return sn.between(this.$anchor,this.$head).getBookmark()}}tn.prototype.visible=!0;class nn{constructor(e,t){this.$from=e,this.$to=t}}let rn=!1;function on(e){rn||e.parent.inlineContent||(rn=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class sn extends tn{constructor(e,t=e){on(e),on(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return tn.near(n);let r=e.resolve(t.map(this.anchor));return new sn(r.parent.inlineContent?r:n,n)}replace(e,t=fe.empty){if(super.replace(e,t),t==fe.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof sn&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new an(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new sn(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=tn.findFrom(t,n,!0)||tn.findFrom(t,-n,!0);if(!e)return tn.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(tn.findFrom(e,-n,!0)||tn.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new sn(e,t)}}tn.jsonID("text",sn);class an{constructor(e,t){this.anchor=e,this.head=t}map(e){return new an(e.map(this.anchor),e.map(this.head))}resolve(e){return sn.between(e.resolve(this.anchor),e.resolve(this.head))}}class ln extends tn{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?tn.near(i):new ln(i)}content(){return new fe(le.from(this.node),0,0)}eq(e){return e instanceof ln&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new un(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ln(e.resolve(t.anchor))}static create(e,t){return new ln(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}ln.prototype.visible=!1,tn.jsonID("node",ln);class un{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new an(n,n):new un(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&ln.isSelectable(n)?new ln(t):tn.near(t)}}class cn extends tn{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=fe.empty){if(t==fe.empty){e.delete(0,e.doc.content.size);let t=tn.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new cn(e)}map(e){return new cn(e)}eq(e){return e instanceof cn}getBookmark(){return dn}}tn.jsonID("all",cn);const dn={map(){return this},resolve:e=>new cn(e)};function pn(e,t,n,r,i,o=!1){if(t.inlineContent)return sn.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&ln.isSelectable(r))return ln.create(e,n-(i<0?r.nodeSize:0))}else{let t=pn(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function hn(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,o=e.steps[r];(o instanceof Nt||o instanceof _t)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(tn.near(e.doc.resolve(i),n)))}const fn=1,mn=2,gn=4;class yn extends Zt{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|fn)&~mn,this.storedMarks=null,this}get selectionSet(){return(this.updated&fn)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=mn,this}ensureMarks(e){return pe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&mn)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~mn,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||pe.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(tn.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=gn,this}get scrolledIntoView(){return(this.updated&gn)>0}}function bn(e,t){return t&&e?e.bind(t):e}class vn{constructor(e,t,n){this.name=e,this.init=bn(t.init,n),this.apply=bn(t.apply,n)}}const wn=[new vn("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new vn("selection",{init:(e,t)=>e.selection||tn.atStart(t.doc),apply:e=>e.selection}),new vn("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new vn("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class xn{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=wn.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new vn(e.key,e.spec.state,e))}))}}class Mn{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,u=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(u&&n.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(u),n=n.applyInner(u),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Mn(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new yn(this)}static create(e){let t=new xn(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Mn(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new xn(this.schema,e.plugins),n=t.fields,r=new Mn(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new xn(e.schema,e.plugins),i=new Mn(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=_e.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=tn.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=a.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function Dn(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=Dn(i,t,{})),n[r]=i}return n}class kn{constructor(e){this.spec=e,this.props={},e.props&&Dn(e.props,this,this.props),this.key=e.key?e.key.key:Cn("plugin")}getState(e){return e[this.key]}}const En=Object.create(null);function Cn(e){return e in En?e+"$"+ ++En[e]:(En[e]=0,e+"$")}class Tn{constructor(e="key"){this.key=Cn(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const On="undefined"!=typeof navigator?navigator:null,Sn="undefined"!=typeof document?document:null,An=On&&On.userAgent||"",Nn=/Edge\/(\d+)/.exec(An),_n=/MSIE \d/.exec(An),jn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(An),In=!!(_n||jn||Nn),Ln=_n?document.documentMode:jn?+jn[1]:Nn?+Nn[1]:0,zn=!In&&/gecko\/(\d+)/i.test(An);zn&&(/Firefox\/(\d+)/.exec(An)||[0,0])[1];const Pn=!In&&/Chrome\/(\d+)/.exec(An),Fn=!!Pn,Rn=Pn?+Pn[1]:0,Bn=!In&&!!On&&/Apple Computer/.test(On.vendor),Un=Bn&&(/Mobile\/\w+/.test(An)||!!On&&On.maxTouchPoints>2),Hn=Un||!!On&&/Mac/.test(On.platform),$n=/Android \d/.test(An),Vn=!!Sn&&"webkitFontSmoothing"in Sn.documentElement.style,Wn=Vn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,qn=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Yn=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let Qn=null;const Kn=function(e,t,n){let r=Qn||(Qn=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Gn=function(e,t,n,r){return n&&(Xn(e,t,n,r,-1)||Xn(e,t,n,r,1))},Jn=/^(img|br|input|textarea|hr)$/i;function Xn(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Zn(e))){let n=e.parentNode;if(!n||1!=n.nodeType||er(e)||Jn.test(e.nodeName)||"false"==e.contentEditable)return!1;t=qn(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?Zn(e):0}}}function Zn(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function er(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const tr=function(e){let t=e.isCollapsed;return t&&Fn&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function nr(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function rr(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function ir(e,t){return"number"==typeof e?e:e[t]}function or(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function sr(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Yn(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?rr(o):or(e),l=0,u=0;if(t.top<a.top+ir(r,"top")?u=-(a.top-t.top+ir(i,"top")):t.bottom>a.bottom-ir(r,"bottom")&&(u=t.bottom-a.bottom+ir(i,"bottom")),t.left<a.left+ir(r,"left")?l=-(a.left-t.left+ir(i,"left")):t.right>a.right-ir(r,"right")&&(l=t.right-a.right+ir(i,"right")),l||u)if(n)o.defaultView.scrollBy(l,u);else{let n=e.scrollLeft,r=e.scrollTop;u&&(e.scrollTop+=u),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n)break}}function ar(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Yn(r));return t}function lr(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let ur=null;function cr(e,t){let n,r,i=2e8,o=0,s=t.top,a=t.top;for(let l=e.firstChild,u=0;l;l=l.nextSibling,u++){let e;if(1==l.nodeType)e=l.getClientRects();else{if(3!=l.nodeType)continue;e=Kn(l).getClientRects()}for(let c=0;c<e.length;c++){let d=e[c];if(d.top<=s&&d.bottom>=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let e=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(e<i){n=l,i=e,r=e&&3==n.nodeType?{left:d.right<t.left?d.right:d.left,top:t.top}:t,1==l.nodeType&&e&&(o=u+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=u+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=fr(r,1);if(n.top!=n.bottom&&dr(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:o}:cr(n,r)}function dr(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function pr(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(dr(t,i))return pr(n,t,i)}}if((o=(o+1)%r)==i)break}return e}function hr(e,t){let n,r=e.dom.ownerDocument,i=0;if(r.caretPositionFromPoint)try{let e=r.caretPositionFromPoint(t.left,t.top);e&&({offsetNode:n,offset:i}=e)}catch(e){}if(!n&&r.caretRangeFromPoint){let e=r.caretRangeFromPoint(t.left,t.top);e&&({startContainer:n,startOffset:i}=e)}let o,s=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top+1);if(!s||!e.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=e.dom.getBoundingClientRect();if(!dr(t,n))return null;if(s=pr(e.dom,t,n),!s)return null}if(Bn)for(let e=s;n&&e;e=Yn(e))e.draggable&&(n=void 0);if(s=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(s,t),n){if(zn&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(o=function(e,t,n,r){let i=-1;for(let n=t;n!=e.dom;){let t=e.docView.nearestDesc(n,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>r.left||e.top>r.top)i=t.posBefore;else{if(!(e.right<r.left||e.bottom<r.top))break;i=t.posAfter}}n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,1)}(e,n,i,t))}null==o&&(o=function(e,t,n){let{node:r,offset:i}=cr(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:o,inside:a?a.posAtStart-a.border:-1}}function fr(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const mr=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function gr(e,t,n){let{node:r,offset:i}=e.docView.domFromPos(t,n<0?-1:1),o=Vn||zn;if(3==r.nodeType){if(!o||!mr.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,yr(fr(Kn(r,e,t),o),o<0)}{let e=fr(Kn(r,i,i),n);if(zn&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=fr(Kn(r,i-1,i-1),-1);if(t.top==e.top){let n=fr(Kn(r,i,i+1),-1);if(n.top!=e.top)return yr(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(n<0||i==Zn(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return br(e.getBoundingClientRect(),!1)}if(i<Zn(r)){let e=r.childNodes[i];if(1==e.nodeType)return br(e.getBoundingClientRect(),!0)}return br(r.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==Zn(r))){let e=r.childNodes[i-1],t=3==e.nodeType?Kn(e,Zn(e)-(o?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return yr(fr(t,1),!1)}if(i<Zn(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Kn(e,0,o?0:1):1==e.nodeType?e:null:null;if(t)return yr(fr(t,-1),!0)}return yr(fr(3==r.nodeType?Kn(r):r,-n),n>=0)}function yr(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function br(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function vr(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const wr=/[\u0590-\u08ac]/;let xr=null,Mr=null,Dr=!1;function kr(e,t,n){return xr==t&&Mr==n?Dr:(xr=t,Mr=n,Dr="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return vr(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let r=gr(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=Kn(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return wr.test(r.parent.textContent)&&a.modify?vr(e,t,(()=>{let t=a.getRangeAt(0),i=a.focusNode,o=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||i==a.focusNode&&o==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?o:s}(e,t,n))}const Er=0,Cr=1,Tr=2,Or=3;class Sr{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Er,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>qn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0};let n,r=0,i=0;for(let t=0;r<this.children.length;r++){let n=this.children[r],o=t+n.size;if(o>e||n instanceof zr){i=e-t;break}t=o}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Ar&&n.side>=0;r--);if(t<=0){let e,n=!0;for(;e=r?this.children[r-1]:null,e&&e.dom.parentNode!=this.contentDOM;r--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?qn(e.dom)+1:0}}{let e,n=!0;for(;e=r<this.children.length?this.children[r]:null,e&&e.dom.parentNode!=this.contentDOM;r++,n=!1);return e&&n&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?qn(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==r&&e<=a){let i=o+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=qn(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=qn(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],u=a+l.size;if(i>a&&o<u)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=u}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),u=!1;if((zn||Bn)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(u=!(!t||"\n"!=e.nodeValue[t-1]),u&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(s=a={node:t.parentNode,offset:qn(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(zn&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let e=l.focusNode.childNodes[l.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||u&&Bn)&&Gn(s.node,s.offset,l.anchorNode,l.anchorOffset)&&Gn(a.node,a.offset,l.focusNode,l.focusOffset))return;let c=!1;if((l.extend||e==t)&&!u){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),c=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!c){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?Tr:Cr,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=Or);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?Or:Tr}n=o}this.dirty=Tr}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?Tr:Cr;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Ar extends Sr{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,(()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Er&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Nr extends Sr{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class _r extends Sr{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=dt.renderSpec(document,t.type.spec.toDOM(t,n))),new _r(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return this.dirty&Or||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=Or&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Er){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=Er}}slice(e,t,n){let r=_r.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=Kr(i,t,o,n)),e>0&&(i=Kr(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}}class jr extends Sr{constructor(e,t,n,r,i,o,s,a,l){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s,o&&this.updateChildren(a,l)}static create(e,t,n,r,i,o){let s,a=i.nodeViews[t.type.name],l=a&&a(t,i,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),u=l&&l.dom,c=l&&l.contentDOM;if(t.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(t.text);else u||({dom:u,contentDOM:c}=dt.renderSpec(document,t.type.spec.toDOM(t)));c||t.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let d=u;return u=Vr(u,n,t),l?s=new Pr(e,t,n,r,u,c||null,d,l,i,o+1):t.isText?new Lr(e,t,n,r,u,d,i):new jr(e,t,n,r,u,c||null,d,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>le.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return this.dirty==Er&&e.eq(this.node)&&Wr(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new Yr(this,o&&o.node);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],l=null;for(let u=0;;){if(s<i.length&&i[s].to==o){let e,t=i[s++];for(;s<i.length&&i[s].to==o;)(e||(e=[t])).push(i[s++]);if(e){e.sort(Qr);for(let t=0;t<e.length;t++)n(e[t],u,!!l)}else n(t,u,!!l)}let c,d;if(l)d=-1,c=l,l=null;else{if(!(u<e.childCount))break;d=u,c=e.child(u++)}for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let p=o+c.nodeSize;if(c.isText){let e=p;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<p&&(l=c.cut(e-o),c=c.cut(0,e-o),p=e,d=-1)}let h=c.isInline&&!c.isLeaf?a.filter((e=>!e.inline)):a.slice();r(c,h,t.forChild(o,c),d),o=p}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?pe.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,l,u)=>{let c;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,l,u)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(c=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,l,c,e)||a.updateNextNode(t,o,l,e,u)||a.addNode(t,o,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Tr)&&(o&&this.protectLocalComposition(e,o),Fr(this.contentDOM,this.children,e),Un&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof sn)||n<t||r>t+this.node.content.size)return null;let i=e.domSelection(),o=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=Zn(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(i.focusNode,i.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;l+=t.text}if(o>=n){let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new Nr(this,i,t,r);e.input.compositionNodes.push(o),this.children=Kr(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(this.dirty==Or||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Er}updateOuterDeco(e){if(Wr(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Hr(this.dom,this.nodeDOM,Ur(this.outerDeco,this.node,t),Ur(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Ir(e,t,n,r,i){return Vr(r,t,e),new jr(void 0,e,t,n,r,r,r,i,0)}class Lr extends jr{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(this.dirty==Or||this.dirty!=Er&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==Er&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Er,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new Lr(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=Or)}get domAtom(){return!1}}class zr extends Sr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Er&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Pr extends jr{constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r,i,o,s,l,u),this.spec=a}update(e,t,n,r){if(this.dirty==Or)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Fr(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=qr(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof _r){let t=r?r.previousSibling:e.lastChild;Fr(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=qr(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Rr=function(e){e&&(this.nodeName=e)};Rr.prototype=Object.create(null);const Br=[new Rr];function Ur(e,t,n){if(0==e.length)return Br;let r=n?Br[0]:new Rr,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Rr(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new Rr(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}}return i}function Hr(e,t,n,r){if(n==Br&&r==Br)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||(t=document.createElement(o.nodeName),t.pmIsDeco=!0,t.appendChild(i),s=Br[0]),i=t}$r(i,s||Br[0],o)}return i}function $r(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function Vr(e,t,n){return Hr(e,e,Br,Ur(t,n,1!=e.nodeType))}function Wr(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function qr(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Yr{constructor(e,t){this.lock=t,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof _r)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,i=this.stack.length>>1,o=Math.min(i,e.length);for(;r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=Er,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++)if(this.top.children[t].matchesMark(e[i])){r=t;break}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=_r.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let r=this.index,i=Math.min(this.top.children.length,r+5);r<i;r++){let i=this.top.children[r];if(i.matchesNode(e,t,n)&&!this.preMatch.matched.has(i)){o=r;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return o.dirty==Or&&o.dom==o.contentDOM&&(o.dirty=Tr),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index=r+1,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,i){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof jr){let a=this.preMatch.matched.get(s);if(null!=a&&a!=i)return!1;let l=s.dom;if(!(this.lock&&(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Or&&Wr(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(e,t,n,r,i){this.top.children.splice(this.index++,0,jr.create(this.top,e,t,n,r,i)),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new Ar(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof _r;)t=e,e=t.children[t.children.length-1];e&&e instanceof Lr&&!/\n$/.test(e.node.text)||((Bn||Fn)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new zr(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}function Qr(e,t){return e.type.side-t.type.side}function Kr(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],u=a,c=a+=l.size;u>=n||c<=t?o.push(l):(u<t&&o.push(l.slice(0,t-u,r)),i&&(o.push(i),i=void 0),c>n&&o.push(l.slice(n-u,l.size,r)))}return o}function Gr(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,u=r.resolve(s);if(tr(n)){for(a=u;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&ln.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==Zn(e);r||i;){if(e==n)return!0;let t=qn(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==Zn(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new ln(s==e?u:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=oi(e,a,u,"pointer"==t||e.state.selection.head<u.pos&&!o?1:-1)}return l}function Jr(e){return e.editable?e.hasFocus():ai(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Xr(e,t=!1){let n=e.state.selection;if(ri(e,n),Jr(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Fn){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Gn(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,qn(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&In&&Ln<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,i,{anchor:o,head:s}=n;!Zr||n instanceof sn||(n.$from.parent.inlineContent||(r=ei(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=ei(e,n.to))),e.docView.setSelection(o,s,e.root,t),Zr&&(r&&ni(r),i&&ni(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Jr(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Zr=Bn||Fn&&Rn<63;function ei(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Bn&&i&&"false"==i.contentEditable)return ti(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return ti(i);if(o)return ti(o)}}function ti(e){return e.contentEditable="true",Bn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function ni(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function ri(e,t){if(t instanceof ln){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(ii(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else ii(e)}function ii(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function oi(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||sn.between(t,n,r)}function si(e){return(!e.editable||e.root.activeElement==e.dom)&&ai(e)}function ai(e){let t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function li(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&tn.findFrom(o,t)}function ui(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function ci(e,t,n){let r=e.state.selection;if(!(r instanceof sn)){if(r instanceof ln&&r.node.isInline)return ui(e,new sn(t>0?r.$to:r.$from));{let n=li(e.state,t);return!!n&&ui(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=li(e.state,t);return!!(n&&n instanceof ln)&&ui(e,n)}if(!(Hn&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(ln.isSelectable(o)?ui(e,new ln(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!Vn&&ui(e,new sn(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function di(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function pi(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function hi(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(zn&&1==n.nodeType&&r<di(n)&&pi(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(pi(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(mi(n))break;{let t=n.previousSibling;for(;t&&pi(t);)i=n.parentNode,o=qn(t),t=t.previousSibling;if(t)n=t,r=di(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?gi(e,t,n,r):i&&gi(e,t,i,o)}function fi(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=di(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!pi(n.childNodes[r]))break;i=n,o=++r}else{if(mi(n))break;{let t=n.nextSibling;for(;t&&pi(t);)i=t.parentNode,o=qn(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=di(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&gi(e,t,i,o)}function mi(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function gi(e,t,n,r){if(tr(t)){let e=document.createRange();e.setEnd(n,r),e.setStart(n,r),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&Xr(e)}),50)}function yi(e,t,n){let r=e.state.selection;if(r instanceof sn&&!r.empty||n.indexOf("s")>-1)return!1;if(Hn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=li(e.state,t);if(n&&n instanceof ln)return ui(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof cn?tn.near(n,t):tn.findFrom(n,t);return!!s&&ui(e,s)}return!1}function bi(e,t){if(!(e.state.selection instanceof sn))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function vi(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function wi(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||Hn&&72==n&&"c"==r?bi(e,-1)||hi(e):46==n||Hn&&68==n&&"c"==r?bi(e,1)||fi(e):13==n||27==n||(37==n||Hn&&66==n&&"c"==r?ci(e,-1,r)||hi(e):39==n||Hn&&70==n&&"c"==r?ci(e,1,r)||fi(e):38==n||Hn&&80==n&&"c"==r?yi(e,-1,r)||hi(e):40==n||Hn&&78==n&&"c"==r?function(e){if(!Bn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;vi(e,n,"true"),setTimeout((()=>vi(e,n,"false")),20)}return!1}(e)||yi(e,1,r)||fi(e):r==(Hn?"m":"c")&&(66==n||73==n||89==n||90==n))}function xi(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||dt.fromSchema(e.state.schema),a=Ni(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&1==c.nodeType&&(u=Si[c.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=a.createElement(u[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}c=l.firstChild}c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n");return{dom:l,text:p}}function Mi(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new fe(le.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):fe.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=dt.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Ni().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&Si[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=e,n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),Vn&&function(e){let t=e.querySelectorAll(Fn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let e=+c[3];e>0&&o.firstChild;e--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Xe.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!c),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Di.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(c)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=le.from(t.create(n[e+1],i)),o++,s++}return new fe(i,o,s)}(Oi(s,+c[1],+c[2]),c[4]);else if(s=fe.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&Ei(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Ci(o[o.length-1],r.length));let t=ki(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return le.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Oi(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const Di=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function ki(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,le.from(e));return e}function Ei(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=Ei(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(le.from(ki(n,e,i+1))))}}function Ci(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Ci(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(le.empty,!0);return e.copy(n.append(r))}function Ti(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return i<r-1&&(a=Ti(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(le.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Oi(e,t,n){return t<e.openStart&&(e=new fe(Ti(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new fe(Ti(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Si={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Ai=null;function Ni(){return Ai||(Ai=document.implementation.createHTMLDocument("title"))}const _i={};let ji={};class Ii{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Li(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function zi(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Pi(e,t))}))}function Pi(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Fi(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Ri(e){return{left:e.clientX,top:e.clientY}}function Bi(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,(t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1))))return!0;return!1}function Ui(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Hi(e,t,n,r,i){return Bi(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof ln&&(n=i.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(ln.isSelectable(t)){r=n&&i.$from.depth>0&&e>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(e);break}}return null!=r&&(Ui(e,ln.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&ln.isSelectable(r))&&(Ui(e,new ln(n),"pointer"),!0)}(e,n))}function $i(e,t,n,r){return Bi(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Vi(e,t,n,r){return Bi(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Ui(e,sn.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)Ui(e,sn.create(r,o+1,o+1+n.content.size),"pointer");else{if(!ln.isSelectable(n))continue;Ui(e,ln.create(r,o),"pointer")}return!0}}(e,n,r)}function Wi(e){return Xi(e)}ji.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Qi(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!$n||!Fn||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Un||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||wi(e,n)?n.preventDefault():Li(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,nr(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},ji.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},ji.keypress=(e,t)=>{let n=t;if(Qi(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Hn&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof sn&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const qi=Hn?"metaKey":"ctrlKey";_i.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Wi(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[qi]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(Ri(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Yi(e,s,n,!!r)):("doubleClick"==o?$i:Vi)(e,s.pos,s.inside,n)?n.preventDefault():Li(e,"pointer"))};class Yi{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[qi],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof ln&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!zn||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Li(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>Xr(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Ri(e))),this.allowDefault||!t?Li(this.view,"pointer"):Hi(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Bn&&this.mightDrag&&!this.mightDrag.node.isAtom||Fn&&!(this.view.state.selection instanceof sn)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ui(this.view,tn.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Li(this.view,"pointer")}move(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),Li(this.view,"pointer"),0==e.buttons&&this.done()}}function Qi(e,t){return!!e.composing||!!(Bn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}_i.touchdown=e=>{Wi(e),Li(e,"pointer")},_i.contextmenu=e=>Wi(e);const Ki=$n?5e3:-1;function Gi(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>Xi(e)),t))}function Ji(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Xi(e,t=!1){if(!($n&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Ji(e),t||e.docView&&e.docView.dirty){let t=Gr(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}ji.compositionstart=ji.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),Xi(e,!0),e.markCursor=null;else if(Xi(e),zn&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}Gi(e,Ki)},ji.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Gi(e,20))};const Zi=In&&Ln<15||Un&&Wn<604;function eo(e,t,n,r){let i=Mi(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||fe.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}_i.copy=ji.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=Zi?null:n.clipboardData,s=r.content(),{dom:a,text:l}=xi(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},ji.paste=(e,t)=>{let n=t;if(e.composing&&!$n)return;let r=Zi?null:n.clipboardData;r&&eo(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?eo(e,r.value,null,t):eo(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class to{constructor(e,t){this.slice=e,this.move=t}}const no=Hn?"altKey":"ctrlKey";_i.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Ri(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof ln?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(ln.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(ln.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=xi(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Zi?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Zi||n.dataTransfer.setData("text/plain",l),e.dragging=new to(s,!n[no])},_i.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},ji.dragover=ji.dragenter=(e,t)=>t.preventDefault(),ji.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Ri(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Mi(e,n.dataTransfer.getData(Zi?"Text":"text/plain"),Zi?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[no]);if(e.someProp("handleDrop",(t=>t(e,n,s||fe.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?Bt(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let u=e.state.tr;a&&u.deleteSelection();let c=u.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(p))return;let h=u.doc.resolve(c);if(d&&ln.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new ln(h));else{let t=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),u.setSelection(oi(e,h,u.doc.resolve(t)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))},_i.focus=e=>{e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&Xr(e)}),20))},_i.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},_i.beforeinput=(e,t)=>{if(Fn&&$n&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,nr(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in ji)_i[e]=ji[e];function ro(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class io{constructor(e,t){this.toDOM=e,this.spec=t||uo,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new ao(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof io&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ro(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class oo{constructor(e,t){this.attrs=e,this.spec=t||uo}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new ao(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof oo&&ro(this.attrs,e.attrs)&&ro(this.spec,e.spec)}static is(e){return e.type instanceof oo}destroy(){}}class so{constructor(e,t){this.attrs=e,this.spec=t||uo}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new ao(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof so&&ro(this.attrs,e.attrs)&&ro(this.spec,e.spec)}destroy(){}}class ao{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new ao(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new ao(e,e,new io(t,n))}static inline(e,t,n,r){return new ao(e,t,new oo(n,r))}static node(e,t,n,r){return new ao(e,t,new so(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof oo}}const lo=[],uo={};class co{constructor(e,t){this.local=e.length?e:lo,this.children=t.length?t:lo}static create(e,t){return t.length?yo(t,e,0,uo):po}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==po||0==e.maps.length?this:this.mapInner(e,t,0,0,n||uo)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice(),l=(e,t,n,r)=>{for(let s=0;s<a.length;s+=3){let l,u=a[s+1];if(u<0||e>u+o)continue;let c=a[s]+o;t>=c?a[s+1]=e<=c?-2:-1:n>=i&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l)}};for(let e=0;e<n.maps.length;e++)n.maps[e].forEach(l);let u=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){u=!0,a[t+1]=-1;continue}let l=n.map(e[t]+o),c=l-i;if(c<0||c>=r.content.size){u=!0;continue}let d=n.map(e[t+1]+o,-1)-i,{index:p,offset:h}=r.content.findIndex(c),f=r.maybeChild(p);if(f&&h==c&&h+f.nodeSize==d){let r=a[t+2].mapInner(n,f,l+1,e[t]+o+1,s);r!=po?(a[t]=c,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,u=!0)}else u=!0}if(u){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(r,i,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+o+1);return n}(a,e,t,n,i,o,s),u=yo(l,r,0,s);t=u.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<u.children.length;e+=3){let n=u.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,u.children[e],u.children[e+1],u.children[e+2])}}return new co(t.sort(bo),a)}(this.children,o||[],e,t,n,r,i):o?new co(o.sort(bo),lo):po}add(e,t){return t.length?this==po?co.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,a=o+n;if(s=mo(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,a+1):r.splice(i,0,o,o+e.nodeSize,yo(s,e,a+1,uo)),i+=3}}));let o=fo(i?go(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new co(o.length?this.local.concat(o).sort(bo):this.local,r||this.children)}remove(e){return 0==e.length||this==po?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(i||(i=[])).push(t));if(!i)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(i,o+1);a!=po?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,i=0;i<e.length;i++)if(n=e[i])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new co(r,n):po}forChild(e,t){if(this==po)return this;if(t.isLeaf)return co.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof oo){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new co(r.sort(bo),lo);return n?new ho([e,n]):e}return n||po}eq(e){if(this==e)return!0;if(!(e instanceof co)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return vo(this.localsInner(e))}localsInner(e){if(this==po)return lo;if(e.inlineContent||!this.local.some(oo.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof oo||t.push(this.local[e]);return t}}co.empty=new co([],[]),co.removeOverlap=vo;const po=co.empty;class ho{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,uo)));return ho.from(n)}forChild(e,t){if(t.isLeaf)return co.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=po&&(i instanceof ho?n=n.concat(i.members):n.push(i))}return ho.from(n)}eq(e){if(!(e instanceof ho)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?vo(n?t:t.sort(bo)):lo}static from(e){switch(e.length){case 0:return po;case 1:return e[0];default:return new ho(e)}}}function fo(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new ao(i.from+t,i.to+t,i.type))}return n}function mo(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t,o=0;o<e.length;o++)(t=e[o])&&t.from>n&&t.to<r&&((i||(i=[])).push(t),e[o]=null);return i}function go(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function yo(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=mo(e,t,s+n);if(a){o=!0;let e=yo(a,t,n+s+1,r);e!=po&&i.push(s,s+t.nodeSize,e)}}));let s=fo(o?go(e):e,-n).sort(bo);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new co(s,i):po}function bo(e,t){return e.from-t.from||e.to-t.to}function vo(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),wo(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),wo(t,i+1,o.copy(r.to,o.to)))}}return t}function wo(e,t,n){for(;t<e.length&&bo(n,e[t])>0;)t++;e.splice(t,0,n)}function xo(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=po&&t.push(r)})),e.cursorWrapper&&t.push(co.create(e.state.doc,[e.cursorWrapper.deco])),ho.from(t)}const Mo={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Do=In&&Ln<=11;class ko{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Eo{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ko,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);In&&Ln<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),Do&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&this.observer.observe(this.view.dom,Mo),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(si(this.view)){if(this.suppressingSelectionUpdates)return Xr(this.view);if(In&&Ln<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&Gn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&si(this.view)&&!this.ignoreSelectionChange(t),r=-1,i=-1,o=!1,s=[];if(this.view.editable)for(let t=0;t<e.length;t++){let n=this.registerMutation(e[t],s);n&&(r=r<0?n.from:Math.min(n.from,r),i=i<0?n.to:Math.max(n.to,i),n.typeOver&&(o=!0))}if(zn&&s.length>1){let e=s.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,i),function(e){if(Co)return;Co=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&console["warn"]("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,i,o,s),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||Xr(this.view),this.currentSelection.set(t))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(In&&Ln<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==e.target?qn(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?qn(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let Co=!1;function To(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Bn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Bn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function Oo(e,t,n,r,i){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Gr(e,t);if(n&&!e.state.selection.eq(n)){let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let a=e.state.selection,l=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),u=e.domSelection(),c=u.anchorNode;if(c&&e.dom.contains(1==c.nodeType?c:c.parentNode)&&(r=[{node:c,offset:u.anchorOffset}],tr(u)||r.push({node:u.focusNode,offset:u.focusOffset})),Fn&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let d=e.state.doc,p=e.someProp("domParser")||Xe.fromSchema(e.state.schema),h=d.resolve(a),f=null,m=p.parse(i,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:To,context:h});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n);if(Fn&&e.cursorWrapper&&l.sel&&l.sel.anchor==e.cursorWrapper.deco.from){let t=e.cursorWrapper.deco.type.toDOM.nextSibling,n=t&&t.nodeValue?t.nodeValue.length:1;l.sel={anchor:l.sel.anchor+n,head:l.sel.anchor+n}}let u,c,d=e.state.doc,p=d.slice(l.from,l.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(u=e.state.selection.to,c="end"):(u=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let h=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){r-=s+Math.max(0,o-Math.min(s,a))-o}if(s<o&&e.size<t.size){o-=r<=o&&r>=s?o-r:0,a=o+(a-s),s=o}else if(a<o){o-=r<=o&&r>=a?o-r:0,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(p.content,l.doc.content,l.from,u,c);if((Un&&e.input.lastIOSEnter>Date.now()-225||$n)&&i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",(t=>t(e,nr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!h){if(!(r&&a instanceof sn&&!a.empty&&a.$head.sameParent(a.$anchor))||e.composing||l.sel&&l.sel.anchor!=l.sel.head){if(l.sel){let t=So(e,e.state.doc,l.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}h={start:a.from,endA:a.to,endB:a.to}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&h.start==h.endB&&e.state.selection instanceof sn&&(h.start>e.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?h.start=e.state.selection.from:h.endA<e.state.selection.to&&h.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),In&&Ln<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>l.from&&"  "==l.doc.textBetween(h.start-l.from-1,h.start-l.from+1)&&(h.start--,h.endA--,h.endB--);let f,m=l.doc.resolveNoCache(h.start-l.from),g=l.doc.resolveNoCache(h.endB-l.from),y=d.resolve(h.start),b=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=h.endA;if((Un&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!b&&m.pos<l.doc.content.size&&(f=tn.findFrom(l.doc.resolve(m.pos+1),1,!0))&&f.head==g.pos)&&e.someProp("handleKeyDown",(t=>t(e,nr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>h.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||Ao(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(Ao(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Ao(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(d,h.start,h.endA,m,g)&&e.someProp("handleKeyDown",(t=>t(e,nr(8,"Backspace")))))return void($n&&Fn&&e.domObserver.suppressSelectionUpdates());Fn&&$n&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),$n&&!b&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==h.endA&&(h.endB-=2,g=l.doc.resolveNoCache(h.endB-l.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,nr(13,"Enter"))}))}),20));let v,w,x,M=h.start,D=h.endA;if(b)if(m.pos==g.pos)In&&Ln<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Xr(e)),20)),v=e.state.tr.delete(M,D),w=d.resolve(h.start).marksAcross(d.resolve(h.endA));else if(h.endA==h.endB&&(x=function(e,t){let n,r,i,o=e.firstChild.marks,s=t.firstChild.marks,a=o,l=s;for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);for(let e=0;e<o.length;e++)l=o[e].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let u=[];for(let e=0;e<t.childCount;e++)u.push(i(t.child(e)));if(le.from(u).eq(e))return{mark:r,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,h.endA-y.start()))))v=e.state.tr,"add"==x.type?v.addMark(M,D,x.mark):v.removeMark(M,D,x.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,M,D,t))))return;v=e.state.tr.insertText(t,M,D)}if(v||(v=e.state.tr.replace(M,D,l.doc.slice(h.start-l.from,h.endB-l.from))),l.sel){let t=So(e,v.doc,l.sel);t&&!(Fn&&$n&&e.composing&&t.empty&&(h.start!=h.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==M||t.head==v.mapping.map(D)-1)||In&&t.empty&&t.head==M)&&v.setSelection(t)}w&&v.ensureMarks(w),e.dispatch(v.scrollIntoView())}function So(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:oi(e,t.resolve(n.anchor),t.resolve(n.head))}function Ao(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class No{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Ii,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(zo),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Io(this),jo(this),this.nodeViews=Lo(this),this.docView=Ir(this.state.doc,_o(this),xo(this),this.dom,this),this.domObserver=new Eo(this,((e,t,n,r)=>Oo(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in _i){let n=_i[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Fi(e,t)||Pi(e,t)||!e.editable&&t.type in ji||n(e,t)})}Bn&&e.dom.addEventListener("input",(()=>null)),zi(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&zi(this),this._props=e,e.plugins&&(e.plugins.forEach(zo),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;if(e.storedMarks&&this.composing&&(Ji(this),i=!0),this.state=e,t){let e=Lo(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,r=!0),zi(this)}this.editable=Io(this),jo(this);let o=xo(this),s=_o(this),a=t?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",l=r||!this.docView.matchesNode(e.doc,s,o);!l&&e.selection.eq(n.selection)||(i=!0);let u="preserve"==a&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:ar(e.dom)}}(this);if(i){this.domObserver.stop();let t=l&&(In||Fn)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(l){let n=Fn?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(e.doc,s,o,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Ir(e.doc,s,o,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return Gn(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Xr(this,t):(ri(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(n),"reset"==a)this.dom.scrollTop=0;else if("to selection"==a){let t=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(e.selection instanceof ln){let n=this.docView.domAfterPos(e.selection.from);1==n.nodeType&&sr(this,n.getBoundingClientRect(),t)}else sr(this,this.coordsAtPos(e.selection.head,1),t)}else u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;lr(n,0==r?0:r-t)}(u)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let i=this.directPlugins[r].props[e];if(null!=i&&(n=t?t(i):i))return n}let i=this.state.plugins;if(i)for(let r=0;r<i.length;r++){let o=i[r].props[e];if(null!=o&&(n=t?t(o):o))return n}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(ur)return e.focus(ur);let t=ar(e);e.focus(null==ur?{get preventScroll(){return ur={preventScroll:!0},!0}}:void 0),ur||(ur=!1,lr(t,0))}(this.dom),Xr(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}posAtCoords(e){return hr(this,e)}coordsAtPos(e,t=1){return gr(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return kr(this,t||this.state,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],xo(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Pi(e,t)||!_i[t.type]||!e.editable&&t.type in ji||_i[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function _o(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e&&(t.class+=" "+n[e]),"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),[ao.node(0,e.state.doc.content.size,t)]}function jo(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:ao.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Io(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Lo(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function zo(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Po={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Fo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ro="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Bo="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Uo="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Ho="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),$o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Vo=Ro&&(Ho||+Ro[1]<57)||Uo&&Ho,Wo=0;Wo<10;Wo++)Po[48+Wo]=Po[96+Wo]=String(Wo);for(Wo=1;Wo<=24;Wo++)Po[Wo+111]="F"+Wo;for(Wo=65;Wo<=90;Wo++)Po[Wo]=String.fromCharCode(Wo+32),Fo[Wo]=String.fromCharCode(Wo);for(var qo in Po)Fo.hasOwnProperty(qo)||(Fo[qo]=Po[qo]);const Yo="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Qo(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);Yo?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Ko(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function Go(e){let t=function(e){let t=Object.create(null);for(let n in e)t[Qo(n)]=e[n];return t}(e);return function(e,n){let r,i=function(e){var t=!(Vo&&(e.ctrlKey||e.altKey||e.metaKey)||(Bo||$o)&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Fo:Po)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),o=1==i.length&&" "!=i,s=t[Ko(i,n,!o)];if(s&&s(e.state,e.dispatch,e))return!0;if(o&&(n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=Po[n.keyCode])&&r!=i){let i=t[Ko(r,n,!0)];if(i&&i(e.state,e.dispatch,e))return!0}else if(o&&n.shiftKey){let r=t[Ko(i,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}function Jo(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function Xo(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Zo(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function es(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function ts(e,t,n){let r,i,o=t.nodeBefore,s=t.nodeAfter;if(o.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!i.isTextblock&&!Rt(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(r[0]||s.type).validEnd){if(n){let i=t.pos+s.nodeSize,a=le.empty;for(let e=r.length-1;e>=0;e--)a=le.from(r[e].create(null,a));a=le.from(o.copy(a));let l=e.tr.step(new _t(t.pos-1,i,t.pos,i,new fe(a,1,0),r.length,!0)),u=i+2*r.length;Rt(l.doc,u)&&l.join(u),n(l.scrollIntoView())}return!0}let l=tn.findFrom(t,1),u=l&&l.$from.blockRange(l.$to),c=u&&Lt(u);if(null!=c&&c>=t.depth)return n&&n(e.tr.lift(u,c).scrollIntoView()),!0;if(a&&Jo(s,"start",!0)&&Jo(o,"end")){let r=o,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=le.empty;for(let e=i.length-1;e>=0;e--)r=le.from(i[e].copy(r));n(e.tr.step(new _t(t.pos-i.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new fe(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ns(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(sn.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const rs=ns(-1),is=ns(1);function ss(e,t=null){return function(n,r){let{from:i,to:o}=n.selection,s=!1;return n.doc.nodesBetween(i,o,((r,i)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(i),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0)}}function as(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);l=new Ae(e,e,s.depth),s.endIndex<s.parent.childCount&&(s=new Ae(i,n.doc.resolve(o.end(s.depth)),s.depth)),a=!0}let u=zt(l,e,t,s);return!!u&&(r&&r(function(e,t,n,r,i){let o=le.empty;for(let e=n.length-1;e>=0;e--)o=le.from(n[e].type.create(n[e].attrs,o));e.step(new _t(t.start-(r?2:0),t.end,t.start,t.end,new fe(o,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==i&&(s=e+1);let a=n.length-s,l=t.start+n.length-(r?2:0),u=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&Ft(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=u.child(n).nodeSize;return e}(n.tr,s,u,a,e).scrollIntoView()),!0)}}function ls(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));return!!o&&(!n||(r.node(o.depth-1).type==e?function(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new _t(o-1,s,o,s,new fe(le.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ae(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));return t(i.lift(r,Lt(r)).scrollIntoView()),!0}(t,n,e,o):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,o=n.startIndex;t>o;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?le.empty:le.from(i))))return!1;let d=o.pos,p=d+s.nodeSize;return r.step(new _t(d-(a?1:0),p+(l?1:0),d+1,p-1,new fe((a?le.empty:le.from(i.copy(le.empty))).append(l?le.empty:le.from(i.copy(le.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,o)))}}function us(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class cs{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,l=e||i.tr,u={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),i=n(...e)(r);return s.push(i),u}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(l),s.every((e=>!0===e)))};return u}createCan(e){const{rawCommands:t,state:n}=this,r=void 0,i=e||n.tr,o=this.buildProps(i,r),s=Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:r})])));return{...s,chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:o}=r;i.storedMarks&&e.setStoredMarks(i.storedMarks);const s={tr:e,editor:r,view:o,state:us({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(s)])))}};return s}}function ds(e,t,n){if(void 0===e.config[t]&&e.parent)return ds(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?ds(e.parent,t,n):null})}return e.config[t]}function ps(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function hs(e){const t=[],{nodeExtensions:n,markExtensions:r}=ps(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=ds(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})}))}))}))})),i.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=ds(e,"addAttributes",n);if(!r)return;const i=r();Object.entries(i).forEach((([n,r])=>{const i={...o,...r};r.isRequired&&void 0===r.default&&delete i.default,t.push({type:e.name,name:n,attribute:i})}))})),t}function fs(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function ms(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]="class"===e?[n[e],t].join(" "):"style"===e?[n[e],t].join("; "):t:n[e]=t})),n}),{})}function gs(e,t){return t.filter((e=>e.attribute.rendered)).map((t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]})).reduce(((e,t)=>ms(e,t)),{})}function ys(e){return"function"==typeof e}function bs(e,t=void 0,...n){return ys(e)?t?e.bind(t)(...n):e(...n):e}function vs(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const i=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...i}}}}function ws(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function xs(e,t){return t.nodes[e]||t.marks[e]||null}function Ms(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function Ds(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class ks{constructor(e){this.find=e.find,this.handler=e.handler}}function Es(e){var t;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(null===(t=u.nodeBefore||u.nodeAfter)||void 0===t?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let c=!1;const d=((e,t=500)=>{let n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,((t,r,i,o)=>{var s,a,l;n+=(null===(a=(s=t.type.spec).toText)||void 0===a?void 0:a.call(s,{node:t,pos:r,parent:i,index:o}))||(null===(l=e.nodeBefore)||void 0===l?void 0:l.text)||"%leaf%"})),n})(u)+o;return s.forEach((e=>{if(c)return;const t=((e,t)=>{if(Ds(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[];return r.push(n.text),r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(d,e.find);if(!t)return;const s=l.state.tr,u=us({state:l.state,transaction:s}),p={from:r-(t[0].length-o.length),to:i},{commands:h,chain:f,can:m}=new cs({editor:n,state:u});null!==e.handler({state:u,range:p,match:t,commands:h,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:i,text:o}),l.dispatch(s),c=!0)})),c}function Cs(e){const{editor:t,rules:n}=e,r=new kn({state:{init:()=>null,apply(e,t){const n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(e,i,o,s)=>Es({editor:t,from:i,to:o,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:i}=e.state.selection;i&&Es({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;const{$cursor:o}=e.state.selection;return!!o&&Es({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class Ts{constructor(e){this.find=e.find,this.handler=e.handler}}function Os(e){const{editor:t,state:n,from:r,to:i,rule:o}=e,{commands:s,chain:a,can:l}=new cs({editor:t,state:n}),u=[];n.doc.nodesBetween(r,i,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const c=Math.max(r,t),d=Math.min(i,t+e.content.size),p=((e,t)=>{if(Ds(t))return[...e.matchAll(t)];const n=t(e);return n?n.map((t=>{const n=[];return n.push(t.text),n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]})(e.textBetween(c-t,d-t,void 0,""),o.find);p.forEach((e=>{if(void 0===e.index)return;const t=c+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},d=o.handler({state:n,range:i,match:e,commands:s,chain:a,can:l});u.push(d)}))}));return u.every((e=>null!==e))}function Ss(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1;return n.map((e=>new kn({view(e){const t=t=>{var n;r=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:e=>(o=r===e.dom.parentElement,!1),paste:(e,t)=>{var n;const r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!i,u="drop"===a.getMeta("uiEvent")&&!o;if(!l&&!u)return;const c=r.doc.content.findDiffStart(s.doc.content),d=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof c||!d||c===d.b)return;const p=s.tr,h=us({state:s,transaction:p});return Os({editor:t,state:h,from:Math.max(c-1,0),to:d.b,rule:e})&&p.steps.length?p:void 0}})))}class As{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=As.resolve(e),this.schema=function(e){var t;const n=hs(e),{nodeExtensions:r,markExtensions:i}=ps(e),o=null===(t=r.find((e=>ds(e,"topNode"))))||void 0===t?void 0:t.name,s=Object.fromEntries(r.map((t=>{const r=n.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage},o=e.reduce(((e,n)=>{const r=ds(n,"extendNodeSchema",i);return{...e,...r?r(t):{}}}),{}),s=ws({...o,content:bs(ds(t,"content",i)),marks:bs(ds(t,"marks",i)),group:bs(ds(t,"group",i)),inline:bs(ds(t,"inline",i)),atom:bs(ds(t,"atom",i)),selectable:bs(ds(t,"selectable",i)),draggable:bs(ds(t,"draggable",i)),code:bs(ds(t,"code",i)),defining:bs(ds(t,"defining",i)),isolating:bs(ds(t,"isolating",i)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=bs(ds(t,"parseHTML",i));a&&(s.parseDOM=a.map((e=>vs(e,r))));const l=ds(t,"renderHTML",i);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:gs(e,r)}));const u=ds(t,"renderText",i);return u&&(s.toText=u),[t.name,s]}))),a=Object.fromEntries(i.map((t=>{const r=n.filter((e=>e.type===t.name)),i={name:t.name,options:t.options,storage:t.storage},o=e.reduce(((e,n)=>{const r=ds(n,"extendMarkSchema",i);return{...e,...r?r(t):{}}}),{}),s=ws({...o,inclusive:bs(ds(t,"inclusive",i)),excludes:bs(ds(t,"excludes",i)),group:bs(ds(t,"group",i)),spanning:bs(ds(t,"spanning",i)),code:bs(ds(t,"code",i)),attrs:Object.fromEntries(r.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),a=bs(ds(t,"parseHTML",i));a&&(s.parseDOM=a.map((e=>vs(e,r))));const l=ds(t,"renderHTML",i);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:gs(e,r)})),[t.name,s]})));return new Ge({topNode:o,nodes:s,marks:a})}(this.extensions),this.extensions.forEach((e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:xs(e.name,this.schema)};if("mark"===e.type){(null===(t=bs(ds(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const r=ds(e,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const i=ds(e,"onCreate",n);i&&this.editor.on("create",i);const o=ds(e,"onUpdate",n);o&&this.editor.on("update",o);const s=ds(e,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=ds(e,"onTransaction",n);a&&this.editor.on("transaction",a);const l=ds(e,"onFocus",n);l&&this.editor.on("focus",l);const u=ds(e,"onBlur",n);u&&this.editor.on("blur",u);const c=ds(e,"onDestroy",n);c&&this.editor.on("destroy",c)}))}static resolve(e){const t=As.sort(As.flatten(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return[...new Set(t)]}(t.map((e=>e.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e=>`'${e}'`)).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map((e=>{const t=ds(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e})).flat(10)}static sort(e){const t=100;return e.sort(((e,n)=>{const r=ds(e,"priority")||t,i=ds(n,"priority")||t;return r>i?-1:r<i?1:0}))}get commands(){return this.extensions.reduce(((e,t)=>{const n=ds(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:xs(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=As.sort([...this.extensions].reverse()),n=[],r=[],i=t.map((t=>{const i={name:t.name,options:t.options,storage:t.storage,editor:e,type:xs(t.name,this.schema)},o=[],s=ds(t,"addKeyboardShortcuts",i);if(s){const t=function(e){return new kn({props:{handleKeyDown:Go(e)}})}(Object.fromEntries(Object.entries(s()).map((([t,n])=>[t,()=>n({editor:e})]))));o.push(t)}const a=ds(t,"addInputRules",i);Ms(t,e.options.enableInputRules)&&a&&n.push(...a());const l=ds(t,"addPasteRules",i);Ms(t,e.options.enablePasteRules)&&l&&r.push(...l());const u=ds(t,"addProseMirrorPlugins",i);if(u){const e=u();o.push(...e)}return o})).flat();return[Cs({editor:e,rules:n}),...Ss({editor:e,rules:r}),...i]}get attributes(){return hs(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=ps(this.extensions);return Object.fromEntries(t.filter((e=>!!ds(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:fs(t.name,this.schema)},i=ds(t,"addNodeView",r);if(!i)return[];return[t.name,(r,o,s,a)=>{const l=gs(r,n);return i()({editor:e,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:t})}]})))}}function Ns(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function _s(e,t){const n={...e};return Ns(e)&&Ns(t)&&Object.keys(t).forEach((r=>{Ns(t[r])?r in e?n[r]=_s(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})})),n}class js{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=bs(ds(this,"addOptions",{name:this.name}))),this.storage=bs(ds(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new js(e)}configure(e={}){const t=this.extend();return t.options=_s(this.options,e),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new js(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=bs(ds(t,"addOptions",{name:t.name})),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}}function Is(e,t,n){const{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return e.nodesBetween(r,i,((e,n,u,c)=>{var d;const p=null==s?void 0:s[e.type.name];p?(e.isBlock&&!l&&(a+=o,l=!0),u&&(a+=p({node:e,pos:n,parent:u,index:c,range:t}))):e.isText?(a+=null===(d=null==e?void 0:e.text)||void 0===d?void 0:d.slice(Math.max(r,n)-n,i-n),l=!1):e.isBlock&&!l&&(a+=o,l=!0)})),a}function Ls(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}const zs=js.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new kn({key:new Tn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map((e=>e.$from.pos))),a=Math.max(...o.map((e=>e.$to.pos)));return Is(r,{from:s,to:a},{textSerializers:Ls(n)})}}})]}});function Ps(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:Ds(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Fs(e,t,n={}){return e.find((e=>e.type===t&&Ps(e.attrs,n)))}function Rs(e,t,n={}){return!!Fs(e,t,n)}function Bs(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=Fs([...r.node.marks],t,n);if(!i)return;let o=r.index,s=e.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(Fs([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,s-=e.parent.child(o).nodeSize;for(;a<e.parent.childCount&&Rs([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Us(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function Hs(e){return e&&"object"==typeof e&&!Array.isArray(e)&&!function(e){var t;return"class"===(null===(t=e.constructor)||void 0===t?void 0:t.toString().substring(0,5))}(e)}function $s(e){return Hs(e)&&e instanceof sn}function Vs(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Ws(e,t=null){if(!t)return null;const n=tn.atStart(e),r=tn.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const i=n.from,o=r.to;return"all"===t?sn.create(e,Vs(0,i,o),Vs(e.content.size,i,o)):sn.create(e,Vs(t,i,o),Vs(t,i,o))}function qs(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ys(e){const t=`<body>${e}</body>`;return(new window.DOMParser).parseFromString(t,"text/html").body}function Qs(e,t,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{return Array.isArray(e)?le.fromArray(e.map((e=>t.nodeFromJSON(e)))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Qs("",t,n)}if("string"==typeof e){const r=Xe.fromSchema(t);return n.slice?r.parseSlice(Ys(e),n.parseOptions).content:r.parse(Ys(e),n.parseOptions)}return Qs("",t,n)}function Ks(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Gs(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,s=t?fs(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:o})}));const l=i-r,u=a.filter((e=>!s||s.name===e.node.type.name)).filter((e=>Ps(e.node.attrs,n,{strict:!1})));if(o)return!!u.length;return u.reduce(((e,t)=>e+t.to-t.from),0)>=l}function Js(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Xs(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}function Zs(e,t,n={}){return Qs(e,t,{slice:!1,parseOptions:n})}function ea(e,t){const n=Us(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function ta(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}function na(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}function ra(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function ia(e,t){const{nodeExtensions:n}=ps(t),r=n.find((t=>t.name===e));if(!r)return!1;const i=bs(ds(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof i&&i.split(" ").includes("list")}const oa=(e,t)=>{const n=ra((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!Rt(e.doc,n.pos)||(e.join(n.pos),!0)},sa=(e,t)=>{const n=ra((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const i=e.doc.nodeAt(r);return n.node.type!==(null==i?void 0:i.type)||!Rt(e.doc,r)||(e.join(r),!0)};function aa(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Us(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!o||o.name===e.type.name)).find((e=>Ps(e.attrs,n,{strict:!1})));let s=0;const a=[];if(i.forEach((({$from:t,$to:n})=>{const r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);s+=o-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:o}))))}))})),0===s)return!1;const l=a.filter((e=>!o||o.name===e.mark.type.name)).filter((e=>Ps(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),u=a.filter((e=>!o||e.mark.type!==o&&e.mark.type.excludes(o))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+u:l)>=s}var la=Object.freeze({__proto__:null,blur:()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return!n||(i.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),a=o.blockRange(s);if(!a)return;const l=Lt(a);if(e.type.isTextblock){const{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof cn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=es(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(sn.create(s.doc,n+1)),t(s.scrollIntoView())}return!0})(e,t),deleteNode:e=>({tr:t,state:n,dispatch:r})=>{const i=fs(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1){if(o.node(e).type===i){if(r){const n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},deleteSelection:()=>({state:e,dispatch:t})=>((e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0))(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=es(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(tn.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0})(e,t),extendMarkRange:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Us(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){const e=Bs(l,o,t);if(e&&e.from<=u&&e.to>=c){const t=sn.create(s,e.from,e.to);n.setSelection(t)}}return!0},first:e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},focus:(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{qs()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===e||!1===e)return!0;if(o&&null===e&&!$s(n.state.selection))return s(),!0;const a=Ws(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),insertContent:(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const i=Qs(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===i.toString())return!0;let{from:s,to:a}="number"==typeof e?{from:e,to:e}:e,l=!0,u=!0;if((i.toString().startsWith("<")?i:[i]).forEach((e=>{e.check(),l=!!l&&(e.isText&&0===e.marks.length),u=!!u&&e.isBlock})),s===a&&u){const{parent:e}=r.doc.resolve(s);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(s-=1,a+=1)}l?r.insertText(t,s,a):r.replaceWith(s,a,i),n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Nt||i instanceof _t))return;const o=e.mapping.maps[r];let s=0;o.forEach(((e,t,n,r)=>{0===s&&(s=r)})),e.setSelection(tn.near(e.doc.resolve(s),n))}(r,r.steps.length-1,-1)}return!0},joinBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=Xo(r);if(!i){let n=r.blockRange(),i=n&&Lt(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&ts(e,i,t))return!0;if(0==r.parent.content.size&&(Jo(o,"end")||ln.isSelectable(o))){let n=Ut(e.doc,r.before(),r.after(),fe.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Jo(o,"end")?tn.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):ln.create(r.doc,i.pos-o.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),0))})(e,t),joinForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;let i=Zo(r);if(!i)return!1;let o=i.nodeAfter;if(ts(e,i,t))return!0;if(0==r.parent.content.size&&(Jo(o,"start")||ln.isSelectable(o))){let n=Ut(e.doc,r.before(),r.after(),fe.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Jo(o,"start")?tn.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):ln.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),0))})(e,t),keyboardShortcut:e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=function(e){const t=e.split(/-(?!$)/);let n,r,i,o,s=t[t.length-1];"Space"===s&&(s=" ");for(let e=0;e<t.length-1;e+=1){const s=t[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);qs()||Ks()?o=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),o&&(s=`Meta-${s}`),i&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=o.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&i&&r.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:r})=>!!Gs(n,fs(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Lt(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:e,dispatch:t})=>((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Ft(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Lt(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)})(e,t),liftListItem:e=>({state:t,dispatch:n})=>ls(fs(e,t.schema))(t,n),newlineInCode:()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))})(e,t),resetAttributes:(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Js("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=fs(e,r.schema)),"mark"===a&&(s=Us(e,r.schema)),i&&n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,Xs(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((i=>{s===i.type&&n.addMark(r,r+e.nodeSize,s.create(Xs(i.attrs,t)))}))}))})),!0)},scrollIntoView:()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),selectAll:()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),selectNodeBackward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=Xo(r)}let s=o&&o.nodeBefore;return!(!s||!ln.isSelectable(s)||(t&&t(e.tr.setSelection(ln.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),0))})(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=Zo(r)}let s=o&&o.nodeAfter;return!(!s||!ln.isSelectable(s)||(t&&t(e.tr.setSelection(ln.create(e.doc,o.pos)).scrollIntoView()),0))})(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:i}=e.selection,o=r.sharedDepth(i);return 0!=o&&(n=r.before(o),t&&t(e.tr.setSelection(ln.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>is(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>rs(e,t),setContent:(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,a=Zs(e,i.schema,n);return o&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!t),!0},setMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Us(e,r.schema);if(i)if(s){const e=ea(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,((e,r)=>{const s=Math.max(r,i),a=Math.min(r+e.nodeSize,o);e.marks.find((e=>e.type===l))?e.marks.forEach((e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))})):n.addMark(s,a,l.create(t))}))}));return!0},setMeta:(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=fs(e,n.schema);return o.isTextblock?i().command((({commands:e})=>!!ss(o,t)(n)||e.clearNodes())).command((({state:e})=>ss(o,t)(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=tn.atStart(n).from,i=tn.atEnd(n).to,o=Vs(e,r,i),s=ln.create(n,o);t.setSelection(s)}return!0},setTextSelection:e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=sn.atStart(n).from,s=sn.atEnd(n).to,a=Vs(r,o,s),l=Vs(i,o,s),u=sn.create(n,a,l);t.setSelection(u)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const r=fs(e,t.schema);return(i=r,function(e,t){let{$from:n,$to:r}=e.selection,o=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==i));if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=i)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,r=le.from(n?i.create():null),s=new fe(le.from(i.create(null,le.from(a.type.create(null,r)))),n?3:1,0),u=o.start,c=o.end;t(e.tr.step(new _t(u-(n?3:1),c,u,c,s,1,!0)).scrollIntoView())}return!0})(t,n);var i},splitBlock:({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=t,{$from:a,$to:l}=o,u=ta(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(o instanceof ln&&o.node.isBlock)return!(!a.parentOffset||!Ft(s,a.pos))&&(r&&(e&&na(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;o instanceof sn&&t.deleteSelection();const s=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let c=r&&s?[{type:s,attrs:u}]:void 0,d=Ft(t.doc,t.mapping.map(a.pos),1,c);if(c||d||!Ft(t.doc,t.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(d=!0,c=s?[{type:s,attrs:u}]:void 0),d&&(t.split(t.mapping.map(a.pos),1,c),s&&!r&&!a.parentOffset&&a.parent.type!==s)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&t.setNodeMarkup(t.mapping.map(a.before()),s)}e&&na(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},splitListItem:e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const s=fs(e,n.schema),{$from:a,$to:l}=n.selection,u=n.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const d=i.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let e=le.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-n;t>=a.depth-3;t-=1)e=le.from(a.node(t).copy(e));const r=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,i=ta(d,a.node().type.name,a.node().attrs),l=(null===(o=s.contentMatch.defaultType)||void 0===o?void 0:o.createAndFill(i))||void 0;e=e.append(le.from(s.createAndFill(null,l)||void 0));const u=a.before(a.depth-(n-1));t.replace(u,a.after(-r),new fe(e,4-n,0));let c=-1;t.doc.nodesBetween(u,t.doc.content.size,((e,t)=>{if(c>-1)return!1;e.isTextblock&&0===e.content.size&&(c=t+1)})),c>-1&&t.setSelection(sn.near(t.doc.resolve(c))),t.scrollIntoView()}return!0}const p=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,h=ta(d,c.type.name,c.attrs),f=ta(d,a.node().type.name,a.node().attrs);t.delete(a.pos,l.pos);const m=p?[{type:s,attrs:h},{type:p,attrs:f}]:[{type:s,attrs:h}];return!!Ft(t.doc,a.pos,2)&&(r&&t.split(a.pos,2,m).scrollIntoView(),!0)},toggleList:(e,t)=>({editor:n,tr:r,state:i,dispatch:o,chain:s,commands:a,can:l})=>{const{extensions:u}=n.extensionManager,c=fs(e,i.schema),d=fs(t,i.schema),{selection:p}=i,{$from:h,$to:f}=p,m=h.blockRange(f);if(!m)return!1;const g=ra((e=>ia(e.type.name,u)))(p);if(m.depth>=1&&g&&m.depth-g.depth<=1){if(g.node.type===c)return a.liftListItem(d);if(ia(g.node.type.name,u)&&c.validContent(g.node.content)&&o)return s().command((()=>(r.setNodeMarkup(g.pos,c),!0))).command((()=>oa(r,c))).command((()=>sa(r,c))).run()}return s().command((()=>!!l().wrapInList(c)||a.clearNodes())).wrapInList(c).command((()=>oa(r,c))).command((()=>sa(r,c))).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Us(e,r.schema);return aa(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=fs(e,r.schema),s=fs(t,r.schema);return Gs(r,o,n)?i.setNode(s):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=fs(e,n.schema);return Gs(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const t=e.tr,n=o.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(o.text){const n=t.doc.resolve(o.from).marks();t.replaceWith(o.from,o.to,e.schema.text(o.text,n))}else t.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=Us(e,r.schema),{$from:u,empty:c,ranges:d}=a;if(!i)return!0;if(c&&s){let{from:e,to:t}=a;const r=null===(o=u.marks().find((e=>e.type===l)))||void 0===o?void 0:o.attrs,i=Bs(u,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else d.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Js("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(o=fs(e,r.schema)),"mark"===a&&(s=Us(e,r.schema)),i&&n.selection.ranges.forEach((e=>{const i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,((e,r)=>{o&&o===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach((o=>{if(s===o.type){const l=Math.max(r,i),u=Math.min(r+e.nodeSize,a);n.addMark(l,u,s.create({...o.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&zt(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(fs(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>as(fs(e,n.schema),t)(n,r)});const ua=js.create({name:"commands",addCommands:()=>({...la})}),ca=js.create({name:"editable",addProseMirrorPlugins(){return[new kn({key:new Tn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),da=js.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new kn({key:new Tn("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),pa=js.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:a}=o,l=tn.atStart(r).from===s;return!(!(i&&l&&a.type.isTextblock)||a.textContent.length)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>e.joinForward(),()=>e.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return qs()||Ks()?i:r},addProseMirrorPlugins(){return[new kn({key:new Tn("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:r,from:i,to:o}=t.selection,s=tn.atStart(t.doc).from,a=tn.atEnd(t.doc).to,l=i===s&&o===a,u=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(r||!l||!u)return;const c=n.tr,d=us({state:n,transaction:c}),{commands:p}=new cs({editor:this.editor,state:d});return p.clearNodes(),c.steps.length?c:void 0}})]}}),ha=js.create({name:"tabindex",addProseMirrorPlugins(){return[new kn({key:new Tn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var fa=Object.freeze({__proto__:null,ClipboardTextSerializer:zs,Commands:ua,Editable:ca,FocusEvents:da,Keymap:pa,Tabindex:ha});function ma(e,t){const n=Js("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=fs(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,(e=>{o.push(e)}));const s=o.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?ea(e,t):{}}const ga=`.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}`;function ya(e,t){const n=[];return e.descendants(((e,r)=>{t(e)&&n.push({node:e,pos:r})})),n}function ba(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.some((t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}))}function va(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const i=Bs(n.resolve(e-1),t.type);i&&r.push({mark:t,...i})})):n.nodesBetween(e,t,((e,t)=>{r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function wa(e,t,n){const r=0,i=e.state.doc.content.size,o=Vs(t,r,i),s=Vs(n,r,i),a=e.coordsAtPos(o),l=e.coordsAtPos(s,-1),u=Math.min(a.top,l.top),c=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),p=Math.max(a.right,l.right),h={top:u,bottom:c,left:d,right:p,width:p-d,height:c-u,x:d,y:u};return{...h,toJSON:()=>h}}function xa(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length,d=va(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>u));if(d.length)return null;c<n.to&&o.delete(c,n.to),u>n.from&&o.delete(n.from+r,u),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function Ma(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let a=n.to;if(r[1]){let t=s+r[0].lastIndexOf(r[1]);t>a?t=a:a=t+r[1].length;const n=r[0][r[0].length-1];o.insertText(n,s+r[0].length-1),o.replaceWith(t,a,e.type.create(i))}else r[0]&&o.replaceWith(s,a,e.type.create(i))}})}function Da(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=bs(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function ka(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,o=n.from;const s=n.to;if(r[1]){const e=r[0].lastIndexOf(r[1]);i+=r[0].slice(e+r[1].length),o+=e;const t=o-s;t>0&&(i=r[0].slice(e-t,e)+i,o=s)}t.tr.insertText(i,o,s)}})}function Ea(e){return new ks({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),a=s&&zt(s,e.type,i);if(!a)return null;o.wrap(s,a);const l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Rt(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)}})}class Ca{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=bs(ds(this,"addOptions",{name:this.name}))),this.storage=bs(ds(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ca(e)}configure(e={}){const t=this.extend();return t.options=_s(this.options,e),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ca(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=bs(ds(t,"addOptions",{name:t.name})),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}}class Ta{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=bs(ds(this,"addOptions",{name:this.name}))),this.storage=bs(ds(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ta(e)}configure(e={}){const t=this.extend();return t.options=_s(this.options,e),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ta(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=bs(ds(t,"addOptions",{name:t.name})),t.storage=bs(ds(t,"addStorage",{name:t.name,options:t.options})),t}}function Oa(e){return new Ts({find:e.find,handler:({state:t,range:n,match:r})=>{const i=bs(e.getAttributes,void 0,r);if(!1===i||null===i)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length,d=va(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>u));if(d.length)return null;c<n.to&&o.delete(c,n.to),u>n.from&&o.delete(n.from+r,u),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}var Sa="top",Aa="bottom",Na="right",_a="left",ja="auto",Ia=[Sa,Aa,Na,_a],La="start",za="end",Pa="clippingParents",Fa="viewport",Ra="popper",Ba="reference",Ua=Ia.reduce((function(e,t){return e.concat([t+"-"+La,t+"-"+za])}),[]),Ha=[].concat(Ia,[ja]).reduce((function(e,t){return e.concat([t,t+"-"+La,t+"-"+za])}),[]),$a=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Va(e){return e?(e.nodeName||"").toLowerCase():null}function Wa(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function qa(e){return e instanceof Wa(e).Element||e instanceof Element}function Ya(e){return e instanceof Wa(e).HTMLElement||e instanceof HTMLElement}function Qa(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Wa(e).ShadowRoot||e instanceof ShadowRoot)}var Ka={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];Ya(i)&&Va(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});Ya(r)&&Va(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Ga(e){return e.split("-")[0]}var Ja=Math.max,Xa=Math.min,Za=Math.round;function el(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(Ya(e)&&t){var o=e.offsetHeight,s=e.offsetWidth;s>0&&(r=Za(n.width)/s||1),o>0&&(i=Za(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function tl(e){var t=el(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function nl(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Qa(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function rl(e){return Wa(e).getComputedStyle(e)}function il(e){return["table","td","th"].indexOf(Va(e))>=0}function ol(e){return((qa(e)?e.ownerDocument:e.document)||window.document).documentElement}function sl(e){return"html"===Va(e)?e:e.assignedSlot||e.parentNode||(Qa(e)?e.host:null)||ol(e)}function al(e){return Ya(e)&&"fixed"!==rl(e).position?e.offsetParent:null}function ll(e){for(var t=Wa(e),n=al(e);n&&il(n)&&"static"===rl(n).position;)n=al(n);return n&&("html"===Va(n)||"body"===Va(n)&&"static"===rl(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&Ya(e)&&"fixed"===rl(e).position)return null;var n=sl(e);for(Qa(n)&&(n=n.host);Ya(n)&&["html","body"].indexOf(Va(n))<0;){var r=rl(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function ul(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function cl(e,t,n){return Ja(e,Xa(t,n))}function dl(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function pl(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var hl={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ga(n.placement),l=ul(a),u=[_a,Na].indexOf(a)>=0?"height":"width";if(o&&s){var c=function(e,t){return dl("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:pl(e,Ia))}(i.padding,n),d=tl(o),p="y"===l?Sa:_a,h="y"===l?Aa:Na,f=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],g=ll(o),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=f/2-m/2,v=c[p],w=y-d[u]-c[h],x=y/2-d[u]/2+b,M=cl(v,x,w),D=l;n.modifiersData[r]=((t={})[D]=M,t.centerOffset=M-x,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&nl(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fl(e){return e.split("-")[1]}var ml={top:"auto",right:"auto",bottom:"auto",left:"auto"};function gl(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,p=s.x,h=void 0===p?0:p,f=s.y,m=void 0===f?0:f,g="function"==typeof c?c({x:h,y:m}):{x:h,y:m};h=g.x,m=g.y;var y=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),v=_a,w=Sa,x=window;if(u){var M=ll(n),D="clientHeight",k="clientWidth";if(M===Wa(n)&&"static"!==rl(M=ol(n)).position&&"absolute"===a&&(D="scrollHeight",k="scrollWidth"),i===Sa||(i===_a||i===Na)&&o===za)w=Aa,m-=(d&&M===x&&x.visualViewport?x.visualViewport.height:M[D])-r.height,m*=l?1:-1;if(i===_a||(i===Sa||i===Aa)&&o===za)v=Na,h-=(d&&M===x&&x.visualViewport?x.visualViewport.width:M[k])-r.width,h*=l?1:-1}var E,C=Object.assign({position:a},u&&ml),T=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Za(t*r)/r||0,y:Za(n*r)/r||0}}({x:h,y:m}):{x:h,y:m};return h=T.x,m=T.y,l?Object.assign({},C,((E={})[w]=b?"0":"",E[v]=y?"0":"",E.transform=(x.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",E)):Object.assign({},C,((t={})[w]=b?m+"px":"",t[v]=y?h+"px":"",t.transform="",t))}var yl={passive:!0};var bl={left:"right",right:"left",bottom:"top",top:"bottom"};function vl(e){return e.replace(/left|right|bottom|top/g,(function(e){return bl[e]}))}var wl={start:"end",end:"start"};function xl(e){return e.replace(/start|end/g,(function(e){return wl[e]}))}function Ml(e){var t=Wa(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Dl(e){return el(ol(e)).left+Ml(e).scrollLeft}function kl(e){var t=rl(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function El(e){return["html","body","#document"].indexOf(Va(e))>=0?e.ownerDocument.body:Ya(e)&&kl(e)?e:El(sl(e))}function Cl(e,t){var n;void 0===t&&(t=[]);var r=El(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=Wa(r),s=i?[o].concat(o.visualViewport||[],kl(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(Cl(sl(s)))}function Tl(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ol(e,t){return t===Fa?Tl(function(e){var t=Wa(e),n=ol(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,s=0,a=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:i,height:o,x:s+Dl(e),y:a}}(e)):qa(t)?function(e){var t=el(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):Tl(function(e){var t,n=ol(e),r=Ml(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Ja(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ja(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Dl(e),l=-r.scrollTop;return"rtl"===rl(i||n).direction&&(a+=Ja(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(ol(e)))}function Sl(e,t,n){var r="clippingParents"===t?function(e){var t=Cl(sl(e)),n=["absolute","fixed"].indexOf(rl(e).position)>=0&&Ya(e)?ll(e):e;return qa(n)?t.filter((function(e){return qa(e)&&nl(e,n)&&"body"!==Va(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],s=i.reduce((function(t,n){var r=Ol(e,n);return t.top=Ja(r.top,t.top),t.right=Xa(r.right,t.right),t.bottom=Xa(r.bottom,t.bottom),t.left=Ja(r.left,t.left),t}),Ol(e,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Al(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Ga(i):null,s=i?fl(i):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case Sa:t={x:a,y:n.y-r.height};break;case Aa:t={x:a,y:n.y+n.height};break;case Na:t={x:n.x+n.width,y:l};break;case _a:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=o?ul(o):null;if(null!=u){var c="y"===u?"height":"width";switch(s){case La:t[u]=t[u]-(n[c]/2-r[c]/2);break;case za:t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}function Nl(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,s=void 0===o?Pa:o,a=n.rootBoundary,l=void 0===a?Fa:a,u=n.elementContext,c=void 0===u?Ra:u,d=n.altBoundary,p=void 0!==d&&d,h=n.padding,f=void 0===h?0:h,m=dl("number"!=typeof f?f:pl(f,Ia)),g=c===Ra?Ba:Ra,y=e.rects.popper,b=e.elements[p?g:c],v=Sl(qa(b)?b:b.contextElement||ol(e.elements.popper),s,l),w=el(e.elements.reference),x=Al({reference:w,element:y,strategy:"absolute",placement:i}),M=Tl(Object.assign({},y,x)),D=c===Ra?M:w,k={top:v.top-D.top+m.top,bottom:D.bottom-v.bottom+m.bottom,left:v.left-D.left+m.left,right:D.right-v.right+m.right},E=e.modifiersData.offset;if(c===Ra&&E){var C=E[i];Object.keys(k).forEach((function(e){var t=[Na,Aa].indexOf(e)>=0?1:-1,n=[Sa,Aa].indexOf(e)>=0?"y":"x";k[e]+=C[n]*t}))}return k}function _l(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?Ha:l,c=fl(r),d=c?a?Ua:Ua.filter((function(e){return fl(e)===c})):Ia,p=d.filter((function(e){return u.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=Nl(e,{placement:n,boundary:i,rootBoundary:o,padding:s})[Ga(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var jl={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,g=t.options.placement,y=Ga(g),b=l||(y===g||!f?[vl(g)]:function(e){if(Ga(e)===ja)return[];var t=vl(e);return[xl(e),t,xl(t)]}(g)),v=[g].concat(b).reduce((function(e,n){return e.concat(Ga(n)===ja?_l(t,{placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,x=t.rects.popper,M=new Map,D=!0,k=v[0],E=0;E<v.length;E++){var C=v[E],T=Ga(C),O=fl(C)===La,S=[Sa,Aa].indexOf(T)>=0,A=S?"width":"height",N=Nl(t,{placement:C,boundary:c,rootBoundary:d,altBoundary:p,padding:u}),_=S?O?Na:_a:O?Aa:Sa;w[A]>x[A]&&(_=vl(_));var j=vl(_),I=[];if(o&&I.push(N[T]<=0),a&&I.push(N[_]<=0,N[j]<=0),I.every((function(e){return e}))){k=C,D=!1;break}M.set(C,I)}if(D)for(var L=function(e){var t=v.find((function(t){var n=M.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},z=f?3:1;z>0;z--){if("break"===L(z))break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Il(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Ll(e){return[Sa,Na,Aa,_a].some((function(t){return e[t]>=0}))}var zl={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,s=Ha.reduce((function(e,n){return e[n]=function(e,t,n){var r=Ga(e),i=[_a,Sa].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[_a,Na].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,o),e}),{}),a=s[t.placement],l=a.x,u=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}};var Pl={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,p=n.tether,h=void 0===p||p,f=n.tetherOffset,m=void 0===f?0:f,g=Nl(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),y=Ga(t.placement),b=fl(t.placement),v=!b,w=ul(y),x="x"===w?"y":"x",M=t.modifiersData.popperOffsets,D=t.rects.reference,k=t.rects.popper,E="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,C="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(M){if(o){var S,A="y"===w?Sa:_a,N="y"===w?Aa:Na,_="y"===w?"height":"width",j=M[w],I=j+g[A],L=j-g[N],z=h?-k[_]/2:0,P=b===La?D[_]:k[_],F=b===La?-k[_]:-D[_],R=t.elements.arrow,B=h&&R?tl(R):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},H=U[A],$=U[N],V=cl(0,D[_],B[_]),W=v?D[_]/2-z-V-H-C.mainAxis:P-V-H-C.mainAxis,q=v?-D[_]/2+z+V+$+C.mainAxis:F+V+$+C.mainAxis,Y=t.elements.arrow&&ll(t.elements.arrow),Q=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,K=null!=(S=null==T?void 0:T[w])?S:0,G=j+q-K,J=cl(h?Xa(I,j+W-K-Q):I,j,h?Ja(L,G):L);M[w]=J,O[w]=J-j}if(a){var X,Z="x"===w?Sa:_a,ee="x"===w?Aa:Na,te=M[x],ne="y"===x?"height":"width",re=te+g[Z],ie=te-g[ee],oe=-1!==[Sa,_a].indexOf(y),se=null!=(X=null==T?void 0:T[x])?X:0,ae=oe?re:te-D[ne]-k[ne]-se+C.altAxis,le=oe?te+D[ne]+k[ne]-se-C.altAxis:ie,ue=h&&oe?function(e,t,n){var r=cl(e,t,n);return r>n?n:r}(ae,te,le):cl(h?ae:re,te,h?le:ie);M[x]=ue,O[x]=ue-te}t.modifiersData[r]=O}},requiresIfExists:["offset"]};function Fl(e,t,n){void 0===n&&(n=!1);var r,i,o=Ya(t),s=Ya(t)&&function(e){var t=e.getBoundingClientRect(),n=Za(t.width)/e.offsetWidth||1,r=Za(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),a=ol(t),l=el(e,s),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==Va(t)||kl(a))&&(u=(r=t)!==Wa(r)&&Ya(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:Ml(r)),Ya(t)?((c=el(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=Dl(a))),{x:l.left+u.scrollLeft-c.x,y:l.top+u.scrollTop-c.y,width:l.width,height:l.height}}function Rl(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var Bl={placement:"bottom",modifiers:[],strategy:"absolute"};function Ul(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Hl(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?Bl:i;return function(e,t,n){void 0===n&&(n=o);var i,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Bl,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],u=!1,c={state:a,setOptions:function(n){var i="function"==typeof n?n(a.options):n;d(),a.options=Object.assign({},o,a.options,i),a.scrollParents={reference:qa(e)?Cl(e):e.contextElement?Cl(e.contextElement):[],popper:Cl(t)};var s=function(e){var t=Rl(e);return $a.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,a.options.modifiers)));return a.orderedModifiers=s.filter((function(e){return e.enabled})),a.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:a,name:t,instance:c,options:r}),s=function(){};l.push(o||s)}})),c.update()},forceUpdate:function(){if(!u){var e=a.elements,t=e.reference,n=e.popper;if(Ul(t,n)){a.rects={reference:Fl(t,ll(n),"fixed"===a.options.strategy),popper:tl(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(e){return a.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],o=i.fn,s=i.options,l=void 0===s?{}:s,d=i.name;"function"==typeof o&&(a=o({state:a,options:l,name:d,instance:c})||a)}else a.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){c.forceUpdate(),e(a)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){d(),u=!0}};if(!Ul(e,t))return c;function d(){l.forEach((function(e){return e()})),l=[]}return c.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),c}}var $l=Hl({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,s=r.resize,a=void 0===s||s,l=Wa(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach((function(e){e.addEventListener("scroll",n.update,yl)})),a&&l.addEventListener("resize",n.update,yl),function(){o&&u.forEach((function(e){e.removeEventListener("scroll",n.update,yl)})),a&&l.removeEventListener("resize",n.update,yl)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Al({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,u={placement:Ga(t.placement),variation:fl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,gl(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,gl(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Ka,zl,jl,Pl,hl,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=Nl(t,{elementContext:"reference"}),a=Nl(t,{altBoundary:!0}),l=Il(s,r),u=Il(a,i,o),c=Ll(l),d=Ll(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}}]}),Vl='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',Wl="tippy-box",ql="tippy-content",Yl="tippy-backdrop",Ql="tippy-arrow",Kl="tippy-svg-arrow",Gl={passive:!0,capture:!0},Jl=function(){return document.body};function Xl(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Zl(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function eu(e,t){return"function"==typeof e?e.apply(void 0,t):e}function tu(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function nu(e){return[].concat(e)}function ru(e,t){-1===e.indexOf(t)&&e.push(t)}function iu(e){return[].slice.call(e)}function ou(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function su(){return document.createElement("div")}function au(e){return["Element","Fragment"].some((function(t){return Zl(e,t)}))}function lu(e){return Zl(e,"MouseEvent")}function uu(e){return au(e)?[e]:function(e){return Zl(e,"NodeList")}(e)?iu(e):Array.isArray(e)?e:iu(document.querySelectorAll(e))}function cu(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function du(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function pu(e){var t,n=nu(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function hu(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function fu(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var mu={isTouch:!1},gu=0;function yu(){mu.isTouch||(mu.isTouch=!0,window.performance&&document.addEventListener("mousemove",bu))}function bu(){var e=performance.now();e-gu<20&&(mu.isTouch=!1,document.removeEventListener("mousemove",bu)),gu=e}function vu(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var wu=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto,xu=Object.assign({appendTo:Jl,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Mu=Object.keys(xu);function Du(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=xu[i])?r:o);return t}),{});return Object.assign({},e,t)}function ku(e,t){var n=Object.assign({},t,{content:eu(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Du(Object.assign({},xu,{plugins:t}))):Mu).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},xu.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function Eu(e,t){e["innerHTML"]=t}function Cu(e){var t=su();return!0===e?t.className=Ql:(t.className=Kl,au(e)?t.appendChild(e):Eu(t,e)),t}function Tu(e,t){au(t.content)?(Eu(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Eu(e,t.content):e.textContent=t.content)}function Ou(e){var t=e.firstElementChild,n=iu(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(ql)})),arrow:n.find((function(e){return e.classList.contains(Ql)||e.classList.contains(Kl)})),backdrop:n.find((function(e){return e.classList.contains(Yl)}))}}function Su(e){var t=su(),n=su();n.className=Wl,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=su();function i(n,r){var i=Ou(t),o=i.box,s=i.content,a=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Tu(s,e.props),r.arrow?a?n.arrow!==r.arrow&&(o.removeChild(a),o.appendChild(Cu(r.arrow))):o.appendChild(Cu(r.arrow)):a&&o.removeChild(a)}return r.className=ql,r.setAttribute("data-state","hidden"),Tu(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}Su.$$tippy=!0;var Au=1,Nu=[],_u=[];function ju(e,t){var n,r,i,o,s,a,l,u,c=ku(e,Object.assign({},xu,Du(ou(t)))),d=!1,p=!1,h=!1,f=!1,m=[],g=tu(Y,c.interactiveDebounce),y=Au++,b=(u=c.plugins).filter((function(e,t){return u.indexOf(e)===t})),v={id:y,reference:e,popper:su(),popperInstance:null,props:c,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){if(v.state.isDestroyed)return;j("onBeforeUpdate",[v,t]),W();var n=v.props,r=ku(e,Object.assign({},n,ou(t),{ignoreAttributes:!0}));v.props=r,V(),n.interactiveDebounce!==r.interactiveDebounce&&(z(),g=tu(Y,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?nu(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");L(),_(),M&&M(n,r);v.popperInstance&&(J(),Z().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));j("onAfterUpdate",[v,t])},setContent:function(e){v.setProps({content:e})},show:function(){var e=v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=mu.isTouch&&!v.props.touch,i=Xl(v.props.duration,0,xu.duration);if(e||t||n||r)return;if(O().hasAttribute("disabled"))return;if(j("onShow",[v],!1),!1===v.props.onShow(v))return;v.state.isVisible=!0,T()&&(x.style.visibility="visible");_(),B(),v.state.isMounted||(x.style.transition="none");if(T()){var o=A(),s=o.box,l=o.content;cu([s,l],0)}a=function(){var e;if(v.state.isVisible&&!f){if(f=!0,x.offsetHeight,x.style.transition=v.props.moveTransition,T()&&v.props.animation){var t=A(),n=t.box,r=t.content;cu([n,r],i),du([n,r],"visible")}I(),L(),ru(_u,v),null==(e=v.popperInstance)||e.forceUpdate(),j("onMount",[v]),v.props.animation&&T()&&function(e,t){H(e,t)}(i,(function(){v.state.isShown=!0,j("onShown",[v])}))}},function(){var e,t=v.props.appendTo,n=O();e=v.props.interactive&&t===Jl||"parent"===t?n.parentNode:eu(t,[n]);e.contains(x)||e.appendChild(x);v.state.isMounted=!0,J()}()},hide:function(){var e=!v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=Xl(v.props.duration,1,xu.duration);if(e||t||n)return;if(j("onHide",[v],!1),!1===v.props.onHide(v))return;v.state.isVisible=!1,v.state.isShown=!1,f=!1,d=!1,T()&&(x.style.visibility="hidden");if(z(),U(),_(!0),T()){var i=A(),o=i.box,s=i.content;v.props.animation&&(cu([o,s],r),du([o,s],"hidden"))}I(),L(),v.props.animation?T()&&function(e,t){H(e,(function(){!v.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,v.unmount):v.unmount()},hideWithInteractivity:function(e){S().addEventListener("mousemove",g),ru(Nu,g),g(e)},enable:function(){v.state.isEnabled=!0},disable:function(){v.hide(),v.state.isEnabled=!1},unmount:function(){v.state.isVisible&&v.hide();if(!v.state.isMounted)return;X(),Z().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);_u=_u.filter((function(e){return e!==v})),v.state.isMounted=!1,j("onHidden",[v])},destroy:function(){if(v.state.isDestroyed)return;v.clearDelayTimeouts(),v.unmount(),W(),delete e._tippy,v.state.isDestroyed=!0,j("onDestroy",[v])}};if(!c.render)return v;var w=c.render(v),x=w.popper,M=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+v.id,v.popper=x,e._tippy=v,x._tippy=v;var D=b.map((function(e){return e.fn(v)})),k=e.hasAttribute("aria-expanded");return V(),L(),_(),j("onCreate",[v]),c.showOnCreate&&ee(),x.addEventListener("mouseenter",(function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&S().addEventListener("mousemove",g)})),v;function E(){var e=v.props.touch;return Array.isArray(e)?e:[e,0]}function C(){return"hold"===E()[0]}function T(){var e;return!(null==(e=v.props.render)||!e.$$tippy)}function O(){return l||e}function S(){var e=O().parentNode;return e?pu(e):document}function A(){return Ou(x)}function N(e){return v.state.isMounted&&!v.state.isVisible||mu.isTouch||o&&"focus"===o.type?0:Xl(v.props.delay,e?0:1,xu.delay)}function _(e){void 0===e&&(e=!1),x.style.pointerEvents=v.props.interactive&&!e?"":"none",x.style.zIndex=""+v.props.zIndex}function j(e,t,n){var r;(void 0===n&&(n=!0),D.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=v.props)[e].apply(r,t)}function I(){var t=v.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;nu(v.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(v.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function L(){!k&&v.props.aria.expanded&&nu(v.props.triggerTarget||e).forEach((function(e){v.props.interactive?e.setAttribute("aria-expanded",v.state.isVisible&&e===O()?"true":"false"):e.removeAttribute("aria-expanded")}))}function z(){S().removeEventListener("mousemove",g),Nu=Nu.filter((function(e){return e!==g}))}function P(t){if(!mu.isTouch||!h&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!v.props.interactive||!fu(x,n)){if(nu(v.props.triggerTarget||e).some((function(e){return fu(e,n)}))){if(mu.isTouch)return;if(v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[v,t]);!0===v.props.hideOnClick&&(v.clearDelayTimeouts(),v.hide(),p=!0,setTimeout((function(){p=!1})),v.state.isMounted||U())}}}function F(){h=!0}function R(){h=!1}function B(){var e=S();e.addEventListener("mousedown",P,!0),e.addEventListener("touchend",P,Gl),e.addEventListener("touchstart",R,Gl),e.addEventListener("touchmove",F,Gl)}function U(){var e=S();e.removeEventListener("mousedown",P,!0),e.removeEventListener("touchend",P,Gl),e.removeEventListener("touchstart",R,Gl),e.removeEventListener("touchmove",F,Gl)}function H(e,t){var n=A().box;function r(e){e.target===n&&(hu(n,"remove",r),t())}if(0===e)return t();hu(n,"remove",s),hu(n,"add",r),s=r}function $(t,n,r){void 0===r&&(r=!1),nu(v.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),m.push({node:e,eventType:t,handler:n,options:r})}))}function V(){var e;C()&&($("touchstart",q,{passive:!0}),$("touchend",Q,{passive:!0})),(e=v.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch($(e,q),e){case"mouseenter":$("mouseleave",Q);break;case"focus":$(wu?"focusout":"blur",K);break;case"focusin":$("focusout",K)}}))}function W(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),m=[]}function q(e){var t,n=!1;if(v.state.isEnabled&&!G(e)&&!p){var r="focus"===(null==(t=o)?void 0:t.type);o=e,l=e.currentTarget,L(),!v.state.isVisible&&lu(e)&&Nu.forEach((function(t){return t(e)})),"click"===e.type&&(v.props.trigger.indexOf("mouseenter")<0||d)&&!1!==v.props.hideOnClick&&v.state.isVisible?n=!0:ee(e),"click"===e.type&&(d=!n),n&&!r&&te(e)}}function Y(e){var t=e.target,n=O().contains(t)||x.contains(t);if("mousemove"!==e.type||!n){var r=Z().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:c}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,s=i.placement.split("-")[0],a=i.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,u="top"===s?a.bottom.y:0,c="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=t.top-r+l>o,h=r-t.bottom-u>o,f=t.left-n+c>o,m=n-t.right-d>o;return p||h||f||m}))})(r,e)&&(z(),te(e))}}function Q(e){G(e)||v.props.trigger.indexOf("click")>=0&&d||(v.props.interactive?v.hideWithInteractivity(e):te(e))}function K(e){v.props.trigger.indexOf("focusin")<0&&e.target!==O()||v.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function G(e){return!!mu.isTouch&&C()!==e.type.indexOf("touch")>=0}function J(){X();var t=v.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,s=t.moveTransition,l=T()?Ou(x).arrow:null,u=o?{getBoundingClientRect:o,contextElement:o.contextElement||O()}:e,c={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(T()){var n=A().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},d=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},c];T()&&l&&d.push({name:"arrow",options:{element:l,padding:3}}),d.push.apply(d,(null==n?void 0:n.modifiers)||[]),v.popperInstance=$l(u,x,Object.assign({},n,{placement:r,onFirstUpdate:a,modifiers:d}))}function X(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Z(){return iu(x.querySelectorAll("[data-tippy-root]"))}function ee(e){v.clearDelayTimeouts(),e&&j("onTrigger",[v,e]),B();var t=N(!0),r=E(),i=r[0],o=r[1];mu.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){v.show()}),t):v.show()}function te(e){if(v.clearDelayTimeouts(),j("onUntrigger",[v,e]),v.state.isVisible){if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&d)){var t=N(!1);t?r=setTimeout((function(){v.state.isVisible&&v.hide()}),t):i=requestAnimationFrame((function(){v.hide()}))}}else U()}}function Iu(e,t){void 0===t&&(t={});var n=xu.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",yu,Gl),window.addEventListener("blur",vu);var r=Object.assign({},t,{plugins:n}),i=uu(e).reduce((function(e,t){var n=t&&ju(t,r);return n&&e.push(n),e}),[]);return au(e)?i[0]:i}Iu.defaultProps=xu,Iu.setDefaultProps=function(e){Object.keys(e).forEach((function(t){xu[t]=e[t]}))},Iu.currentInput=mu,Object.assign({},Ka,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});var Lu={clientX:0,clientY:0},zu=[];function Pu(e){var t=e.clientX,n=e.clientY;Lu={clientX:t,clientY:n}}var Fu={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=pu(e.props.triggerTarget||t),r=!1,i=!1,o=!0,s=e.props;function a(){return"initial"===e.props.followCursor&&e.state.isVisible}function l(){n.addEventListener("mousemove",d)}function u(){n.removeEventListener("mousemove",d)}function c(){r=!0,e.setProps({getReferenceClientRect:null}),r=!1}function d(n){var r=!n.target||t.contains(n.target),i=e.props.followCursor,o=n.clientX,s=n.clientY,a=t.getBoundingClientRect(),l=o-a.left,u=s-a.top;!r&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=o,r=s;"initial"===i&&(n=e.left+l,r=e.top+u);var a="horizontal"===i?e.top:r,c="vertical"===i?e.right:n,d="horizontal"===i?e.bottom:r,p="vertical"===i?e.left:n;return{width:c-p,height:d-a,top:a,right:c,bottom:d,left:p}}})}function p(){e.props.followCursor&&(zu.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",Pu)}(n))}function h(){zu=zu.filter((function(t){return t.instance!==e})),0===zu.filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",Pu)}(n)}return{onCreate:p,onDestroy:h,onBeforeUpdate:function(){s=e.props},onAfterUpdate:function(t,n){var o=n.followCursor;r||void 0!==o&&s.followCursor!==o&&(h(),o?(p(),!e.state.isMounted||i||a()||l()):(u(),c()))},onMount:function(){e.props.followCursor&&!i&&(o&&(d(Lu),o=!1),a()||l())},onTrigger:function(e,t){lu(t)&&(Lu={clientX:t.clientX,clientY:t.clientY}),i="focus"===t.type},onHidden:function(){e.props.followCursor&&(c(),u(),o=!0)}}}};Iu.setDefaultProps({render:Su});class Ru{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t,from:n,to:r})=>{const{doc:i,selection:o}=t,{empty:s}=o,a=!i.textBetween(n,r).length&&$s(t.selection);return!(!e.hasFocus()||s||a)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=Iu(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,r,i;const{state:o,composing:s}=e,{doc:a,selection:l}=o,u=t&&t.doc.eq(a)&&t.selection.eq(l);if(s||u)return;this.createTooltip();const{ranges:c}=l,d=Math.min(...c.map((e=>e.$from.pos))),p=Math.max(...c.map((e=>e.$to.pos)));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:o,oldState:t,from:d,to:p}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(i=this.tippyOptions)||void 0===i?void 0:i.getReferenceClientRect)||(()=>{if(Hs(t=o.selection)&&t instanceof ln){const t=e.nodeDOM(d);if(t)return t.getBoundingClientRect()}var t;return wa(e,d,p)})}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Bu=e=>new kn({key:"string"==typeof e.pluginKey?new Tn(e.pluginKey):e.pluginKey,view:t=>new Ru({view:t,...e})});js.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[Bu({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class Uu{constructor({editor:e,element:t,view:n,tippyOptions:r={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:e,state:t})=>{const{selection:n}=t,{$anchor:r,empty:i}=n,o=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;return!!(e.hasFocus()&&i&&o&&s)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.editor=e,this.element=t,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=Iu(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(e=>{this.blurHandler({event:e})})))}update(e,t){var n,r,i;const{state:o}=e,{doc:s,selection:a}=o,{from:l,to:u}=a;if(t&&t.doc.eq(s)&&t.selection.eq(a))return;this.createTooltip();(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:o,oldState:t}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(i=this.tippyOptions)||void 0===i?void 0:i.getReferenceClientRect)||(()=>wa(e,l,u))}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}js.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[(e={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow},new kn({key:"string"==typeof e.pluginKey?new Tn(e.pluginKey):e.pluginKey,view:t=>new Uu({view:t,...e})}))]:[];var e}});const Hu=e=>{const[n,r]=i(null);return o((()=>{if(!n)return;if(e.editor.isDestroyed)return;const{pluginKey:t="bubbleMenu",editor:r,tippyOptions:i={},shouldShow:o=null}=e,s=Bu({pluginKey:t,editor:r,element:n,tippyOptions:i,shouldShow:o});return r.registerPlugin(s),()=>r.unregisterPlugin(t)}),[e.editor,n]),t.createElement("div",{ref:r,className:e.className,style:{visibility:"hidden"}},e.children)};class $u extends class extends class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(e,t){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}(ga,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e){this.setOptions({editable:e})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=ys(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(e){if(this.isDestroyed)return;const t="string"==typeof e?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((e=>!e.key.startsWith(t)))});this.view.updateState(n)}createExtensionManager(){const e=[...this.options.enableCoreExtensions?Object.values(fa):[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new As(e,this)}createCommandManager(){this.commandManager=new cs({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Zs(this.options.content,this.schema,this.options.parseOptions),t=Ws(e,this.options.autofocus);this.view=new No(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Mn.create({doc:e,selection:t||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews();this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null===(t=this.capturedTransaction)||void 0===t?void 0:t.step(e)})):void(this.capturedTransaction=e);const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const r=e.getMeta("focus"),i=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return ma(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return Gs(e,null,n)||aa(e,null,n);const r=Js(t,e.schema);return"node"===r?Gs(e,t,n):"mark"===r&&aa(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(e,t){const n=dt.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return Is(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...n,...Ls(this.schema)}})}get isEmpty(){return function(e){var t;const n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}{constructor(){super(...arguments),this.contentComponent=null}}const Vu=({renderers:e})=>t.createElement(t.Fragment,null,Array.from(e).map((([e,t])=>h.createPortal(t.reactElement,t.element,e))));class Wu extends t.Component{constructor(e){super(e),this.editorContentRef=t.createRef(),this.state={renderers:new Map}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews()}}componentWillUnmount(){const{editor:e}=this.props;if(!e)return;if(e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild)return;const t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){const{editor:e,...n}=this.props;return t.createElement(t.Fragment,null,t.createElement("div",{ref:this.editorContentRef,...n}),t.createElement(Vu,{renderers:this.state.renderers}))}}const qu=t.memo(Wu),Yu=n({onDragStart:void 0}),Qu=()=>r(Yu),Ku=e=>{const n=e.as||"div",{nodeViewContentRef:r}=Qu();return t.createElement(n,{...e,ref:r,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style}})},Gu=t.forwardRef(((e,n)=>{const{onDragStart:r}=Qu(),i=e.as||"div";return t.createElement(i,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})}));class Ju{constructor(e,{editor:t,props:n={},as:r="div",className:i=""}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.render()}render(){var e;const n=this.component,r=this.props;(function(e){return!("function"!=typeof e||!e.prototype||!e.prototype.isReactComponent)}(n)||function(e){var t;return!("object"!=typeof e||"Symbol(react.forward_ref)"!==(null===(t=e.$$typeof)||void 0===t?void 0:t.toString()))}(n))&&(r.ref=e=>{this.ref=e}),this.reactElement=t.createElement(n,{...r}),(null===(e=this.editor)||void 0===e?void 0:e.contentComponent)&&this.editor.contentComponent.setState({renderers:this.editor.contentComponent.state.renderers.set(this.id,this)})}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;if(null===(e=this.editor)||void 0===e?void 0:e.contentComponent){const{renderers:e}=this.editor.contentComponent.state;e.delete(this.id),this.editor.contentComponent.setState({renderers:e})}}}class Xu extends class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,a;const{view:l}=this.editor,u=e.target,c=3===u.nodeType?null===(t=u.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(u))||!c)return;let d=0,p=0;if(this.dom!==c){const t=this.dom.getBoundingClientRect(),n=c.getBoundingClientRect(),a=null!==(r=e.offsetX)&&void 0!==r?r:null===(i=e.nativeEvent)||void 0===i?void 0:i.offsetX,l=null!==(o=e.offsetY)&&void 0!==o?o:null===(s=e.nativeEvent)||void 0===s?void 0:s.offsetY;d=n.x-t.x+a,p=n.y-t.y+l}null===(a=e.dataTransfer)||void 0===a||a.setDragImage(this.dom,d,p);const h=ln.create(l.state.doc,this.getPos()),f=l.state.tr.setSelection(h);l.dispatch(f)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(n))))return!1;const r="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!r)return!0;const{isEditable:i}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,a=ln.isSelectable(this.node),l="copy"===e.type,u="paste"===e.type,c="cut"===e.type,d="mousedown"===e.type,p=e.type.startsWith("drag");if(!s&&a&&p&&e.preventDefault(),s&&p&&!o)return e.preventDefault(),!1;if(s&&i&&!o&&d){const e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(()=>{this.isDragging=!1}),{once:!0}))}return!(o||r||l||u||c||d&&a)}ignoreMutation(e){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:e});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&qs()&&this.editor.isFocused){if([...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every((e=>e.isContentEditable)))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command((({tr:t})=>{const n=this.getPos();return t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0}))}deleteNode(){const e=this.getPos(),t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}const n=e=>{const n=this.component,r=this.onDragStart.bind(this);return t.createElement(Yu.Provider,{value:{onDragStart:r,nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&e.appendChild(this.contentDOMElement)}}},t.createElement(n,{...e}))};n.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let r=this.node.isInline?"span":"div";this.options.as&&(r=this.options.as);const{className:i=""}=this.options;this.renderer=new Ju(n,{editor:this.editor,props:e,as:r,className:`node-${this.node.type.name} ${i}`.trim()})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null===(e=this.renderer.element.firstElementChild)||void 0===e?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,t){const n=e=>{this.renderer.updateProps(e)};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){const r=this.node,i=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:r,oldDecorations:i,newNode:e,newDecorations:t,updateProps:()=>n({node:e,decorations:t})})}return e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,n({node:e,decorations:t})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function Zu(e,t){return n=>n.editor.contentComponent?new Xu(e,n,t):{}}const ec=(e={},t=[])=>{const[n,r]=i(null),s=function(){const[,e]=i(0);return()=>e((e=>e+1))}();return o((()=>{let t=!0;const n=new $u(e);return r(n),n.on("transaction",(()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t&&s()}))}))})),()=>{n.destroy(),t=!1}}),t),n};var tc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function nc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function rc(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var ic,oc={exports:{}};
2
2
  /*!
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see
@@ -29,7 +29,7 @@ Bd.exports=Ud;var Dp=Bd.exports,kp={exports:{}},Ep={},Cp="function"==typeof Symb
29
29
  * http://jaywcjlove.github.io/hotkeys
30
30
  * Licensed under the MIT license
31
31
  */
32
- var ef="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function tf(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function nf(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function rf(e){"string"!=typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var of={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":ef?173:189,"=":ef?61:187,";":ef?59:186,"'":222,"[":219,"]":221,"\\":220},sf={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},af={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},lf={16:!1,18:!1,17:!1,91:!1},uf={},cf=1;cf<20;cf++)of["f".concat(cf)]=111+cf;var df=[],pf=!1,hf="all",ff=[],mf=function(e){return of[e.toLowerCase()]||sf[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function gf(e){hf=e||"all"}function yf(){return hf||"all"}var bf=function(e){var t=e.key,n=e.scope,r=e.method,i=e.splitKey,o=void 0===i?"+":i;rf(t).forEach((function(e){var t=e.split(o),i=t.length,s=t[i-1],a="*"===s?"*":mf(s);if(uf[a]){n||(n=yf());var l=i>1?nf(sf,t):[];uf[a]=uf[a].filter((function(e){return!((!r||e.method===r)&&e.scope===n&&function(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0,o=0;o<n.length;o++)-1===r.indexOf(n[o])&&(i=!1);return i}(e.mods,l))}))}}))};function vf(e,t,n,r){var i;if(t.element===r&&(t.scope===n||"all"===t.scope)){for(var o in i=t.mods.length>0,lf)Object.prototype.hasOwnProperty.call(lf,o)&&(!lf[o]&&t.mods.indexOf(+o)>-1||lf[o]&&-1===t.mods.indexOf(+o))&&(i=!1);(0!==t.mods.length||lf[16]||lf[18]||lf[17]||lf[91])&&!i&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function wf(e,t){var n=uf["*"],r=e.keyCode||e.which||e.charCode;if(xf.filter.call(this,e)){if(93!==r&&224!==r||(r=91),-1===df.indexOf(r)&&229!==r&&df.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=af[t];e[t]&&-1===df.indexOf(n)?df.push(n):!e[t]&&df.indexOf(n)>-1?df.splice(df.indexOf(n),1):"metaKey"===t&&e[t]&&3===df.length&&(e.ctrlKey||e.shiftKey||e.altKey||(df=df.slice(df.indexOf(n))))})),r in lf){for(var i in lf[r]=!0,sf)sf[i]===r&&(xf[i]=!0);if(!n)return}for(var o in lf)Object.prototype.hasOwnProperty.call(lf,o)&&(lf[o]=e[af[o]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===df.indexOf(17)&&df.push(17),-1===df.indexOf(18)&&df.push(18),lf[17]=!0,lf[18]=!0);var s=yf();if(n)for(var a=0;a<n.length;a++)n[a].scope===s&&("keydown"===e.type&&n[a].keydown||"keyup"===e.type&&n[a].keyup)&&vf(e,n[a],s,t);if(r in uf)for(var l=0;l<uf[r].length;l++)if(("keydown"===e.type&&uf[r][l].keydown||"keyup"===e.type&&uf[r][l].keyup)&&uf[r][l].key){for(var u=uf[r][l],c=u.splitKey,d=u.key.split(c),p=[],h=0;h<d.length;h++)p.push(mf(d[h]));p.sort().join("")===df.sort().join("")&&vf(e,u,s,t)}}}function xf(e,t,n){df=[];var r=rf(e),i=[],o="all",s=document,a=0,l=!1,u=!0,c="+",d=!1;for(void 0===n&&"function"==typeof t&&(n=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(o=t.scope),t.element&&(s=t.element),t.keyup&&(l=t.keyup),void 0!==t.keydown&&(u=t.keydown),void 0!==t.capture&&(d=t.capture),"string"==typeof t.splitKey&&(c=t.splitKey)),"string"==typeof t&&(o=t);a<r.length;a++)i=[],(e=r[a].split(c)).length>1&&(i=nf(sf,e)),(e="*"===(e=e[e.length-1])?"*":mf(e))in uf||(uf[e]=[]),uf[e].push({keyup:l,keydown:u,scope:o,mods:i,shortcut:r[a],method:n,key:r[a],splitKey:c,element:s});void 0!==s&&!function(e){return ff.indexOf(e)>-1}(s)&&window&&(ff.push(s),tf(s,"keydown",(function(e){wf(e,s)}),d),pf||(pf=!0,tf(window,"focus",(function(){df=[]}),d)),tf(s,"keyup",(function(e){wf(e,s),function(e){var t=e.keyCode||e.which||e.charCode,n=df.indexOf(t);if(n>=0&&df.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&df.splice(0,df.length),93!==t&&224!==t||(t=91),t in lf)for(var r in lf[t]=!1,sf)sf[r]===t&&(xf[r]=!1)}(e)}),d))}var Mf={setScope:gf,getScope:yf,deleteScope:function(e,t){var n,r;for(var i in e||(e=yf()),uf)if(Object.prototype.hasOwnProperty.call(uf,i))for(n=uf[i],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;yf()===e&&gf(t||"all")},getPressedKeyCodes:function(){return df.slice(0)},isPressed:function(e){return"string"==typeof e&&(e=mf(e)),-1!==df.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return!t.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||t.readOnly)||(r=!1),r},trigger:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(uf).forEach((function(n){var r=uf[n].find((function(n){return n.scope===t&&n.shortcut===e}));r&&r.method&&r.method()}))},unbind:function(e){if(e){if(Array.isArray(e))e.forEach((function(e){e.key&&bf(e)}));else if("object"==typeof e)e.key&&bf(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n[0],o=n[1];"function"==typeof i&&(o=i,i=""),bf({key:e,scope:i,method:o,splitKey:"+"})}}else Object.keys(uf).forEach((function(e){return delete uf[e]}))},keyMap:of,modifier:sf,modifierMap:af};for(var Df in Mf)Object.prototype.hasOwnProperty.call(Mf,Df)&&(xf[Df]=Mf[Df]);if("undefined"!=typeof window){var kf=window.hotkeys;xf.noConflict=function(e){return e&&window.hotkeys===xf&&(window.hotkeys=kf),xf},window.hotkeys=xf}xf.filter=function(){return!0};var Ef=function(e,t){var n=e.target,r=n&&n.tagName;return Boolean(r&&t&&t.includes(r))};function Cf(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var i=n||{},s=i.enableOnTags,a=i.filter,l=i.keyup,d=i.keydown,p=i.filterPreventDefault,h=void 0===p||p,f=i.enabled,m=void 0===f||f,g=i.enableOnContentEditable,y=void 0!==g&&g,b=u(null),v=c((function(e,n){var r;return a&&!a(e)?!h:!!(Ef(e,["INPUT","TEXTAREA","SELECT"])&&!Ef(e,s)||null!=(r=e.target)&&r.isContentEditable&&!y)||(null===b.current||document.activeElement===b.current)&&(t(e,n),!0)}),r?[b,s,a].concat(r):[b,s,a]);return o((function(){if(m)return l&&!0!==d&&(n.keydown=!1),xf(e,n||{},v),function(){return xf.unbind(e,v)};xf.unbind(e,v)}),[v,e,m]),b}xf.isPressed;const Tf=()=>{},Of="xs",Sf="sm",Af="md",Nf=e=>{let{size:n="sm",isOpen:r=!1,onClose:i=Tf,loading:o=!1,children:s,className:a="",closeOnEsc:l=!0,closeButton:c=!0,backdropClassName:d="",closeOnOutsideClick:p=!0,...h}=e;const f=u();return Pd(f,p?i:Tf),Cf("esc",l?i:Tf),t.createElement(zd,{className:"ne-portal"},r&&t.createElement(yd,{key:"modal-backdrop",className:sc("ne-modal__backdrop",d)},t.createElement("div",ie({ref:f,key:"modal-wrapper",className:sc("ne-modal__wrapper",{"ne-modal__wrapper--xs":n===Of,"ne-modal__wrapper--sm":n===Sf,"ne-modal__wrapper--md":n===Af,[a]:a})},h),c&&t.createElement(Ld,{style:"text",icon:th,className:"ne-modal__close",onClick:i}),o?"":s)))},_f=e=>{let{children:n,className:r="",required:i=!1,helpIconProps:o=null,...s}=e;const{onClick:a,icon:l,tooltipProps:u,className:c,...d}=o||{},p=l||mh;return t.createElement("label",ie({className:sc("ne-label flex items-center",r)},s),n,i&&t.createElement("span",{"aria-hidden":!0},"*"),o&&t.createElement(Ad,ie({},u,{disabled:!u}),t.createElement("span",{className:sc("ml-1",{[c]:c}),onClick:a},t.createElement(p,ie({size:16},d)))))},jf=s(((e,n)=>{const{id:r,size:i="small",type:o="text",label:s,error:a=null,suffix:l=null,prefix:u=null,disabled:c=!1,helpText:d="",className:p="",nakedInput:h=!1,contentSize:f=null,required:m=!1,...g}=e;return t.createElement("div",{className:sc(["ne-input__wrapper",p])},s&&t.createElement(_f,{required:m,"data-cy":"neeto-editor-".concat(sd(s),"-input-label"),htmlFor:r},s),t.createElement("div",{className:sc("ne-input",{"ne-input--naked":!!h,"ne-input--error":!!a,"ne-input--disabled":!!c,"ne-input--small":"small"===i})},u&&t.createElement("div",{className:"ne-input__prefix"},u),t.createElement("input",ie({ref:n,type:o,disabled:c,size:f,required:m,"aria-invalid":!!a,"data-cy":"".concat(sd(s),"-input-field")},g)),l&&t.createElement("div",{className:"ne-input__suffix"},l)),!!a&&t.createElement("p",{"data-cy":"".concat(sd(s),"-input-error"),className:"ne-input__error"},a),d&&t.createElement("p",{className:"ne-input__help-text"},d))}));jf.displayName="Input";const If=e=>{let{url:n,editor:r,onClose:o,alt:s}=e;const[a,l]=i(s||""),u=()=>{r.chain().focus().setImage({src:n,alt:a}).run(),o()};return t.createElement("div",{className:"neeto-editor-image-editor",onKeyDown:e=>{"Enter"===e.key&&u()}},t.createElement("figure",null,t.createElement("img",{src:n,loading:"lazy"})),t.createElement(jf,{value:a,onChange:e=>l(e.target.value),placeholder:"Brand Image",label:"Caption"}),t.createElement("div",{className:"neeto-editor-image-editor__footer"},t.createElement(Ld,{size:"large",label:"Proceed",onClick:u}),t.createElement(Ld,{size:"large",label:"Cancel",style:"text",onClick:o})))},Lf=e=>{let{editor:n,isOpen:r,onClose:i}=e;const o=n&&n.view.state.selection.node;return t.createElement(Nf,{isOpen:r,onClose:i},t.createElement("div",{className:"neeto-editor-image-uploader"},t.createElement("div",{className:"neeto-editor-image-uploader__content"},t.createElement(If,{editor:n,onClose:i,url:null==o?void 0:o.attrs.src,alt:null==o?void 0:o.attrs.alt}))))},zf=e=>{let{editor:t,isImageEditorModalOpen:n,setIsImageEditorModalOpen:r}=e;return[{Icon:yh,command:()=>t.chain().focus().setImageAttributes({float:"left",align:"none"}).run(),active:t.isActive("image",{float:"left",align:"none"}),optionName:"Float Left"},{Icon:Zp,command:()=>t.chain().focus().setImageAttributes({float:"none",align:"center"}).run(),active:t.isActive("image",{float:"none",align:"center"}),optionName:"Align Center"},{Icon:jh,command:()=>t.chain().focus().setImageAttributes({float:"right",align:"none"}).run(),active:t.isActive("image",{float:"right",align:"center"}),optionName:"Float Right"},{Icon:ah,command:()=>r(!0),active:n,optionName:"Caption"},{Icon:th,command:()=>t.commands.deleteSelection(),active:!1,optionName:"Remove"}]},Pf=e=>{let{Icon:n,command:r,active:i,optionName:o}=e;return t.createElement(Ad,{content:od(o),position:"top",delay:[500]},t.createElement("div",{className:sc("neeto-editor-bubble-menu__item",{active:i}),onClick:r,"data-cy":"neeto-editor-bubble-menu-".concat(o,"-option")},t.createElement(n,{size:20})))},Ff=e=>{let{editor:n,isImageEditorModalOpen:r,setIsImageEditorModalOpen:i}=e;return zf({editor:n,isImageEditorModalOpen:r,setIsImageEditorModalOpen:i}).map((e=>t.createElement(Pf,ie({key:e.optionName},e))))},Rf=/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/,Bf=/^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,Uf=/((?:http|https):\/\/)?(www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|(?:manage\/)?videos?\/|)(\d+)(?:(?:\/|\?h=)(\w+))?(?:|\/\?)/,Hf=e=>{let{editor:n,handleClose:r,handleAnimateInvalidLink:s}=e;const[a,l]=i("");o((()=>{l(n.getAttributes("link").href||"")}),[]);const u=()=>{Rf.test(a)?(n.chain().focus().setLink({href:a}).run(),r()):ld(a)?(n.chain().focus().unsetLink().run(),r()):(l(""),s())};return t.createElement("div",{onKeyDown:e=>{"Escape"===e.key?r():"Enter"===e.key&&u()},className:"neeto-editor-bubble-menu__link"},t.createElement("input",{autoFocus:!0,name:"url",value:a,placeholder:"Paste or type a link...",onChange:e=>{let{target:{value:t}}=e;return l(t)},className:"neeto-editor-bubble-menu-link__input","data-cy":"neeto-editor-link-input"}),t.createElement(Ld,{style:"icon",icon:th,onClick:()=>{a?(l(""),n.chain().focus().unsetLink().run()):r()},"data-cy":"neeto-editor-link-cancel-button"}))},$f=e=>{let{editor:n,options:r,setIsInvalidLink:i,isLinkOptionActive:o,setIsLinkOptionActive:s}=e;return o?t.createElement(Hf,{editor:n,handleClose:()=>s(!1),handleAnimateInvalidLink:()=>{i(!0),setTimeout((()=>{i(!1)}),1e3)}}):(e=>{let{editor:t,setIsLinkOptionActive:n}=e;return[{Icon:Ph,command:()=>t.chain().focus().toggleBold().run(),active:t.isActive("bold"),optionName:"bold"},{Icon:Wh,command:()=>t.chain().focus().toggleItalic().run(),active:t.isActive("italic"),optionName:"italic"},{Icon:Jh,command:()=>t.chain().focus().toggleUnderline().run(),active:t.isActive("underline"),optionName:"underline"},{Icon:Rh,command:()=>t.chain().focus().toggleStrike().run(),active:t.isActive("strike"),optionName:"strike"},{Icon:vh,command:()=>n(!0),active:t.isActive("link"),optionName:"link"},{Icon:rh,command:()=>t.chain().focus().toggleCode().run(),active:t.isActive("code"),optionName:"code-block"},{Icon:dh,command:()=>t.chain().focus().toggleHighlight().run(),active:t.isActive("highlight"),optionName:"highlight"}]})({editor:n,setIsLinkOptionActive:s}).filter((e=>{let{optionName:t}=e;return r.includes(t)})).map((e=>t.createElement(Pf,ie({},e,{key:e.optionName}))))},Vf=e=>{let{editor:n,options:r}=e;const[o,s]=i(!1),[a,l]=i(!1),[u,c]=i(!1),d=n&&n.view.state.selection.node,p=d&&"image"===d.type.name,h=[md.BOLD,md.ITALIC,md.UNDERLINE,md.STRIKETHROUGH,md.LINK],f=ld(r.filter((e=>h.includes(e))));return!n||!p&&f?null:t.createElement("div",null,t.createElement(Hu,{editor:n,tippyOptions:{arrow:Vl,zIndex:99999,onHide:()=>l(!1)},className:sc("neeto-editor-bubble-menu",{"neeto-editor-bubble-menu-animate-shake":o})},p?t.createElement(Ff,{editor:n,isImageEditorModalOpen:u,setIsImageEditorModalOpen:c}):t.createElement($f,{editor:n,options:r,setIsInvalidLink:s,isLinkOptionActive:a,setIsLinkOptionActive:l})),t.createElement(Lf,{editor:n,isOpen:u,onClose:()=>c(!1)}))},Wf=e=>{let{count:n,limit:r,strategy:i}=e;const o="limit"===i&&r;return t.createElement("p",{className:"neeto-editor-character-count","data-cy":"neeto-editor-character-count"},o?"".concat(r-n," characters remaining"):"".concat(n," characters"))};var qf={exports:{}},Yf="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";function Qf(){}function Kf(){}Kf.resetWarningCache=Qf;qf.exports=function(){function e(e,t,n,r,i,o){if(o!==Yf){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. "+"Use PropTypes.checkPropTypes() to call them. "+"Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Kf,resetWarningCache:Qf};return n.PropTypes=n,n}();const Gf=20,Jf="#2F3941",Xf="#87929D",Zf=e=>{let{icon:n,iconActive:r=!0,tooltipProps:i,...o}=e;return t.createElement(Ad,i,t.createElement("button",ie({className:"neeto-editor-fixed-menu__item",type:"button"},o),t.createElement(n,{color:r?Jf:Xf,size:Gf})))};Zf.propTypes={icon:qf.exports.oneOfType([qf.exports.element,qf.exports.func]),iconActive:qf.exports.bool,onClick:qf.exports.func,tooltipProps:qf.exports.object},e.createContext(),e.createContext();var em=function(e){return e.reduce((function(e,t){var n=t[0],r=t[1];return e[n]=r,e}),{})},tm="undefined"!=typeof window&&window.document&&window.document.createElement?e.useLayoutEffect:e.useEffect,nm="undefined"!=typeof Element,rm="function"==typeof Map,im="function"==typeof Set,om="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function sm(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,r,i,o;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!sm(e[r],t[r]))return!1;return!0}if(rm&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!sm(r.value[1],t.get(r.value[0])))return!1;return!0}if(im&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(om&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(nm&&e instanceof Element)return!1;for(r=n;0!=r--;)if(("_owner"!==i[r]&&"__v"!==i[r]&&"__o"!==i[r]||!e.$$typeof)&&!sm(e[i[r]],t[i[r]]))return!1;return!0}return e!=e&&t!=t}var am=function(e,t){try{return sm(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}},lm=[];const um=()=>{},cm=(n,r)=>{let{label:s,isOpen:a,onVisible:l=um,onClose:c=um,ulProps:h,position:f,children:m,className:g,customTarget:y,closeOnEsc:b=!0,closeOnSelect:v=!0,closeOnOutsideClick:w=!0,dropdownModifiers:x=[],...M}=n;const D=u(),k=y(),E=!(null==a),[C,T]=i(!1),[O,S]=i(null),[A,N]=i(null),{styles:_,attributes:j}=function(t,n,r){void 0===r&&(r={});var i=e.useRef(null),o={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||lm},s=e.useState({styles:{popper:{position:o.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=s[0],l=s[1],u=e.useMemo((function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(e){var t=e.state,n=Object.keys(t.elements);p.flushSync((function(){l({styles:em(n.map((function(e){return[e,t.styles[e]||{}]}))),attributes:em(n.map((function(e){return[e,t.attributes[e]]})))})}))},requires:["computeStyles"]}}),[]),c=e.useMemo((function(){var e={onFirstUpdate:o.onFirstUpdate,placement:o.placement,strategy:o.strategy,modifiers:[].concat(o.modifiers,[u,{name:"applyStyles",enabled:!1}])};return am(i.current,e)?i.current||e:(i.current=e,e)}),[o.onFirstUpdate,o.placement,o.strategy,o.modifiers,u]),d=e.useRef();return tm((function(){d.current&&d.current.setOptions(c)}),[c]),tm((function(){if(null!=t&&null!=n){var e=(r.createPopper||$l)(t,n,c);return d.current=e,function(){e.destroy(),d.current=null}}}),[t,n,r.createPopper]),{state:d.current?d.current.state:null,styles:a.styles,attributes:a.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}}(O,A,{placement:f||"bottom-end",modifiers:x});d(r,(()=>({close:()=>T(!1),visible:C})));const I=()=>{E||T(!1),c()};return Cf("esc",b?I:um),Pd(D,w?I:um),o((()=>{E&&T(a)}),[a]),o((()=>{C&&l()}),[C]),t.createElement("div",ie({ref:D,className:sc("ne-dropdown__wrapper",{[g]:g})},M),y?t.createElement("div",{ref:S,onClick:()=>{!E&&T(!C)}},k):t.createElement("div",null,s,t.createElement(oh,null)),C&&t.createElement("ul",ie({className:"ne-dropdown__popup",ref:N,onClick:()=>{v&&I()},"data-cy":"neeto-editor-".concat(sd(s),"-dropdown-container")},h,{style:{display:"block",..._.offset,..._.popper}},j.popper),m))};cm.displayName="Dropdown";var dm=s(cm);function pm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var hm,fm={exports:{}},mm={exports:{}},gm=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},ym=gm,bm=Object.prototype.toString,vm=(hm=Object.create(null),function(e){var t=bm.call(e);return hm[t]||(hm[t]=t.slice(8,-1).toLowerCase())});function wm(e){return e=e.toLowerCase(),function(t){return vm(t)===e}}function xm(e){return Array.isArray(e)}function Mm(e){return void 0===e}var Dm=wm("ArrayBuffer");function km(e){return null!==e&&"object"==typeof e}function Em(e){if("object"!==vm(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var Cm=wm("Date"),Tm=wm("File"),Om=wm("Blob"),Sm=wm("FileList");function Am(e){return"[object Function]"===bm.call(e)}var Nm=wm("URLSearchParams");function _m(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),xm(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var jm,Im=(jm="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return jm&&e instanceof jm}),Lm={isArray:xm,isArrayBuffer:Dm,isBuffer:function(e){return null!==e&&!Mm(e)&&null!==e.constructor&&!Mm(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||bm.call(e)===t||Am(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Dm(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:km,isPlainObject:Em,isUndefined:Mm,isDate:Cm,isFile:Tm,isBlob:Om,isFunction:Am,isStream:function(e){return km(e)&&Am(e.pipe)},isURLSearchParams:Nm,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:_m,merge:function e(){var t={};function n(n,r){Em(t[r])&&Em(n)?t[r]=e(t[r],n):Em(n)?t[r]=e({},n):xm(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)_m(arguments[r],n);return t},extend:function(e,t,n){return _m(t,(function(t,r){e[r]=n&&"function"==typeof t?ym(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n){var r,i,o,s={};t=t||{};do{for(i=(r=Object.getOwnPropertyNames(e)).length;i-- >0;)s[o=r[i]]||(t[o]=e[o],s[o]=!0);e=Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:vm,kindOfTest:wm,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;var t=e.length;if(Mm(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},isTypedArray:Im,isFileList:Sm},zm=Lm;function Pm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Fm=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(zm.isURLSearchParams(t))r=t.toString();else{var i=[];zm.forEach(t,(function(e,t){null!=e&&(zm.isArray(e)?t+="[]":e=[e],zm.forEach(e,(function(e){zm.isDate(e)?e=e.toISOString():zm.isObject(e)&&(e=JSON.stringify(e)),i.push(Pm(t)+"="+Pm(e))})))})),r=i.join("&")}if(r){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},Rm=Lm;function Bm(){this.handlers=[]}Bm.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},Bm.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},Bm.prototype.forEach=function(e){Rm.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var Um,Hm,$m=Bm,Vm=Lm;function Wm(){if(Hm)return Um;Hm=1;var e=Lm;function t(e,t,n,r,i){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}e.inherits(t,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var n=t.prototype,r={};return["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){r[e]={value:e}})),Object.defineProperties(t,r),Object.defineProperty(n,"isAxiosError",{value:!0}),t.from=function(r,i,o,s,a,l){var u=Object.create(n);return e.toFlatObject(r,u,(function(e){return e!==Error.prototype})),t.call(u,r.message,i,o,s,a),u.name=r.name,l&&Object.assign(u,l),u},Um=t}var qm,Ym,Qm,Km,Gm,Jm,Xm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};function Zm(){if(Ym)return qm;Ym=1;var e=Lm;return qm=function(t,n){n=n||new FormData;var r=[];function i(t){return null===t?"":e.isDate(t)?t.toISOString():e.isArrayBuffer(t)||e.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}return function t(o,s){if(e.isPlainObject(o)||e.isArray(o)){if(-1!==r.indexOf(o))throw Error("Circular reference detected in "+s);r.push(o),e.forEach(o,(function(r,o){if(!e.isUndefined(r)){var a,l=s?s+"."+o:o;if(r&&!s&&"object"==typeof r)if(e.endsWith(o,"{}"))r=JSON.stringify(r);else if(e.endsWith(o,"[]")&&(a=e.toArray(r)))return void a.forEach((function(t){!e.isUndefined(t)&&n.append(l,i(t))}));t(r,l)}})),r.pop()}else n.append(s,i(o))}(t),n},qm}function eg(){if(Jm)return Gm;Jm=1;var e=Lm;return Gm=e.isStandardBrowserEnv()?{write:function(t,n,r,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(n)),e.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),e.isString(i)&&a.push("path="+i),e.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Gm}var tg,ng,rg,ig,og,sg,ag,lg,ug,cg,dg,pg,hg=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},fg=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},mg=function(e,t){return e&&!hg(t)?fg(e,t):t};function gg(){if(ng)return tg;ng=1;var e=Lm,t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return tg=function(n){var r,i,o,s={};return n?(e.forEach(n.split("\n"),(function(n){if(o=n.indexOf(":"),r=e.trim(n.substr(0,o)).toLowerCase(),i=e.trim(n.substr(o+1)),r){if(s[r]&&t.indexOf(r)>=0)return;s[r]="set-cookie"===r?(s[r]?s[r]:[]).concat([i]):s[r]?s[r]+", "+i:i}})),s):s},tg}function yg(){if(ig)return rg;ig=1;var e=Lm;return rg=e.isStandardBrowserEnv()?function(){var t,n=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var t=e;return n&&(r.setAttribute("href",t),t=r.href),r.setAttribute("href",t),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=i(window.location.href),function(n){var r=e.isString(n)?i(n):n;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}}function bg(){if(sg)return og;sg=1;var e=Wm();function t(t){e.call(this,null==t?"canceled":t,e.ERR_CANCELED),this.name="CanceledError"}return Lm.inherits(t,e,{__CANCEL__:!0}),og=t}function vg(){return lg||(lg=1,ag=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}),ag}function wg(){if(cg)return ug;cg=1;var e=Lm,t=function(){if(Km)return Qm;Km=1;var e=Wm();return Qm=function(t,n,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?n(new e("Request failed with status code "+r.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}}(),n=eg(),r=Fm,i=mg,o=gg(),s=yg(),a=Xm,l=Wm(),u=bg(),c=vg();return ug=function(d){return new Promise((function(p,h){var f,m=d.data,g=d.headers,y=d.responseType;function b(){d.cancelToken&&d.cancelToken.unsubscribe(f),d.signal&&d.signal.removeEventListener("abort",f)}e.isFormData(m)&&e.isStandardBrowserEnv()&&delete g["Content-Type"];var v=new XMLHttpRequest;if(d.auth){var w=d.auth.username||"",x=d.auth.password?unescape(encodeURIComponent(d.auth.password)):"";g.Authorization="Basic "+btoa(w+":"+x)}var M=i(d.baseURL,d.url);function D(){if(v){var e="getAllResponseHeaders"in v?o(v.getAllResponseHeaders()):null,n={data:y&&"text"!==y&&"json"!==y?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:e,config:d,request:v};t((function(e){p(e),b()}),(function(e){h(e),b()}),n),v=null}}if(v.open(d.method.toUpperCase(),r(M,d.params,d.paramsSerializer),!0),v.timeout=d.timeout,"onloadend"in v?v.onloadend=D:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(D)},v.onabort=function(){v&&(h(new l("Request aborted",l.ECONNABORTED,d,v)),v=null)},v.onerror=function(){h(new l("Network Error",l.ERR_NETWORK,d,v,v)),v=null},v.ontimeout=function(){var e=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded",t=d.transitional||a;d.timeoutErrorMessage&&(e=d.timeoutErrorMessage),h(new l(e,t.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,d,v)),v=null},e.isStandardBrowserEnv()){var k=(d.withCredentials||s(M))&&d.xsrfCookieName?n.read(d.xsrfCookieName):void 0;k&&(g[d.xsrfHeaderName]=k)}"setRequestHeader"in v&&e.forEach(g,(function(e,t){void 0===m&&"content-type"===t.toLowerCase()?delete g[t]:v.setRequestHeader(t,e)})),e.isUndefined(d.withCredentials)||(v.withCredentials=!!d.withCredentials),y&&"json"!==y&&(v.responseType=d.responseType),"function"==typeof d.onDownloadProgress&&v.addEventListener("progress",d.onDownloadProgress),"function"==typeof d.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",d.onUploadProgress),(d.cancelToken||d.signal)&&(f=function(e){v&&(h(!e||e&&e.type?new u:e),v.abort(),v=null)},d.cancelToken&&d.cancelToken.subscribe(f),d.signal&&(d.signal.aborted?f():d.signal.addEventListener("abort",f))),m||(m=null);var E=c(M);E&&-1===["http","https","file"].indexOf(E)?h(new l("Unsupported protocol "+E+":",l.ERR_BAD_REQUEST,d)):v.send(m)}))},ug}var xg=Lm,Mg=function(e,t){Vm.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},Dg=Wm(),kg=Xm,Eg=Zm(),Cg={"Content-Type":"application/x-www-form-urlencoded"};function Tg(e,t){!xg.isUndefined(e)&&xg.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Og,Sg={transitional:kg,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Og=wg()),Og),transformRequest:[function(e,t){if(Mg(t,"Accept"),Mg(t,"Content-Type"),xg.isFormData(e)||xg.isArrayBuffer(e)||xg.isBuffer(e)||xg.isStream(e)||xg.isFile(e)||xg.isBlob(e))return e;if(xg.isArrayBufferView(e))return e.buffer;if(xg.isURLSearchParams(e))return Tg(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var n,r=xg.isObject(e),i=t&&t["Content-Type"];if((n=xg.isFileList(e))||r&&"multipart/form-data"===i){var o=this.env&&this.env.FormData;return Eg(n?{"files[]":e}:e,o&&new o)}return r||"application/json"===i?(Tg(t,"application/json"),function(e,t,n){if(xg.isString(e))try{return(t||JSON.parse)(e),xg.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||Sg.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,i=!n&&"json"===this.responseType;if(i||r&&xg.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw Dg.from(e,Dg.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pg?dg:(pg=1,dg=null)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};xg.forEach(["delete","get","head"],(function(e){Sg.headers[e]={}})),xg.forEach(["post","put","patch"],(function(e){Sg.headers[e]=xg.merge(Cg)}));var Ag,Ng,_g=Sg,jg=Lm,Ig=_g;function Lg(){return Ng?Ag:(Ng=1,Ag=function(e){return!(!e||!e.__CANCEL__)})}var zg=Lm,Pg=function(e,t,n){var r=this||Ig;return jg.forEach(n,(function(n){e=n.call(r,e,t)})),e},Fg=Lg(),Rg=_g,Bg=bg();function Ug(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Bg}var Hg,$g,Vg=Lm,Wg=function(e,t){t=t||{};var n={};function r(e,t){return Vg.isPlainObject(e)&&Vg.isPlainObject(t)?Vg.merge(e,t):Vg.isPlainObject(t)?Vg.merge({},t):Vg.isArray(t)?t.slice():t}function i(n){return Vg.isUndefined(t[n])?Vg.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function o(e){if(!Vg.isUndefined(t[e]))return r(void 0,t[e])}function s(n){return Vg.isUndefined(t[n])?Vg.isUndefined(e[n])?void 0:r(void 0,e[n]):r(void 0,t[n])}function a(n){return n in t?r(e[n],t[n]):n in e?r(void 0,e[n]):void 0}var l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a};return Vg.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=l[e]||i,r=t(e);Vg.isUndefined(r)&&t!==a||(n[e]=r)})),n};function qg(){return $g?Hg:($g=1,Hg={version:"0.27.2"})}var Yg=qg().version,Qg=Wm(),Kg={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Kg[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var Gg={};Kg.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Yg+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,i,o){if(!1===e)throw new Qg(r(i," has been removed"+(t?" in "+t:"")),Qg.ERR_DEPRECATED);return t&&!Gg[i]&&(Gg[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}};var Jg,Xg,Zg,ey,ty,ny,ry={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Qg("options must be an object",Qg.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),i=r.length;i-- >0;){var o=r[i],s=t[o];if(s){var a=e[o],l=void 0===a||s(a,o,e);if(!0!==l)throw new Qg("option "+o+" must be "+l,Qg.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Qg("Unknown option "+o,Qg.ERR_BAD_OPTION)}},validators:Kg},iy=Lm,oy=Fm,sy=$m,ay=function(e){return Ug(e),e.headers=e.headers||{},e.data=Pg.call(e,e.data,e.headers,e.transformRequest),e.headers=zg.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),zg.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||Rg.adapter)(e).then((function(t){return Ug(e),t.data=Pg.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return Fg(t)||(Ug(e),t&&t.response&&(t.response.data=Pg.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},ly=Wg,uy=mg,cy=ry,dy=cy.validators;function py(e){this.defaults=e,this.interceptors={request:new sy,response:new sy}}py.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=ly(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&cy.assertOptions(n,{silentJSONParsing:dy.transitional(dy.boolean),forcedJSONParsing:dy.transitional(dy.boolean),clarifyTimeoutError:dy.transitional(dy.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var o,s=[];if(this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)})),!i){var a=[ay,void 0];for(Array.prototype.unshift.apply(a,r),a=a.concat(s),o=Promise.resolve(t);a.length;)o=o.then(a.shift(),a.shift());return o}for(var l=t;r.length;){var u=r.shift(),c=r.shift();try{l=u(l)}catch(e){c(e);break}}try{o=ay(l)}catch(e){return Promise.reject(e)}for(;s.length;)o=o.then(s.shift(),s.shift());return o},py.prototype.getUri=function(e){e=ly(this.defaults,e);var t=uy(e.baseURL,e.url);return oy(t,e.params,e.paramsSerializer)},iy.forEach(["delete","get","head","options"],(function(e){py.prototype[e]=function(t,n){return this.request(ly(n||{},{method:e,url:t,data:(n||{}).data}))}})),iy.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(ly(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}py.prototype[e]=t(),py.prototype[e+"Form"]=t(!0)}));var hy=Lm,fy=gm,my=py,gy=Wg;var yy=function e(t){var n=new my(t),r=fy(my.prototype.request,n);return hy.extend(r,my.prototype,n),hy.extend(r,n),r.create=function(n){return e(gy(t,n))},r}(_g);yy.Axios=my,yy.CanceledError=bg(),yy.CancelToken=function(){if(Xg)return Jg;Xg=1;var e=bg();function t(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(e){n=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},t((function(t){r.reason||(r.reason=new e(t),n(r.reason))}))}return t.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},t.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},t.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},t.source=function(){var e,n=new t((function(t){e=t}));return{token:n,cancel:e}},Jg=t}(),yy.isCancel=Lg(),yy.VERSION=qg().version,yy.toFormData=Zm(),yy.AxiosError=Wm(),yy.Cancel=yy.CanceledError,yy.all=function(e){return Promise.all(e)},yy.spread=ey?Zg:(ey=1,Zg=function(e){return function(t){return e.apply(null,t)}}),yy.isAxiosError=function(){if(ny)return ty;ny=1;var e=Lm;return ty=function(t){return e.isObject(t)&&!0===t.isAxiosError}}(),mm.exports=yy,mm.exports.default=yy;var by=nc(fm.exports=mm.exports);function vy(e){return e&&e.__esModule?e.default:e}var wy,xy,My,Dy,ky,Ey,Cy={},Ty=[],Oy=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Sy(e,t){for(var n in t)e[n]=t[n];return e}function Ay(e){var t=e.parentNode;t&&t.removeChild(e)}function Ny(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?wy.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return _y(e,s,r,i,null)}function _y(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++My:i};return null==i&&null!=xy.vnode&&xy.vnode(o),o}function jy(e){return e.children}function Iy(e,t){this.props=e,this.context=t}function Ly(e,t){if(null==t)return e.__?Ly(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Ly(e):null}function zy(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return zy(e)}}function Py(e){(!e.__d&&(e.__d=!0)&&Dy.push(e)&&!Fy.__r++||Ey!==xy.debounceRendering)&&((Ey=xy.debounceRendering)||ky)(Fy)}function Fy(){for(var e;Fy.__r=Dy.length;)e=Dy.sort((function(e,t){return e.__v.__b-t.__v.__b})),Dy=[],e.some((function(e){var t,n,r,i,o,s;e.__d&&(o=(i=(t=e).__v).__e,(s=t.__P)&&(n=[],(r=Sy({},i)).__v=i.__v+1,Yy(s,i,r,t.__n,void 0!==s.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?Ly(i):o,i.__h),Qy(n,i),i.__e!=o&&zy(i)))}))}function Ry(e,t,n,r,i,o,s,a,l,u){var c,d,p,h,f,m,g,y=r&&r.__k||Ty,b=y.length;for(n.__k=[],c=0;c<t.length;c++)if(null!=(h=n.__k[c]=null==(h=t[c])||"boolean"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?_y(null,h,null,null,h):Array.isArray(h)?_y(jy,{children:h},null,null,null):h.__b>0?_y(h.type,h.props,h.key,null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(p=y[c])||p&&h.key==p.key&&h.type===p.type)y[c]=void 0;else for(d=0;d<b;d++){if((p=y[d])&&h.key==p.key&&h.type===p.type){y[d]=void 0;break}p=null}Yy(e,h,p=p||Cy,i,o,s,a,l,u),f=h.__e,(d=h.ref)&&p.ref!=d&&(g||(g=[]),p.ref&&g.push(p.ref,null,h),g.push(d,h.__c||f,h)),null!=f?(null==m&&(m=f),"function"==typeof h.type&&h.__k===p.__k?h.__d=l=By(h,l,e):l=Hy(e,h,p,y,f,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=Ly(p))}for(n.__e=m,c=b;c--;)null!=y[c]&&("function"==typeof n.type&&null!=y[c].__e&&y[c].__e==n.__d&&(n.__d=Ly(r,c+1)),Gy(y[c],y[c]));if(g)for(c=0;c<g.length;c++)Ky(g[c],g[++c],g[++c])}function By(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?By(r,t,n):Hy(n,r,r,i,r.__e,t));return t}function Uy(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){Uy(e,t)})):t.push(e)),t}function Hy(e,t,n,r,i,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<r.length;l+=2)if(a==i)break e;e.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function $y(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||Oy.test(t)?n:n+"px"}function Vy(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||$y(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||$y(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?qy:Wy,o):e.removeEventListener(t,o?qy:Wy,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function Wy(e){this.l[e.type+!1](xy.event?xy.event(e):e)}function qy(e){this.l[e.type+!0](xy.event?xy.event(e):e)}function Yy(e,t,n,r,i,o,s,a,l){var u,c,d,p,h,f,m,g,y,b,v,w=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(u=xy.__b)&&u(t);try{e:if("function"==typeof w){if(g=t.props,y=(u=w.contextType)&&r[u.__c],b=u?y?y.props.value:u.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:("prototype"in w&&w.prototype.render?t.__c=c=new w(g,b):(t.__c=c=new Iy(g,b),c.constructor=w,c.render=Jy),y&&y.sub(c),c.props=g,c.state||(c.state={}),c.context=b,c.__n=r,d=c.__d=!0,c.__h=[]),null==c.__s&&(c.__s=c.state),null!=w.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Sy({},c.__s)),Sy(c.__s,w.getDerivedStateFromProps(g,c.__s))),p=c.props,h=c.state,d)null==w.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==w.getDerivedStateFromProps&&g!==p&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(g,b),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(g,c.__s,b)||t.__v===n.__v){c.props=g,c.state=c.__s,t.__v!==n.__v&&(c.__d=!1),c.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),c.__h.length&&s.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(g,c.__s,b),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(p,h,f)}))}c.context=b,c.props=g,c.state=c.__s,(u=xy.__r)&&u(t),c.__d=!1,c.__v=t,c.__P=e,u=c.render(c.props,c.state,c.context),c.state=c.__s,null!=c.getChildContext&&(r=Sy(Sy({},r),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(f=c.getSnapshotBeforeUpdate(p,h)),v=null!=u&&u.type===jy&&null==u.key?u.props.children:u,Ry(e,Array.isArray(v)?v:[v],t,n,r,i,o,s,a,l),c.base=t.__e,t.__h=null,c.__h.length&&s.push(c),m&&(c.__E=c.__=null),c.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,o,s,a){var l,u,c,d=n.props,p=t.props,h=t.type,f=0;if("svg"===h&&(i=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===h)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,p.is&&p),o=null,a=!1}if(null===h)d===p||a&&e.data===p||(e.data=p);else{if(o=o&&wy.call(e.childNodes),u=(d=n.props||Cy).dangerouslySetInnerHTML,c=p.dangerouslySetInnerHTML,!a){if(null!=o)for(d={},f=0;f<e.attributes.length;f++)d[e.attributes[f].name]=e.attributes[f].value;(c||u)&&(c&&(u&&c.__html==u.__html||c.__html===e.innerHTML)||(e.innerHTML=c&&c.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||Vy(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||Vy(e,o,t[o],n[o],r)}(e,p,d,i,a),c)t.__k=[];else if(f=t.props.children,Ry(e,Array.isArray(f)?f:[f],t,n,r,i&&"foreignObject"!==h,o,s,o?o[0]:n.__k&&Ly(n,0),a),null!=o)for(f=o.length;f--;)null!=o[f]&&Ay(o[f]);a||("value"in p&&void 0!==(f=p.value)&&(f!==d.value||f!==e.value||"progress"===h&&!f)&&Vy(e,"value",f,d.value,!1),"checked"in p&&void 0!==(f=p.checked)&&f!==e.checked&&Vy(e,"checked",f,d.checked,!1))}return e}(n.__e,t,n,r,i,o,s,l);(u=xy.diffed)&&u(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),xy.__e(e,t,n)}}function Qy(e,t){xy.__c&&xy.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){xy.__e(e,t.__v)}}))}function Ky(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){xy.__e(e,n)}}function Gy(e,t,n){var r,i;if(xy.unmount&&xy.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Ky(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){xy.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Gy(r[i],t,"function"!=typeof e.type);n||null==e.__e||Ay(e.__e),e.__e=e.__d=void 0}function Jy(e,t,n){return this.constructor(e,n)}function Xy(e,t,n){var r,i,o;xy.__&&xy.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],Yy(t,e=(!r&&n||t).__k=Ny(jy,null,[e]),i||Cy,Cy,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?wy.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),Qy(o,e)}wy=Ty.slice,xy={__e:function(e,t){for(var n,r,i;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),i=n.__d),i)return n.__E=n}catch(t){e=t}throw e}},My=0,Iy.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Sy({},this.state),"function"==typeof e&&(e=e(Sy({},n),this.props)),e&&Sy(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),Py(this))},Iy.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Py(this))},Iy.prototype.render=jy,Dy=[],ky="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Fy.__r=0;var Zy=0;function eb(e,t,n,r,i){var o,s,a={};for(s in t)"ref"==s?o=t[s]:a[s]=t[s];var l={type:e,props:a,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--Zy,__source:r,__self:i};if("function"==typeof e&&(o=e.defaultProps))for(s in o)void 0===a[s]&&(a[s]=o[s]);return xy.vnode&&xy.vnode(l),l}var tb;tb=JSON.parse('{"search":"Search","search_no_results_1":"Oh no!","search_no_results_2":"That emoji couldn’t be found","pick":"Pick an emoji…","add_custom":"Add custom emoji","categories":{"activity":"Activity","custom":"Custom","flags":"Flags","foods":"Food & Drink","frequent":"Frequently used","nature":"Animals & Nature","objects":"Objects","people":"Smileys & People","places":"Travel & Places","search":"Search Results","symbols":"Symbols"},"skins":{"1":"Default","2":"Light","3":"Medium-Light","4":"Medium","5":"Medium-Dark","6":"Dark","choose":"Choose default skin tone"}}');var nb={set:function(e,t){try{window.localStorage["emoji-mart.".concat(e)]=JSON.stringify(t)}catch(e){}},get:function(e){try{const t=window.localStorage["emoji-mart.".concat(e)];if(t)return JSON.parse(t)}catch(e){}}},rb=new Map;function ib(e){if(rb.has(e))return rb.get(e);var t=ob(e);return rb.set(e,t),t}var ob=function(){var e=null;try{e=document.createElement("canvas").getContext("2d")}catch(e){}if(!e)return function(){return!1};var t=25,n=20,r=Math.floor(t/2);return e.font=r+"px Arial, Sans-Serif",e.textBaseline="top",e.canvas.width=2*n,e.canvas.height=t,function(r){e.clearRect(0,0,2*n,t),e.fillStyle="#FF0000",e.fillText(r,0,22),e.fillStyle="#0000FF",e.fillText(r,n,22);for(var i=e.getImageData(0,0,n,t).data,o=i.length,s=0;s<o&&!i[s+3];s+=4);if(s>=o)return!1;var a=n+s/4%n,l=Math.floor(s/4/n),u=e.getImageData(a,l,1,1).data;return i[s]===u[0]&&i[s+2]===u[2]&&!(e.measureText(r).width>=n)}}();const sb=[{v:14,emoji:"🫠"},{v:13.1,emoji:"😶‍🌫️"},{v:13,emoji:"🥸"},{v:12.1,emoji:"🧑‍🦰"},{v:12,emoji:"🥱"},{v:11,emoji:"🥰"},{v:5,emoji:"🤩"},{v:4,emoji:"👱‍♀️"},{v:3,emoji:"🤣"},{v:2,emoji:"👋🏻"},{v:1,emoji:"🙃"}];var ab={latestVersion:function(){for(const{v:e,emoji:t}of sb)if(ib(t))return e},noCountryFlags:function(){return!ib("🇨🇦")}};const lb=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart"];let ub=null;var cb={add:function(e){ub||(ub=nb.get("frequently")||{});const t=e.id||e;t&&(ub[t]||(ub[t]=0),ub[t]+=1,nb.set("last",t),nb.set("frequently",ub))},get:function(e){let{maxFrequentRows:t,perLine:n}=e;ub||(ub=nb.get("frequently"));let r=[];if(!ub){ub={};for(let e in lb.slice(0,n)){const t=lb[e];ub[t]=n-e,r.push(t)}return r}const i=t*n,o=nb.get("last");for(let e in ub)r.push(e);if(r.sort(((e,t)=>{const n=ub[t],r=ub[e];return n==r?e.localeCompare(t):n-r})),r.length>i){const e=r.slice(i);r=r.slice(0,i);for(let t of e)t!=o&&delete ub[t];o&&-1==r.indexOf(o)&&(delete ub[r[r.length-1]],r.splice(-1,1,o)),nb.set("frequently",ub)}return r}};let db=null;var pb={search:async function(e){let{maxResults:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||!e.trim().length)return null;t||(t=90),await xb();const n=e.toLowerCase().replace(/(\w)-/,"$1 ").split(/[\s|,]+/).filter(((e,t,n)=>e.trim()&&n.indexOf(e)==t));if(!n.length)return;let r,i,o=db||(db=Object.values(mb.emojis));for(const e of n){if(!o.length)break;r=[],i={};for(const t of o){if(!t.search)continue;const n=t.search.indexOf(",".concat(e));-1!=n&&(r.push(t),i[t.id]||(i[t.id]=0),i[t.id]+=t.id==e?0:n+1)}o=r}return r.length<2||(r.sort(((e,t)=>{const n=i[e.id],r=i[t.id];return n==r?e.id.localeCompare(t.id):n-r})),r.length>t&&(r=r.slice(0,t))),r},get:function(e){return e.id?e:mb.emojis[e]||mb.emojis[mb.aliases[e]]||mb.emojis[mb.natives[e]]},SHORTCODES_REGEX:/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/};const hb=["checkered_flag","crossed_flags","pirate_flag","rainbow-flag","transgender_flag","triangular_flag_on_post","waving_black_flag","waving_white_flag"];let fb=null,mb=null;const gb={autoFocus:{value:!1},emojiButtonColors:{value:null},emojiButtonRadius:{value:"100%"},emojiButtonSize:{value:36},emojiSize:{value:24},emojiVersion:{value:14,choices:[1,2,3,4,5,11,12,12.1,13,13.1,14]},icons:{value:"auto",choices:["auto","outline","solid"]},locale:{value:"en",choices:["en","de","fr","it","pl","pt","ru","zh"]},maxFrequentRows:{value:4},navPosition:{value:"top",choices:["top","bottom","none"]},noCountryFlags:{value:!1},noResultsEmoji:{value:null},perLine:{value:9},previewEmoji:{value:null},previewPosition:{value:"bottom",choices:["top","bottom","none"]},searchPosition:{value:"sticky",choices:["sticky","static","none"]},set:{value:"native",choices:["native","apple","facebook","google","twitter"]},skin:{value:1,choices:[1,2,3,4,5,6]},skinTonePosition:{value:"preview",choices:["preview","search","none"]},stickySearch:{deprecated:!0,value:!0},theme:{value:"auto",choices:["auto","light","dark"]}};async function yb(e){const t=await fetch(e);return await t.json()}let bb=null,vb=!1,wb=null;function xb(e){return bb||(bb=new Promise((e=>{wb=e}))),e&&!vb&&(vb=!0,async function(e,t){const{data:n,i18n:r}=e,i=function(e,t){function n(n){const r=gb[n];let i=t&&t.getAttribute(n)||e[n];return null!=i&&r.value&&typeof r.value!=typeof i&&(i="boolean"==typeof r.value?"false"!=i:r.value.constructor(i)),(null==i||r.choices&&-1==r.choices.indexOf(i))&&(i=r.value),i}e||(e={});const r={};for(let e in gb)r[e]=n(e);return r}(e,t),{emojiVersion:o,set:s,locale:a}=i;if(mb=("function"==typeof n?await n():n)||await yb("https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/sets/".concat(o,"/").concat(s,".json")),fb=("function"==typeof r?await r():r)||("en"==a?vy(tb):await yb("https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/i18n/".concat(a,".json"))),i.maxFrequentRows){const e=cb.get(i);e.length&&mb.categories.unshift({id:"frequent",emojis:e})}if(e.custom)for(let t in e.custom){t=parseInt(t);const n=e.custom[t],r=e.custom[t-1];if(!n.emojis||!n.emojis.length)continue;n.id="custom_".concat(t+1),n.name||(n.name=fb.categories.custom),r&&!n.icon&&(n.target=r.target||r),mb.categories.push(n);const i=[];for(const e of n.emojis)mb.emojis[e.id]||(mb.emojis[e.id]=e,i.push(e.id));n.emojis=i}e.categories&&(mb.categories=mb.categories.filter((t=>-1!=e.categories.indexOf(t.id))).sort(((t,n)=>e.categories.indexOf(t.id)-e.categories.indexOf(n.id))));let l=null,u=null;"native"==s&&(l=ab.latestVersion(),u=i.noCountryFlags||ab.noCountryFlags());mb.emoticons={},mb.natives={};for(const t of mb.categories){let n=t.emojis.length;const{categoryIcons:r}=e;if(r){const e=r[t.id];e&&!t.icon&&(t.icon=e)}for(;n--;){const e=mb.emojis[t.emojis[n]],r=()=>{t.emojis.splice(n,1)};if(!e){r();continue}if(l&&e.version>l){r();continue}if(u&&"flags"==t.id&&!hb.includes(e.id)){r();continue}if(e.search=","+[[e.id,!1],[e.name,!0],[e.keywords,!1],[e.emoticons,!1]].map((e=>{let[t,n]=e;if(t)return(Array.isArray(t)?t:[t]).map((e=>(n?e.split(/[-|_|\s]+/):[e]).map((e=>e.toLowerCase())))).flat()})).flat().filter((e=>e&&e.trim())).join(","),e.emoticons)for(const t of e.emoticons)mb.emoticons[t]||(mb.emoticons[t]=e.id);let i=0;for(const t of e.skins){if(!t)continue;i++;const{native:n}=t;n&&(mb.natives[n]=e.id,e.search+=",".concat(n));const r=1==i?"":":skin-tone-".concat(i,":");t.shortcodes=":".concat(e.id,":").concat(r)}}}for(const e in mb.aliases){const t=mb.aliases[e],n=mb.emojis[t];n&&(n.aliases||(n.aliases=[]),n.aliases.push(e))}wb(i)}(e)),bb}var Mb={categories:{activity:{outline:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:eb("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113"})}),solid:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:eb("path",{d:"M16.17 337.5c0 44.98 7.565 83.54 13.98 107.9C35.22 464.3 50.46 496 174.9 496c9.566 0 19.59-.4707 29.84-1.271L17.33 307.3C16.53 317.6 16.17 327.7 16.17 337.5zM495.8 174.5c0-44.98-7.565-83.53-13.98-107.9c-4.688-17.54-18.34-31.23-36.04-35.95C435.5 27.91 392.9 16 337 16c-9.564 0-19.59 .4707-29.84 1.271l187.5 187.5C495.5 194.4 495.8 184.3 495.8 174.5zM26.77 248.8l236.3 236.3c142-36.1 203.9-150.4 222.2-221.1L248.9 26.87C106.9 62.96 45.07 177.2 26.77 248.8zM256 335.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L164.7 283.3C161.6 280.2 160 276.1 160 271.1c0-8.529 6.865-16 16-16c4.095 0 8.189 1.562 11.31 4.688l64.01 64C254.4 327.8 256 331.9 256 335.1zM304 287.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L212.7 235.3C209.6 232.2 208 228.1 208 223.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01C302.5 279.8 304 283.9 304 287.1zM256 175.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01c3.125 3.125 4.688 7.219 4.688 11.31c0 9.133-7.468 16-16 16c-4.094 0-8.189-1.562-11.31-4.688l-64.01-64.01C257.6 184.2 256 180.1 256 175.1z"})})},custom:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:eb("path",{d:"M417.1 368c-5.937 10.27-16.69 16-27.75 16c-5.422 0-10.92-1.375-15.97-4.281L256 311.4V448c0 17.67-14.33 32-31.1 32S192 465.7 192 448V311.4l-118.3 68.29C68.67 382.6 63.17 384 57.75 384c-11.06 0-21.81-5.734-27.75-16c-8.828-15.31-3.594-34.88 11.72-43.72L159.1 256L41.72 187.7C26.41 178.9 21.17 159.3 29.1 144C36.63 132.5 49.26 126.7 61.65 128.2C65.78 128.7 69.88 130.1 73.72 132.3L192 200.6V64c0-17.67 14.33-32 32-32S256 46.33 256 64v136.6l118.3-68.29c3.838-2.213 7.939-3.539 12.07-4.051C398.7 126.7 411.4 132.5 417.1 144c8.828 15.31 3.594 34.88-11.72 43.72L288 256l118.3 68.28C421.6 333.1 426.8 352.7 417.1 368z"})}),flags:{outline:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:eb("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z"})}),solid:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:eb("path",{d:"M64 496C64 504.8 56.75 512 48 512h-32C7.25 512 0 504.8 0 496V32c0-17.75 14.25-32 32-32s32 14.25 32 32V496zM476.3 0c-6.365 0-13.01 1.35-19.34 4.233c-45.69 20.86-79.56 27.94-107.8 27.94c-59.96 0-94.81-31.86-163.9-31.87C160.9 .3055 131.6 4.867 96 15.75v350.5c32-9.984 59.87-14.1 84.85-14.1c73.63 0 124.9 31.78 198.6 31.78c31.91 0 68.02-5.971 111.1-23.09C504.1 355.9 512 344.4 512 332.1V30.73C512 11.1 495.3 0 476.3 0z"})})},foods:{outline:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:eb("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9"})}),solid:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:eb("path",{d:"M481.9 270.1C490.9 279.1 496 291.3 496 304C496 316.7 490.9 328.9 481.9 337.9C472.9 346.9 460.7 352 448 352H64C51.27 352 39.06 346.9 30.06 337.9C21.06 328.9 16 316.7 16 304C16 291.3 21.06 279.1 30.06 270.1C39.06 261.1 51.27 256 64 256H448C460.7 256 472.9 261.1 481.9 270.1zM475.3 388.7C478.3 391.7 480 395.8 480 400V416C480 432.1 473.3 449.3 461.3 461.3C449.3 473.3 432.1 480 416 480H96C79.03 480 62.75 473.3 50.75 461.3C38.74 449.3 32 432.1 32 416V400C32 395.8 33.69 391.7 36.69 388.7C39.69 385.7 43.76 384 48 384H464C468.2 384 472.3 385.7 475.3 388.7zM50.39 220.8C45.93 218.6 42.03 215.5 38.97 211.6C35.91 207.7 33.79 203.2 32.75 198.4C31.71 193.5 31.8 188.5 32.99 183.7C54.98 97.02 146.5 32 256 32C365.5 32 457 97.02 479 183.7C480.2 188.5 480.3 193.5 479.2 198.4C478.2 203.2 476.1 207.7 473 211.6C469.1 215.5 466.1 218.6 461.6 220.8C457.2 222.9 452.3 224 447.3 224H64.67C59.73 224 54.84 222.9 50.39 220.8zM372.7 116.7C369.7 119.7 368 123.8 368 128C368 131.2 368.9 134.3 370.7 136.9C372.5 139.5 374.1 141.6 377.9 142.8C380.8 143.1 384 144.3 387.1 143.7C390.2 143.1 393.1 141.6 395.3 139.3C397.6 137.1 399.1 134.2 399.7 131.1C400.3 128 399.1 124.8 398.8 121.9C397.6 118.1 395.5 116.5 392.9 114.7C390.3 112.9 387.2 111.1 384 111.1C379.8 111.1 375.7 113.7 372.7 116.7V116.7zM244.7 84.69C241.7 87.69 240 91.76 240 96C240 99.16 240.9 102.3 242.7 104.9C244.5 107.5 246.1 109.6 249.9 110.8C252.8 111.1 256 112.3 259.1 111.7C262.2 111.1 265.1 109.6 267.3 107.3C269.6 105.1 271.1 102.2 271.7 99.12C272.3 96.02 271.1 92.8 270.8 89.88C269.6 86.95 267.5 84.45 264.9 82.7C262.3 80.94 259.2 79.1 256 79.1C251.8 79.1 247.7 81.69 244.7 84.69V84.69zM116.7 116.7C113.7 119.7 112 123.8 112 128C112 131.2 112.9 134.3 114.7 136.9C116.5 139.5 118.1 141.6 121.9 142.8C124.8 143.1 128 144.3 131.1 143.7C134.2 143.1 137.1 141.6 139.3 139.3C141.6 137.1 143.1 134.2 143.7 131.1C144.3 128 143.1 124.8 142.8 121.9C141.6 118.1 139.5 116.5 136.9 114.7C134.3 112.9 131.2 111.1 128 111.1C123.8 111.1 119.7 113.7 116.7 116.7L116.7 116.7z"})})},frequent:{outline:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[eb("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),eb("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"})]}),solid:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:eb("path",{d:"M256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512zM232 256C232 264 236 271.5 242.7 275.1L338.7 339.1C349.7 347.3 364.6 344.3 371.1 333.3C379.3 322.3 376.3 307.4 365.3 300L280 243.2V120C280 106.7 269.3 96 255.1 96C242.7 96 231.1 106.7 231.1 120L232 256z"})})},nature:{outline:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[eb("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8"}),eb("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235"})]}),solid:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:eb("path",{d:"M332.7 19.85C334.6 8.395 344.5 0 356.1 0C363.6 0 370.6 3.52 375.1 9.502L392 32H444.1C456.8 32 469.1 37.06 478.1 46.06L496 64H552C565.3 64 576 74.75 576 88V112C576 156.2 540.2 192 496 192H426.7L421.6 222.5L309.6 158.5L332.7 19.85zM448 64C439.2 64 432 71.16 432 80C432 88.84 439.2 96 448 96C456.8 96 464 88.84 464 80C464 71.16 456.8 64 448 64zM416 256.1V480C416 497.7 401.7 512 384 512H352C334.3 512 320 497.7 320 480V364.8C295.1 377.1 268.8 384 240 384C211.2 384 184 377.1 160 364.8V480C160 497.7 145.7 512 128 512H96C78.33 512 64 497.7 64 480V249.8C35.23 238.9 12.64 214.5 4.836 183.3L.9558 167.8C-3.331 150.6 7.094 133.2 24.24 128.1C41.38 124.7 58.76 135.1 63.05 152.2L66.93 167.8C70.49 182 83.29 191.1 97.97 191.1H303.8L416 256.1z"})})},objects:{outline:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[eb("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z"}),eb("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789"})]}),solid:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:eb("path",{d:"M112.1 454.3c0 6.297 1.816 12.44 5.284 17.69l17.14 25.69c5.25 7.875 17.17 14.28 26.64 14.28h61.67c9.438 0 21.36-6.401 26.61-14.28l17.08-25.68c2.938-4.438 5.348-12.37 5.348-17.7L272 415.1h-160L112.1 454.3zM191.4 .0132C89.44 .3257 16 82.97 16 175.1c0 44.38 16.44 84.84 43.56 115.8c16.53 18.84 42.34 58.23 52.22 91.45c.0313 .25 .0938 .5166 .125 .7823h160.2c.0313-.2656 .0938-.5166 .125-.7823c9.875-33.22 35.69-72.61 52.22-91.45C351.6 260.8 368 220.4 368 175.1C368 78.61 288.9-.2837 191.4 .0132zM192 96.01c-44.13 0-80 35.89-80 79.1C112 184.8 104.8 192 96 192S80 184.8 80 176c0-61.76 50.25-111.1 112-111.1c8.844 0 16 7.159 16 16S200.8 96.01 192 96.01z"})})},people:{outline:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[eb("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}),eb("path",{d:"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0"})]}),solid:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:eb("path",{d:"M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256 432C332.1 432 396.2 382 415.2 314.1C419.1 300.4 407.8 288 393.6 288H118.4C104.2 288 92.92 300.4 96.76 314.1C115.8 382 179.9 432 256 432V432zM176.4 160C158.7 160 144.4 174.3 144.4 192C144.4 209.7 158.7 224 176.4 224C194 224 208.4 209.7 208.4 192C208.4 174.3 194 160 176.4 160zM336.4 224C354 224 368.4 209.7 368.4 192C368.4 174.3 354 160 336.4 160C318.7 160 304.4 174.3 304.4 192C304.4 209.7 318.7 224 336.4 224z"})})},places:{outline:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[eb("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5"}),eb("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z"})]}),solid:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:eb("path",{d:"M39.61 196.8L74.8 96.29C88.27 57.78 124.6 32 165.4 32H346.6C387.4 32 423.7 57.78 437.2 96.29L472.4 196.8C495.6 206.4 512 229.3 512 256V448C512 465.7 497.7 480 480 480H448C430.3 480 416 465.7 416 448V400H96V448C96 465.7 81.67 480 64 480H32C14.33 480 0 465.7 0 448V256C0 229.3 16.36 206.4 39.61 196.8V196.8zM109.1 192H402.9L376.8 117.4C372.3 104.6 360.2 96 346.6 96H165.4C151.8 96 139.7 104.6 135.2 117.4L109.1 192zM96 256C78.33 256 64 270.3 64 288C64 305.7 78.33 320 96 320C113.7 320 128 305.7 128 288C128 270.3 113.7 256 96 256zM416 320C433.7 320 448 305.7 448 288C448 270.3 433.7 256 416 256C398.3 256 384 270.3 384 288C384 305.7 398.3 320 416 320z"})})},symbols:{outline:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:eb("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"})}),solid:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:eb("path",{d:"M500.3 7.251C507.7 13.33 512 22.41 512 31.1V175.1C512 202.5 483.3 223.1 447.1 223.1C412.7 223.1 383.1 202.5 383.1 175.1C383.1 149.5 412.7 127.1 447.1 127.1V71.03L351.1 90.23V207.1C351.1 234.5 323.3 255.1 287.1 255.1C252.7 255.1 223.1 234.5 223.1 207.1C223.1 181.5 252.7 159.1 287.1 159.1V63.1C287.1 48.74 298.8 35.61 313.7 32.62L473.7 .6198C483.1-1.261 492.9 1.173 500.3 7.251H500.3zM74.66 303.1L86.5 286.2C92.43 277.3 102.4 271.1 113.1 271.1H174.9C185.6 271.1 195.6 277.3 201.5 286.2L213.3 303.1H239.1C266.5 303.1 287.1 325.5 287.1 351.1V463.1C287.1 490.5 266.5 511.1 239.1 511.1H47.1C21.49 511.1-.0019 490.5-.0019 463.1V351.1C-.0019 325.5 21.49 303.1 47.1 303.1H74.66zM143.1 359.1C117.5 359.1 95.1 381.5 95.1 407.1C95.1 434.5 117.5 455.1 143.1 455.1C170.5 455.1 191.1 434.5 191.1 407.1C191.1 381.5 170.5 359.1 143.1 359.1zM440.3 367.1H496C502.7 367.1 508.6 372.1 510.1 378.4C513.3 384.6 511.6 391.7 506.5 396L378.5 508C372.9 512.1 364.6 513.3 358.6 508.9C352.6 504.6 350.3 496.6 353.3 489.7L391.7 399.1H336C329.3 399.1 323.4 395.9 321 389.6C318.7 383.4 320.4 376.3 325.5 371.1L453.5 259.1C459.1 255 467.4 254.7 473.4 259.1C479.4 263.4 481.6 271.4 478.7 278.3L440.3 367.1zM116.7 219.1L19.85 119.2C-8.112 90.26-6.614 42.31 24.85 15.34C51.82-8.137 93.26-3.642 118.2 21.83L128.2 32.32L137.7 21.83C162.7-3.642 203.6-8.137 231.6 15.34C262.6 42.31 264.1 90.26 236.1 119.2L139.7 219.1C133.2 225.6 122.7 225.6 116.7 219.1H116.7z"})})}},search:{loupe:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:eb("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"})}),delete:eb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:eb("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"})})}};function Db(e){let{id:t,skin:n,shortcodes:r,emoji:i}=e;if(!i&&!t&&r){const e=r.match(pb.SHORTCODES_REGEX);e&&(t=e[1],e[2]&&(n=e[2]))}if(i||(i=pb.get(t)),!i)return e.fallback;const o=i.skins[n-1]||i.skins[0],s=o.src||("native"==e.set||e.spritesheet?void 0:"function"==typeof e.getImageURL?e.getImageURL(e.set,o.unified):"https://cdn.jsdelivr.net/npm/emoji-datasource-".concat(e.set,"@14.0.0/img/").concat(e.set,"/64/").concat(o.unified,".png")),a="function"==typeof e.getSpritesheetURL?e.getSpritesheetURL(e.set):"https://cdn.jsdelivr.net/npm/emoji-datasource-".concat(e.set,"@14.0.0/img/").concat(e.set,"/sheets-256/64.png");return eb("span",{class:"emoji-mart-emoji","data-emoji-set":e.set,children:s?eb("img",{style:{height:e.size||"1em",width:"auto",display:"inline-block",position:"relative",top:".1em"},alt:o.native||o.shortcodes,src:s}):"native"==e.set?eb("span",{style:{fontSize:e.size,fontFamily:'"EmojiMart", "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Android Emoji"'},children:o.native}):eb("span",{style:{display:"block",width:e.size,height:e.size,backgroundImage:"url(".concat(a,")"),backgroundSize:"".concat(100*mb.sheet.cols,"% ").concat(100*mb.sheet.rows,"%"),backgroundPosition:"".concat(100/(mb.sheet.cols-1)*o.x,"% ").concat(100/(mb.sheet.rows-1)*o.y,"%")}})})}class kb extends window.HTMLElement{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super(),this.props=e,e.parent||e.ref){const t=e.parent||e.ref&&e.ref.current;t&&t.appendChild(this)}}}class Eb extends kb{constructor(e){let{styles:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e),this.setShadow(),this.injectStyles(t)}setShadow(){this.attachShadow({mode:"open"})}injectStyles(e){if(!e)return;const t=document.createElement("style");t.textContent=e,this.shadowRoot.insertBefore(t,this.shadowRoot.firstChild)}}customElements.get("em-emoji")||customElements.define("em-emoji",class extends kb{async connectedCallback(){const e=await xb(),t=this.getAttribute("native");let n=null;t&&(n=pb.get(t));Xy(eb(Db,{...{...e,emoji:n,id:this.getAttribute("id"),set:this.getAttribute("set")||e.set,size:this.getAttribute("size"),fallback:this.getAttribute("fallback"),shortcodes:this.getAttribute("shortcodes")}}),this)}});var Cb,Tb=[],Ob=xy.__b,Sb=xy.__r,Ab=xy.diffed,Nb=xy.__c,_b=xy.unmount;function jb(){var e;for(Tb.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=Tb.pop();)if(e.__P)try{e.__H.__h.forEach(Lb),e.__H.__h.forEach(zb),e.__H.__h=[]}catch(t){e.__H.__h=[],xy.__e(t,e.__v)}}xy.__b=function(e){Ob&&Ob(e)},xy.__r=function(e){Sb&&Sb(e);var t=e.__c.__H;t&&(t.__h.forEach(Lb),t.__h.forEach(zb),t.__h=[])},xy.diffed=function(e){Ab&&Ab(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==Tb.push(t)&&Cb===xy.requestAnimationFrame||((Cb=xy.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),Ib&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Ib&&(t=requestAnimationFrame(n))})(jb))},xy.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Lb),e.__h=e.__h.filter((function(e){return!e.__||zb(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],xy.__e(n,e.__v)}})),Nb&&Nb(e,t)},xy.unmount=function(e){_b&&_b(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Lb(e)}catch(e){t=e}})),t&&xy.__e(t,n.__v))};var Ib="function"==typeof requestAnimationFrame;function Lb(e){var t=e.__c;"function"==typeof t&&(e.__c=void 0,t())}function zb(e){e.__c=e.__()}function Pb(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Fb(e){this.props=e}(Fb.prototype=new Iy).isPureReactComponent=!0,Fb.prototype.shouldComponentUpdate=function(e,t){return Pb(this.props,e)||Pb(this.state,t)};var Rb=xy.__b;xy.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Rb&&Rb(e)};var Bb=xy.__e;xy.__e=function(e,t,n){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);Bb(e,t,n)};var Ub=xy.unmount;function Hb(){this.__u=0,this.t=null,this.__b=null}function $b(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function Vb(){this.u=null,this.o=null}xy.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),Ub&&Ub(e)},(Hb.prototype=new Iy).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var i=$b(r.__v),o=!1,s=function(){o||(o=!0,n.__R=null,i?i(a):a())};n.__R=s;var a=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},l=!0===t.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(s,s)},Hb.prototype.componentWillUnmount=function(){this.t=[]},Hb.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=function(e,t){for(var n in t)e[n]=t[n];return e}({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__e&&Ny(jy,null,e.fallback);return i&&(i.__h=null),[Ny(jy,null,t.__e?null:e.children),i]};var Wb=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};(Vb.prototype=new Iy).__e=function(e){var t=this,n=$b(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),Wb(t,e,r)):i()};n?n(o):o()}},Vb.prototype.render=function(e){this.u=null,this.o=new Map;var t=Uy(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Vb.prototype.componentDidUpdate=Vb.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){Wb(e,n,t)}))};var qb="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Yb=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Qb="undefined"!=typeof document,Kb=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};Iy.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(Iy.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Gb=xy.event;function Jb(){}function Xb(){return this.cancelBubble}function Zb(){return this.defaultPrevented}xy.event=function(e){return Gb&&(e=Gb(e)),e.persist=Jb,e.isPropagationStopped=Xb,e.isDefaultPrevented=Zb,e.nativeEvent=e};var ev={configurable:!0,get:function(){return this.class}},tv=xy.vnode;xy.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var o in r={},n){var s=n[o];Qb&&"children"===o&&"noscript"===t||"value"===o&&"defaultValue"in n&&null==s||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===s?s="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!Kb(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():i&&Yb.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===s&&(s=void 0),r[o]=s)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=Uy(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=Uy(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(ev.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",ev))}e.$$typeof=qb,tv&&tv(e)};var nv=xy.__r;xy.__r=function(e){nv&&nv(e),e.__c};const rv={light:"outline",dark:"solid"};class iv extends Fb{constructor(){super(),this.categories=mb.categories.filter((e=>!e.target)),this.state={categoryId:this.categories[0].id}}renderIcon(e){const{icon:t}=e;if(t){if(t.svg)return eb("span",{class:"flex",dangerouslySetInnerHTML:{__html:t.svg}});if(t.src)return eb("img",{src:t.src})}const n=Mb.categories[e.id]||Mb.categories.custom;return n["auto"==this.props.icons?rv[this.props.theme]:this.props.icons]||n}render(){let e=null;return eb("nav",{id:"nav",class:"padding","data-position":this.props.position,children:eb("div",{class:"flex relative",children:[this.categories.map(((t,n)=>{const r=t.name||fb.categories[t.id],i=!this.props.unfocused&&t.id==this.state.categoryId;return i&&(e=n),eb("button",{"aria-label":r,"aria-selected":i||void 0,title:r,type:"button",class:"flex flex-grow flex-center",onMouseDown:e=>e.preventDefault(),onClick:()=>{this.props.onClick({category:t,i:n})},children:this.renderIcon(t)})})),eb("div",{class:"bar",style:{width:"".concat(100/this.categories.length,"%"),opacity:null==e?0:1,transform:"translateX(".concat(100*e,"%)")}})]})})}}class ov extends Fb{shouldComponentUpdate(e){for(let t in e)if("children"!=t&&e[t]!=this.props[t])return!0;return!1}render(){return this.props.children}}const sv=10;class av extends Iy{constructor(e){super(),pm(this,"handleClickOutside",(e=>{const{element:t}=this.props;e.target!=t&&(this.state.showSkins&&this.closeSkins(),this.props.onClickOutside&&this.props.onClickOutside())})),pm(this,"handleBaseClick",(e=>{this.state.showSkins&&(e.target.closest(".menu")||(e.preventDefault(),e.stopImmediatePropagation(),this.closeSkins()))})),pm(this,"handleBaseKeydown",(e=>{this.state.showSkins&&"Escape"==e.key&&(e.preventDefault(),e.stopImmediatePropagation(),this.closeSkins())})),pm(this,"handleSearchClick",(()=>{this.getEmojiByPos(this.state.pos)&&this.setState({pos:[-1,-1]})})),pm(this,"handleSearchInput",(async()=>{const e=this.refs.searchInput.current;if(!e)return;const{value:t}=e,n=await pb.search(t),r=()=>{this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0)};if(!n)return this.setState({searchResults:n,pos:[-1,-1]},r);const i=e.selectionStart==e.value.length?[0,0]:[-1,-1],o=[];o.setsize=n.length;let s=null;for(let e of n)o.length&&s.length!=this.props.perLine||(s=[],s.__categoryId="search",s.__index=o.length,o.push(s)),s.push(e);this.ignoreMouse(),this.setState({searchResults:o,pos:i},r)})),pm(this,"handleSearchKeyDown",(e=>{const t=e.currentTarget;switch(e.stopImmediatePropagation(),e.key){case"ArrowLeft":this.navigate({e:e,input:t,left:!0});break;case"ArrowRight":this.navigate({e:e,input:t,right:!0});break;case"ArrowUp":this.navigate({e:e,input:t,up:!0});break;case"ArrowDown":this.navigate({e:e,input:t,down:!0});break;case"Enter":e.preventDefault(),this.handleEmojiClick({pos:this.state.pos});break;case"Escape":e.preventDefault(),this.state.searchResults?this.clearSearch():this.unfocusSearch()}})),pm(this,"clearSearch",(()=>{const e=this.refs.searchInput.current;e&&(e.value="",e.focus(),this.handleSearchInput())})),pm(this,"handleCategoryClick",(e=>{let{category:t,i:n}=e;this.scrollTo(0==n?{row:-1}:{categoryId:t.id})})),pm(this,"openSkins",(e=>{const{currentTarget:t}=e,n=t.getBoundingClientRect();this.setState({showSkins:n},(async()=>{await async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;for(let t in[...Array(e).keys()])await new Promise(requestAnimationFrame)}(2);const e=this.refs.menu.current;e&&(e.classList.remove("hidden"),this.refs.skinToneRadio.current.focus(),this.base.addEventListener("click",this.handleBaseClick,!0),this.base.addEventListener("keydown",this.handleBaseKeydown,!0))}))})),this.state={pos:[-1,-1],skin:nb.get("skin")||e.skin,theme:this.initTheme(e.theme),visibleRows:{0:!0}}}componentWillMount(){const{categories:e}=mb;this.refs={categories:new Map,menu:{current:null},navigation:{current:null},scroll:{current:null},search:{current:null},searchInput:{current:null},skinToneButton:{current:null},skinToneRadio:{current:null}},this.grid=[],this.grid.setsize=0;const t=(e,t)=>{const n=[];n.__categoryId=t.id,n.__index=e.length,this.grid.push(n);const r=this.grid.length-1,i=r%sv?{}:{current:null};return i.index=r,i.posinset=this.grid.setsize+1,e.push(i),n};for(let n of e){const e=[];let r=t(e,n);for(let i of n.emojis)r.length==this.props.perLine&&(r=t(e,n)),this.grid.setsize+=1,r.push(i);this.refs.categories.set(n.id,{root:{current:null},rows:e})}0==this.props.stickySearch&&"sticky"==this.props.searchPosition&&(console.warn("[EmojiMart] Deprecation warning: `stickySearch` has been renamed `searchPosition`."),this.props.searchPosition="static")}componentDidMount(){if(this.observeCategories(),this.observeRows(),this.shadowRoot=this.base.parentNode,document.addEventListener("click",this.handleClickOutside),this.props.autoFocus){const{searchInput:e}=this.refs;e.current&&e.current.focus()}}initTheme(e){if("auto"!=e)return e;const t=matchMedia("(prefers-color-scheme: dark)");return t.media.match(/^not/)?"light":(t.addListener((()=>{this.setState({theme:t.matches?"dark":"light"})})),t.matches?"dark":"light")}getEmojiByPos(e){let[t,n]=e;const r=this.state.searchResults||this.grid,i=r[t]&&r[t][n];if(i)return pb.get(i)}observeCategories(){const e=this.refs.navigation.current;if(!e)return;const t=new Map,n=t=>{t!=e.state.categoryId&&e.setState({categoryId:t})},r={root:this.refs.scroll.current,threshold:[0,1]},i=new IntersectionObserver((e=>{for(const n of e){const e=n.target.dataset.id;t.set(e,n.intersectionRatio)}const r=[...t],i=r[r.length-1];if(1==i[1])return n(i[0]);for(const[e,t]of r)if(t){n(e);break}}),r);for(const{root:e}of this.refs.categories.values())i.observe(e.current)}observeRows(){const e={...this.state.visibleRows},t=new IntersectionObserver((t=>{for(const n of t){const t=parseInt(n.target.dataset.index);n.isIntersecting?e[t]=!0:delete e[t]}this.setState({visibleRows:e})}),{root:this.refs.scroll.current,rootMargin:"".concat(this.props.emojiButtonSize*(sv+5),"px 0px ").concat(this.props.emojiButtonSize*sv,"px")});for(const{rows:e}of this.refs.categories.values())for(const n of e)n.current&&t.observe(n.current)}preventDefault(e){e.preventDefault()}unfocusSearch(){const e=this.refs.searchInput.current;e&&e.blur()}navigate(e){let{e:t,input:n,left:r,right:i,up:o,down:s}=e;const a=this.state.searchResults||this.grid;if(!a.length)return;let[l,u]=this.state.pos;const c=(()=>{if(0==l&&0==u&&!t.repeat&&(r||o))return null;if(-1==l)return t.repeat||!i&&!s||n.selectionStart!=n.value.length?null:[0,0];if(r||i){let e=a[l];const t=r?-1:1;if(u+=t,!e[u]){if(l+=t,e=a[l],!e)return l=r?0:a.length-1,u=r?0:a[l].length-1,[l,u];u=r?e.length-1:0}return[l,u]}if(o||s){l+=o?-1:1;const e=a[l];return e?(e[u]||(u=e.length-1),[l,u]):(l=o?0:a.length-1,u=o?0:a[l].length-1,[l,u])}})();c?(t.preventDefault(),this.setState({pos:c,keyboard:!0},(()=>{this.scrollTo({row:c[0]})}))):this.state.pos[0]>-1&&this.setState({pos:[-1,-1]})}scrollTo(e){let{categoryId:t,row:n}=e;const r=this.state.searchResults||this.grid;if(!r.length)return;const i=this.refs.scroll.current,o=i.getBoundingClientRect();let s=0;if(n>=0&&(t=r[n].__categoryId),t){s=(this.refs[t]||this.refs.categories.get(t).root).current.getBoundingClientRect().top-(o.top-i.scrollTop)+1}if(n>=0)if(n){const e=s+r[n].__index*this.props.emojiButtonSize,t=e+this.props.emojiButtonSize+.88*this.props.emojiButtonSize;if(e<i.scrollTop)s=e;else{if(!(t>i.scrollTop+o.height))return;s=t-o.height}}else s=0;this.ignoreMouse(),i.scrollTop=s}ignoreMouse(){this.mouseIsIgnored=!0,clearTimeout(this.ignoreMouseTimer),this.ignoreMouseTimer=setTimeout((()=>{delete this.mouseIsIgnored}),100)}handleEmojiOver(e){this.mouseIsIgnored||this.state.showSkins||this.setState({pos:e||[-1,-1],keyboard:!1})}handleEmojiClick(e){let{emoji:t,pos:n}=e;if(this.props.onEmojiSelect&&(!t&&n&&(t=this.getEmojiByPos(n)),t)){const e=t.skins[this.state.skin-1]||t.skins[0],n={id:t.id,name:t.name,native:e.native,unified:e.unified,keywords:t.keywords,shortcodes:e.shortcodes||t.shortcodes};e.src&&(n.src=e.src),t.aliases&&t.aliases.length&&(n.aliases=t.aliases),t.emoticons&&t.emoticons.length&&(n.emoticons=t.emoticons),this.props.maxFrequentRows&&cb.add(n,this.props),this.props.onEmojiSelect(n)}}closeSkins(){this.state.showSkins&&(this.setState({showSkins:null,tempSkin:null}),this.base.removeEventListener("click",this.handleBaseClick),this.base.removeEventListener("keydown",this.handleBaseKeydown))}handleSkinMouseOver(e){this.setState({tempSkin:e})}handleSkinClick(e){this.ignoreMouse(),this.closeSkins(),this.setState({skin:e,tempSkin:null}),nb.set("skin",e)}renderNav(){return eb(iv,{ref:this.refs.navigation,icons:this.props.icons,theme:this.state.theme,unfocused:!!this.state.searchResults,position:this.props.navPosition,onClick:this.handleCategoryClick})}renderPreview(){const e=this.getEmojiByPos(this.state.pos),t=this.state.searchResults&&!this.state.searchResults.length;return eb("div",{id:"preview",class:"flex flex-middle","data-position":this.props.previewPosition,children:[eb("div",{class:"flex flex-middle flex-grow",children:[eb("div",{class:"flex flex-auto flex-middle flex-center",style:{height:this.props.emojiButtonSize,fontSize:this.props.emojiButtonSize},children:eb(Db,{emoji:e,id:t?this.props.noResultsEmoji||"cry":this.props.previewEmoji||("top"==this.props.previewPosition?"point_down":"point_up"),set:this.props.set,size:this.props.emojiButtonSize,skin:this.state.tempSkin||this.state.skin,spritesheet:!0,getSpritesheetURL:this.props.getSpritesheetURL})}),eb("div",{class:"margin-l",children:eb("div",e?{class:"padding-r",children:[eb("div",{class:"ellipsis",style:{fontSize:"1.1em"},children:e.name}),eb("div",{class:"ellipsis color-c",style:{fontSize:".9em"},children:e.skins[0].shortcodes})]}:t?{class:"padding-r",children:[eb("div",{class:"ellipsis",style:{fontSize:"1.1em"},children:fb.search_no_results_1}),eb("div",{class:"ellipsis color-c",style:{fontSize:".9em"},children:fb.search_no_results_2})]}:{class:"color-c",style:{fontSize:21},children:fb.pick})})]}),!e&&"preview"==this.props.skinTonePosition&&this.renderSkinToneButton()]})}renderEmojiButton(e,t){let{pos:n,posinset:r,grid:i}=t;const o=this.props.emojiButtonSize,s=this.state.tempSkin||this.state.skin,a=(e.skins[s-1]||e.skins[0]).native,l=function(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every(((e,n)=>e==t[n]))}(this.state.pos,n),u=n.concat(e.id).join("");return eb(ov,{selected:l,skin:s,size:o,children:eb("button",{"aria-label":a,"aria-selected":l||void 0,"aria-posinset":r,"aria-setsize":i.setsize,"data-keyboard":this.state.keyboard,title:"none"==this.props.previewPosition?e.name:void 0,type:"button",class:"flex flex-center flex-middle",tabindex:"-1",onClick:()=>this.handleEmojiClick({emoji:e}),onMouseEnter:()=>this.handleEmojiOver(n),onMouseLeave:()=>this.handleEmojiOver(),style:{width:this.props.emojiButtonSize,height:this.props.emojiButtonSize,fontSize:this.props.emojiSize,lineHeight:0},children:[eb("div",{"aria-hidden":"true",class:"background",style:{borderRadius:this.props.emojiButtonRadius,backgroundColor:this.props.emojiButtonColors?this.props.emojiButtonColors[(r-1)%this.props.emojiButtonColors.length]:void 0}}),eb(Db,{emoji:e,set:this.props.set,size:this.props.emojiSize,skin:s,spritesheet:!0,getSpritesheetURL:this.props.getSpritesheetURL})]})},u)}renderSearch(){return eb("div",{children:[eb("div",{class:"spacer"}),eb("div",{class:"flex flex-middle",children:[eb("div",{class:"search relative flex-grow",children:[eb("input",{type:"search",ref:this.refs.searchInput,placeholder:fb.search,onClick:this.handleSearchClick,onInput:this.handleSearchInput,onKeyDown:this.handleSearchKeyDown}),eb("span",{class:"icon loupe flex",children:Mb.search.loupe}),this.state.searchResults&&eb("button",{title:"Clear","aria-label":"Clear",type:"button",class:"icon delete flex",onClick:this.clearSearch,onMouseDown:this.preventDefault,children:Mb.search.delete})]}),("none"==this.props.previewPosition||"search"==this.props.skinTonePosition)&&this.renderSkinToneButton()]})]})}renderSearchResults(){const{searchResults:e}=this.state;return e?eb("div",{class:"category",ref:this.refs.search,children:[eb("div",{class:"sticky padding-small",children:fb.categories.search}),eb("div",{children:e.length?e.map(((t,n)=>eb("div",{class:"flex",children:t.map(((t,r)=>this.renderEmojiButton(t,{pos:[n,r],posinset:n*this.props.perLine+r+1,grid:e})))}))):eb("div",{class:"padding-small",children:this.props.onAddCustomEmoji&&eb("a",{onClick:this.props.onAddCustomEmoji,children:fb.add_custom})})})]}):null}renderCategories(){const{categories:e}=mb,t=!!this.state.searchResults;return eb("div",{style:{visibility:t?"hidden":void 0,display:t?"none":void 0},children:e.map((e=>{const{root:t,rows:n}=this.refs.categories.get(e.id);return eb("div",{"data-id":e.target?e.target.id:e.id,class:"category",ref:t,children:[eb("div",{class:"sticky padding-small",children:e.name||fb.categories[e.id]}),eb("div",{class:"relative",style:{height:n.length*this.props.emojiButtonSize},children:n.map(((t,n)=>{const r=t.index-t.index%sv,i=this.state.visibleRows[r],o="current"in t?t:void 0;if(!i&&!o)return null;const s=n*this.props.perLine,a=s+this.props.perLine,l=e.emojis.slice(s,a);return eb("div",{"data-index":t.index,ref:o,class:"flex row",style:{top:n*this.props.emojiButtonSize},children:i&&l.map(((e,n)=>{const r=pb.get(e);return this.renderEmojiButton(r,{pos:[t.index,n],posinset:t.posinset+n,grid:this.grid})}))},t.index)}))})]})}))})}renderSkinToneButton(){return"none"==this.props.skinTonePosition?null:eb("div",{class:"flex flex-auto flex-center flex-middle",style:{position:"relative",width:this.props.emojiButtonSize,height:this.props.emojiButtonSize},children:eb("button",{type:"button",ref:this.refs.skinToneButton,class:"skin-tone-button flex flex-auto flex-center flex-middle","aria-selected":this.state.showSkins?"":void 0,"aria-label":fb.skins.choose,title:fb.skins.choose,onClick:this.openSkins,style:{width:this.props.emojiSize,height:this.props.emojiSize},children:eb("span",{class:"skin-tone skin-tone-".concat(this.state.skin)})})})}renderSkins(){const e=this.refs.skinToneButton.current.getBoundingClientRect(),t=this.base.getBoundingClientRect(),n={right:t.right-e.right-3};return"bottom"==this.props.previewPosition&&"preview"==this.props.skinTonePosition?n.bottom=t.bottom-e.top+6:(n.top=e.bottom-t.top+3,n.bottom="auto"),eb("div",{ref:this.refs.menu,role:"radiogroup","aria-label":fb.skins.choose,class:"menu hidden","data-position":n.top?"top":"bottom",style:n,children:[...Array(6).keys()].map((e=>{const t=e+1,n=this.state.skin==t;return eb("div",{children:[eb("input",{type:"radio",name:"skin-tone",value:t,"aria-label":fb.skins[t],ref:n?this.refs.skinToneRadio:null,defaultChecked:n,onChange:()=>this.handleSkinMouseOver(t),onKeyDown:e=>{"Enter"!=e.code&&"Space"!=e.code&&"Tab"!=e.code||(e.preventDefault(),this.handleSkinClick(t))}}),eb("button",{"aria-hidden":"true",tabindex:"-1",onClick:()=>this.handleSkinClick(t),onMouseEnter:()=>this.handleSkinMouseOver(t),onMouseLeave:()=>this.handleSkinMouseOver(),class:"option flex flex-grow flex-middle",children:[eb("span",{class:"skin-tone skin-tone-".concat(t)}),eb("span",{class:"margin-small-lr",children:fb.skins[t]})]})]})}))})}render(){return eb("section",{id:"root",class:"flex flex-column",style:{width:this.props.perLine*this.props.emojiButtonSize+28},"data-emoji-set":this.props.set,"data-theme":this.state.theme,"data-menu":this.state.showSkins?"":void 0,children:["top"==this.props.previewPosition&&this.renderPreview(),"top"==this.props.navPosition&&this.renderNav(),"sticky"==this.props.searchPosition&&eb("div",{class:"padding-lr",children:this.renderSearch()}),eb("div",{ref:this.refs.scroll,class:"scroll flex-grow padding-lr",children:eb("div",{style:{width:this.props.perLine*this.props.emojiButtonSize},children:["static"==this.props.searchPosition&&this.renderSearch(),this.renderSearchResults(),this.renderCategories(),eb("div",{class:"spacer"})]})}),"bottom"==this.props.navPosition&&this.renderNav(),"bottom"==this.props.previewPosition&&this.renderPreview(),this.state.showSkins&&this.renderSkins()]})}}class lv extends Eb{constructor(e){super(e,{styles:vy(uv)})}async connectedCallback(){const e=await xb(this.props),{onEmojiSelect:t,onClickOutside:n,onAddCustomEmoji:r,getImageURL:i,getSpritesheetURL:o}=this.props,s={...e,element:this,onEmojiSelect:t,onClickOutside:n,onAddCustomEmoji:r,getImageURL:i,getSpritesheetURL:o};Xy(eb(av,{...s}),this.shadowRoot)}}customElements.get("em-emoji-picker")||customElements.define("em-emoji-picker",lv);var uv={};uv=':host {\n display: flex;\n width: -webkit-min-content;\n width: -moz-min-content;\n width: min-content;\n height: 435px;\n min-height: 230px;\n border-radius: var(--border-radius);\n box-shadow: var(--shadow);\n --border-radius: 10px;\n --category-icon-size: 18px;\n --font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;\n --font-size: 15px;\n --shadow-color: 0deg 0% 0%;\n --shadow:\n 0.3px 0.5px 2.7px hsl(var(--shadow-color) / 0.14),\n 0.4px 0.8px 1px -3.2px hsl(var(--shadow-color) / 0.14),\n 1px 2px 2.5px -4.5px hsl(var(--shadow-color) / 0.14);\n}\n\n[data-theme=light] {\n --em-rgb-color: var(--rgb-color, 34, 36, 39);\n --em-rgb-accent: var(--rgb-accent, 34, 102, 237);\n --em-rgb-background: var(--rgb-background, 255, 255, 255);\n --em-rgb-input: var(--rgb-input, 255, 255, 255);\n --em-color-border: var(--color-border, rgba(0, 0, 0, .05));\n --em-color-border-over: var(--color-border-over, rgba(0, 0, 0, .1));\n}\n\n[data-theme=dark] {\n --em-rgb-color: var(--rgb-color, 222, 222, 221);\n --em-rgb-accent: var(--rgb-accent, 58, 130, 247);\n --em-rgb-background: var(--rgb-background, 21, 22, 23);\n --em-rgb-input: var(--rgb-input, 0, 0, 0);\n --em-color-border: var(--color-border, rgba(255, 255, 255, .1));\n --em-color-border-over: var(--color-border-over, rgba(255, 255, 255, .2));\n}\n\n#root {\n --color-a: rgb(var(--em-rgb-color));\n --color-b: rgba(var(--em-rgb-color), .65);\n --color-c: rgba(var(--em-rgb-color), .45);\n --padding: 12px;\n --padding-small: calc(var(--padding) / 2);\n --sidebar-width: 16px;\n --duration: 225ms;\n --duration-fast: 125ms;\n --duration-instant: 50ms;\n --easing: cubic-bezier(.4, .0, .2, 1);\n position: relative;\n width: 100%;\n text-align: left;\n border-radius: var(--border-radius);\n background-color: rgb(var(--em-rgb-background));\n}\n\n@media (prefers-reduced-motion) {\n #root {\n --duration: 0;\n --duration-fast: 0;\n --duration-instant: 0;\n }\n}\n\n#root[data-menu] button {\n cursor: auto;\n}\n\n#root[data-menu] .menu button {\n cursor: pointer;\n}\n\n:host, #root, input, button {\n color: rgb(var(--em-rgb-color));\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: normal;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n*, *:before, *:after {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n min-width: 0;\n}\n\n.relative {\n position: relative;\n}\n\n.flex {\n display: flex;\n}\n\n.flex-auto {\n flex: 0 0 auto;\n}\n\n.flex-center {\n justify-content: center;\n}\n\n.flex-column {\n flex-direction: column;\n}\n\n.flex-grow {\n flex: 1 1 auto;\n}\n\n.flex-middle {\n align-items: center;\n}\n\n.flex-wrap {\n flex-wrap: wrap;\n}\n\n.padding {\n padding: var(--padding);\n}\n\n.padding-t {\n padding-top: var(--padding);\n}\n\n.padding-lr {\n padding-left: var(--padding);\n padding-right: var(--padding);\n}\n\n.padding-r {\n padding-right: var(--padding);\n}\n\n.padding-small {\n padding: var(--padding-small);\n}\n\n.padding-small-b {\n padding-bottom: var(--padding-small);\n}\n\n.padding-small-lr {\n padding-left: var(--padding-small);\n padding-right: var(--padding-small);\n}\n\n.margin {\n margin: var(--padding);\n}\n\n.margin-l {\n margin-left: var(--padding);\n}\n\n.margin-small-l {\n margin-left: var(--padding-small);\n}\n\n.margin-small-lr {\n margin-left: var(--padding-small);\n margin-right: var(--padding-small);\n}\n\n.color-a {\n color: var(--color-a);\n}\n\n.color-b {\n color: var(--color-b);\n}\n\n.color-c {\n color: var(--color-c);\n}\n\n.ellipsis {\n white-space: nowrap;\n max-width: 100%;\n width: auto;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\na {\n cursor: pointer;\n color: rgb(var(--em-rgb-accent));\n}\n\na:hover {\n text-decoration: underline;\n}\n\n.spacer {\n height: 10px;\n}\n\n.scroll {\n overflow: auto;\n overflow-x: hidden;\n padding-right: 0;\n}\n\n.scroll::-webkit-scrollbar {\n width: var(--sidebar-width);\n height: var(--sidebar-width);\n}\n\n.scroll::-webkit-scrollbar-track {\n border: 0;\n}\n\n.scroll::-webkit-scrollbar-button {\n width: 0;\n height: 0;\n display: none;\n}\n\n.scroll::-webkit-scrollbar-corner {\n background-color: transparent;\n}\n\n.scroll::-webkit-scrollbar-thumb {\n min-height: 20%;\n min-height: 65px;\n border: 4px solid rgb(var(--em-rgb-background));\n border-radius: 8px;\n}\n\n.scroll::-webkit-scrollbar-thumb:hover {\n background-color: var(--em-color-border-over) !important;\n}\n\n.scroll:hover::-webkit-scrollbar-thumb {\n background-color: var(--em-color-border);\n}\n\n.sticky {\n position: -webkit-sticky;\n position: sticky;\n z-index: 1;\n top: -1px;\n font-weight: 500;\n background-color: rgba(var(--em-rgb-background), 0.9);\n -webkit-backdrop-filter: blur(4px);\n backdrop-filter: blur(4px);\n}\n\n.search {\n z-index: 2;\n position: relative;\n}\n\n.search input, .search button {\n font-size: calc(var(--font-size) - 1px);\n}\n\n.search input[type=search] {\n display: block;\n border: 0;\n outline: 0;\n width: 100%;\n padding: 10px 2em 10px 2.2em;\n border-radius: 10px;\n background-color: var(--em-color-border);\n transition-duration: var(--duration);\n transition-property: background-color, box-shadow;\n transition-timing-function: var(--easing);\n}\n\n.search input[type=search]::-moz-placeholder {\n color: inherit;\n opacity: 0.6;\n}\n\n.search input[type=search]:-ms-input-placeholder {\n color: inherit;\n opacity: 0.6;\n}\n\n.search input[type=search]::placeholder {\n color: inherit;\n opacity: 0.6;\n}\n\n.search input[type=search], .search input[type=search]::-webkit-search-decoration, .search input[type=search]::-webkit-search-cancel-button, .search input[type=search]::-webkit-search-results-button, .search input[type=search]::-webkit-search-results-decoration {\n -webkit-appearance: none;\n appearance: none;\n}\n\n.search input[type=search]:focus {\n background-color: rgb(var(--em-rgb-input));\n box-shadow: inset 0 0 0 1px rgb(var(--em-rgb-accent)), 0 1px 3px rgba(65, 69, 73, 0.2);\n}\n\n.search .icon {\n z-index: 1;\n position: absolute;\n top: 50%;\n color: rgba(var(--em-rgb-color), 0.7);\n transform: translateY(-50%);\n}\n\n.search .loupe {\n left: 0.7em;\n pointer-events: none;\n}\n\n.search .delete {\n right: 0.7em;\n}\n\nsvg {\n fill: currentColor;\n width: 1em;\n height: 1em;\n}\n\nbutton {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n color: currentColor;\n border: 0;\n background-color: transparent;\n}\n\n#nav {\n z-index: 2;\n position: relative;\n padding-top: 12px;\n padding-bottom: 12px;\n padding-right: var(--sidebar-width);\n}\n\n#nav button {\n color: var(--color-b);\n transition: color var(--duration) var(--easing);\n}\n\n#nav button:hover {\n color: var(--color-a);\n}\n\n#nav svg, #nav img {\n width: var(--category-icon-size);\n height: var(--category-icon-size);\n}\n\n#nav .bar {\n position: absolute;\n bottom: -12px;\n left: 0;\n width: 100%;\n height: 3px;\n background-color: rgb(var(--em-rgb-accent));\n border-radius: 3px 3px 0 0;\n transition: transform var(--duration) var(--easing);\n}\n\n#nav button[aria-selected] {\n color: rgb(var(--em-rgb-accent));\n}\n\n#preview {\n z-index: 2;\n position: relative;\n padding: calc(var(--padding) + 4px) var(--padding);\n padding-right: var(--sidebar-width);\n}\n\n#nav:before, #preview:before {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n height: 2px;\n}\n\n#nav[data-position=top]:before, #preview[data-position=top]:before {\n top: 100%;\n background: linear-gradient(to bottom, var(--em-color-border), transparent);\n}\n\n#nav[data-position=bottom]:before, #preview[data-position=bottom]:before {\n bottom: 100%;\n background: linear-gradient(to top, var(--em-color-border), transparent);\n}\n\n.category button {\n position: relative;\n font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;\n}\n\n.category button > * {\n position: relative;\n}\n\n.category button .background {\n position: absolute;\n inset: 0;\n opacity: 0;\n background-color: var(--em-color-border);\n transition: opacity var(--duration-fast) var(--easing) var(--duration-instant);\n}\n\n.category button:hover .background {\n transition-duration: var(--duration-instant);\n transition-delay: 0ms;\n}\n\n.category button[aria-selected] .background {\n opacity: 1;\n}\n\n.category button[data-keyboard] .background {\n transition: none;\n}\n\n.row {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n}\n\n.skin-tone-button {\n border-radius: 100%;\n border: 1px solid transparent;\n}\n\n.skin-tone-button:hover {\n border-color: var(--em-color-border);\n}\n\n.skin-tone-button:active .skin-tone {\n transform: scale(0.85) !important;\n}\n\n.skin-tone-button .skin-tone {\n transition: transform var(--duration) var(--easing);\n}\n\n.skin-tone-button[aria-selected] {\n border-left-width: 0;\n border-right-width: 0;\n border-top-color: rgba(0, 0, 0, 0.05);\n border-bottom-color: transparent;\n background-color: var(--em-color-border);\n}\n\n.skin-tone-button[aria-selected] .skin-tone {\n transform: scale(0.9);\n}\n\n.menu {\n z-index: 2;\n position: absolute;\n white-space: nowrap;\n padding: 4px;\n border: 1px solid var(--em-color-border);\n background-color: rgba(var(--em-rgb-background), 0.9);\n -webkit-backdrop-filter: blur(4px);\n backdrop-filter: blur(4px);\n border-radius: 10px;\n box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.05);\n transition-property: opacity, transform;\n transition-duration: var(--duration);\n transition-timing-function: var(--easing);\n}\n\n.menu.hidden {\n opacity: 0;\n}\n\n.menu[data-position=bottom] {\n transform-origin: bottom right;\n}\n\n.menu[data-position=bottom].hidden {\n transform: scale(0.9) rotate(-3deg) translateY(5%);\n}\n\n.menu[data-position=top] {\n transform-origin: top right;\n}\n\n.menu[data-position=top].hidden {\n transform: scale(0.9) rotate(3deg) translateY(-5%);\n}\n\n.menu input[type=radio] {\n position: absolute;\n overflow: hidden;\n clip: rect(0 0 0 0);\n width: 1px;\n height: 1px;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.menu input[type=radio]:checked + .option {\n box-shadow: 0 0 0 2px rgb(var(--em-rgb-accent));\n}\n\n.option {\n width: 100%;\n padding: 4px 6px;\n border-radius: 6px;\n}\n\n.option:hover {\n color: #fff;\n background-color: rgb(var(--em-rgb-accent));\n}\n\n.skin-tone {\n position: relative;\n display: inline-block;\n width: 16px;\n height: 16px;\n border-radius: 100%;\n overflow: hidden;\n}\n\n.skin-tone:after {\n content: "";\n position: absolute;\n inset: 0;\n border-radius: 100%;\n border: 1px solid rgba(0, 0, 0, 0.8);\n mix-blend-mode: overlay;\n box-shadow: inset 0 -2px 3px #000, inset 0 1px 2px #fff;\n background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);\n}\n\n.skin-tone-1 {\n background-color: #ffc93a;\n}\n\n.skin-tone-2 {\n background-color: #ffdab7;\n}\n\n.skin-tone-3 {\n background-color: #e7b98f;\n}\n\n.skin-tone-4 {\n background-color: #c88c61;\n}\n\n.skin-tone-5 {\n background-color: #a46134;\n}\n\n.skin-tone-6 {\n background-color: #5d4437;\n}\n\n[data-emoji-set=twitter] .skin-tone:after {\n border-color: rgba(0, 0, 0, 0.5);\n box-shadow: none;\n}\n\n[data-emoji-set=twitter] .skin-tone-1 {\n background-color: #FADE72;\n}\n\n[data-emoji-set=twitter] .skin-tone-2 {\n background-color: #F3DFD0;\n}\n\n[data-emoji-set=twitter] .skin-tone-3 {\n background-color: #EED3A8;\n}\n\n[data-emoji-set=twitter] .skin-tone-4 {\n background-color: #CFAD8D;\n}\n\n[data-emoji-set=twitter] .skin-tone-5 {\n background-color: #A8805D;\n}\n\n[data-emoji-set=twitter] .skin-tone-6 {\n background-color: #765542;\n}\n\n[data-emoji-set=google] .skin-tone:after {\n box-shadow: inset 0 0 2px 2px rgba(0, 0, 0, 0.4);\n}\n\n[data-emoji-set=google] .skin-tone-1 {\n background-color: #F5C748;\n}\n\n[data-emoji-set=google] .skin-tone-2 {\n background-color: #F1D5AA;\n}\n\n[data-emoji-set=google] .skin-tone-3 {\n background-color: #D4B48D;\n}\n\n[data-emoji-set=google] .skin-tone-4 {\n background-color: #AA876B;\n}\n\n[data-emoji-set=google] .skin-tone-5 {\n background-color: #916544;\n}\n\n[data-emoji-set=google] .skin-tone-6 {\n background-color: #61493F;\n}\n\n[data-emoji-set=facebook] .skin-tone:after {\n border-color: rgba(0, 0, 0, 0.4);\n box-shadow: inset 0 -2px 3px #000, inset 0 1px 4px #fff;\n}\n\n[data-emoji-set=facebook] .skin-tone-1 {\n background-color: #F5C748;\n}\n\n[data-emoji-set=facebook] .skin-tone-2 {\n background-color: #F1D5AA;\n}\n\n[data-emoji-set=facebook] .skin-tone-3 {\n background-color: #D4B48D;\n}\n\n[data-emoji-set=facebook] .skin-tone-4 {\n background-color: #AA876B;\n}\n\n[data-emoji-set=facebook] .skin-tone-5 {\n background-color: #916544;\n}\n\n[data-emoji-set=facebook] .skin-tone-6 {\n background-color: #61493F;\n}\n';class cv extends t.Component{constructor(){super(...arguments),pm(this,"ref",t.createRef()),pm(this,"fetchEmojiData",(async()=>{try{const{data:e}=await by.get("https://cdn.jsdelivr.net/npm/@emoji-mart/data");return e}catch(e){return{}}})),pm(this,"onKeyDown",(e=>{let{event:t}=e;return"Escape"===t.key&&(this.props.editor.chain().focus().deleteRange(this.props.range).run(),!0)})),pm(this,"handleSelect",(e=>{this.props.editor.chain().focus().deleteRange(this.props.range).setEmoji(e).run()}))}componentDidMount(){new lv({...this.props,onEmojiSelect:this.handleSelect,style:{maxWidth:"100%"},theme:"light",native:!0,previewPosition:"none",showSkinTones:!1,data:this.fetchEmojiData,ref:this.ref})}render(){return t.createElement("div",{ref:this.ref,"data-cy":"neeto-editor-emoji-picker"})}}cv.defaultProps={editor:{},range:{}},cv.propTypes={editor:qf.exports.object.isRequired,range:qf.exports.object};const dv=e=>{let{editor:n}=e;const r=u();return t.createElement(dm,{ref:r,closeOnSelect:!1,customTarget:()=>{var e;return t.createElement(Zf,{icon:Lh,iconActive:null==r||null===(e=r.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Emoji",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-emoji-option-button"})},position:"bottom-start"},t.createElement(cv,{editor:n}))},pv=e=>{let{editor:n,options:r}=e;const i={[md.H1]:{label:"H1",value:1},[md.H2]:{label:"H2",value:2},[md.H3]:{label:"H3",value:3},[md.H4]:{label:"H4",value:4},[md.H5]:{label:"H5",value:5},[md.H6]:{label:"H6",value:6}};return t.createElement(dm,{customTarget:()=>t.createElement(Zf,{icon:Kh,iconActive:n.isActive("heading"),tooltipProps:{content:"Font Size",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-font-size-option"}),className:"neeto-editor-font-size-wrapper",placement:"bottom"},r.map((e=>{const{label:r,value:o}=i[e];return t.createElement("li",{onClick:()=>{return e=o,n.chain().focus().toggleHeading({level:e}).run();var e},key:o,className:sc({active:(s=o,n.isActive("heading",{level:s}))}),"data-cy":"neeto-editor-fixed-menu-font-size-option-".concat(r)},r);var s})))},hv=e=>{let{editor:n}=e;const r=u(),o=u(),[s,a]=i(""),[l,c]=i(""),d=n.isActive("link"),p=()=>{c(n.getAttributes("link").href||"")},h=()=>{var e;Rf.test(l)?(n.chain().focus().setLink({href:l}).run(),null===(e=r.current)||void 0===e||e.close()):a("Please enter a valid url")};return t.createElement(dm,{ref:r,onVisible:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.focus({preventScroll:!0})},customTarget:()=>t.createElement(Zf,{icon:vh,iconActive:d,onClick:p,tooltipProps:{content:"Link",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-link-option"}),className:"neeto-editor-link-wrapper",closeOnSelect:!1,position:"bottom"},t.createElement("div",{onKeyDown:e=>{"Escape"===e.key?r.current.close():"Enter"===e.key&&h()},className:"neeto-editor-link__item"},t.createElement(jf,{ref:o,name:"url",value:l,placeholder:"Paste URL",onFocus:()=>a(""),error:s,onChange:e=>{let{target:{value:t}}=e;return c(t)},"data-cy":"neeto-editor-fixed-menu-link-option-input"}),t.createElement(Ld,{label:"Link",onClick:h,"data-cy":"neeto-editor-fixed-menu-link-option-link-button"}),d&&t.createElement(Ld,{label:"Unlink",onClick:()=>{var e;n.chain().focus().unsetLink().run(),null===(e=r.current)||void 0===e||e.close()},"data-cy":"neeto-editor-fixed-menu-link-option-unlink-button"})))},fv=e=>{const{size:n,color:r,underlineColor:i,...o}=e;return t.createElement("svg",ie({viewBox:"0 0 24 24",fill:"none",height:n,width:n},o),t.createElement("path",{d:"M21 20H3",stroke:i||r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M17.3125 15L12.1562 4L7 15M8.03125 12.8H16.2812",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};fv.defaultProps={color:"currentColor",size:24},fv.propTypes={color:qf.exports.string,size:qf.exports.oneOfType([qf.exports.string,qf.exports.number])};const mv=e=>{const{size:n,color:r,bgColor:i,...o}=e;return t.createElement("svg",ie({viewBox:"0 0 24 24",fill:"none",height:n,width:n},o),t.createElement("path",{d:"M21 7V17C21 19.209 19.209 21 17 21H7C4.791 21 3 19.209 3 17V7C3 4.791 4.791 3 7 3H17C19.209 3 21 4.791 21 7Z",fill:i,stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M10 8V16",stroke:r,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M14 8V16",stroke:r,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M8 14H16",stroke:r,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M8 10H16",stroke:r,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}))};mv.defaultProps={color:"white",bgColor:"#68737D",size:24},mv.propTypes={color:qf.exports.string,bgColor:qf.exports.string,size:qf.exports.oneOfType([qf.exports.string,qf.exports.number])};const gv=e=>{let{color:n="#000",onChange:r}=e;const i=u();return t.createElement(Zf,{icon:e=>{let{color:o,size:s}=e;return t.createElement(t.Fragment,null,t.createElement(fv,{size:s,color:o,underlineColor:n}),t.createElement("input",{ref:i,type:"color",onChange:e=>r&&r(e.target.value)}))},iconActive:!1,onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.click()},tooltipProps:{content:"Text Color",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-text-color-option"})},yv={small:24,medium:32,large:40,xlarge:64},bv=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"],vv=e=>{let{size:n,user:r,isSquare:o,status:s,onClick:a,className:l,...u}=e;const[c,d]=i(!1),{name:p="",imageUrl:h}=r,f="medium"===n,m="large"===n,g="xlarge"===n,y=(e=>{const t=e.trim().split(" "),n=t.reduce(((e,n,r)=>(0!==r&&r!==t.length-1||(e="".concat(e).concat(n.charAt(0).toUpperCase())),e)),"");return n})(p),b={height:yv[n],width:yv[n],backgroundColor:(()=>{const e=(y.charCodeAt(0)||0)+(y.charCodeAt(1)||0);return bv[e%65%bv.length]||bv[0]})()},v=sc("ne-avatar",{"ne-avatar--medium":f,"ne-avatar--large":m,"ne-avatar--xlarge":g,"ne-avatar--round":!o,hidden:!c}),w=sc("ne-avatar__text",{"ne-avatar__text-medium":f,"ne-avatar__text-large":m,"ne-avatar__text-xlarge":g}),x=sc("ne-avatar__status","".concat(s),{"ne-avatar__status-medium":f,"ne-avatar__status-large":m,"ne-avatar__status-xlarge":g,"ne-avatar__status-square":o}),M=()=>null==s?t.Fragment:t.createElement("span",{className:x}),D=()=>t.createElement("span",{className:w},y),k=y&&!h&&!c;return t.createElement("div",ie({onClick:a,style:b,className:sc("ne-avatar--container",{"ne-avatar--container-round":!o},l)},u),t.createElement(M,null),k?t.createElement(D,null):t.createElement("img",{className:v,onLoad:()=>d(!0),onError:()=>d(!1),src:h,alt:"avatar-".concat(y)}))};vv.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:()=>{},status:null},vv.propTypes={size:qf.exports.oneOf(Object.keys(yv)),user:qf.exports.shape({imageUrl:qf.exports.string,name:qf.exports.string}),isSquare:qf.exports.bool,onClick:qf.exports.func,status:qf.exports.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:qf.exports.string};const wv=e=>{let{editor:n,mentions:r,showImageInMention:i}=e;const o=u();return r&&r.length?t.createElement(dm,{ref:o,customTarget:()=>{var e;return t.createElement(Zf,{icon:uh,iconActive:null===(e=o.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Mention",position:"bottom",delay:[500]},"data-cy":"neeto-editor-mention-option"})}},t.createElement("div",{className:"neeto-editor-mentions__wrapper neeto-editor-mentions__wrapper--small"},r.map((e=>{let{key:r,name:o,imageUrl:s}=e;return t.createElement("button",{className:"neeto-editor-mentions__item neeto-editor-mentions__item--light",key:r,onClick:()=>n.commands.setMention(o),type:"button","data-cy":"neeto-editor-mention-option-".concat(r)},i&&t.createElement(vv,{size:"small",user:{name:o,imageUrl:s}}),t.createElement("p",null,o))})))):null},xv=e=>{let{onClickVariable:n,variables:r}=e;const i=function(){const e=[],t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((n=>{const{category_key:r,category_label:i,variables:o}=n;if(r&&o){const e=o.map((e=>({...e,category_key:r})));t.push({label:i,variables:e})}else e.push(n)})),e.length&&t.push({label:t.length?"Others":null,variables:e}),t}(r);return r&&r.length?t.createElement("div",{className:"neeto-editor-variables-list"},i.map(((e,r)=>{let{label:i,variables:o}=e;return t.createElement(Mv,{key:r,index:r,title:i,variables:o,onClickItem:n})}))):null},Mv=e=>{let{index:n,title:r,variables:i,onClickItem:o}=e;return t.createElement("div",{className:"neeto-editor-variables-block","data-cy":"neeto-editor-variable-option-category-".concat(n)},r&&t.createElement("h6",null,r),t.createElement("div",{className:"neeto-editor-variables-row"},i.map((e=>t.createElement("button",{type:"button",onClick:()=>o(e),key:"".concat(e.label,"--").concat(e.value),className:"neeto-editor-variable","data-cy":"neeto-editor-variable-option-item-".concat(e.label,"--").concat(e.value)},e.label)))))},Dv=e=>{let{editor:n,variables:r}=e;return r&&r.length?t.createElement(dm,{customTarget:()=>t.createElement(Zf,{icon:e=>{let{_color:n,...r}=e;return t.createElement(mv,r)},tooltipProps:{content:"Variables",position:"bottom",delay:[500]},"data-cy":"neeto-editor-variable-option"})},t.createElement(xv,{onClickVariable:e=>{const{category_key:t,key:r}=e,i=t?"".concat(t,".").concat(r):r;n.chain().focus().setVariable({label:i}).run()},variables:r})):null},kv=e=>{let{editor:n,variables:r,setImageUploadVisible:o,options:s,mentions:a,showImageInMention:l}=e;const[u,c]=i(!1),d=n&&n.view.state.selection.node,p=d&&"image"===d.type.name;if(!n)return null;const h=[{Icon:Ph,command:()=>n.chain().focus().toggleBold().run(),active:n.isActive("bold"),optionName:"bold"},{Icon:Wh,command:()=>n.chain().focus().toggleItalic().run(),active:n.isActive("italic"),optionName:"italic"},{Icon:Jh,command:()=>n.chain().focus().toggleUnderline().run(),active:n.isActive("underline"),optionName:"underline"},{Icon:Rh,command:()=>n.chain().focus().toggleStrike().run(),active:n.isActive("strike"),optionName:"strike"},{Icon:dh,command:()=>n.chain().focus().toggleHighlight().run(),active:n.isActive("highlight"),optionName:"highlight"}].filter((e=>s.includes(e.optionName))),f=[{Icon:Nh,command:()=>n.chain().focus().toggleBlockquote().run(),active:n.isActive("blockquote"),optionName:"block-quote"},{Icon:rh,command:()=>n.chain().focus().toggleCodeBlock().run(),active:n.isActive("codeBlock"),optionName:"code-block"},{Icon:hh,command:()=>o(!0),active:n.isActive("imageUpload"),optionName:"image-upload"}].filter((e=>s.includes(e.optionName))),m=[{Icon:xh,command:()=>n.chain().focus().toggleBulletList().run(),active:n.isActive("bulletList"),optionName:"bullet-list"},{Icon:Dh,command:()=>n.chain().focus().toggleOrderedList().run(),active:n.isActive("orderedList"),optionName:"ordered-list"}].filter((e=>s.includes(e.optionName))),g=s.filter((e=>e.match(/^h[1-6]$/))),y=s.includes(md.FONT_COLOR),b=g.length>0,v=s.includes(md.EMOJI),w=s.includes(md.LINK),x=(e,n)=>{let{Icon:r,command:i,active:o,optionName:s}=e;return t.createElement(Zf,{key:n,icon:r,iconActive:o,onClick:i,tooltipProps:{content:od(s),position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-".concat(s,"-option")})};return t.createElement("div",{className:"neeto-editor-fixed-menu"},b&&t.createElement(pv,{editor:n,options:g}),h.map(x),y&&t.createElement(gv,{color:n.getAttributes("textStyle").color,onChange:e=>n.chain().focus().setColor(e).run()}),v&&t.createElement(dv,{editor:n}),w&&t.createElement(hv,{editor:n}),f.map(x),m.map(x),p&&zf({editor:n,isImageEditorModalOpen:u,setIsImageEditorModalOpen:c}).map(((e,n)=>{let{Icon:r,command:i,active:o,optionName:s}=e;return t.createElement(Zf,{key:n,icon:r,iconActive:o,onClick:i,tooltipProps:{content:od(s),position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-".concat(s,"-option")})})),t.createElement("div",{className:"neeto-editor-fixed-menu-addons"},t.createElement(Dv,{editor:n,variables:r}),t.createElement(wv,{editor:n,mentions:a,showImageInMention:l})),t.createElement(Nf,{isOpen:u,onClose:()=>c(!1)},t.createElement("div",{className:"neeto-editor-image-uploader"},t.createElement("div",{className:"neeto-editor-image-uploader__content"},t.createElement(If,{editor:n,onClose:()=>c(!1),url:null==d?void 0:d.attrs.src,alt:null==d?void 0:d.attrs.alt})))))},Ev=()=>{},Cv="large",Tv=e=>{let{children:n,size:r,noUnderline:i,className:o="",...s}=e;return t.createElement("div",ie({className:sc({"ne-tab__wrapper":!0},{"ne-tab__wrapper--size-large":r===Cv},{"ne-tab__wrapper--underline-none":i},[o]),"data-cy":"tab-container"},s),n)};Tv.Item=e=>{let{active:n,className:r="",children:i,icon:o=null,onClick:s=Ev,...a}=e;const l="button",u="string"==typeof o?()=>t.createElement("i",{className:o,"data-cy":"tab-item-icon"}):o||t.Fragment;return t.createElement(l,ie({className:sc(["ne-tab flex select-none items-center justify-center",r],{active:n}),onClick:s,"data-cy":"tab-item"},a),o&&t.createElement(u,{className:"ne-tab__icon"}),i)};const Ov={autoProceed:!0,allowMultipleUploads:!1,restrictions:{maxFileSize:5*1024*1024,allowedFileTypes:[".jpg",".jpeg",".png",".gif"]}},Sv={formData:!0,fieldName:"blob"},Av="/api/v1/direct_uploads/image_upload",Nv=[{title:"Upload",key:"local"},{title:"Link",key:"link"},{title:"Unsplash",key:"unsplash"}];var _v={exports:{}},jv={};function Iv(e){return e<10?`0${e}`:e.toString()}var Lv=function(){const e=new Date;return`${Iv(e.getHours())}:${Iv(e.getMinutes())}:${Iv(e.getSeconds())}`};Object.defineProperty(jv,"__esModule",{value:!0}),jv.justErrorsLogger=jv.debugLogger=void 0;const zv=Lv,Pv={debug:()=>{},warn:()=>{},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.error(`[Uppy] [${zv()}]`,...t)}};jv.justErrorsLogger=Pv;const Fv={debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.debug(`[Uppy] [${zv()}]`,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.warn(`[Uppy] [${zv()}]`,...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.error(`[Uppy] [${zv()}]`,...t)}};jv.debugLogger=Fv;let Rv="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Bv={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+=Rv[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}},Uv={},Hv=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1);e=Number(e/Math.pow(1024,r));var i=n[r];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i};function $v(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}$v.prototype.match=function(e){var t,n,r=!0,i=this.parts,o=i.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(n=(e||"").split(this.separator),t=0;r&&t<o;t++)"*"!==i[t]&&(r=t<n.length&&i[t]===n[t]);r=r&&n}else r=!1;else if("function"==typeof e.splice)for(r=[],t=e.length;t--;)this.match(e[t])&&(r[r.length]=e[t]);else if("object"==typeof e)for(var s in r={},e)this.match(s)&&(r[s]=e[s]);return r};var Vv=function(e,t,n){var r=new $v(e,n||/[\/\.]/);return void 0!==t?r.match(t):r},Wv=/[\/\+\.]/;Object.defineProperty(Uv,"__esModule",{value:!0}),Uv.defaultOptions=Uv.RestrictionError=Uv.Restricter=void 0;const qv=Hv,Yv=function(e,t){function n(t){var n=Vv(t,e,Wv);return n&&n.length>=2}return t?n(t.split(";")[0]):n};Uv.defaultOptions={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class Qv extends Error{constructor(){super(...arguments),this.isRestriction=!0}}Uv.RestrictionError=Qv,"undefined"==typeof AggregateError&&(globalThis.AggregateError=class extends Error{constructor(e,t){super(t),this.errors=e}});Uv.Restricter=class{constructor(e,t){this.i18n=t,this.getOpts=()=>{const t=e();if(null!=t.restrictions.allowedFileTypes&&!Array.isArray(t.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return t}}validate(e,t){const{maxFileSize:n,minFileSize:r,maxTotalFileSize:i,maxNumberOfFiles:o,allowedFileTypes:s}=this.getOpts().restrictions;if(o&&t.length+1>o)throw new Qv(`${this.i18n("youCanOnlyUploadX",{smart_count:o})}`);if(s){const t=s.some((t=>t.includes("/")?!!e.type&&Yv(e.type.replace(/;.*?$/,""),t):!("."!==t[0]||!e.extension)&&e.extension.toLowerCase()===t.slice(1).toLowerCase()));if(!t){const e=s.join(", ");throw new Qv(this.i18n("youCanOnlyUploadFileTypes",{types:e}))}}if(i&&null!=e.size){const n=t.reduce(((e,t)=>e+t.size),e.size);if(n>i)throw new Qv(this.i18n("exceedsSize",{size:qv(i),file:e.name}))}if(n&&null!=e.size&&e.size>n)throw new Qv(this.i18n("exceedsSize",{size:qv(n),file:e.name}));if(r&&null!=e.size&&e.size<r)throw new Qv(this.i18n("inferiorSize",{size:qv(r)}))}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(Object.keys(e).length<t)throw new Qv(this.i18n("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new Qv(this.i18n("missingRequiredMetaFieldOnFile",{fileName:e.name})),{requiredMetaFields:n}=this.getOpts().restrictions,r=Object.prototype.hasOwnProperty,i=[];for(const t of n)r.call(e.meta,t)&&""!==e.meta[t]||i.push(t);return{missingFields:i,error:t}}};var Kv=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function Gv(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Jv=0;function Xv(e){return"__private_"+Jv+++"_"+e}const Zv=Kv;function ew(e,t,n){const r=[];return e.forEach((e=>"string"!=typeof e?r.push(e):t[Symbol.split](e).forEach(((e,t,i)=>{""!==e&&r.push(e),t<i.length-1&&r.push(n)})))),r}
32
+ var ef="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function tf(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function nf(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function rf(e){"string"!=typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var of={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":ef?173:189,"=":ef?61:187,";":ef?59:186,"'":222,"[":219,"]":221,"\\":220},sf={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},af={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},lf={16:!1,18:!1,17:!1,91:!1},uf={},cf=1;cf<20;cf++)of["f".concat(cf)]=111+cf;var df=[],pf=!1,hf="all",ff=[],mf=function(e){return of[e.toLowerCase()]||sf[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function gf(e){hf=e||"all"}function yf(){return hf||"all"}var bf=function(e){var t=e.key,n=e.scope,r=e.method,i=e.splitKey,o=void 0===i?"+":i;rf(t).forEach((function(e){var t=e.split(o),i=t.length,s=t[i-1],a="*"===s?"*":mf(s);if(uf[a]){n||(n=yf());var l=i>1?nf(sf,t):[];uf[a]=uf[a].filter((function(e){return!((!r||e.method===r)&&e.scope===n&&function(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0,o=0;o<n.length;o++)-1===r.indexOf(n[o])&&(i=!1);return i}(e.mods,l))}))}}))};function vf(e,t,n,r){var i;if(t.element===r&&(t.scope===n||"all"===t.scope)){for(var o in i=t.mods.length>0,lf)Object.prototype.hasOwnProperty.call(lf,o)&&(!lf[o]&&t.mods.indexOf(+o)>-1||lf[o]&&-1===t.mods.indexOf(+o))&&(i=!1);(0!==t.mods.length||lf[16]||lf[18]||lf[17]||lf[91])&&!i&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function wf(e,t){var n=uf["*"],r=e.keyCode||e.which||e.charCode;if(xf.filter.call(this,e)){if(93!==r&&224!==r||(r=91),-1===df.indexOf(r)&&229!==r&&df.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=af[t];e[t]&&-1===df.indexOf(n)?df.push(n):!e[t]&&df.indexOf(n)>-1?df.splice(df.indexOf(n),1):"metaKey"===t&&e[t]&&3===df.length&&(e.ctrlKey||e.shiftKey||e.altKey||(df=df.slice(df.indexOf(n))))})),r in lf){for(var i in lf[r]=!0,sf)sf[i]===r&&(xf[i]=!0);if(!n)return}for(var o in lf)Object.prototype.hasOwnProperty.call(lf,o)&&(lf[o]=e[af[o]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===df.indexOf(17)&&df.push(17),-1===df.indexOf(18)&&df.push(18),lf[17]=!0,lf[18]=!0);var s=yf();if(n)for(var a=0;a<n.length;a++)n[a].scope===s&&("keydown"===e.type&&n[a].keydown||"keyup"===e.type&&n[a].keyup)&&vf(e,n[a],s,t);if(r in uf)for(var l=0;l<uf[r].length;l++)if(("keydown"===e.type&&uf[r][l].keydown||"keyup"===e.type&&uf[r][l].keyup)&&uf[r][l].key){for(var u=uf[r][l],c=u.splitKey,d=u.key.split(c),p=[],h=0;h<d.length;h++)p.push(mf(d[h]));p.sort().join("")===df.sort().join("")&&vf(e,u,s,t)}}}function xf(e,t,n){df=[];var r=rf(e),i=[],o="all",s=document,a=0,l=!1,u=!0,c="+",d=!1;for(void 0===n&&"function"==typeof t&&(n=t),"[object Object]"===Object.prototype.toString.call(t)&&(t.scope&&(o=t.scope),t.element&&(s=t.element),t.keyup&&(l=t.keyup),void 0!==t.keydown&&(u=t.keydown),void 0!==t.capture&&(d=t.capture),"string"==typeof t.splitKey&&(c=t.splitKey)),"string"==typeof t&&(o=t);a<r.length;a++)i=[],(e=r[a].split(c)).length>1&&(i=nf(sf,e)),(e="*"===(e=e[e.length-1])?"*":mf(e))in uf||(uf[e]=[]),uf[e].push({keyup:l,keydown:u,scope:o,mods:i,shortcut:r[a],method:n,key:r[a],splitKey:c,element:s});void 0!==s&&!function(e){return ff.indexOf(e)>-1}(s)&&window&&(ff.push(s),tf(s,"keydown",(function(e){wf(e,s)}),d),pf||(pf=!0,tf(window,"focus",(function(){df=[]}),d)),tf(s,"keyup",(function(e){wf(e,s),function(e){var t=e.keyCode||e.which||e.charCode,n=df.indexOf(t);if(n>=0&&df.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&df.splice(0,df.length),93!==t&&224!==t||(t=91),t in lf)for(var r in lf[t]=!1,sf)sf[r]===t&&(xf[r]=!1)}(e)}),d))}var Mf={setScope:gf,getScope:yf,deleteScope:function(e,t){var n,r;for(var i in e||(e=yf()),uf)if(Object.prototype.hasOwnProperty.call(uf,i))for(n=uf[i],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;yf()===e&&gf(t||"all")},getPressedKeyCodes:function(){return df.slice(0)},isPressed:function(e){return"string"==typeof e&&(e=mf(e)),-1!==df.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return!t.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||t.readOnly)||(r=!1),r},trigger:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(uf).forEach((function(n){var r=uf[n].find((function(n){return n.scope===t&&n.shortcut===e}));r&&r.method&&r.method()}))},unbind:function(e){if(e){if(Array.isArray(e))e.forEach((function(e){e.key&&bf(e)}));else if("object"==typeof e)e.key&&bf(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n[0],o=n[1];"function"==typeof i&&(o=i,i=""),bf({key:e,scope:i,method:o,splitKey:"+"})}}else Object.keys(uf).forEach((function(e){return delete uf[e]}))},keyMap:of,modifier:sf,modifierMap:af};for(var Df in Mf)Object.prototype.hasOwnProperty.call(Mf,Df)&&(xf[Df]=Mf[Df]);if("undefined"!=typeof window){var kf=window.hotkeys;xf.noConflict=function(e){return e&&window.hotkeys===xf&&(window.hotkeys=kf),xf},window.hotkeys=xf}xf.filter=function(){return!0};var Ef=function(e,t){var n=e.target,r=n&&n.tagName;return Boolean(r&&t&&t.includes(r))};function Cf(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var i=n||{},s=i.enableOnTags,a=i.filter,l=i.keyup,d=i.keydown,p=i.filterPreventDefault,h=void 0===p||p,f=i.enabled,m=void 0===f||f,g=i.enableOnContentEditable,y=void 0!==g&&g,b=u(null),v=c((function(e,n){var r;return a&&!a(e)?!h:!!(Ef(e,["INPUT","TEXTAREA","SELECT"])&&!Ef(e,s)||null!=(r=e.target)&&r.isContentEditable&&!y)||(null===b.current||document.activeElement===b.current)&&(t(e,n),!0)}),r?[b,s,a].concat(r):[b,s,a]);return o((function(){if(m)return l&&!0!==d&&(n.keydown=!1),xf(e,n||{},v),function(){return xf.unbind(e,v)};xf.unbind(e,v)}),[v,e,m]),b}xf.isPressed;const Tf=()=>{},Of="xs",Sf="sm",Af="md",Nf=e=>{let{size:n="sm",isOpen:r=!1,onClose:i=Tf,loading:o=!1,children:s,className:a="",closeOnEsc:l=!0,closeButton:c=!0,backdropClassName:d="",closeOnOutsideClick:p=!0,...h}=e;const f=u();return Pd(f,p?i:Tf),Cf("esc",l?i:Tf),t.createElement(zd,{className:"ne-portal"},r&&t.createElement(yd,{key:"modal-backdrop",className:sc("ne-modal__backdrop",d)},t.createElement("div",ie({ref:f,key:"modal-wrapper",className:sc("ne-modal__wrapper",{"ne-modal__wrapper--xs":n===Of,"ne-modal__wrapper--sm":n===Sf,"ne-modal__wrapper--md":n===Af,[a]:a})},h),c&&t.createElement(Ld,{style:"text",icon:th,className:"ne-modal__close",onClick:i}),o?"":s)))},_f=e=>{let{children:n,className:r="",required:i=!1,helpIconProps:o=null,...s}=e;const{onClick:a,icon:l,tooltipProps:u,className:c,...d}=o||{},p=l||mh;return t.createElement("label",ie({className:sc("ne-label flex items-center",r)},s),n,i&&t.createElement("span",{"aria-hidden":!0},"*"),o&&t.createElement(Ad,ie({},u,{disabled:!u}),t.createElement("span",{className:sc("ml-1",{[c]:c}),onClick:a},t.createElement(p,ie({size:16},d)))))},jf=s(((e,n)=>{const{id:r,size:i="small",type:o="text",label:s,error:a=null,suffix:l=null,prefix:u=null,disabled:c=!1,helpText:d="",className:p="",nakedInput:h=!1,contentSize:f=null,required:m=!1,...g}=e;return t.createElement("div",{className:sc(["ne-input__wrapper",p])},s&&t.createElement(_f,{required:m,"data-cy":"neeto-editor-".concat(sd(s),"-input-label"),htmlFor:r},s),t.createElement("div",{className:sc("ne-input",{"ne-input--naked":!!h,"ne-input--error":!!a,"ne-input--disabled":!!c,"ne-input--small":"small"===i})},u&&t.createElement("div",{className:"ne-input__prefix"},u),t.createElement("input",ie({ref:n,type:o,disabled:c,size:f,required:m,"aria-invalid":!!a,"data-cy":"".concat(sd(s),"-input-field")},g)),l&&t.createElement("div",{className:"ne-input__suffix"},l)),!!a&&t.createElement("p",{"data-cy":"".concat(sd(s),"-input-error"),className:"ne-input__error"},a),d&&t.createElement("p",{className:"ne-input__help-text"},d))}));jf.displayName="Input";const If=e=>{let{url:n,editor:r,onClose:o,alt:s}=e;const[a,l]=i(s||""),u=()=>{r.chain().focus().setImage({src:n,alt:a}).run(),o()};return t.createElement("div",{className:"neeto-editor-image-editor",onKeyDown:e=>{"Enter"===e.key&&u()}},t.createElement("figure",null,t.createElement("img",{src:n,loading:"lazy"})),t.createElement(jf,{autoFocus:!0,value:a,onChange:e=>l(e.target.value),placeholder:"Brand Image",label:"Caption"}),t.createElement("div",{className:"neeto-editor-image-editor__footer"},t.createElement(Ld,{size:"large",label:"Proceed",onClick:u}),t.createElement(Ld,{size:"large",label:"Cancel",style:"text",onClick:o})))},Lf=e=>{let{editor:n,isOpen:r,onClose:i}=e;const o=n&&n.view.state.selection.node;return t.createElement(Nf,{isOpen:r,onClose:i},t.createElement("div",{className:"neeto-editor-image-uploader"},t.createElement("div",{className:"neeto-editor-image-uploader__content"},t.createElement(If,{editor:n,onClose:i,url:null==o?void 0:o.attrs.src,alt:null==o?void 0:o.attrs.alt}))))},zf=e=>{let{editor:t,isImageEditorModalOpen:n,setIsImageEditorModalOpen:r}=e;return[{Icon:yh,command:()=>t.chain().focus().setImageAttributes({float:"left",align:"none"}).run(),active:t.isActive("image",{float:"left",align:"none"}),optionName:"Float Left"},{Icon:Zp,command:()=>t.chain().focus().setImageAttributes({float:"none",align:"center"}).run(),active:t.isActive("image",{float:"none",align:"center"}),optionName:"Align Center"},{Icon:jh,command:()=>t.chain().focus().setImageAttributes({float:"right",align:"none"}).run(),active:t.isActive("image",{float:"right",align:"center"}),optionName:"Float Right"},{Icon:ah,command:()=>r(!0),active:n,optionName:"Caption"},{Icon:th,command:()=>t.commands.deleteSelection(),active:!1,optionName:"Remove"}]},Pf=e=>{let{Icon:n,command:r,active:i,optionName:o}=e;return t.createElement(Ad,{content:od(o),position:"top",delay:[500]},t.createElement("div",{className:sc("neeto-editor-bubble-menu__item",{active:i}),onClick:r,"data-cy":"neeto-editor-bubble-menu-".concat(o,"-option")},t.createElement(n,{size:20})))},Ff=e=>{let{editor:n,isImageEditorModalOpen:r,setIsImageEditorModalOpen:i}=e;return zf({editor:n,isImageEditorModalOpen:r,setIsImageEditorModalOpen:i}).map((e=>t.createElement(Pf,ie({key:e.optionName},e))))},Rf=/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/,Bf=/^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,Uf=/((?:http|https):\/\/)?(www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|(?:manage\/)?videos?\/|)(\d+)(?:(?:\/|\?h=)(\w+))?(?:|\/\?)/,Hf=e=>{let{editor:n,handleClose:r,handleAnimateInvalidLink:s}=e;const[a,l]=i("");o((()=>{l(n.getAttributes("link").href||"")}),[]);const u=()=>{Rf.test(a)?(n.chain().focus().setLink({href:a}).run(),r()):ld(a)?(n.chain().focus().unsetLink().run(),r()):(l(""),s())};return t.createElement("div",{onKeyDown:e=>{"Escape"===e.key?r():"Enter"===e.key&&u()},className:"neeto-editor-bubble-menu__link"},t.createElement("input",{autoFocus:!0,name:"url",value:a,placeholder:"Paste or type a link...",onChange:e=>{let{target:{value:t}}=e;return l(t)},className:"neeto-editor-bubble-menu-link__input","data-cy":"neeto-editor-link-input"}),t.createElement(Ld,{style:"icon",icon:th,onClick:()=>{a?(l(""),n.chain().focus().unsetLink().run()):r()},"data-cy":"neeto-editor-link-cancel-button"}))},$f=e=>{let{editor:n,options:r,setIsInvalidLink:i,isLinkOptionActive:o,setIsLinkOptionActive:s}=e;return o?t.createElement(Hf,{editor:n,handleClose:()=>s(!1),handleAnimateInvalidLink:()=>{i(!0),setTimeout((()=>{i(!1)}),1e3)}}):(e=>{let{editor:t,setIsLinkOptionActive:n}=e;return[{Icon:Ph,command:()=>t.chain().focus().toggleBold().run(),active:t.isActive("bold"),optionName:"bold"},{Icon:Wh,command:()=>t.chain().focus().toggleItalic().run(),active:t.isActive("italic"),optionName:"italic"},{Icon:Jh,command:()=>t.chain().focus().toggleUnderline().run(),active:t.isActive("underline"),optionName:"underline"},{Icon:Rh,command:()=>t.chain().focus().toggleStrike().run(),active:t.isActive("strike"),optionName:"strike"},{Icon:vh,command:()=>n(!0),active:t.isActive("link"),optionName:"link"},{Icon:rh,command:()=>t.chain().focus().toggleCode().run(),active:t.isActive("code"),optionName:"code-block"},{Icon:dh,command:()=>t.chain().focus().toggleHighlight().run(),active:t.isActive("highlight"),optionName:"highlight"}]})({editor:n,setIsLinkOptionActive:s}).filter((e=>{let{optionName:t}=e;return r.includes(t)})).map((e=>t.createElement(Pf,ie({},e,{key:e.optionName}))))},Vf=e=>{let{editor:n,options:r}=e;const[o,s]=i(!1),[a,l]=i(!1),[u,c]=i(!1),d=n&&n.view.state.selection.node,p=d&&"image"===d.type.name,h=[md.BOLD,md.ITALIC,md.UNDERLINE,md.STRIKETHROUGH,md.LINK],f=ld(r.filter((e=>h.includes(e))));return!n||!p&&f?null:t.createElement("div",null,t.createElement(Hu,{editor:n,tippyOptions:{arrow:Vl,zIndex:99999,onHide:()=>l(!1)},className:sc("neeto-editor-bubble-menu",{"neeto-editor-bubble-menu-animate-shake":o})},p?t.createElement(Ff,{editor:n,isImageEditorModalOpen:u,setIsImageEditorModalOpen:c}):t.createElement($f,{editor:n,options:r,setIsInvalidLink:s,isLinkOptionActive:a,setIsLinkOptionActive:l})),t.createElement(Lf,{editor:n,isOpen:u,onClose:()=>c(!1)}))},Wf=e=>{let{count:n,limit:r,strategy:i}=e;const o="limit"===i&&r;return t.createElement("p",{className:"neeto-editor-character-count","data-cy":"neeto-editor-character-count"},o?"".concat(r-n," characters remaining"):"".concat(n," characters"))};var qf={exports:{}},Yf="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";function Qf(){}function Kf(){}Kf.resetWarningCache=Qf;qf.exports=function(){function e(e,t,n,r,i,o){if(o!==Yf){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. "+"Use PropTypes.checkPropTypes() to call them. "+"Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Kf,resetWarningCache:Qf};return n.PropTypes=n,n}();const Gf=20,Jf="#2F3941",Xf="#87929D",Zf=e=>{let{icon:n,iconActive:r=!0,tooltipProps:i,...o}=e;return t.createElement(Ad,i,t.createElement("button",ie({className:"neeto-editor-fixed-menu__item",type:"button"},o),t.createElement(n,{color:r?Jf:Xf,size:Gf})))};Zf.propTypes={icon:qf.exports.oneOfType([qf.exports.element,qf.exports.func]),iconActive:qf.exports.bool,onClick:qf.exports.func,tooltipProps:qf.exports.object},e.createContext(),e.createContext();var em=function(e){return e.reduce((function(e,t){var n=t[0],r=t[1];return e[n]=r,e}),{})},tm="undefined"!=typeof window&&window.document&&window.document.createElement?e.useLayoutEffect:e.useEffect,nm="undefined"!=typeof Element,rm="function"==typeof Map,im="function"==typeof Set,om="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function sm(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,r,i,o;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!sm(e[r],t[r]))return!1;return!0}if(rm&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!sm(r.value[1],t.get(r.value[0])))return!1;return!0}if(im&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(om&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(nm&&e instanceof Element)return!1;for(r=n;0!=r--;)if(("_owner"!==i[r]&&"__v"!==i[r]&&"__o"!==i[r]||!e.$$typeof)&&!sm(e[i[r]],t[i[r]]))return!1;return!0}return e!=e&&t!=t}var am=function(e,t){try{return sm(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}},lm=[];const um=()=>{},cm=(n,r)=>{let{label:s,isOpen:a,onVisible:l=um,onClose:c=um,ulProps:h,position:f,children:m,className:g,customTarget:y,closeOnEsc:b=!0,closeOnSelect:v=!0,closeOnOutsideClick:w=!0,dropdownModifiers:x=[],...M}=n;const D=u(),k=y(),E=!(null==a),[C,T]=i(!1),[O,S]=i(null),[A,N]=i(null),{styles:_,attributes:j}=function(t,n,r){void 0===r&&(r={});var i=e.useRef(null),o={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||lm},s=e.useState({styles:{popper:{position:o.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=s[0],l=s[1],u=e.useMemo((function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(e){var t=e.state,n=Object.keys(t.elements);p.flushSync((function(){l({styles:em(n.map((function(e){return[e,t.styles[e]||{}]}))),attributes:em(n.map((function(e){return[e,t.attributes[e]]})))})}))},requires:["computeStyles"]}}),[]),c=e.useMemo((function(){var e={onFirstUpdate:o.onFirstUpdate,placement:o.placement,strategy:o.strategy,modifiers:[].concat(o.modifiers,[u,{name:"applyStyles",enabled:!1}])};return am(i.current,e)?i.current||e:(i.current=e,e)}),[o.onFirstUpdate,o.placement,o.strategy,o.modifiers,u]),d=e.useRef();return tm((function(){d.current&&d.current.setOptions(c)}),[c]),tm((function(){if(null!=t&&null!=n){var e=(r.createPopper||$l)(t,n,c);return d.current=e,function(){e.destroy(),d.current=null}}}),[t,n,r.createPopper]),{state:d.current?d.current.state:null,styles:a.styles,attributes:a.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}}(O,A,{placement:f||"bottom-end",modifiers:x});d(r,(()=>({close:()=>T(!1),visible:C})));const I=()=>{E||T(!1),c()};return Cf("esc",b?I:um),Pd(D,w?I:um),o((()=>{E&&T(a)}),[a]),o((()=>{C&&l()}),[C]),t.createElement("div",ie({ref:D,className:sc("ne-dropdown__wrapper",{[g]:g})},M),y?t.createElement("div",{ref:S,onClick:()=>{!E&&T(!C)}},k):t.createElement("div",null,s,t.createElement(oh,null)),C&&t.createElement("ul",ie({className:"ne-dropdown__popup",ref:N,onClick:()=>{v&&I()},"data-cy":"neeto-editor-".concat(sd(s),"-dropdown-container")},h,{style:{display:"block",..._.offset,..._.popper}},j.popper),m))};cm.displayName="Dropdown";var dm=s(cm);function pm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var hm,fm={exports:{}},mm={exports:{}},gm=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},ym=gm,bm=Object.prototype.toString,vm=(hm=Object.create(null),function(e){var t=bm.call(e);return hm[t]||(hm[t]=t.slice(8,-1).toLowerCase())});function wm(e){return e=e.toLowerCase(),function(t){return vm(t)===e}}function xm(e){return Array.isArray(e)}function Mm(e){return void 0===e}var Dm=wm("ArrayBuffer");function km(e){return null!==e&&"object"==typeof e}function Em(e){if("object"!==vm(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var Cm=wm("Date"),Tm=wm("File"),Om=wm("Blob"),Sm=wm("FileList");function Am(e){return"[object Function]"===bm.call(e)}var Nm=wm("URLSearchParams");function _m(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),xm(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var jm,Im=(jm="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return jm&&e instanceof jm}),Lm={isArray:xm,isArrayBuffer:Dm,isBuffer:function(e){return null!==e&&!Mm(e)&&null!==e.constructor&&!Mm(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||bm.call(e)===t||Am(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Dm(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:km,isPlainObject:Em,isUndefined:Mm,isDate:Cm,isFile:Tm,isBlob:Om,isFunction:Am,isStream:function(e){return km(e)&&Am(e.pipe)},isURLSearchParams:Nm,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:_m,merge:function e(){var t={};function n(n,r){Em(t[r])&&Em(n)?t[r]=e(t[r],n):Em(n)?t[r]=e({},n):xm(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)_m(arguments[r],n);return t},extend:function(e,t,n){return _m(t,(function(t,r){e[r]=n&&"function"==typeof t?ym(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n){var r,i,o,s={};t=t||{};do{for(i=(r=Object.getOwnPropertyNames(e)).length;i-- >0;)s[o=r[i]]||(t[o]=e[o],s[o]=!0);e=Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:vm,kindOfTest:wm,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;var t=e.length;if(Mm(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},isTypedArray:Im,isFileList:Sm},zm=Lm;function Pm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Fm=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(zm.isURLSearchParams(t))r=t.toString();else{var i=[];zm.forEach(t,(function(e,t){null!=e&&(zm.isArray(e)?t+="[]":e=[e],zm.forEach(e,(function(e){zm.isDate(e)?e=e.toISOString():zm.isObject(e)&&(e=JSON.stringify(e)),i.push(Pm(t)+"="+Pm(e))})))})),r=i.join("&")}if(r){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},Rm=Lm;function Bm(){this.handlers=[]}Bm.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},Bm.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},Bm.prototype.forEach=function(e){Rm.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var Um,Hm,$m=Bm,Vm=Lm;function Wm(){if(Hm)return Um;Hm=1;var e=Lm;function t(e,t,n,r,i){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}e.inherits(t,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var n=t.prototype,r={};return["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){r[e]={value:e}})),Object.defineProperties(t,r),Object.defineProperty(n,"isAxiosError",{value:!0}),t.from=function(r,i,o,s,a,l){var u=Object.create(n);return e.toFlatObject(r,u,(function(e){return e!==Error.prototype})),t.call(u,r.message,i,o,s,a),u.name=r.name,l&&Object.assign(u,l),u},Um=t}var qm,Ym,Qm,Km,Gm,Jm,Xm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};function Zm(){if(Ym)return qm;Ym=1;var e=Lm;return qm=function(t,n){n=n||new FormData;var r=[];function i(t){return null===t?"":e.isDate(t)?t.toISOString():e.isArrayBuffer(t)||e.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}return function t(o,s){if(e.isPlainObject(o)||e.isArray(o)){if(-1!==r.indexOf(o))throw Error("Circular reference detected in "+s);r.push(o),e.forEach(o,(function(r,o){if(!e.isUndefined(r)){var a,l=s?s+"."+o:o;if(r&&!s&&"object"==typeof r)if(e.endsWith(o,"{}"))r=JSON.stringify(r);else if(e.endsWith(o,"[]")&&(a=e.toArray(r)))return void a.forEach((function(t){!e.isUndefined(t)&&n.append(l,i(t))}));t(r,l)}})),r.pop()}else n.append(s,i(o))}(t),n},qm}function eg(){if(Jm)return Gm;Jm=1;var e=Lm;return Gm=e.isStandardBrowserEnv()?{write:function(t,n,r,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(n)),e.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),e.isString(i)&&a.push("path="+i),e.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Gm}var tg,ng,rg,ig,og,sg,ag,lg,ug,cg,dg,pg,hg=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},fg=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},mg=function(e,t){return e&&!hg(t)?fg(e,t):t};function gg(){if(ng)return tg;ng=1;var e=Lm,t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return tg=function(n){var r,i,o,s={};return n?(e.forEach(n.split("\n"),(function(n){if(o=n.indexOf(":"),r=e.trim(n.substr(0,o)).toLowerCase(),i=e.trim(n.substr(o+1)),r){if(s[r]&&t.indexOf(r)>=0)return;s[r]="set-cookie"===r?(s[r]?s[r]:[]).concat([i]):s[r]?s[r]+", "+i:i}})),s):s},tg}function yg(){if(ig)return rg;ig=1;var e=Lm;return rg=e.isStandardBrowserEnv()?function(){var t,n=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var t=e;return n&&(r.setAttribute("href",t),t=r.href),r.setAttribute("href",t),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=i(window.location.href),function(n){var r=e.isString(n)?i(n):n;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}}function bg(){if(sg)return og;sg=1;var e=Wm();function t(t){e.call(this,null==t?"canceled":t,e.ERR_CANCELED),this.name="CanceledError"}return Lm.inherits(t,e,{__CANCEL__:!0}),og=t}function vg(){return lg||(lg=1,ag=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}),ag}function wg(){if(cg)return ug;cg=1;var e=Lm,t=function(){if(Km)return Qm;Km=1;var e=Wm();return Qm=function(t,n,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?n(new e("Request failed with status code "+r.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}}(),n=eg(),r=Fm,i=mg,o=gg(),s=yg(),a=Xm,l=Wm(),u=bg(),c=vg();return ug=function(d){return new Promise((function(p,h){var f,m=d.data,g=d.headers,y=d.responseType;function b(){d.cancelToken&&d.cancelToken.unsubscribe(f),d.signal&&d.signal.removeEventListener("abort",f)}e.isFormData(m)&&e.isStandardBrowserEnv()&&delete g["Content-Type"];var v=new XMLHttpRequest;if(d.auth){var w=d.auth.username||"",x=d.auth.password?unescape(encodeURIComponent(d.auth.password)):"";g.Authorization="Basic "+btoa(w+":"+x)}var M=i(d.baseURL,d.url);function D(){if(v){var e="getAllResponseHeaders"in v?o(v.getAllResponseHeaders()):null,n={data:y&&"text"!==y&&"json"!==y?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:e,config:d,request:v};t((function(e){p(e),b()}),(function(e){h(e),b()}),n),v=null}}if(v.open(d.method.toUpperCase(),r(M,d.params,d.paramsSerializer),!0),v.timeout=d.timeout,"onloadend"in v?v.onloadend=D:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(D)},v.onabort=function(){v&&(h(new l("Request aborted",l.ECONNABORTED,d,v)),v=null)},v.onerror=function(){h(new l("Network Error",l.ERR_NETWORK,d,v,v)),v=null},v.ontimeout=function(){var e=d.timeout?"timeout of "+d.timeout+"ms exceeded":"timeout exceeded",t=d.transitional||a;d.timeoutErrorMessage&&(e=d.timeoutErrorMessage),h(new l(e,t.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,d,v)),v=null},e.isStandardBrowserEnv()){var k=(d.withCredentials||s(M))&&d.xsrfCookieName?n.read(d.xsrfCookieName):void 0;k&&(g[d.xsrfHeaderName]=k)}"setRequestHeader"in v&&e.forEach(g,(function(e,t){void 0===m&&"content-type"===t.toLowerCase()?delete g[t]:v.setRequestHeader(t,e)})),e.isUndefined(d.withCredentials)||(v.withCredentials=!!d.withCredentials),y&&"json"!==y&&(v.responseType=d.responseType),"function"==typeof d.onDownloadProgress&&v.addEventListener("progress",d.onDownloadProgress),"function"==typeof d.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",d.onUploadProgress),(d.cancelToken||d.signal)&&(f=function(e){v&&(h(!e||e&&e.type?new u:e),v.abort(),v=null)},d.cancelToken&&d.cancelToken.subscribe(f),d.signal&&(d.signal.aborted?f():d.signal.addEventListener("abort",f))),m||(m=null);var E=c(M);E&&-1===["http","https","file"].indexOf(E)?h(new l("Unsupported protocol "+E+":",l.ERR_BAD_REQUEST,d)):v.send(m)}))},ug}var xg=Lm,Mg=function(e,t){Vm.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},Dg=Wm(),kg=Xm,Eg=Zm(),Cg={"Content-Type":"application/x-www-form-urlencoded"};function Tg(e,t){!xg.isUndefined(e)&&xg.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Og,Sg={transitional:kg,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Og=wg()),Og),transformRequest:[function(e,t){if(Mg(t,"Accept"),Mg(t,"Content-Type"),xg.isFormData(e)||xg.isArrayBuffer(e)||xg.isBuffer(e)||xg.isStream(e)||xg.isFile(e)||xg.isBlob(e))return e;if(xg.isArrayBufferView(e))return e.buffer;if(xg.isURLSearchParams(e))return Tg(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var n,r=xg.isObject(e),i=t&&t["Content-Type"];if((n=xg.isFileList(e))||r&&"multipart/form-data"===i){var o=this.env&&this.env.FormData;return Eg(n?{"files[]":e}:e,o&&new o)}return r||"application/json"===i?(Tg(t,"application/json"),function(e,t,n){if(xg.isString(e))try{return(t||JSON.parse)(e),xg.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||Sg.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,i=!n&&"json"===this.responseType;if(i||r&&xg.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw Dg.from(e,Dg.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pg?dg:(pg=1,dg=null)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};xg.forEach(["delete","get","head"],(function(e){Sg.headers[e]={}})),xg.forEach(["post","put","patch"],(function(e){Sg.headers[e]=xg.merge(Cg)}));var Ag,Ng,_g=Sg,jg=Lm,Ig=_g;function Lg(){return Ng?Ag:(Ng=1,Ag=function(e){return!(!e||!e.__CANCEL__)})}var zg=Lm,Pg=function(e,t,n){var r=this||Ig;return jg.forEach(n,(function(n){e=n.call(r,e,t)})),e},Fg=Lg(),Rg=_g,Bg=bg();function Ug(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Bg}var Hg,$g,Vg=Lm,Wg=function(e,t){t=t||{};var n={};function r(e,t){return Vg.isPlainObject(e)&&Vg.isPlainObject(t)?Vg.merge(e,t):Vg.isPlainObject(t)?Vg.merge({},t):Vg.isArray(t)?t.slice():t}function i(n){return Vg.isUndefined(t[n])?Vg.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function o(e){if(!Vg.isUndefined(t[e]))return r(void 0,t[e])}function s(n){return Vg.isUndefined(t[n])?Vg.isUndefined(e[n])?void 0:r(void 0,e[n]):r(void 0,t[n])}function a(n){return n in t?r(e[n],t[n]):n in e?r(void 0,e[n]):void 0}var l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a};return Vg.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=l[e]||i,r=t(e);Vg.isUndefined(r)&&t!==a||(n[e]=r)})),n};function qg(){return $g?Hg:($g=1,Hg={version:"0.27.2"})}var Yg=qg().version,Qg=Wm(),Kg={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Kg[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var Gg={};Kg.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Yg+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,i,o){if(!1===e)throw new Qg(r(i," has been removed"+(t?" in "+t:"")),Qg.ERR_DEPRECATED);return t&&!Gg[i]&&(Gg[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}};var Jg,Xg,Zg,ey,ty,ny,ry={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Qg("options must be an object",Qg.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),i=r.length;i-- >0;){var o=r[i],s=t[o];if(s){var a=e[o],l=void 0===a||s(a,o,e);if(!0!==l)throw new Qg("option "+o+" must be "+l,Qg.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Qg("Unknown option "+o,Qg.ERR_BAD_OPTION)}},validators:Kg},iy=Lm,oy=Fm,sy=$m,ay=function(e){return Ug(e),e.headers=e.headers||{},e.data=Pg.call(e,e.data,e.headers,e.transformRequest),e.headers=zg.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),zg.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||Rg.adapter)(e).then((function(t){return Ug(e),t.data=Pg.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return Fg(t)||(Ug(e),t&&t.response&&(t.response.data=Pg.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},ly=Wg,uy=mg,cy=ry,dy=cy.validators;function py(e){this.defaults=e,this.interceptors={request:new sy,response:new sy}}py.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=ly(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&cy.assertOptions(n,{silentJSONParsing:dy.transitional(dy.boolean),forcedJSONParsing:dy.transitional(dy.boolean),clarifyTimeoutError:dy.transitional(dy.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var o,s=[];if(this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)})),!i){var a=[ay,void 0];for(Array.prototype.unshift.apply(a,r),a=a.concat(s),o=Promise.resolve(t);a.length;)o=o.then(a.shift(),a.shift());return o}for(var l=t;r.length;){var u=r.shift(),c=r.shift();try{l=u(l)}catch(e){c(e);break}}try{o=ay(l)}catch(e){return Promise.reject(e)}for(;s.length;)o=o.then(s.shift(),s.shift());return o},py.prototype.getUri=function(e){e=ly(this.defaults,e);var t=uy(e.baseURL,e.url);return oy(t,e.params,e.paramsSerializer)},iy.forEach(["delete","get","head","options"],(function(e){py.prototype[e]=function(t,n){return this.request(ly(n||{},{method:e,url:t,data:(n||{}).data}))}})),iy.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(ly(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}py.prototype[e]=t(),py.prototype[e+"Form"]=t(!0)}));var hy=Lm,fy=gm,my=py,gy=Wg;var yy=function e(t){var n=new my(t),r=fy(my.prototype.request,n);return hy.extend(r,my.prototype,n),hy.extend(r,n),r.create=function(n){return e(gy(t,n))},r}(_g);yy.Axios=my,yy.CanceledError=bg(),yy.CancelToken=function(){if(Xg)return Jg;Xg=1;var e=bg();function t(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(e){n=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},t((function(t){r.reason||(r.reason=new e(t),n(r.reason))}))}return t.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},t.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},t.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},t.source=function(){var e,n=new t((function(t){e=t}));return{token:n,cancel:e}},Jg=t}(),yy.isCancel=Lg(),yy.VERSION=qg().version,yy.toFormData=Zm(),yy.AxiosError=Wm(),yy.Cancel=yy.CanceledError,yy.all=function(e){return Promise.all(e)},yy.spread=ey?Zg:(ey=1,Zg=function(e){return function(t){return e.apply(null,t)}}),yy.isAxiosError=function(){if(ny)return ty;ny=1;var e=Lm;return ty=function(t){return e.isObject(t)&&!0===t.isAxiosError}}(),mm.exports=yy,mm.exports.default=yy;var by=nc(fm.exports=mm.exports);function vy(e){return e&&e.__esModule?e.default:e}function wy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xy,My,Dy,ky,Ey,Cy,Ty={},Oy=[],Sy=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Ay(e,t){for(var n in t)e[n]=t[n];return e}function Ny(e){var t=e.parentNode;t&&t.removeChild(e)}function _y(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?xy.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return jy(e,s,r,i,null)}function jy(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Dy:i};return null==i&&null!=My.vnode&&My.vnode(o),o}function Iy(e){return e.children}function Ly(e,t){this.props=e,this.context=t}function zy(e,t){if(null==t)return e.__?zy(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?zy(e):null}function Py(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Py(e)}}function Fy(e){(!e.__d&&(e.__d=!0)&&ky.push(e)&&!Ry.__r++||Cy!==My.debounceRendering)&&((Cy=My.debounceRendering)||Ey)(Ry)}function Ry(){for(var e;Ry.__r=ky.length;)e=ky.sort((function(e,t){return e.__v.__b-t.__v.__b})),ky=[],e.some((function(e){var t,n,r,i,o,s;e.__d&&(o=(i=(t=e).__v).__e,(s=t.__P)&&(n=[],(r=Ay({},i)).__v=i.__v+1,Qy(s,i,r,t.__n,void 0!==s.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?zy(i):o,i.__h),Ky(n,i),i.__e!=o&&Py(i)))}))}function By(e,t,n,r,i,o,s,a,l,u){var c,d,p,h,f,m,g,y=r&&r.__k||Oy,b=y.length;for(n.__k=[],c=0;c<t.length;c++)if(null!=(h=n.__k[c]=null==(h=t[c])||"boolean"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?jy(null,h,null,null,h):Array.isArray(h)?jy(Iy,{children:h},null,null,null):h.__b>0?jy(h.type,h.props,h.key,null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(p=y[c])||p&&h.key==p.key&&h.type===p.type)y[c]=void 0;else for(d=0;d<b;d++){if((p=y[d])&&h.key==p.key&&h.type===p.type){y[d]=void 0;break}p=null}Qy(e,h,p=p||Ty,i,o,s,a,l,u),f=h.__e,(d=h.ref)&&p.ref!=d&&(g||(g=[]),p.ref&&g.push(p.ref,null,h),g.push(d,h.__c||f,h)),null!=f?(null==m&&(m=f),"function"==typeof h.type&&h.__k===p.__k?h.__d=l=Uy(h,l,e):l=$y(e,h,p,y,f,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=zy(p))}for(n.__e=m,c=b;c--;)null!=y[c]&&("function"==typeof n.type&&null!=y[c].__e&&y[c].__e==n.__d&&(n.__d=zy(r,c+1)),Jy(y[c],y[c]));if(g)for(c=0;c<g.length;c++)Gy(g[c],g[++c],g[++c])}function Uy(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?Uy(r,t,n):$y(n,r,r,i,r.__e,t));return t}function Hy(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){Hy(e,t)})):t.push(e)),t}function $y(e,t,n,r,i,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<r.length;l+=2)if(a==i)break e;e.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function Vy(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||Sy.test(t)?n:n+"px"}function Wy(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Vy(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Vy(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?Yy:qy,o):e.removeEventListener(t,o?Yy:qy,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function qy(e){this.l[e.type+!1](My.event?My.event(e):e)}function Yy(e){this.l[e.type+!0](My.event?My.event(e):e)}function Qy(e,t,n,r,i,o,s,a,l){var u,c,d,p,h,f,m,g,y,b,v,w=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(u=My.__b)&&u(t);try{e:if("function"==typeof w){if(g=t.props,y=(u=w.contextType)&&r[u.__c],b=u?y?y.props.value:u.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:("prototype"in w&&w.prototype.render?t.__c=c=new w(g,b):(t.__c=c=new Ly(g,b),c.constructor=w,c.render=Xy),y&&y.sub(c),c.props=g,c.state||(c.state={}),c.context=b,c.__n=r,d=c.__d=!0,c.__h=[]),null==c.__s&&(c.__s=c.state),null!=w.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Ay({},c.__s)),Ay(c.__s,w.getDerivedStateFromProps(g,c.__s))),p=c.props,h=c.state,d)null==w.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==w.getDerivedStateFromProps&&g!==p&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(g,b),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(g,c.__s,b)||t.__v===n.__v){c.props=g,c.state=c.__s,t.__v!==n.__v&&(c.__d=!1),c.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),c.__h.length&&s.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(g,c.__s,b),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(p,h,f)}))}c.context=b,c.props=g,c.state=c.__s,(u=My.__r)&&u(t),c.__d=!1,c.__v=t,c.__P=e,u=c.render(c.props,c.state,c.context),c.state=c.__s,null!=c.getChildContext&&(r=Ay(Ay({},r),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(f=c.getSnapshotBeforeUpdate(p,h)),v=null!=u&&u.type===Iy&&null==u.key?u.props.children:u,By(e,Array.isArray(v)?v:[v],t,n,r,i,o,s,a,l),c.base=t.__e,t.__h=null,c.__h.length&&s.push(c),m&&(c.__E=c.__=null),c.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,o,s,a){var l,u,c,d=n.props,p=t.props,h=t.type,f=0;if("svg"===h&&(i=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===h)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,p.is&&p),o=null,a=!1}if(null===h)d===p||a&&e.data===p||(e.data=p);else{if(o=o&&xy.call(e.childNodes),u=(d=n.props||Ty).dangerouslySetInnerHTML,c=p.dangerouslySetInnerHTML,!a){if(null!=o)for(d={},f=0;f<e.attributes.length;f++)d[e.attributes[f].name]=e.attributes[f].value;(c||u)&&(c&&(u&&c.__html==u.__html||c.__html===e.innerHTML)||(e.innerHTML=c&&c.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||Wy(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||Wy(e,o,t[o],n[o],r)}(e,p,d,i,a),c)t.__k=[];else if(f=t.props.children,By(e,Array.isArray(f)?f:[f],t,n,r,i&&"foreignObject"!==h,o,s,o?o[0]:n.__k&&zy(n,0),a),null!=o)for(f=o.length;f--;)null!=o[f]&&Ny(o[f]);a||("value"in p&&void 0!==(f=p.value)&&(f!==d.value||f!==e.value||"progress"===h&&!f)&&Wy(e,"value",f,d.value,!1),"checked"in p&&void 0!==(f=p.checked)&&f!==e.checked&&Wy(e,"checked",f,d.checked,!1))}return e}(n.__e,t,n,r,i,o,s,l);(u=My.diffed)&&u(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),My.__e(e,t,n)}}function Ky(e,t){My.__c&&My.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){My.__e(e,t.__v)}}))}function Gy(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){My.__e(e,n)}}function Jy(e,t,n){var r,i;if(My.unmount&&My.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Gy(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){My.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Jy(r[i],t,"function"!=typeof e.type);n||null==e.__e||Ny(e.__e),e.__e=e.__d=void 0}function Xy(e,t,n){return this.constructor(e,n)}function Zy(e,t,n){var r,i,o;My.__&&My.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],Qy(t,e=(!r&&n||t).__k=_y(Iy,null,[e]),i||Ty,Ty,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?xy.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),Ky(o,e)}xy=Oy.slice,My={__e:function(e,t){for(var n,r,i;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),i=n.__d),i)return n.__E=n}catch(t){e=t}throw e}},Dy=0,Ly.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Ay({},this.state),"function"==typeof e&&(e=e(Ay({},n),this.props)),e&&Ay(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),Fy(this))},Ly.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Fy(this))},Ly.prototype.render=Iy,ky=[],Ey="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ry.__r=0;var eb=0;function tb(e,t,n,r,i){var o,s,a={};for(s in t)"ref"==s?o=t[s]:a[s]=t[s];var l={type:e,props:a,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--eb,__source:r,__self:i};if("function"==typeof e&&(o=e.defaultProps))for(s in o)void 0===a[s]&&(a[s]=o[s]);return My.vnode&&My.vnode(l),l}var nb;nb=JSON.parse('{"search":"Search","search_no_results_1":"Oh no!","search_no_results_2":"That emoji couldn’t be found","pick":"Pick an emoji…","add_custom":"Add custom emoji","categories":{"activity":"Activity","custom":"Custom","flags":"Flags","foods":"Food & Drink","frequent":"Frequently used","nature":"Animals & Nature","objects":"Objects","people":"Smileys & People","places":"Travel & Places","search":"Search Results","symbols":"Symbols"},"skins":{"1":"Default","2":"Light","3":"Medium-Light","4":"Medium","5":"Medium-Dark","6":"Dark","choose":"Choose default skin tone"}}');var rb={autoFocus:{value:!1},emojiButtonColors:{value:null},emojiButtonRadius:{value:"100%"},emojiButtonSize:{value:36},emojiSize:{value:24},emojiVersion:{value:14,choices:[1,2,3,4,5,11,12,12.1,13,13.1,14]},icons:{value:"auto",choices:["auto","outline","solid"]},locale:{value:"en",choices:["en","ar","de","es","fa","fr","it","ja","nl","pl","pt","ru","uk","zh"]},maxFrequentRows:{value:4},navPosition:{value:"top",choices:["top","bottom","none"]},noCountryFlags:{value:!1},noResultsEmoji:{value:null},perLine:{value:9},previewEmoji:{value:null},previewPosition:{value:"bottom",choices:["top","bottom","none"]},searchPosition:{value:"sticky",choices:["sticky","static","none"]},set:{value:"native",choices:["native","apple","facebook","google","twitter"]},skin:{value:1,choices:[1,2,3,4,5,6]},skinTonePosition:{value:"preview",choices:["preview","search","none"]},theme:{value:"auto",choices:["auto","light","dark"]},categories:null,categoryIcons:null,custom:null,data:null,i18n:null,getImageURL:null,getSpritesheetURL:null,onAddCustomEmoji:null,onClickOutside:null,onEmojiSelect:null,stickySearch:{deprecated:!0,value:!0}};var ib={set:function(e,t){try{window.localStorage[`emoji-mart.${e}`]=JSON.stringify(t)}catch(e){}},get:function(e){try{const t=window.localStorage[`emoji-mart.${e}`];if(t)return JSON.parse(t)}catch(e){}}},ob=new Map;function sb(e){if(ob.has(e))return ob.get(e);var t=ab(e);return ob.set(e,t),t}var ab=function(){var e=null;try{e=document.createElement("canvas").getContext("2d")}catch(e){}if(!e)return function(){return!1};var t=25,n=20,r=Math.floor(t/2);return e.font=r+"px Arial, Sans-Serif",e.textBaseline="top",e.canvas.width=2*n,e.canvas.height=t,function(r){e.clearRect(0,0,2*n,t),e.fillStyle="#FF0000",e.fillText(r,0,22),e.fillStyle="#0000FF",e.fillText(r,n,22);for(var i=e.getImageData(0,0,n,t).data,o=i.length,s=0;s<o&&!i[s+3];s+=4);if(s>=o)return!1;var a=n+s/4%n,l=Math.floor(s/4/n),u=e.getImageData(a,l,1,1).data;return i[s]===u[0]&&i[s+2]===u[2]&&!(e.measureText(r).width>=n)}}();const lb=[{v:14,emoji:"🫠"},{v:13.1,emoji:"😶‍🌫️"},{v:13,emoji:"🥸"},{v:12.1,emoji:"🧑‍🦰"},{v:12,emoji:"🥱"},{v:11,emoji:"🥰"},{v:5,emoji:"🤩"},{v:4,emoji:"👱‍♀️"},{v:3,emoji:"🤣"},{v:2,emoji:"👋🏻"},{v:1,emoji:"🙃"}];var ub={latestVersion:function(){for(const{v:e,emoji:t}of lb)if(sb(t))return e},noCountryFlags:function(){return!sb("🇨🇦")}};const cb=["+1","grinning","kissing_heart","heart_eyes","laughing","stuck_out_tongue_winking_eye","sweat_smile","joy","scream","disappointed","unamused","weary","sob","sunglasses","heart"];let db=null;var pb={add:function(e){db||(db=ib.get("frequently")||{});const t=e.id||e;t&&(db[t]||(db[t]=0),db[t]+=1,ib.set("last",t),ib.set("frequently",db))},get:function({maxFrequentRows:e,perLine:t}){if(!e)return[];db||(db=ib.get("frequently"));let n=[];if(!db){db={};for(let e in cb.slice(0,t)){const r=cb[e];db[r]=t-e,n.push(r)}return n}const r=e*t,i=ib.get("last");for(let e in db)n.push(e);if(n.sort(((e,t)=>{const n=db[t],r=db[e];return n==r?e.localeCompare(t):n-r})),n.length>r){const e=n.slice(r);n=n.slice(0,r);for(let t of e)t!=i&&delete db[t];i&&-1==n.indexOf(i)&&(delete db[n[n.length-1]],n.splice(-1,1,i)),ib.set("frequently",db)}return n}};let hb=null;var fb={search:async function(e,{maxResults:t}={}){if(!e||!e.trim().length)return null;t||(t=90),await xb();const n=e.toLowerCase().replace(/(\w)-/,"$1 ").split(/[\s|,]+/).filter(((e,t,n)=>e.trim()&&n.indexOf(e)==t));if(!n.length)return;let r,i,o=hb||(hb=Object.values(yb.emojis));for(const e of n){if(!o.length)break;r=[],i={};for(const t of o){if(!t.search)continue;const n=t.search.indexOf(`,${e}`);-1!=n&&(r.push(t),i[t.id]||(i[t.id]=0),i[t.id]+=t.id==e?0:n+1)}o=r}return r.length<2||(r.sort(((e,t)=>{const n=i[e.id],r=i[t.id];return n==r?e.id.localeCompare(t.id):n-r})),r.length>t&&(r=r.slice(0,t))),r},get:function(e){return e.id?e:yb.emojis[e]||yb.emojis[yb.aliases[e]]||yb.emojis[yb.natives[e]]},reset:function(){hb=null},SHORTCODES_REGEX:/^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/};const mb=["checkered_flag","crossed_flags","pirate_flag","rainbow-flag","transgender_flag","triangular_flag_on_post","waving_black_flag","waving_white_flag"];let gb=null,yb=null;async function bb(e){const t=await fetch(e);return await t.json()}let vb=null,wb=null;function xb(e){return vb||(vb=new Promise((e=>{wb=e}))),e&&async function(e){let{emojiVersion:t,set:n,locale:r}=e;if(t||(t=rb.emojiVersion.value),n||(n=rb.set.value),r||(r=rb.locale.value),yb)yb.categories=yb.categories.filter((e=>!!!e.name));else{yb=("function"==typeof e.data?await e.data():e.data)||await bb(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/sets/${t}/${n}.json`),yb.emoticons={},yb.natives={},yb.categories.unshift({id:"frequent",emojis:[]});for(const e in yb.aliases){const t=yb.aliases[e],n=yb.emojis[t];n&&(n.aliases||(n.aliases=[]),n.aliases.push(e))}}gb||(gb=("function"==typeof e.i18n?await e.i18n():e.i18n)||("en"==r?vy(nb):await bb(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/i18n/${r}.json`)));if(e.custom)for(let t in e.custom){t=parseInt(t);const n=e.custom[t],r=e.custom[t-1];if(!n.emojis||!n.emojis.length)continue;n.id||(n.id=`custom_${t+1}`),n.name||(n.name=gb.categories.custom),r&&!n.icon&&(n.target=r.target||r),yb.categories.push(n);const i=[];for(const e of n.emojis)i.indexOf(e.id)>-1||(yb.emojis[e.id]=e,i.push(e.id));n.emojis=i}e.categories&&(yb.categories=yb.categories.filter((t=>-1!=e.categories.indexOf(t.id))).sort(((t,n)=>e.categories.indexOf(t.id)-e.categories.indexOf(n.id))));let i=null,o=null;"native"==n&&(i=ub.latestVersion(),o=e.noCountryFlags||ub.noCountryFlags());let s=yb.categories.length,a=!1;for(;s--;){const t=yb.categories[s];if("frequent"==t.id&&(t.emojis=pb.get(e)),!t.emojis||!t.emojis.length){yb.categories.splice(s,1);continue}const{categoryIcons:n}=e;if(n){const e=n[t.id];e&&!t.icon&&(t.icon=e)}let r=t.emojis.length;for(;r--;){const e=yb.emojis[t.emojis[r]],n=()=>{t.emojis.splice(r,1)};if(e)if(i&&e.version>i)n();else if(!o||"flags"!=t.id||mb.includes(e.id)){if(!e.search){if(a=!0,e.search=","+[[e.id,!1],[e.name,!0],[e.keywords,!1],[e.emoticons,!1]].map((([e,t])=>{if(e)return(Array.isArray(e)?e:[e]).map((e=>(t?e.split(/[-|_|\s]+/):[e]).map((e=>e.toLowerCase())))).flat()})).flat().filter((e=>e&&e.trim())).join(","),e.emoticons)for(const t of e.emoticons)yb.emoticons[t]||(yb.emoticons[t]=e.id);let t=0;for(const n of e.skins){if(!n)continue;t++;const{native:r}=n;r&&(yb.natives[r]=e.id,e.search+=`,${r}`);const i=1==t?"":`:skin-tone-${t}:`;n.shortcodes=`:${e.id}:${i}`}}}else n();else n()}}a&&fb.reset();wb()}(e),vb}function Mb(e,t,n){e||(e={});const r={};for(let i in t)r[i]=Db(i,e,t,n);return r}function Db(e,t,n,r){const i=n[e];let o=r&&r.getAttribute(e)||(null!=t[e]&&null!=t[e]?t[e]:null);return i?(null!=o&&i.value&&typeof i.value!=typeof o&&(o="boolean"==typeof i.value?"false"!=o:i.value.constructor(o)),(null==o||i.choices&&-1==i.choices.indexOf(o))&&(o=i.value),o):o}var kb={categories:{activity:{outline:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:tb("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113"})}),solid:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:tb("path",{d:"M16.17 337.5c0 44.98 7.565 83.54 13.98 107.9C35.22 464.3 50.46 496 174.9 496c9.566 0 19.59-.4707 29.84-1.271L17.33 307.3C16.53 317.6 16.17 327.7 16.17 337.5zM495.8 174.5c0-44.98-7.565-83.53-13.98-107.9c-4.688-17.54-18.34-31.23-36.04-35.95C435.5 27.91 392.9 16 337 16c-9.564 0-19.59 .4707-29.84 1.271l187.5 187.5C495.5 194.4 495.8 184.3 495.8 174.5zM26.77 248.8l236.3 236.3c142-36.1 203.9-150.4 222.2-221.1L248.9 26.87C106.9 62.96 45.07 177.2 26.77 248.8zM256 335.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L164.7 283.3C161.6 280.2 160 276.1 160 271.1c0-8.529 6.865-16 16-16c4.095 0 8.189 1.562 11.31 4.688l64.01 64C254.4 327.8 256 331.9 256 335.1zM304 287.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L212.7 235.3C209.6 232.2 208 228.1 208 223.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01C302.5 279.8 304 283.9 304 287.1zM256 175.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01c3.125 3.125 4.688 7.219 4.688 11.31c0 9.133-7.468 16-16 16c-4.094 0-8.189-1.562-11.31-4.688l-64.01-64.01C257.6 184.2 256 180.1 256 175.1z"})})},custom:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",children:tb("path",{d:"M417.1 368c-5.937 10.27-16.69 16-27.75 16c-5.422 0-10.92-1.375-15.97-4.281L256 311.4V448c0 17.67-14.33 32-31.1 32S192 465.7 192 448V311.4l-118.3 68.29C68.67 382.6 63.17 384 57.75 384c-11.06 0-21.81-5.734-27.75-16c-8.828-15.31-3.594-34.88 11.72-43.72L159.1 256L41.72 187.7C26.41 178.9 21.17 159.3 29.1 144C36.63 132.5 49.26 126.7 61.65 128.2C65.78 128.7 69.88 130.1 73.72 132.3L192 200.6V64c0-17.67 14.33-32 32-32S256 46.33 256 64v136.6l118.3-68.29c3.838-2.213 7.939-3.539 12.07-4.051C398.7 126.7 411.4 132.5 417.1 144c8.828 15.31 3.594 34.88-11.72 43.72L288 256l118.3 68.28C421.6 333.1 426.8 352.7 417.1 368z"})}),flags:{outline:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:tb("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z"})}),solid:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:tb("path",{d:"M64 496C64 504.8 56.75 512 48 512h-32C7.25 512 0 504.8 0 496V32c0-17.75 14.25-32 32-32s32 14.25 32 32V496zM476.3 0c-6.365 0-13.01 1.35-19.34 4.233c-45.69 20.86-79.56 27.94-107.8 27.94c-59.96 0-94.81-31.86-163.9-31.87C160.9 .3055 131.6 4.867 96 15.75v350.5c32-9.984 59.87-14.1 84.85-14.1c73.63 0 124.9 31.78 198.6 31.78c31.91 0 68.02-5.971 111.1-23.09C504.1 355.9 512 344.4 512 332.1V30.73C512 11.1 495.3 0 476.3 0z"})})},foods:{outline:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:tb("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9"})}),solid:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:tb("path",{d:"M481.9 270.1C490.9 279.1 496 291.3 496 304C496 316.7 490.9 328.9 481.9 337.9C472.9 346.9 460.7 352 448 352H64C51.27 352 39.06 346.9 30.06 337.9C21.06 328.9 16 316.7 16 304C16 291.3 21.06 279.1 30.06 270.1C39.06 261.1 51.27 256 64 256H448C460.7 256 472.9 261.1 481.9 270.1zM475.3 388.7C478.3 391.7 480 395.8 480 400V416C480 432.1 473.3 449.3 461.3 461.3C449.3 473.3 432.1 480 416 480H96C79.03 480 62.75 473.3 50.75 461.3C38.74 449.3 32 432.1 32 416V400C32 395.8 33.69 391.7 36.69 388.7C39.69 385.7 43.76 384 48 384H464C468.2 384 472.3 385.7 475.3 388.7zM50.39 220.8C45.93 218.6 42.03 215.5 38.97 211.6C35.91 207.7 33.79 203.2 32.75 198.4C31.71 193.5 31.8 188.5 32.99 183.7C54.98 97.02 146.5 32 256 32C365.5 32 457 97.02 479 183.7C480.2 188.5 480.3 193.5 479.2 198.4C478.2 203.2 476.1 207.7 473 211.6C469.1 215.5 466.1 218.6 461.6 220.8C457.2 222.9 452.3 224 447.3 224H64.67C59.73 224 54.84 222.9 50.39 220.8zM372.7 116.7C369.7 119.7 368 123.8 368 128C368 131.2 368.9 134.3 370.7 136.9C372.5 139.5 374.1 141.6 377.9 142.8C380.8 143.1 384 144.3 387.1 143.7C390.2 143.1 393.1 141.6 395.3 139.3C397.6 137.1 399.1 134.2 399.7 131.1C400.3 128 399.1 124.8 398.8 121.9C397.6 118.1 395.5 116.5 392.9 114.7C390.3 112.9 387.2 111.1 384 111.1C379.8 111.1 375.7 113.7 372.7 116.7V116.7zM244.7 84.69C241.7 87.69 240 91.76 240 96C240 99.16 240.9 102.3 242.7 104.9C244.5 107.5 246.1 109.6 249.9 110.8C252.8 111.1 256 112.3 259.1 111.7C262.2 111.1 265.1 109.6 267.3 107.3C269.6 105.1 271.1 102.2 271.7 99.12C272.3 96.02 271.1 92.8 270.8 89.88C269.6 86.95 267.5 84.45 264.9 82.7C262.3 80.94 259.2 79.1 256 79.1C251.8 79.1 247.7 81.69 244.7 84.69V84.69zM116.7 116.7C113.7 119.7 112 123.8 112 128C112 131.2 112.9 134.3 114.7 136.9C116.5 139.5 118.1 141.6 121.9 142.8C124.8 143.1 128 144.3 131.1 143.7C134.2 143.1 137.1 141.6 139.3 139.3C141.6 137.1 143.1 134.2 143.7 131.1C144.3 128 143.1 124.8 142.8 121.9C141.6 118.1 139.5 116.5 136.9 114.7C134.3 112.9 131.2 111.1 128 111.1C123.8 111.1 119.7 113.7 116.7 116.7L116.7 116.7z"})})},frequent:{outline:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[tb("path",{d:"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"}),tb("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"})]}),solid:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:tb("path",{d:"M256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512zM232 256C232 264 236 271.5 242.7 275.1L338.7 339.1C349.7 347.3 364.6 344.3 371.1 333.3C379.3 322.3 376.3 307.4 365.3 300L280 243.2V120C280 106.7 269.3 96 255.1 96C242.7 96 231.1 106.7 231.1 120L232 256z"})})},nature:{outline:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[tb("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8"}),tb("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235"})]}),solid:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",children:tb("path",{d:"M332.7 19.85C334.6 8.395 344.5 0 356.1 0C363.6 0 370.6 3.52 375.1 9.502L392 32H444.1C456.8 32 469.1 37.06 478.1 46.06L496 64H552C565.3 64 576 74.75 576 88V112C576 156.2 540.2 192 496 192H426.7L421.6 222.5L309.6 158.5L332.7 19.85zM448 64C439.2 64 432 71.16 432 80C432 88.84 439.2 96 448 96C456.8 96 464 88.84 464 80C464 71.16 456.8 64 448 64zM416 256.1V480C416 497.7 401.7 512 384 512H352C334.3 512 320 497.7 320 480V364.8C295.1 377.1 268.8 384 240 384C211.2 384 184 377.1 160 364.8V480C160 497.7 145.7 512 128 512H96C78.33 512 64 497.7 64 480V249.8C35.23 238.9 12.64 214.5 4.836 183.3L.9558 167.8C-3.331 150.6 7.094 133.2 24.24 128.1C41.38 124.7 58.76 135.1 63.05 152.2L66.93 167.8C70.49 182 83.29 191.1 97.97 191.1H303.8L416 256.1z"})})},objects:{outline:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[tb("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z"}),tb("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789"})]}),solid:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:tb("path",{d:"M112.1 454.3c0 6.297 1.816 12.44 5.284 17.69l17.14 25.69c5.25 7.875 17.17 14.28 26.64 14.28h61.67c9.438 0 21.36-6.401 26.61-14.28l17.08-25.68c2.938-4.438 5.348-12.37 5.348-17.7L272 415.1h-160L112.1 454.3zM191.4 .0132C89.44 .3257 16 82.97 16 175.1c0 44.38 16.44 84.84 43.56 115.8c16.53 18.84 42.34 58.23 52.22 91.45c.0313 .25 .0938 .5166 .125 .7823h160.2c.0313-.2656 .0938-.5166 .125-.7823c9.875-33.22 35.69-72.61 52.22-91.45C351.6 260.8 368 220.4 368 175.1C368 78.61 288.9-.2837 191.4 .0132zM192 96.01c-44.13 0-80 35.89-80 79.1C112 184.8 104.8 192 96 192S80 184.8 80 176c0-61.76 50.25-111.1 112-111.1c8.844 0 16 7.159 16 16S200.8 96.01 192 96.01z"})})},people:{outline:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[tb("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10"}),tb("path",{d:"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0"})]}),solid:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:tb("path",{d:"M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256 432C332.1 432 396.2 382 415.2 314.1C419.1 300.4 407.8 288 393.6 288H118.4C104.2 288 92.92 300.4 96.76 314.1C115.8 382 179.9 432 256 432V432zM176.4 160C158.7 160 144.4 174.3 144.4 192C144.4 209.7 158.7 224 176.4 224C194 224 208.4 209.7 208.4 192C208.4 174.3 194 160 176.4 160zM336.4 224C354 224 368.4 209.7 368.4 192C368.4 174.3 354 160 336.4 160C318.7 160 304.4 174.3 304.4 192C304.4 209.7 318.7 224 336.4 224z"})})},places:{outline:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[tb("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5"}),tb("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z"})]}),solid:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:tb("path",{d:"M39.61 196.8L74.8 96.29C88.27 57.78 124.6 32 165.4 32H346.6C387.4 32 423.7 57.78 437.2 96.29L472.4 196.8C495.6 206.4 512 229.3 512 256V448C512 465.7 497.7 480 480 480H448C430.3 480 416 465.7 416 448V400H96V448C96 465.7 81.67 480 64 480H32C14.33 480 0 465.7 0 448V256C0 229.3 16.36 206.4 39.61 196.8V196.8zM109.1 192H402.9L376.8 117.4C372.3 104.6 360.2 96 346.6 96H165.4C151.8 96 139.7 104.6 135.2 117.4L109.1 192zM96 256C78.33 256 64 270.3 64 288C64 305.7 78.33 320 96 320C113.7 320 128 305.7 128 288C128 270.3 113.7 256 96 256zM416 320C433.7 320 448 305.7 448 288C448 270.3 433.7 256 416 256C398.3 256 384 270.3 384 288C384 305.7 398.3 320 416 320z"})})},symbols:{outline:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:tb("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76"})}),solid:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",children:tb("path",{d:"M500.3 7.251C507.7 13.33 512 22.41 512 31.1V175.1C512 202.5 483.3 223.1 447.1 223.1C412.7 223.1 383.1 202.5 383.1 175.1C383.1 149.5 412.7 127.1 447.1 127.1V71.03L351.1 90.23V207.1C351.1 234.5 323.3 255.1 287.1 255.1C252.7 255.1 223.1 234.5 223.1 207.1C223.1 181.5 252.7 159.1 287.1 159.1V63.1C287.1 48.74 298.8 35.61 313.7 32.62L473.7 .6198C483.1-1.261 492.9 1.173 500.3 7.251H500.3zM74.66 303.1L86.5 286.2C92.43 277.3 102.4 271.1 113.1 271.1H174.9C185.6 271.1 195.6 277.3 201.5 286.2L213.3 303.1H239.1C266.5 303.1 287.1 325.5 287.1 351.1V463.1C287.1 490.5 266.5 511.1 239.1 511.1H47.1C21.49 511.1-.0019 490.5-.0019 463.1V351.1C-.0019 325.5 21.49 303.1 47.1 303.1H74.66zM143.1 359.1C117.5 359.1 95.1 381.5 95.1 407.1C95.1 434.5 117.5 455.1 143.1 455.1C170.5 455.1 191.1 434.5 191.1 407.1C191.1 381.5 170.5 359.1 143.1 359.1zM440.3 367.1H496C502.7 367.1 508.6 372.1 510.1 378.4C513.3 384.6 511.6 391.7 506.5 396L378.5 508C372.9 512.1 364.6 513.3 358.6 508.9C352.6 504.6 350.3 496.6 353.3 489.7L391.7 399.1H336C329.3 399.1 323.4 395.9 321 389.6C318.7 383.4 320.4 376.3 325.5 371.1L453.5 259.1C459.1 255 467.4 254.7 473.4 259.1C479.4 263.4 481.6 271.4 478.7 278.3L440.3 367.1zM116.7 219.1L19.85 119.2C-8.112 90.26-6.614 42.31 24.85 15.34C51.82-8.137 93.26-3.642 118.2 21.83L128.2 32.32L137.7 21.83C162.7-3.642 203.6-8.137 231.6 15.34C262.6 42.31 264.1 90.26 236.1 119.2L139.7 219.1C133.2 225.6 122.7 225.6 116.7 219.1H116.7z"})})}},search:{loupe:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:tb("path",{d:"M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"})}),delete:tb("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:tb("path",{d:"M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z"})})}};function Eb(e){let{id:t,skin:n,emoji:r}=e;if(e.shortcodes){const r=e.shortcodes.match(fb.SHORTCODES_REGEX);r&&(t=r[1],r[2]&&(n=r[2]))}if(r||(r=fb.get(t||e.native)),!r)return e.fallback;const i=r.skins[n-1]||r.skins[0],o=i.src||("native"==e.set||e.spritesheet?void 0:"function"==typeof e.getImageURL?e.getImageURL(e.set,i.unified):`https://cdn.jsdelivr.net/npm/emoji-datasource-${e.set}@14.0.0/img/${e.set}/64/${i.unified}.png`),s="function"==typeof e.getSpritesheetURL?e.getSpritesheetURL(e.set):`https://cdn.jsdelivr.net/npm/emoji-datasource-${e.set}@14.0.0/img/${e.set}/sheets-256/64.png`;return tb("span",{class:"emoji-mart-emoji","data-emoji-set":e.set,children:o?tb("img",{style:{height:e.size||"1em",width:"auto",display:"inline-block",position:"relative",top:".1em"},alt:i.native||i.shortcodes,src:o}):"native"==e.set?tb("span",{style:{fontSize:e.size,fontFamily:'"EmojiMart", "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Android Emoji"'},children:i.native}):tb("span",{style:{display:"block",width:e.size,height:e.size,backgroundImage:`url(${s})`,backgroundSize:`${100*yb.sheet.cols}% ${100*yb.sheet.rows}%`,backgroundPosition:`${100/(yb.sheet.cols-1)*i.x}% ${100/(yb.sheet.rows-1)*i.y}%`}})})}const Cb="undefined"!=typeof window?window.HTMLElement:Object;class Tb extends Cb{static get observedAttributes(){return Object.keys(this.Props)}update(e={}){for(let t in e)this.attributeChangedCallback(t,null,e[t])}attributeChangedCallback(e,t,n){if(!this.component)return;const r=Db(e,{[e]:n},this.constructor.Props,this);this.component.componentWillReceiveProps?this.component.componentWillReceiveProps({[e]:r}):(this.component.props[e]=r,this.component.forceUpdate())}constructor(e={}){if(super(),this.props=e,e.parent||e.ref){let t=null;const n=e.parent||(t=e.ref&&e.ref.current);t&&(t.innerHTML=""),n&&n.appendChild(this)}}}class Ob extends Tb{setShadow(){this.attachShadow({mode:"open"})}injectStyles(e){if(!e)return;const t=document.createElement("style");t.textContent=e,this.shadowRoot.insertBefore(t,this.shadowRoot.firstChild)}constructor(e,{styles:t}={}){super(e),this.setShadow(),this.injectStyles(t)}}var Sb={fallback:"",id:"",native:"",shortcodes:"",size:"",set:rb.set,skin:rb.skin};class Ab extends Tb{async connectedCallback(){const e=Mb(this.props,Sb,this);e.element=this,e.ref=e=>{this.component=e},await xb(),Zy(tb(Eb,{...e}),this)}constructor(e){super(e)}}wy(Ab,"Props",Sb),"undefined"==typeof customElements||customElements.get("em-emoji")||customElements.define("em-emoji",Ab);var Nb,_b=[],jb=My.__b,Ib=My.__r,Lb=My.diffed,zb=My.__c,Pb=My.unmount;function Fb(){var e;for(_b.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=_b.pop();)if(e.__P)try{e.__H.__h.forEach(Bb),e.__H.__h.forEach(Ub),e.__H.__h=[]}catch(t){e.__H.__h=[],My.__e(t,e.__v)}}My.__b=function(e){jb&&jb(e)},My.__r=function(e){Ib&&Ib(e);var t=e.__c.__H;t&&(t.__h.forEach(Bb),t.__h.forEach(Ub),t.__h=[])},My.diffed=function(e){Lb&&Lb(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==_b.push(t)&&Nb===My.requestAnimationFrame||((Nb=My.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),Rb&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Rb&&(t=requestAnimationFrame(n))})(Fb))},My.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Bb),e.__h=e.__h.filter((function(e){return!e.__||Ub(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],My.__e(n,e.__v)}})),zb&&zb(e,t)},My.unmount=function(e){Pb&&Pb(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Bb(e)}catch(e){t=e}})),t&&My.__e(t,n.__v))};var Rb="function"==typeof requestAnimationFrame;function Bb(e){var t=e.__c;"function"==typeof t&&(e.__c=void 0,t())}function Ub(e){e.__c=e.__()}function Hb(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function $b(e){this.props=e}($b.prototype=new Ly).isPureReactComponent=!0,$b.prototype.shouldComponentUpdate=function(e,t){return Hb(this.props,e)||Hb(this.state,t)};var Vb=My.__b;My.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Vb&&Vb(e)};var Wb=My.__e;My.__e=function(e,t,n){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);Wb(e,t,n)};var qb=My.unmount;function Yb(){this.__u=0,this.t=null,this.__b=null}function Qb(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function Kb(){this.u=null,this.o=null}My.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),qb&&qb(e)},(Yb.prototype=new Ly).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var i=Qb(r.__v),o=!1,s=function(){o||(o=!0,n.__R=null,i?i(a):a())};n.__R=s;var a=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},l=!0===t.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(s,s)},Yb.prototype.componentWillUnmount=function(){this.t=[]},Yb.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=function(e,t){for(var n in t)e[n]=t[n];return e}({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__e&&_y(Iy,null,e.fallback);return i&&(i.__h=null),[_y(Iy,null,t.__e?null:e.children),i]};var Gb=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};(Kb.prototype=new Ly).__e=function(e){var t=this,n=Qb(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),Gb(t,e,r)):i()};n?n(o):o()}},Kb.prototype.render=function(e){this.u=null,this.o=new Map;var t=Hy(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Kb.prototype.componentDidUpdate=Kb.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){Gb(e,n,t)}))};var Jb="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Xb=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Zb="undefined"!=typeof document,ev=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};Ly.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(Ly.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var tv=My.event;function nv(){}function rv(){return this.cancelBubble}function iv(){return this.defaultPrevented}My.event=function(e){return tv&&(e=tv(e)),e.persist=nv,e.isPropagationStopped=rv,e.isDefaultPrevented=iv,e.nativeEvent=e};var ov={configurable:!0,get:function(){return this.class}},sv=My.vnode;My.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var o in r={},n){var s=n[o];Zb&&"children"===o&&"noscript"===t||"value"===o&&"defaultValue"in n&&null==s||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===s?s="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!ev(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():i&&Xb.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===s&&(s=void 0),r[o]=s)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=Hy(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=Hy(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(ov.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",ov))}e.$$typeof=Jb,sv&&sv(e)};var av=My.__r;My.__r=function(e){av&&av(e),e.__c};const lv={light:"outline",dark:"solid"};class uv extends $b{renderIcon(e){const{icon:t}=e;if(t){if(t.svg)return tb("span",{class:"flex",dangerouslySetInnerHTML:{__html:t.svg}});if(t.src)return tb("img",{src:t.src})}const n=kb.categories[e.id]||kb.categories.custom;return n["auto"==this.props.icons?lv[this.props.theme]:this.props.icons]||n}render(){let e=null;return tb("nav",{id:"nav",class:"padding","data-position":this.props.position,children:tb("div",{class:"flex relative",children:[this.categories.map(((t,n)=>{const r=t.name||gb.categories[t.id],i=!this.props.unfocused&&t.id==this.state.categoryId;return i&&(e=n),tb("button",{"aria-label":r,"aria-selected":i||void 0,title:r,type:"button",class:"flex flex-grow flex-center",onMouseDown:e=>e.preventDefault(),onClick:()=>{this.props.onClick({category:t,i:n})},children:this.renderIcon(t)})})),tb("div",{class:"bar",style:{width:`${100/this.categories.length}%`,opacity:null==e?0:1,transform:`translateX(${100*e}%)`}})]})})}constructor(){super(),this.categories=yb.categories.filter((e=>!e.target)),this.state={categoryId:this.categories[0].id}}}class cv extends $b{shouldComponentUpdate(e){for(let t in e)if("children"!=t&&e[t]!=this.props[t])return!0;return!1}render(){return this.props.children}}const dv=10;class pv extends Ly{getInitialState(e=this.props){return{skin:ib.get("skin")||e.skin,theme:this.initTheme(e.theme)}}componentWillMount(){this.observers=[],this.dir=gb.rtl?"rtl":"ltr",this.refs={menu:{current:null},navigation:{current:null},scroll:{current:null},search:{current:null},searchInput:{current:null},skinToneButton:{current:null},skinToneRadio:{current:null}},this.initGrid(),0==this.props.stickySearch&&"sticky"==this.props.searchPosition&&(console.warn("[EmojiMart] Deprecation warning: `stickySearch` has been renamed `searchPosition`."),this.props.searchPosition="static")}componentDidMount(){if(this.register(),this.shadowRoot=this.base.parentNode,this.props.autoFocus){const{searchInput:e}=this.refs;e.current&&e.current.focus()}}componentWillReceiveProps(e){let t=null;for(const n in e)this.props[n]=e[n],"custom"===n||"categories"===n?this.reset():n in this.state&&(t||(t=this.getInitialState()),this.setState({[n]:t[n]}))}componentWillUnmount(){this.unregister()}reset(){xb(this.props),this.initGrid(),this.unobserve(),this.forceUpdate((()=>{this.observeCategories(),this.observeRows()}))}register(){document.addEventListener("click",this.handleClickOutside),this.observe()}unregister(){document.removeEventListener("click",this.handleClickOutside),this.unobserve()}observe(){this.observeCategories(),this.observeRows()}unobserve(){for(const e of this.observers)e.disconnect()}initGrid(){const{categories:e}=yb;this.refs.categories=new Map;const t=yb.categories.map((e=>e.id)).join(",");this.navKey&&this.navKey!=t&&this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0),this.navKey=t,this.grid=[],this.grid.setsize=0;const n=(e,t)=>{const n=[];n.__categoryId=t.id,n.__index=e.length,this.grid.push(n);const r=this.grid.length-1,i=r%dv?{}:{current:null};return i.index=r,i.posinset=this.grid.setsize+1,e.push(i),n};for(let t of e){const e=[];let r=n(e,t);for(let i of t.emojis)r.length==this.props.perLine&&(r=n(e,t)),this.grid.setsize+=1,r.push(i);this.refs.categories.set(t.id,{root:{current:null},rows:e})}}initTheme(e){if("auto"!=e)return e;if(!this.darkMedia){if(this.darkMedia=matchMedia("(prefers-color-scheme: dark)"),this.darkMedia.media.match(/^not/))return"light";this.darkMedia.addListener((()=>{"auto"==this.props.theme&&this.setState({theme:this.darkMedia.matches?"dark":"light"})}))}return this.darkMedia.matches?"dark":"light"}getEmojiByPos([e,t]){const n=this.state.searchResults||this.grid,r=n[e]&&n[e][t];if(r)return fb.get(r)}observeCategories(){const e=this.refs.navigation.current;if(!e)return;const t=new Map,n=t=>{t!=e.state.categoryId&&e.setState({categoryId:t})},r={root:this.refs.scroll.current,threshold:[0,1]},i=new IntersectionObserver((e=>{for(const n of e){const e=n.target.dataset.id;t.set(e,n.intersectionRatio)}const r=[...t],i=r[r.length-1];if(1==i[1])return n(i[0]);for(const[e,t]of r)if(t){n(e);break}}),r);for(const{root:e}of this.refs.categories.values())i.observe(e.current);this.observers.push(i)}observeRows(){const e={...this.state.visibleRows},t=new IntersectionObserver((t=>{for(const n of t){const t=parseInt(n.target.dataset.index);n.isIntersecting?e[t]=!0:delete e[t]}this.setState({visibleRows:e})}),{root:this.refs.scroll.current,rootMargin:`${this.props.emojiButtonSize*(dv+5)}px 0px ${this.props.emojiButtonSize*dv}px`});for(const{rows:e}of this.refs.categories.values())for(const n of e)n.current&&t.observe(n.current);this.observers.push(t)}preventDefault(e){e.preventDefault()}unfocusSearch(){const e=this.refs.searchInput.current;e&&e.blur()}navigate({e:e,input:t,left:n,right:r,up:i,down:o}){const s=this.state.searchResults||this.grid;if(!s.length)return;let[a,l]=this.state.pos;const u=(()=>{if(0==a&&0==l&&!e.repeat&&(n||i))return null;if(-1==a)return e.repeat||!r&&!o||t.selectionStart!=t.value.length?null:[0,0];if(n||r){let e=s[a];const t=n?-1:1;if(l+=t,!e[l]){if(a+=t,e=s[a],!e)return a=n?0:s.length-1,l=n?0:s[a].length-1,[a,l];l=n?e.length-1:0}return[a,l]}if(i||o){a+=i?-1:1;const e=s[a];return e?(e[l]||(l=e.length-1),[a,l]):(a=i?0:s.length-1,l=i?0:s[a].length-1,[a,l])}})();u?(e.preventDefault(),this.setState({pos:u,keyboard:!0},(()=>{this.scrollTo({row:u[0]})}))):this.state.pos[0]>-1&&this.setState({pos:[-1,-1]})}scrollTo({categoryId:e,row:t}){const n=this.state.searchResults||this.grid;if(!n.length)return;const r=this.refs.scroll.current,i=r.getBoundingClientRect();let o=0;if(t>=0&&(e=n[t].__categoryId),e){o=(this.refs[e]||this.refs.categories.get(e).root).current.getBoundingClientRect().top-(i.top-r.scrollTop)+1}if(t>=0)if(t){const e=o+n[t].__index*this.props.emojiButtonSize,s=e+this.props.emojiButtonSize+.88*this.props.emojiButtonSize;if(e<r.scrollTop)o=e;else{if(!(s>r.scrollTop+i.height))return;o=s-i.height}}else o=0;this.ignoreMouse(),r.scrollTop=o}ignoreMouse(){this.mouseIsIgnored=!0,clearTimeout(this.ignoreMouseTimer),this.ignoreMouseTimer=setTimeout((()=>{delete this.mouseIsIgnored}),100)}handleEmojiOver(e){this.mouseIsIgnored||this.state.showSkins||this.setState({pos:e||[-1,-1],keyboard:!1})}handleEmojiClick({emoji:e,pos:t}){if(this.props.onEmojiSelect&&(!e&&t&&(e=this.getEmojiByPos(t)),e)){const t=e.skins[this.state.skin-1]||e.skins[0],n={id:e.id,name:e.name,native:t.native,unified:t.unified,keywords:e.keywords,shortcodes:t.shortcodes||e.shortcodes};t.src&&(n.src=t.src),e.aliases&&e.aliases.length&&(n.aliases=e.aliases),e.emoticons&&e.emoticons.length&&(n.emoticons=e.emoticons),this.props.maxFrequentRows&&pb.add(n,this.props),this.props.onEmojiSelect(n)}}closeSkins(){this.state.showSkins&&(this.setState({showSkins:null,tempSkin:null}),this.base.removeEventListener("click",this.handleBaseClick),this.base.removeEventListener("keydown",this.handleBaseKeydown))}handleSkinMouseOver(e){this.setState({tempSkin:e})}handleSkinClick(e){this.ignoreMouse(),this.closeSkins(),this.setState({skin:e,tempSkin:null}),ib.set("skin",e)}renderNav(){return tb(uv,{ref:this.refs.navigation,icons:this.props.icons,theme:this.state.theme,unfocused:!!this.state.searchResults,position:this.props.navPosition,onClick:this.handleCategoryClick},this.navKey)}renderPreview(){const e=this.getEmojiByPos(this.state.pos),t=this.state.searchResults&&!this.state.searchResults.length;return tb("div",{id:"preview",class:"flex flex-middle",dir:this.dir,"data-position":this.props.previewPosition,children:[tb("div",{class:"flex flex-middle flex-grow",children:[tb("div",{class:"flex flex-auto flex-middle flex-center",style:{height:this.props.emojiButtonSize,fontSize:this.props.emojiButtonSize},children:tb(Eb,{emoji:e,id:t?this.props.noResultsEmoji||"cry":this.props.previewEmoji||("top"==this.props.previewPosition?"point_down":"point_up"),set:this.props.set,size:this.props.emojiButtonSize,skin:this.state.tempSkin||this.state.skin,spritesheet:!0,getSpritesheetURL:this.props.getSpritesheetURL})}),tb("div",{class:`margin-${this.dir[0]}`,children:tb("div",e?{class:`padding-${this.dir[2]} align-${this.dir[0]}`,children:[tb("div",{class:"ellipsis",style:{fontSize:"1.1em"},children:e.name}),tb("div",{class:"ellipsis color-c",style:{fontSize:".9em"},children:e.skins[0].shortcodes})]}:t?{class:`padding-${this.dir[2]} align-${this.dir[0]}`,children:[tb("div",{class:"ellipsis",style:{fontSize:"1.1em"},children:gb.search_no_results_1}),tb("div",{class:"ellipsis color-c",style:{fontSize:".9em"},children:gb.search_no_results_2})]}:{class:"color-c",style:{fontSize:21},children:gb.pick})})]}),!e&&"preview"==this.props.skinTonePosition&&this.renderSkinToneButton()]})}renderEmojiButton(e,{pos:t,posinset:n,grid:r}){const i=this.props.emojiButtonSize,o=this.state.tempSkin||this.state.skin,s=(e.skins[o-1]||e.skins[0]).native,a=function(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every(((e,n)=>e==t[n]))}(this.state.pos,t),l=t.concat(e.id).join("");return tb(cv,{selected:a,skin:o,size:i,children:tb("button",{"aria-label":s,"aria-selected":a||void 0,"aria-posinset":n,"aria-setsize":r.setsize,"data-keyboard":this.state.keyboard,title:"none"==this.props.previewPosition?e.name:void 0,type:"button",class:"flex flex-center flex-middle",tabindex:"-1",onClick:()=>this.handleEmojiClick({emoji:e}),onMouseEnter:()=>this.handleEmojiOver(t),onMouseLeave:()=>this.handleEmojiOver(),style:{width:this.props.emojiButtonSize,height:this.props.emojiButtonSize,fontSize:this.props.emojiSize,lineHeight:0},children:[tb("div",{"aria-hidden":"true",class:"background",style:{borderRadius:this.props.emojiButtonRadius,backgroundColor:this.props.emojiButtonColors?this.props.emojiButtonColors[(n-1)%this.props.emojiButtonColors.length]:void 0}}),tb(Eb,{emoji:e,set:this.props.set,size:this.props.emojiSize,skin:o,spritesheet:!0,getSpritesheetURL:this.props.getSpritesheetURL})]})},l)}renderSearch(){const e="none"==this.props.previewPosition||"search"==this.props.skinTonePosition;return tb("div",{children:[tb("div",{class:"spacer"}),tb("div",{class:"flex flex-middle",children:[e&&"rtl"==this.dir&&this.renderSkinToneButton(),tb("div",{class:"search relative flex-grow",children:[tb("input",{type:"search",ref:this.refs.searchInput,placeholder:gb.search,onClick:this.handleSearchClick,onInput:this.handleSearchInput,onKeyDown:this.handleSearchKeyDown}),tb("span",{class:"icon loupe flex",children:kb.search.loupe}),this.state.searchResults&&tb("button",{title:"Clear","aria-label":"Clear",type:"button",class:"icon delete flex",onClick:this.clearSearch,onMouseDown:this.preventDefault,children:kb.search.delete})]}),e&&"ltr"==this.dir&&this.renderSkinToneButton()]})]})}renderSearchResults(){const{searchResults:e}=this.state;return e?tb("div",{class:"category",ref:this.refs.search,children:[tb("div",{class:`sticky padding-small align-${this.dir[0]}`,children:gb.categories.search}),tb("div",{children:e.length?e.map(((t,n)=>tb("div",{class:"flex",children:t.map(((t,r)=>this.renderEmojiButton(t,{pos:[n,r],posinset:n*this.props.perLine+r+1,grid:e})))}))):tb("div",{class:`padding-small align-${this.dir[0]}`,children:this.props.onAddCustomEmoji&&tb("a",{onClick:this.props.onAddCustomEmoji,children:gb.add_custom})})})]}):null}renderCategories(){const{categories:e}=yb,t=!!this.state.searchResults;return tb("div",{style:{visibility:t?"hidden":void 0,display:t?"none":void 0},children:e.map((e=>{const{root:t,rows:n}=this.refs.categories.get(e.id);return tb("div",{"data-id":e.target?e.target.id:e.id,class:"category",ref:t,children:[tb("div",{class:`sticky padding-small align-${this.dir[0]}`,children:e.name||gb.categories[e.id]}),tb("div",{class:"relative",style:{height:n.length*this.props.emojiButtonSize},children:n.map(((t,n)=>{const r=t.index-t.index%dv,i=this.state.visibleRows[r],o="current"in t?t:void 0;if(!i&&!o)return null;const s=n*this.props.perLine,a=s+this.props.perLine,l=e.emojis.slice(s,a);return tb("div",{"data-index":t.index,ref:o,class:"flex row",style:{top:n*this.props.emojiButtonSize},children:i&&l.map(((e,n)=>{const r=fb.get(e);return this.renderEmojiButton(r,{pos:[t.index,n],posinset:t.posinset+n,grid:this.grid})}))},t.index)}))})]})}))})}renderSkinToneButton(){return"none"==this.props.skinTonePosition?null:tb("div",{class:"flex flex-auto flex-center flex-middle",style:{position:"relative",width:this.props.emojiButtonSize,height:this.props.emojiButtonSize},children:tb("button",{type:"button",ref:this.refs.skinToneButton,class:"skin-tone-button flex flex-auto flex-center flex-middle","aria-selected":this.state.showSkins?"":void 0,"aria-label":gb.skins.choose,title:gb.skins.choose,onClick:this.openSkins,style:{width:this.props.emojiSize,height:this.props.emojiSize},children:tb("span",{class:`skin-tone skin-tone-${this.state.skin}`})})})}renderSkins(){const e=this.refs.skinToneButton.current.getBoundingClientRect(),t=this.base.getBoundingClientRect(),n={};return"ltr"==this.dir?n.right=t.right-e.right-3:n.left=e.left-t.left-3,"bottom"==this.props.previewPosition&&"preview"==this.props.skinTonePosition?n.bottom=t.bottom-e.top+6:(n.top=e.bottom-t.top+3,n.bottom="auto"),tb("div",{ref:this.refs.menu,role:"radiogroup",dir:this.dir,"aria-label":gb.skins.choose,class:"menu hidden","data-position":n.top?"top":"bottom",style:n,children:[...Array(6).keys()].map((e=>{const t=e+1,n=this.state.skin==t;return tb("div",{children:[tb("input",{type:"radio",name:"skin-tone",value:t,"aria-label":gb.skins[t],ref:n?this.refs.skinToneRadio:null,defaultChecked:n,onChange:()=>this.handleSkinMouseOver(t),onKeyDown:e=>{"Enter"!=e.code&&"Space"!=e.code&&"Tab"!=e.code||(e.preventDefault(),this.handleSkinClick(t))}}),tb("button",{"aria-hidden":"true",tabindex:"-1",onClick:()=>this.handleSkinClick(t),onMouseEnter:()=>this.handleSkinMouseOver(t),onMouseLeave:()=>this.handleSkinMouseOver(),class:"option flex flex-grow flex-middle",children:[tb("span",{class:`skin-tone skin-tone-${t}`}),tb("span",{class:"margin-small-lr",children:gb.skins[t]})]})]})}))})}render(){return tb("section",{id:"root",class:"flex flex-column",style:{width:this.props.perLine*this.props.emojiButtonSize+28},"data-emoji-set":this.props.set,"data-theme":this.state.theme,"data-menu":this.state.showSkins?"":void 0,children:["top"==this.props.previewPosition&&this.renderPreview(),"top"==this.props.navPosition&&this.renderNav(),"sticky"==this.props.searchPosition&&tb("div",{class:"padding-lr",children:this.renderSearch()}),tb("div",{ref:this.refs.scroll,class:"scroll flex-grow padding-lr",children:tb("div",{style:{width:this.props.perLine*this.props.emojiButtonSize},children:["static"==this.props.searchPosition&&this.renderSearch(),this.renderSearchResults(),this.renderCategories(),tb("div",{class:"spacer"})]})}),"bottom"==this.props.navPosition&&this.renderNav(),"bottom"==this.props.previewPosition&&this.renderPreview(),this.state.showSkins&&this.renderSkins()]})}constructor(e){super(),wy(this,"handleClickOutside",(e=>{const{element:t}=this.props;e.target!=t&&(this.state.showSkins&&this.closeSkins(),this.props.onClickOutside&&this.props.onClickOutside())})),wy(this,"handleBaseClick",(e=>{this.state.showSkins&&(e.target.closest(".menu")||(e.preventDefault(),e.stopImmediatePropagation(),this.closeSkins()))})),wy(this,"handleBaseKeydown",(e=>{this.state.showSkins&&"Escape"==e.key&&(e.preventDefault(),e.stopImmediatePropagation(),this.closeSkins())})),wy(this,"handleSearchClick",(()=>{this.getEmojiByPos(this.state.pos)&&this.setState({pos:[-1,-1]})})),wy(this,"handleSearchInput",(async()=>{const e=this.refs.searchInput.current;if(!e)return;const{value:t}=e,n=await fb.search(t),r=()=>{this.refs.scroll.current&&(this.refs.scroll.current.scrollTop=0)};if(!n)return this.setState({searchResults:n,pos:[-1,-1]},r);const i=e.selectionStart==e.value.length?[0,0]:[-1,-1],o=[];o.setsize=n.length;let s=null;for(let e of n)o.length&&s.length!=this.props.perLine||(s=[],s.__categoryId="search",s.__index=o.length,o.push(s)),s.push(e);this.ignoreMouse(),this.setState({searchResults:o,pos:i},r)})),wy(this,"handleSearchKeyDown",(e=>{const t=e.currentTarget;switch(e.stopImmediatePropagation(),e.key){case"ArrowLeft":this.navigate({e:e,input:t,left:!0});break;case"ArrowRight":this.navigate({e:e,input:t,right:!0});break;case"ArrowUp":this.navigate({e:e,input:t,up:!0});break;case"ArrowDown":this.navigate({e:e,input:t,down:!0});break;case"Enter":e.preventDefault(),this.handleEmojiClick({pos:this.state.pos});break;case"Escape":e.preventDefault(),this.state.searchResults?this.clearSearch():this.unfocusSearch()}})),wy(this,"clearSearch",(()=>{const e=this.refs.searchInput.current;e&&(e.value="",e.focus(),this.handleSearchInput())})),wy(this,"handleCategoryClick",(({category:e,i:t})=>{this.scrollTo(0==t?{row:-1}:{categoryId:e.id})})),wy(this,"openSkins",(e=>{const{currentTarget:t}=e,n=t.getBoundingClientRect();this.setState({showSkins:n},(async()=>{await async function(e=1){for(let t in[...Array(e).keys()])await new Promise(requestAnimationFrame)}(2);const e=this.refs.menu.current;e&&(e.classList.remove("hidden"),this.refs.skinToneRadio.current.focus(),this.base.addEventListener("click",this.handleBaseClick,!0),this.base.addEventListener("keydown",this.handleBaseKeydown,!0))}))})),this.state={pos:[-1,-1],visibleRows:{0:!0},...this.getInitialState(e)}}}class hv extends Ob{async connectedCallback(){const e=Mb(this.props,rb,this);e.element=this,e.ref=e=>{this.component=e},await xb(e),Zy(tb(pv,{...e}),this.shadowRoot)}disconnectedCallback(){this.component&&this.component.unregister()}constructor(e){super(e,{styles:vy(fv)})}}wy(hv,"Props",rb),"undefined"==typeof customElements||customElements.get("em-emoji-picker")||customElements.define("em-emoji-picker",hv);var fv={};fv=':host {\n display: flex;\n width: -webkit-min-content;\n width: -moz-min-content;\n width: min-content;\n height: 435px;\n min-height: 230px;\n border-radius: var(--border-radius);\n box-shadow: var(--shadow);\n --border-radius: 10px;\n --category-icon-size: 18px;\n --font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;\n --font-size: 15px;\n --shadow-color: 0deg 0% 0%;\n --shadow:\n 0.3px 0.5px 2.7px hsl(var(--shadow-color) / 0.14),\n 0.4px 0.8px 1px -3.2px hsl(var(--shadow-color) / 0.14),\n 1px 2px 2.5px -4.5px hsl(var(--shadow-color) / 0.14);\n}\n\n[data-theme=light] {\n --em-rgb-color: var(--rgb-color, 34, 36, 39);\n --em-rgb-accent: var(--rgb-accent, 34, 102, 237);\n --em-rgb-background: var(--rgb-background, 255, 255, 255);\n --em-rgb-input: var(--rgb-input, 255, 255, 255);\n --em-color-border: var(--color-border, rgba(0, 0, 0, .05));\n --em-color-border-over: var(--color-border-over, rgba(0, 0, 0, .1));\n}\n\n[data-theme=dark] {\n --em-rgb-color: var(--rgb-color, 222, 222, 221);\n --em-rgb-accent: var(--rgb-accent, 58, 130, 247);\n --em-rgb-background: var(--rgb-background, 21, 22, 23);\n --em-rgb-input: var(--rgb-input, 0, 0, 0);\n --em-color-border: var(--color-border, rgba(255, 255, 255, .1));\n --em-color-border-over: var(--color-border-over, rgba(255, 255, 255, .2));\n}\n\n#root {\n --color-a: rgb(var(--em-rgb-color));\n --color-b: rgba(var(--em-rgb-color), .65);\n --color-c: rgba(var(--em-rgb-color), .45);\n --padding: 12px;\n --padding-small: calc(var(--padding) / 2);\n --sidebar-width: 16px;\n --duration: 225ms;\n --duration-fast: 125ms;\n --duration-instant: 50ms;\n --easing: cubic-bezier(.4, .0, .2, 1);\n position: relative;\n width: 100%;\n text-align: left;\n border-radius: var(--border-radius);\n background-color: rgb(var(--em-rgb-background));\n}\n\n@media (prefers-reduced-motion) {\n #root {\n --duration: 0;\n --duration-fast: 0;\n --duration-instant: 0;\n }\n}\n\n#root[data-menu] button {\n cursor: auto;\n}\n\n#root[data-menu] .menu button {\n cursor: pointer;\n}\n\n:host, #root, input, button {\n color: rgb(var(--em-rgb-color));\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: normal;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n*, *:before, *:after {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n min-width: 0;\n}\n\n.relative {\n position: relative;\n}\n\n.flex {\n display: flex;\n}\n\n.flex-auto {\n flex: 0 0 auto;\n}\n\n.flex-center {\n justify-content: center;\n}\n\n.flex-column {\n flex-direction: column;\n}\n\n.flex-grow {\n flex: 1 1 auto;\n}\n\n.flex-middle {\n align-items: center;\n}\n\n.flex-wrap {\n flex-wrap: wrap;\n}\n\n.padding {\n padding: var(--padding);\n}\n\n.padding-t {\n padding-top: var(--padding);\n}\n\n.padding-lr {\n padding-left: var(--padding);\n padding-right: var(--padding);\n}\n\n.padding-r {\n padding-right: var(--padding);\n}\n\n.padding-small {\n padding: var(--padding-small);\n}\n\n.padding-small-b {\n padding-bottom: var(--padding-small);\n}\n\n.padding-small-lr {\n padding-left: var(--padding-small);\n padding-right: var(--padding-small);\n}\n\n.margin {\n margin: var(--padding);\n}\n\n.margin-r {\n margin-right: var(--padding);\n}\n\n.margin-l {\n margin-left: var(--padding);\n}\n\n.margin-small-l {\n margin-left: var(--padding-small);\n}\n\n.margin-small-lr {\n margin-left: var(--padding-small);\n margin-right: var(--padding-small);\n}\n\n.align-l {\n text-align: left;\n}\n\n.align-r {\n text-align: right;\n}\n\n.color-a {\n color: var(--color-a);\n}\n\n.color-b {\n color: var(--color-b);\n}\n\n.color-c {\n color: var(--color-c);\n}\n\n.ellipsis {\n white-space: nowrap;\n max-width: 100%;\n width: auto;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\na {\n cursor: pointer;\n color: rgb(var(--em-rgb-accent));\n}\n\na:hover {\n text-decoration: underline;\n}\n\n.spacer {\n height: 10px;\n}\n\n.scroll {\n overflow: auto;\n overflow-x: hidden;\n padding-right: 0;\n}\n\n.scroll::-webkit-scrollbar {\n width: var(--sidebar-width);\n height: var(--sidebar-width);\n}\n\n.scroll::-webkit-scrollbar-track {\n border: 0;\n}\n\n.scroll::-webkit-scrollbar-button {\n width: 0;\n height: 0;\n display: none;\n}\n\n.scroll::-webkit-scrollbar-corner {\n background-color: transparent;\n}\n\n.scroll::-webkit-scrollbar-thumb {\n min-height: 20%;\n min-height: 65px;\n border: 4px solid rgb(var(--em-rgb-background));\n border-radius: 8px;\n}\n\n.scroll::-webkit-scrollbar-thumb:hover {\n background-color: var(--em-color-border-over) !important;\n}\n\n.scroll:hover::-webkit-scrollbar-thumb {\n background-color: var(--em-color-border);\n}\n\n.sticky {\n position: -webkit-sticky;\n position: sticky;\n z-index: 1;\n top: -1px;\n font-weight: 500;\n background-color: rgba(var(--em-rgb-background), 0.9);\n -webkit-backdrop-filter: blur(4px);\n backdrop-filter: blur(4px);\n}\n\n.search {\n z-index: 2;\n position: relative;\n}\n\n.search input, .search button {\n font-size: calc(var(--font-size) - 1px);\n}\n\n.search input[type=search] {\n display: block;\n border: 0;\n outline: 0;\n width: 100%;\n padding: 10px 2em 10px 2.2em;\n border-radius: 10px;\n background-color: var(--em-color-border);\n transition-duration: var(--duration);\n transition-property: background-color, box-shadow;\n transition-timing-function: var(--easing);\n}\n\n.search input[type=search]::-moz-placeholder {\n color: inherit;\n opacity: 0.6;\n}\n\n.search input[type=search]:-ms-input-placeholder {\n color: inherit;\n opacity: 0.6;\n}\n\n.search input[type=search]::placeholder {\n color: inherit;\n opacity: 0.6;\n}\n\n.search input[type=search], .search input[type=search]::-webkit-search-decoration, .search input[type=search]::-webkit-search-cancel-button, .search input[type=search]::-webkit-search-results-button, .search input[type=search]::-webkit-search-results-decoration {\n -webkit-appearance: none;\n appearance: none;\n}\n\n.search input[type=search]:focus {\n background-color: rgb(var(--em-rgb-input));\n box-shadow: inset 0 0 0 1px rgb(var(--em-rgb-accent)), 0 1px 3px rgba(65, 69, 73, 0.2);\n}\n\n.search .icon {\n z-index: 1;\n position: absolute;\n top: 50%;\n color: rgba(var(--em-rgb-color), 0.7);\n transform: translateY(-50%);\n}\n\n.search .loupe {\n left: 0.7em;\n pointer-events: none;\n}\n\n.search .delete {\n right: 0.7em;\n}\n\nsvg {\n fill: currentColor;\n width: 1em;\n height: 1em;\n}\n\nbutton {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n color: currentColor;\n border: 0;\n background-color: transparent;\n}\n\n#nav {\n z-index: 2;\n position: relative;\n padding-top: 12px;\n padding-bottom: 12px;\n padding-right: var(--sidebar-width);\n}\n\n#nav button {\n color: var(--color-b);\n transition: color var(--duration) var(--easing);\n}\n\n#nav button:hover {\n color: var(--color-a);\n}\n\n#nav svg, #nav img {\n width: var(--category-icon-size);\n height: var(--category-icon-size);\n}\n\n#nav .bar {\n position: absolute;\n bottom: -12px;\n left: 0;\n width: 100%;\n height: 3px;\n background-color: rgb(var(--em-rgb-accent));\n border-radius: 3px 3px 0 0;\n transition: transform var(--duration) var(--easing);\n}\n\n#nav button[aria-selected] {\n color: rgb(var(--em-rgb-accent));\n}\n\n#preview {\n z-index: 2;\n position: relative;\n padding: calc(var(--padding) + 4px) var(--padding);\n padding-right: var(--sidebar-width);\n}\n\n#nav:before, #preview:before {\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n height: 2px;\n}\n\n#nav[data-position=top]:before, #preview[data-position=top]:before {\n top: 100%;\n background: linear-gradient(to bottom, var(--em-color-border), transparent);\n}\n\n#nav[data-position=bottom]:before, #preview[data-position=bottom]:before {\n bottom: 100%;\n background: linear-gradient(to top, var(--em-color-border), transparent);\n}\n\n.category button {\n position: relative;\n font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;\n}\n\n.category button > * {\n position: relative;\n}\n\n.category button .background {\n position: absolute;\n inset: 0;\n opacity: 0;\n background-color: var(--em-color-border);\n transition: opacity var(--duration-fast) var(--easing) var(--duration-instant);\n}\n\n.category button:hover .background {\n transition-duration: var(--duration-instant);\n transition-delay: 0ms;\n}\n\n.category button[aria-selected] .background {\n opacity: 1;\n}\n\n.category button[data-keyboard] .background {\n transition: none;\n}\n\n.row {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n}\n\n.skin-tone-button {\n border-radius: 100%;\n border: 1px solid transparent;\n}\n\n.skin-tone-button:hover {\n border-color: var(--em-color-border);\n}\n\n.skin-tone-button:active .skin-tone {\n transform: scale(0.85) !important;\n}\n\n.skin-tone-button .skin-tone {\n transition: transform var(--duration) var(--easing);\n}\n\n.skin-tone-button[aria-selected] {\n border-left-width: 0;\n border-right-width: 0;\n border-top-color: rgba(0, 0, 0, 0.05);\n border-bottom-color: transparent;\n background-color: var(--em-color-border);\n}\n\n.skin-tone-button[aria-selected] .skin-tone {\n transform: scale(0.9);\n}\n\n.menu {\n z-index: 2;\n position: absolute;\n white-space: nowrap;\n padding: 4px;\n border: 1px solid var(--em-color-border);\n background-color: rgba(var(--em-rgb-background), 0.9);\n -webkit-backdrop-filter: blur(4px);\n backdrop-filter: blur(4px);\n border-radius: 10px;\n box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.05);\n transition-property: opacity, transform;\n transition-duration: var(--duration);\n transition-timing-function: var(--easing);\n}\n\n.menu.hidden {\n opacity: 0;\n}\n\n.menu[data-position=bottom] {\n transform-origin: bottom right;\n}\n\n.menu[data-position=bottom].hidden {\n transform: scale(0.9) rotate(-3deg) translateY(5%);\n}\n\n.menu[data-position=top] {\n transform-origin: top right;\n}\n\n.menu[data-position=top].hidden {\n transform: scale(0.9) rotate(3deg) translateY(-5%);\n}\n\n.menu input[type=radio] {\n position: absolute;\n overflow: hidden;\n clip: rect(0 0 0 0);\n width: 1px;\n height: 1px;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.menu input[type=radio]:checked + .option {\n box-shadow: 0 0 0 2px rgb(var(--em-rgb-accent));\n}\n\n.option {\n width: 100%;\n padding: 4px 6px;\n border-radius: 6px;\n}\n\n.option:hover {\n color: #fff;\n background-color: rgb(var(--em-rgb-accent));\n}\n\n.skin-tone {\n position: relative;\n display: inline-block;\n width: 16px;\n height: 16px;\n border-radius: 100%;\n overflow: hidden;\n}\n\n.skin-tone:after {\n content: "";\n position: absolute;\n inset: 0;\n border-radius: 100%;\n border: 1px solid rgba(0, 0, 0, 0.8);\n mix-blend-mode: overlay;\n box-shadow: inset 0 -2px 3px #000, inset 0 1px 2px #fff;\n background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);\n}\n\n.skin-tone-1 {\n background-color: #ffc93a;\n}\n\n.skin-tone-2 {\n background-color: #ffdab7;\n}\n\n.skin-tone-3 {\n background-color: #e7b98f;\n}\n\n.skin-tone-4 {\n background-color: #c88c61;\n}\n\n.skin-tone-5 {\n background-color: #a46134;\n}\n\n.skin-tone-6 {\n background-color: #5d4437;\n}\n\n[data-emoji-set=twitter] .skin-tone:after {\n border-color: rgba(0, 0, 0, 0.5);\n box-shadow: none;\n}\n\n[data-emoji-set=twitter] .skin-tone-1 {\n background-color: #FADE72;\n}\n\n[data-emoji-set=twitter] .skin-tone-2 {\n background-color: #F3DFD0;\n}\n\n[data-emoji-set=twitter] .skin-tone-3 {\n background-color: #EED3A8;\n}\n\n[data-emoji-set=twitter] .skin-tone-4 {\n background-color: #CFAD8D;\n}\n\n[data-emoji-set=twitter] .skin-tone-5 {\n background-color: #A8805D;\n}\n\n[data-emoji-set=twitter] .skin-tone-6 {\n background-color: #765542;\n}\n\n[data-emoji-set=google] .skin-tone:after {\n box-shadow: inset 0 0 2px 2px rgba(0, 0, 0, 0.4);\n}\n\n[data-emoji-set=google] .skin-tone-1 {\n background-color: #F5C748;\n}\n\n[data-emoji-set=google] .skin-tone-2 {\n background-color: #F1D5AA;\n}\n\n[data-emoji-set=google] .skin-tone-3 {\n background-color: #D4B48D;\n}\n\n[data-emoji-set=google] .skin-tone-4 {\n background-color: #AA876B;\n}\n\n[data-emoji-set=google] .skin-tone-5 {\n background-color: #916544;\n}\n\n[data-emoji-set=google] .skin-tone-6 {\n background-color: #61493F;\n}\n\n[data-emoji-set=facebook] .skin-tone:after {\n border-color: rgba(0, 0, 0, 0.4);\n box-shadow: inset 0 -2px 3px #000, inset 0 1px 4px #fff;\n}\n\n[data-emoji-set=facebook] .skin-tone-1 {\n background-color: #F5C748;\n}\n\n[data-emoji-set=facebook] .skin-tone-2 {\n background-color: #F1D5AA;\n}\n\n[data-emoji-set=facebook] .skin-tone-3 {\n background-color: #D4B48D;\n}\n\n[data-emoji-set=facebook] .skin-tone-4 {\n background-color: #AA876B;\n}\n\n[data-emoji-set=facebook] .skin-tone-5 {\n background-color: #916544;\n}\n\n[data-emoji-set=facebook] .skin-tone-6 {\n background-color: #61493F;\n}\n';class mv extends t.Component{constructor(){super(...arguments),pm(this,"ref",t.createRef()),pm(this,"fetchEmojiData",(async()=>{try{const{data:e}=await by.get("https://cdn.jsdelivr.net/npm/@emoji-mart/data");return e}catch(e){return{}}})),pm(this,"onKeyDown",(e=>{let{event:t}=e;return"Escape"===t.key&&(this.props.editor.chain().focus().deleteRange(this.props.range).run(),!0)})),pm(this,"handleSelect",(e=>{this.props.editor.chain().focus().deleteRange(this.props.range).setEmoji(e).run()}))}componentDidMount(){new hv({...this.props,onEmojiSelect:this.handleSelect,style:{maxWidth:"100%"},theme:"light",native:!0,previewPosition:"none",showSkinTones:!1,data:this.fetchEmojiData,ref:this.ref})}render(){return t.createElement("div",{ref:this.ref,"data-cy":"neeto-editor-emoji-picker"})}}mv.defaultProps={editor:{},range:{}},mv.propTypes={editor:qf.exports.object.isRequired,range:qf.exports.object};const gv=e=>{let{editor:n}=e;const r=u();return t.createElement(dm,{ref:r,closeOnSelect:!1,customTarget:()=>{var e;return t.createElement(Zf,{icon:Lh,iconActive:null==r||null===(e=r.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Emoji",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-emoji-option-button"})},position:"bottom-start"},t.createElement(mv,{editor:n}))},yv=e=>{let{editor:n,options:r}=e;const i={[md.H1]:{label:"H1",value:1},[md.H2]:{label:"H2",value:2},[md.H3]:{label:"H3",value:3},[md.H4]:{label:"H4",value:4},[md.H5]:{label:"H5",value:5},[md.H6]:{label:"H6",value:6}};return t.createElement(dm,{customTarget:()=>t.createElement(Zf,{icon:Kh,iconActive:n.isActive("heading"),tooltipProps:{content:"Font Size",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-font-size-option"}),className:"neeto-editor-font-size-wrapper",placement:"bottom"},r.map((e=>{const{label:r,value:o}=i[e];return t.createElement("li",{onClick:()=>{return e=o,n.chain().focus().toggleHeading({level:e}).run();var e},key:o,className:sc({active:(s=o,n.isActive("heading",{level:s}))}),"data-cy":"neeto-editor-fixed-menu-font-size-option-".concat(r)},r);var s})))},bv=e=>{let{editor:n}=e;const r=u(),o=u(),[s,a]=i(""),[l,c]=i(""),d=n.isActive("link"),p=()=>{c(n.getAttributes("link").href||"")},h=()=>{var e;Rf.test(l)?(n.chain().focus().setLink({href:l}).run(),null===(e=r.current)||void 0===e||e.close()):a("Please enter a valid url")};return t.createElement(dm,{ref:r,onVisible:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.focus({preventScroll:!0})},customTarget:()=>t.createElement(Zf,{icon:vh,iconActive:d,onClick:p,tooltipProps:{content:"Link",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-link-option"}),className:"neeto-editor-link-wrapper",closeOnSelect:!1,position:"bottom"},t.createElement("div",{onKeyDown:e=>{"Escape"===e.key?r.current.close():"Enter"===e.key&&h()},className:"neeto-editor-link__item"},t.createElement(jf,{ref:o,name:"url",value:l,placeholder:"Paste URL",onFocus:()=>a(""),error:s,onChange:e=>{let{target:{value:t}}=e;return c(t)},"data-cy":"neeto-editor-fixed-menu-link-option-input"}),t.createElement(Ld,{label:"Link",onClick:h,"data-cy":"neeto-editor-fixed-menu-link-option-link-button"}),d&&t.createElement(Ld,{label:"Unlink",onClick:()=>{var e;n.chain().focus().unsetLink().run(),null===(e=r.current)||void 0===e||e.close()},"data-cy":"neeto-editor-fixed-menu-link-option-unlink-button"})))},vv=e=>{const{size:n,color:r,underlineColor:i,...o}=e;return t.createElement("svg",ie({viewBox:"0 0 24 24",fill:"none",height:n,width:n},o),t.createElement("path",{d:"M21 20H3",stroke:i||r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M17.3125 15L12.1562 4L7 15M8.03125 12.8H16.2812",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};vv.defaultProps={color:"currentColor",size:24},vv.propTypes={color:qf.exports.string,size:qf.exports.oneOfType([qf.exports.string,qf.exports.number])};const wv=e=>{const{size:n,color:r,bgColor:i,...o}=e;return t.createElement("svg",ie({viewBox:"0 0 24 24",fill:"none",height:n,width:n},o),t.createElement("path",{d:"M21 7V17C21 19.209 19.209 21 17 21H7C4.791 21 3 19.209 3 17V7C3 4.791 4.791 3 7 3H17C19.209 3 21 4.791 21 7Z",fill:i,stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M10 8V16",stroke:r,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M14 8V16",stroke:r,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M8 14H16",stroke:r,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}),t.createElement("path",{d:"M8 10H16",stroke:r,strokeWidth:"1.389",strokeLinecap:"round",strokeLinejoin:"round"}))};wv.defaultProps={color:"white",bgColor:"#68737D",size:24},wv.propTypes={color:qf.exports.string,bgColor:qf.exports.string,size:qf.exports.oneOfType([qf.exports.string,qf.exports.number])};const xv=e=>{let{color:n="#000",onChange:r}=e;const i=u();return t.createElement(Zf,{icon:e=>{let{color:o,size:s}=e;return t.createElement(t.Fragment,null,t.createElement(vv,{size:s,color:o,underlineColor:n}),t.createElement("input",{ref:i,type:"color",onChange:e=>r&&r(e.target.value)}))},iconActive:!1,onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.click()},tooltipProps:{content:"Text Color",position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-text-color-option"})},Mv={small:24,medium:32,large:40,xlarge:64},Dv=["#E5E7EB","#FECACA","#FDE68A","#A7F3D0","#BFDBFE","#C7D2FE","#DDD6FE","#FBCFE8"],kv=e=>{let{size:n,user:r,isSquare:o,status:s,onClick:a,className:l,...u}=e;const[c,d]=i(!1),{name:p="",imageUrl:h}=r,f="medium"===n,m="large"===n,g="xlarge"===n,y=(e=>{const t=e.trim().split(" "),n=t.reduce(((e,n,r)=>(0!==r&&r!==t.length-1||(e="".concat(e).concat(n.charAt(0).toUpperCase())),e)),"");return n})(p),b={height:Mv[n],width:Mv[n],backgroundColor:(()=>{const e=(y.charCodeAt(0)||0)+(y.charCodeAt(1)||0);return Dv[e%65%Dv.length]||Dv[0]})()},v=sc("ne-avatar",{"ne-avatar--medium":f,"ne-avatar--large":m,"ne-avatar--xlarge":g,"ne-avatar--round":!o,hidden:!c}),w=sc("ne-avatar__text",{"ne-avatar__text-medium":f,"ne-avatar__text-large":m,"ne-avatar__text-xlarge":g}),x=sc("ne-avatar__status","".concat(s),{"ne-avatar__status-medium":f,"ne-avatar__status-large":m,"ne-avatar__status-xlarge":g,"ne-avatar__status-square":o}),M=()=>null==s?t.Fragment:t.createElement("span",{className:x}),D=()=>t.createElement("span",{className:w},y),k=y&&!h&&!c;return t.createElement("div",ie({onClick:a,style:b,className:sc("ne-avatar--container",{"ne-avatar--container-round":!o},l)},u),t.createElement(M,null),k?t.createElement(D,null):t.createElement("img",{className:v,onLoad:()=>d(!0),onError:()=>d(!1),src:h,alt:"avatar-".concat(y)}))};kv.defaultProps={size:"medium",user:{imageUrl:"",name:""},isSquare:!1,onClick:()=>{},status:null},kv.propTypes={size:qf.exports.oneOf(Object.keys(Mv)),user:qf.exports.shape({imageUrl:qf.exports.string,name:qf.exports.string}),isSquare:qf.exports.bool,onClick:qf.exports.func,status:qf.exports.oneOf(Object.keys({online:"online",idle:"idle",offline:"offline"})),className:qf.exports.string};const Ev=e=>{let{editor:n,mentions:r,showImageInMention:i}=e;const o=u();return r&&r.length?t.createElement(dm,{ref:o,customTarget:()=>{var e;return t.createElement(Zf,{icon:uh,iconActive:null===(e=o.current)||void 0===e?void 0:e.visible,tooltipProps:{content:"Mention",position:"bottom",delay:[500]},"data-cy":"neeto-editor-mention-option"})}},t.createElement("div",{className:"neeto-editor-mentions__wrapper neeto-editor-mentions__wrapper--small"},r.map((e=>{let{key:r,name:o,imageUrl:s}=e;return t.createElement("button",{className:"neeto-editor-mentions__item neeto-editor-mentions__item--light",key:r,onClick:()=>n.commands.setMention(o),type:"button","data-cy":"neeto-editor-mention-option-".concat(r)},i&&t.createElement(kv,{size:"small",user:{name:o,imageUrl:s}}),t.createElement("p",null,o))})))):null},Cv=e=>{let{onClickVariable:n,variables:r}=e;const i=function(){const e=[],t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((n=>{const{category_key:r,category_label:i,variables:o}=n;if(r&&o){const e=o.map((e=>({...e,category_key:r})));t.push({label:i,variables:e})}else e.push(n)})),e.length&&t.push({label:t.length?"Others":null,variables:e}),t}(r);return r&&r.length?t.createElement("div",{className:"neeto-editor-variables-list"},i.map(((e,r)=>{let{label:i,variables:o}=e;return t.createElement(Tv,{key:r,index:r,title:i,variables:o,onClickItem:n})}))):null},Tv=e=>{let{index:n,title:r,variables:i,onClickItem:o}=e;return t.createElement("div",{className:"neeto-editor-variables-block","data-cy":"neeto-editor-variable-option-category-".concat(n)},r&&t.createElement("h6",null,r),t.createElement("div",{className:"neeto-editor-variables-row"},i.map((e=>t.createElement("button",{type:"button",onClick:()=>o(e),key:"".concat(e.label,"--").concat(e.value),className:"neeto-editor-variable","data-cy":"neeto-editor-variable-option-item-".concat(e.label,"--").concat(e.value)},e.label)))))},Ov=e=>{let{editor:n,variables:r}=e;return r&&r.length?t.createElement(dm,{customTarget:()=>t.createElement(Zf,{icon:e=>{let{_color:n,...r}=e;return t.createElement(wv,r)},tooltipProps:{content:"Variables",position:"bottom",delay:[500]},"data-cy":"neeto-editor-variable-option"})},t.createElement(Cv,{onClickVariable:e=>{const{category_key:t,key:r}=e,i=t?"".concat(t,".").concat(r):r;n.chain().focus().setVariable({label:i}).run()},variables:r})):null},Sv=e=>{let{editor:n,variables:r,setImageUploadVisible:o,options:s,mentions:a,showImageInMention:l}=e;const[u,c]=i(!1),d=n&&n.view.state.selection.node,p=d&&"image"===d.type.name;if(!n)return null;const h=[{Icon:Ph,command:()=>n.chain().focus().toggleBold().run(),active:n.isActive("bold"),optionName:"bold"},{Icon:Wh,command:()=>n.chain().focus().toggleItalic().run(),active:n.isActive("italic"),optionName:"italic"},{Icon:Jh,command:()=>n.chain().focus().toggleUnderline().run(),active:n.isActive("underline"),optionName:"underline"},{Icon:Rh,command:()=>n.chain().focus().toggleStrike().run(),active:n.isActive("strike"),optionName:"strike"},{Icon:dh,command:()=>n.chain().focus().toggleHighlight().run(),active:n.isActive("highlight"),optionName:"highlight"}].filter((e=>s.includes(e.optionName))),f=[{Icon:Nh,command:()=>n.chain().focus().toggleBlockquote().run(),active:n.isActive("blockquote"),optionName:"block-quote"},{Icon:rh,command:()=>n.chain().focus().toggleCodeBlock().run(),active:n.isActive("codeBlock"),optionName:"code-block"},{Icon:hh,command:()=>o(!0),active:n.isActive("imageUpload"),optionName:"image-upload"}].filter((e=>s.includes(e.optionName))),m=[{Icon:xh,command:()=>n.chain().focus().toggleBulletList().run(),active:n.isActive("bulletList"),optionName:"bullet-list"},{Icon:Dh,command:()=>n.chain().focus().toggleOrderedList().run(),active:n.isActive("orderedList"),optionName:"ordered-list"}].filter((e=>s.includes(e.optionName))),g=s.filter((e=>e.match(/^h[1-6]$/))),y=s.includes(md.FONT_COLOR),b=g.length>0,v=s.includes(md.EMOJI),w=s.includes(md.LINK),x=(e,n)=>{let{Icon:r,command:i,active:o,optionName:s}=e;return t.createElement(Zf,{key:n,icon:r,iconActive:o,onClick:i,tooltipProps:{content:od(s),position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-".concat(s,"-option")})};return t.createElement("div",{className:"neeto-editor-fixed-menu"},b&&t.createElement(yv,{editor:n,options:g}),h.map(x),y&&t.createElement(xv,{color:n.getAttributes("textStyle").color,onChange:e=>n.chain().focus().setColor(e).run()}),v&&t.createElement(gv,{editor:n}),w&&t.createElement(bv,{editor:n}),f.map(x),m.map(x),p&&zf({editor:n,isImageEditorModalOpen:u,setIsImageEditorModalOpen:c}).map(((e,n)=>{let{Icon:r,command:i,active:o,optionName:s}=e;return t.createElement(Zf,{key:n,icon:r,iconActive:o,onClick:i,tooltipProps:{content:od(s),position:"bottom",delay:[500]},"data-cy":"neeto-editor-fixed-menu-".concat(s,"-option")})})),t.createElement("div",{className:"neeto-editor-fixed-menu-addons"},t.createElement(Ov,{editor:n,variables:r}),t.createElement(Ev,{editor:n,mentions:a,showImageInMention:l})),t.createElement(Nf,{isOpen:u,onClose:()=>c(!1)},t.createElement("div",{className:"neeto-editor-image-uploader"},t.createElement("div",{className:"neeto-editor-image-uploader__content"},t.createElement(If,{editor:n,onClose:()=>c(!1),url:null==d?void 0:d.attrs.src,alt:null==d?void 0:d.attrs.alt})))))},Av=()=>{},Nv="large",_v=e=>{let{children:n,size:r,noUnderline:i,className:o="",...s}=e;return t.createElement("div",ie({className:sc({"ne-tab__wrapper":!0},{"ne-tab__wrapper--size-large":r===Nv},{"ne-tab__wrapper--underline-none":i},[o]),"data-cy":"tab-container"},s),n)};_v.Item=e=>{let{active:n,className:r="",children:i,icon:o=null,onClick:s=Av,...a}=e;const l="button",u="string"==typeof o?()=>t.createElement("i",{className:o,"data-cy":"tab-item-icon"}):o||t.Fragment;return t.createElement(l,ie({className:sc(["ne-tab flex select-none items-center justify-center",r],{active:n}),onClick:s,"data-cy":"tab-item"},a),o&&t.createElement(u,{className:"ne-tab__icon"}),i)};const jv={autoProceed:!0,allowMultipleUploads:!1,restrictions:{maxFileSize:5*1024*1024,allowedFileTypes:[".jpg",".jpeg",".png",".gif"]}},Iv={formData:!0,fieldName:"blob"},Lv="/api/v1/direct_uploads/image_upload",zv=[{title:"Upload",key:"local"},{title:"Link",key:"link"},{title:"Unsplash",key:"unsplash"}];var Pv={exports:{}},Fv={};function Rv(e){return e<10?`0${e}`:e.toString()}var Bv=function(){const e=new Date;return`${Rv(e.getHours())}:${Rv(e.getMinutes())}:${Rv(e.getSeconds())}`};Object.defineProperty(Fv,"__esModule",{value:!0}),Fv.justErrorsLogger=Fv.debugLogger=void 0;const Uv=Bv,Hv={debug:()=>{},warn:()=>{},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.error(`[Uppy] [${Uv()}]`,...t)}};Fv.justErrorsLogger=Hv;const $v={debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.debug(`[Uppy] [${Uv()}]`,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.warn(`[Uppy] [${Uv()}]`,...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return console.error(`[Uppy] [${Uv()}]`,...t)}};Fv.debugLogger=$v;let Vv="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Wv={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+=Vv[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}},qv={},Yv=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1);e=Number(e/Math.pow(1024,r));var i=n[r];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i};function Qv(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}Qv.prototype.match=function(e){var t,n,r=!0,i=this.parts,o=i.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(n=(e||"").split(this.separator),t=0;r&&t<o;t++)"*"!==i[t]&&(r=t<n.length&&i[t]===n[t]);r=r&&n}else r=!1;else if("function"==typeof e.splice)for(r=[],t=e.length;t--;)this.match(e[t])&&(r[r.length]=e[t]);else if("object"==typeof e)for(var s in r={},e)this.match(s)&&(r[s]=e[s]);return r};var Kv=function(e,t,n){var r=new Qv(e,n||/[\/\.]/);return void 0!==t?r.match(t):r},Gv=/[\/\+\.]/;Object.defineProperty(qv,"__esModule",{value:!0}),qv.defaultOptions=qv.RestrictionError=qv.Restricter=void 0;const Jv=Yv,Xv=function(e,t){function n(t){var n=Kv(t,e,Gv);return n&&n.length>=2}return t?n(t.split(";")[0]):n};qv.defaultOptions={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class Zv extends Error{constructor(){super(...arguments),this.isRestriction=!0}}qv.RestrictionError=Zv,"undefined"==typeof AggregateError&&(globalThis.AggregateError=class extends Error{constructor(e,t){super(t),this.errors=e}});qv.Restricter=class{constructor(e,t){this.i18n=t,this.getOpts=()=>{const t=e();if(null!=t.restrictions.allowedFileTypes&&!Array.isArray(t.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return t}}validate(e,t){const{maxFileSize:n,minFileSize:r,maxTotalFileSize:i,maxNumberOfFiles:o,allowedFileTypes:s}=this.getOpts().restrictions;if(o&&t.length+1>o)throw new Zv(`${this.i18n("youCanOnlyUploadX",{smart_count:o})}`);if(s){const t=s.some((t=>t.includes("/")?!!e.type&&Xv(e.type.replace(/;.*?$/,""),t):!("."!==t[0]||!e.extension)&&e.extension.toLowerCase()===t.slice(1).toLowerCase()));if(!t){const e=s.join(", ");throw new Zv(this.i18n("youCanOnlyUploadFileTypes",{types:e}))}}if(i&&null!=e.size){const n=t.reduce(((e,t)=>e+t.size),e.size);if(n>i)throw new Zv(this.i18n("exceedsSize",{size:Jv(i),file:e.name}))}if(n&&null!=e.size&&e.size>n)throw new Zv(this.i18n("exceedsSize",{size:Jv(n),file:e.name}));if(r&&null!=e.size&&e.size<r)throw new Zv(this.i18n("inferiorSize",{size:Jv(r)}))}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(Object.keys(e).length<t)throw new Zv(this.i18n("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new Zv(this.i18n("missingRequiredMetaFieldOnFile",{fileName:e.name})),{requiredMetaFields:n}=this.getOpts().restrictions,r=Object.prototype.hasOwnProperty,i=[];for(const t of n)r.call(e.meta,t)&&""!==e.meta[t]||i.push(t);return{missingFields:i,error:t}}};var ew=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function tw(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var nw=0;function rw(e){return"__private_"+nw+++"_"+e}const iw=ew;function ow(e,t,n){const r=[];return e.forEach((e=>"string"!=typeof e?r.push(e):t[Symbol.split](e).forEach(((e,t,i)=>{""!==e&&r.push(e),t<i.length-1&&r.push(n)})))),r}
33
33
  /**
34
34
  * Takes a string with placeholder variables like `%{smart_count} file selected`
35
35
  * and replaces it with values from options `{smart_count: 5}`
@@ -40,4 +40,4 @@ var ef="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf(
40
40
  * @param {string} phrase that needs interpolation, with placeholders
41
41
  * @param {object} options with values that will be used to replace placeholders
42
42
  * @returns {any[]} interpolated
43
- */function tw(e,t){const n=/\$/g,r="$$$$";let i=[e];if(null==t)return i;for(const e of Object.keys(t))if("_"!==e){let o=t[e];"string"==typeof o&&(o=n[Symbol.replace](o,r)),i=ew(i,new RegExp(`%\\{${e}\\}`,"g"),o)}return i}var nw=Xv("apply");function rw(e){if(null==e||!e.strings)return;const t=this.locale;this.locale={...t,strings:{...t.strings,...e.strings}},this.locale.pluralize=e.pluralize||t.pluralize}var iw=class{constructor(e){Object.defineProperty(this,nw,{value:rw}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(e)?e.forEach(Gv(this,nw)[nw],this):Gv(this,nw)[nw](e)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!Zv(this.locale.strings,e))throw new Error(`missing string: ${e}`);const n=this.locale.strings[e];if("object"==typeof n){if(t&&void 0!==t.smart_count){return tw(n[this.locale.pluralize(t.smart_count)],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return tw(n,t)}},ow=function(){var e={},t=e._fns={};return e.emit=function(e,n,r,i,o,s,a){var l=function(e){var n=t[e]?t[e]:[],r=e.indexOf(":"),i=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],o=Object.keys(t),s=0,a=o.length;for(;s<a;s++){var l=o[s];if("*"===l&&(n=n.concat(t[l])),2===i.length&&i[0]===l){n=n.concat(t[l]);break}}return n}(e);l.length&&function(e,t,n){var r=0,i=t.length;for(;r<i&&t[r];r++)t[r].event=e,t[r].apply(t[r],n)}(e,l,[n,r,i,o,s,a])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){this.on(t,(function r(){n.apply(this,arguments),e.off(t,r)}))},e.off=function(e,t){var n=[];if(e&&t)for(var r=this._fns[e],i=0,o=r?r.length:0;i<o;i++)r[i]!==t&&n.push(r[i]);n.length?this._fns[e]=n:delete this._fns[e]},e},sw="Expected a function",aw=0/0,lw="[object Symbol]",uw=/^\s+|\s+$/g,cw=/^[-+]0x[0-9a-f]+$/i,dw=/^0b[01]+$/i,pw=/^0o[0-7]+$/i,hw=parseInt,fw="object"==typeof tc&&tc&&tc.Object===Object&&tc,mw="object"==typeof self&&self&&self.Object===Object&&self,gw=fw||mw||Function("return this")(),yw=Object.prototype.toString,bw=Math.max,vw=Math.min,ww=function(){return gw.Date.now()};function xw(e,t,n){var r,i,o,s,a,l,u=0,c=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError(sw);function h(t){var n=r,o=i;return r=i=void 0,u=t,s=e.apply(o,n)}function f(e){return u=e,a=setTimeout(g,t),c?h(e):s}function m(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-u>=o}function g(){var e=ww();if(m(e))return y(e);a=setTimeout(g,function(e){var n=t-(e-l);return d?vw(n,o-(e-u)):n}(e))}function y(e){return a=void 0,p&&r?h(e):(r=i=void 0,s)}function b(){var e=ww(),n=m(e);if(r=arguments,i=this,l=e,n){if(void 0===a)return f(l);if(d)return a=setTimeout(g,t),h(l)}return void 0===a&&(a=setTimeout(g,t)),s}return t=Dw(t)||0,Mw(n)&&(c=!!n.leading,o=(d="maxWait"in n)?bw(Dw(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p),b.cancel=function(){void 0!==a&&clearTimeout(a),u=0,r=l=i=a=void 0},b.flush=function(){return void 0===a?s:y(ww())},b}function Mw(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Dw(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&yw.call(e)==lw}(e))return aw;if(Mw(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Mw(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(uw,"");var n=dw.test(e);return n||pw.test(e)?hw(e.slice(2),n?2:8):cw.test(e)?aw:+e}var kw=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError(sw);return Mw(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),xw(e,t,{leading:r,maxWait:t,trailing:i})};var Ew=0;function Cw(e){return"__private_"+Ew+++"_"+e}var Tw=Cw("publish");class Ow{constructor(){Object.defineProperty(this,Tw,{value:Sw}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t={...this.state},n={...this.state,...e};this.state=n,function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(this,Tw)[Tw](t,n,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function Sw(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.callbacks.forEach((e=>{e(...t)}))}Ow.VERSION="2.1.0";var Aw=function(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}};const Nw=Aw,_w={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function jw(e){let t="";return e.replace(/[^A-Z0-9]/gi,(e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/")))+t}var Iw=function(e){let t="uppy";return"string"==typeof e.name&&(t+=`-${jw(e.name.toLowerCase())}`),void 0!==e.type&&(t+=`-${e.type}`),e.meta&&"string"==typeof e.meta.relativePath&&(t+=`-${jw(e.meta.relativePath.toLowerCase())}`),void 0!==e.data.size&&(t+=`-${e.data.size}`),void 0!==e.data.lastModified&&(t+=`-${e.data.lastModified}`),t};var Lw=function(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const n=t[1];let[r,i]=n.split(".");return r=parseInt(r,10),i=parseInt(i,10),r<15||15===r&&i<15063||(r>18||18===r&&i>=18218)};var zw=Bv,Pw=jv,Fw=Uv;let Rw,Bw;function Uw(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Hw=0;function $w(e){return"__private_"+Hw+++"_"+e}const Vw=iw,Ww=ow,qw=kw,Yw=function(){return new Ow},Qw=function(e){var t;if(e.type)return e.type;const n=e.name?null==(t=Nw(e.name).extension)?void 0:t.toLowerCase():null;return n&&n in _w?_w[n]:"application/octet-stream"},Kw=Aw,Gw=Iw,Jw=Lw,Xw=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"},Zw={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",emptyFolderAdded:"No files were added from empty folder",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}};var ex=$w("plugins"),tx=$w("restricter"),nx=$w("storeUnsubscribe"),rx=$w("emitter"),ix=$w("preProcessors"),ox=$w("uploaders"),sx=$w("postProcessors"),ax=$w("informAndEmit"),lx=$w("checkRequiredMetaFieldsOnFile"),ux=$w("checkRequiredMetaFields"),cx=$w("assertNewUploadAllowed"),dx=$w("checkAndCreateFileStateObject"),px=$w("startIfAutoProceed"),hx=$w("addListeners"),fx=$w("updateOnlineStatus"),mx=$w("createUpload"),gx=$w("getUpload"),yx=$w("removeUpload"),bx=$w("runUpload");Rw=Symbol.for("uppy test: getPlugins"),Bw=Symbol.for("uppy test: createUpload");class vx{constructor(e){Object.defineProperty(this,bx,{value:Ax}),Object.defineProperty(this,yx,{value:Sx}),Object.defineProperty(this,gx,{value:Ox}),Object.defineProperty(this,mx,{value:Tx}),Object.defineProperty(this,hx,{value:Cx}),Object.defineProperty(this,px,{value:Ex}),Object.defineProperty(this,dx,{value:kx}),Object.defineProperty(this,cx,{value:Dx}),Object.defineProperty(this,ux,{value:Mx}),Object.defineProperty(this,lx,{value:xx}),Object.defineProperty(this,ax,{value:wx}),Object.defineProperty(this,ex,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,tx,{writable:!0,value:void 0}),Object.defineProperty(this,nx,{writable:!0,value:void 0}),Object.defineProperty(this,rx,{writable:!0,value:Ww()}),Object.defineProperty(this,ix,{writable:!0,value:new Set}),Object.defineProperty(this,ox,{writable:!0,value:new Set}),Object.defineProperty(this,sx,{writable:!0,value:new Set}),Object.defineProperty(this,fx,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=Zw;const t={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:Fw.defaultOptions,meta:{},onBeforeFileAdded:e=>e,onBeforeUpload:e=>e,store:Yw(),logger:Pw.justErrorsLogger,infoTimeout:5e3};this.opts={...t,...e,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=Pw.debugLogger),this.log(`Using Core v${this.constructor.VERSION}`),this.i18nInit(),this.calculateProgress=qw(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:Jw(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:{...this.opts.meta},info:[],recoveredState:null}),Uw(this,tx)[tx]=new Fw.Restricter((()=>this.opts),this.i18n),Uw(this,nx)[nx]=this.store.subscribe(((e,t,n)=>{this.emit("state-update",e,t,n),this.updateAll(t)})),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),Uw(this,hx)[hx]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];Uw(this,rx)[rx].emit(e,...n)}on(e,t){return Uw(this,rx)[rx].on(e,t),this}once(e,t){return Uw(this,rx)[rx].once(e,t),this}off(e,t){return Uw(this,rx)[rx].off(e,t),this}updateAll(e){this.iteratePlugins((t=>{t.update(e)}))}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:{...this.getState().files,[e]:{...this.getState().files[e],...t}}})}i18nInit(){const e=new Vw([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e&&e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins((e=>{e.setOptions()})),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},n={};Object.keys(t).forEach((r=>{const i={...t[r]};i.progress={...i.progress,...e},n[r]=i})),this.setState({files:n,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){Uw(this,ix)[ix].add(e)}removePreProcessor(e){return Uw(this,ix)[ix].delete(e)}addPostProcessor(e){Uw(this,sx)[sx].add(e)}removePostProcessor(e){return Uw(this,sx)[sx].delete(e)}addUploader(e){Uw(this,ox)[ox].add(e)}removeUploader(e){return Uw(this,ox)[ox].delete(e)}setMeta(e){const t={...this.getState().meta,...e},n={...this.getState().files};Object.keys(n).forEach((t=>{n[t]={...n[t],meta:{...n[t].meta,...e}}})),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){const n={...this.getState().files};if(!n[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const r={...n[e].meta,...t};n[e]={...n[e],meta:r},this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),i=r.filter((e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted})),o=r.filter((e=>!e.progress.uploadStarted)),s=r.filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess)),a=r.filter((e=>e.progress.uploadStarted)),l=r.filter((e=>e.isPaused)),u=r.filter((e=>e.progress.uploadComplete)),c=r.filter((e=>e.error)),d=i.filter((e=>!e.isPaused)),p=r.filter((e=>e.progress.preprocess||e.progress.postprocess));return{newFiles:o,startedFiles:s,uploadStartedFiles:a,pausedFiles:l,completeFiles:u,erroredFiles:c,inProgressFiles:i,inProgressNotPausedFiles:d,processingFiles:p,isUploadStarted:a.length>0,isAllComplete:100===t&&u.length===r.length&&0===p.length,isAllErrored:!!n&&c.length===r.length,isAllPaused:0!==i.length&&l.length===i.length,isUploadInProgress:i.length>0,isSomeGhost:r.some((e=>e.isGhost))}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{return Uw(this,tx)[tx].validate(e,t),{result:!0}}catch(e){return{result:!1,reason:e.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){Uw(this,cx)[cx](e);const{files:t}=this.getState();let n=Uw(this,dx)[dx](t,e);return t[n.id]&&t[n.id].isGhost&&(n={...t[n.id],data:e.data,isGhost:!1},this.log(`Replaced the blob in the restored ghost file: ${n.name}, ${n.id}`)),this.setState({files:{...t,[n.id]:n}}),this.emit("file-added",n),this.emit("files-added",[n]),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),Uw(this,px)[px](),n.id}addFiles(e){Uw(this,cx)[cx]();const t={...this.getState().files},n=[],r=[];for(let i=0;i<e.length;i++)try{let r=Uw(this,dx)[dx](t,e[i]);t[r.id]&&t[r.id].isGhost&&(r={...t[r.id],data:e[i].data,isGhost:!1},this.log(`Replaced blob in a ghost file: ${r.name}, ${r.id}`)),t[r.id]=r,n.push(r)}catch(e){e.isRestriction||r.push(e)}if(this.setState({files:t}),n.forEach((e=>{this.emit("file-added",e)})),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.keys(n).forEach((e=>{this.log(`Added file: ${n[e].name}\n id: ${n[e].id}\n type: ${n[e].type}`)})),n.length>0&&Uw(this,px)[px](),r.length>0){let e="Multiple errors occurred while adding files:\n";if(r.forEach((t=>{e+=`\n * ${t.message}`})),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(r,e);{const t=new Error(e);throw t.errors=r,t}}}removeFiles(e,t){const{files:n,currentUploads:r}=this.getState(),i={...n},o={...r},s=Object.create(null);function a(e){return void 0===s[e]}e.forEach((e=>{n[e]&&(s[e]=n[e],delete i[e])})),Object.keys(o).forEach((e=>{const t=r[e].fileIDs.filter(a);0!==t.length?o[e]={...r[e],fileIDs:t}:delete o[e]}));const l={currentUploads:o,files:i};0===Object.keys(i).length&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.calculateTotalProgress();const u=Object.keys(s);u.forEach((e=>{this.emit("file-removed",s[e],t)})),u.length>5?this.log(`Removed ${u.length} files`):this.log(`Removed files: ${u.join(", ")}`)}removeFile(e,t){void 0===t&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;const t=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const n={...e[t],isPaused:!0};e[t]=n})),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n})),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter((t=>e[t].error));if(t.forEach((t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n})),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});const n=Uw(this,mx)[mx](t,{forceAllowNewUpload:!0});return Uw(this,bx)[bx](n)}cancelAll(e){let{reason:t="user"}=void 0===e?{}:e;if(this.emit("cancel-all",{reason:t}),"user"===t){const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=Uw(this,mx)[mx]([e],{forceAllowNewUpload:!0});return Uw(this,bx)[bx](t)}reset(){this.cancelAll(...arguments)}logout(){this.iteratePlugins((e=>{e.provider&&e.provider.logout&&e.provider.logout()}))}calculateProgress(e,t){if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){const e=this.getFiles().filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess));if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter((e=>null!=e.progress.bytesTotal)),n=e.filter((e=>null==e.progress.bytesTotal));if(0===t.length){const t=100*e.length,r=n.reduce(((e,t)=>e+t.progress.percentage),0),i=Math.round(r/t*100);return void this.setState({totalProgress:i})}let r=t.reduce(((e,t)=>e+t.progress.bytesTotal),0);const i=r/t.length;r+=i*n.length;let o=0;t.forEach((e=>{o+=e.progress.bytesUploaded})),n.forEach((e=>{o+=i*(e.progress.percentage||0)/100}));let s=0===r?0:Math.round(o/r*100);s>100&&(s=100),this.setState({totalProgress:s}),this.emit("progress",s)}updateOnlineStatus(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if("function"!=typeof e){throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}.`+" Please verify that the plugin was imported and spelled correctly.")}const n=new e(this,t),r=n.id;if(!r)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const i=this.getPlugin(r);if(i){const e=`Already found a plugin named '${i.id}'. `+`Tried to use: '${r}'.\n`+"Uppy plugins must have unique `id` options. See https://uppy.io/docs/plugins/#id.";throw new Error(e)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),n.type in Uw(this,ex)[ex]?Uw(this,ex)[ex][n.type].push(n):Uw(this,ex)[ex][n.type]=[n],n.install(),this}getPlugin(e){for(const t of Object.values(Uw(this,ex)[ex])){const n=t.find((t=>t.id===e));if(null!=n)return n}}[Rw](e){return Uw(this,ex)[ex][e]}iteratePlugins(e){Object.values(Uw(this,ex)[ex]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=Uw(this,ex)[ex][e.type],n=t.findIndex((t=>t.id===e.id));-1!==n&&t.splice(n,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}close(e){let{reason:t}=void 0===e?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),Uw(this,nx)[nx](),this.iteratePlugins((e=>{this.removePlugin(e)})),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",Uw(this,fx)[fx]),window.removeEventListener("offline",Uw(this,fx)[fx]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){void 0===t&&(t="info"),void 0===n&&(n=3e3);const r="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout((()=>this.hideInfo()),n),this.emit("info-visible")}log(e,t){const{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e)}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?Uw(this,bx)[bx](e):(Uw(this,yx)[yx](e),Promise.reject(new Error("Nonexistent upload")))}[Bw](){return Uw(this,mx)[mx](...arguments)}addResultData(e,t){if(!Uw(this,gx)[gx](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:n}=this.getState(),r={...n[e],result:{...n[e].result,...t}};this.setState({currentUploads:{...n,[e]:r}})}upload(){var e;null!=(e=Uw(this,ex)[ex].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const n=this.opts.onBeforeUpload(t);return!1===n?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(n&&"object"==typeof n&&(t=n,this.setState({files:t})),Promise.resolve().then((()=>Uw(this,tx)[tx].validateMinNumberOfFiles(t))).catch((e=>{throw Uw(this,ax)[ax](e),e})).then((()=>{if(!Uw(this,ux)[ux](t))throw new Fw.RestrictionError(this.i18n("missingRequiredMetaField"))})).catch((e=>{throw e})).then((()=>{const{currentUploads:e}=this.getState(),n=Object.values(e).flatMap((e=>e.fileIDs)),r=[];Object.keys(t).forEach((e=>{const t=this.getFile(e);t.progress.uploadStarted||-1!==n.indexOf(e)||r.push(t.id)}));const i=Uw(this,mx)[mx](r);return Uw(this,bx)[bx](i)})).catch((e=>{throw this.emit("error",e),this.log(e,"error"),e})))}}function wx(e,t){const{message:n,details:r=""}=e;e.isRestriction?this.emit("restriction-failed",t,e):this.emit("error",e),this.info({message:n,details:r},"error",this.opts.infoTimeout),this.log(`${n} ${r}`.trim(),"error")}function xx(e){const{missingFields:t,error:n}=Uw(this,tx)[tx].getMissingRequiredMetaFields(e);return!(t.length>0)||(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(n.message),this.emit("restriction-failed",e,n),!1)}function Mx(e){let t=!0;for(const n of Object.values(e))Uw(this,lx)[lx](n)||(t=!1);return t}function Dx(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new Fw.RestrictionError(this.i18n("noMoreFilesAllowed"));throw Uw(this,ax)[ax](t,e),t}}function kx(e,t){const n=Qw(t),r=Xw(n,t),i=Kw(r).extension,o=Boolean(t.isRemote),s=Gw({...t,type:n});if(this.checkIfFileAlreadyExists(s)){const e=new Fw.RestrictionError(this.i18n("noDuplicates",{fileName:r}));throw Uw(this,ax)[ax](e,t),e}const a=t.meta||{};a.name=r,a.type=n;const l=Number.isFinite(t.data.size)?t.data.size:null;let u={source:t.source||"",id:s,name:r,extension:i||"",meta:{...this.getState().meta,...a},type:n,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isRemote:o,remote:t.remote||"",preview:t.preview};const c=this.opts.onBeforeFileAdded(u,e);if(!1===c){const e=new Fw.RestrictionError("Cannot add the file because onBeforeFileAdded returned false.");throw this.emit("restriction-failed",t,e),e}"object"==typeof c&&null!==c&&(u=c);try{const t=Object.keys(e).map((t=>e[t]));Uw(this,tx)[tx].validate(u,t)}catch(e){throw Uw(this,ax)[ax](e,u),e}return u}function Ex(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout((()=>{this.scheduledAutoProceed=null,this.upload().catch((e=>{e.isRestriction||this.log(e.stack||e.message||e)}))}),4))}function Cx(){const e=(e,t,n)=>{let r=e.message||"Unknown error";e.details&&(r+=` ${e.details}`),this.setState({error:r}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:n})};this.on("error",e),this.on("upload-error",((t,n,r)=>{if(e(n,t,r),"object"==typeof n&&n.message){const e=new Error(n.message);e.details=n.message,n.details&&(e.details+=` ${n.details}`),e.message=this.i18n("failedToUpload",{file:null==t?void 0:t.name}),Uw(this,ax)[ax](e)}else Uw(this,ax)[ax](n)})),this.on("upload",(()=>{this.setState({error:null})})),this.on("upload-started",(e=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("upload-progress",this.calculateProgress),this.on("upload-success",((e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...n,postprocess:Uw(this,sx)[sx].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()})),this.on("preprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("preprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})})),this.on("postprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("postprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})})),this.on("restored",(()=>{this.calculateTotalProgress()})),this.on("dashboard:file-edit-complete",(e=>{e&&Uw(this,lx)[lx](e)})),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",Uw(this,fx)[fx]),window.addEventListener("offline",Uw(this,fx)[fx]),setTimeout(Uw(this,fx)[fx],3e3))}function Tx(e,t){void 0===t&&(t={});const{forceAllowNewUpload:n=!1}=t,{allowNewUpload:r,currentUploads:i}=this.getState();if(!r&&!n)throw new Error("Cannot create a new upload: already uploading.");const o=(0,zw.nanoid)();return this.emit("upload",{id:o,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...i,[o]:{fileIDs:e,step:0,result:{}}}}),o}function Ox(e){const{currentUploads:t}=this.getState();return t[e]}function Sx(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function Ax(e){let{currentUploads:t}=this.getState(),n=t[e];const r=n.step||0,i=[...Uw(this,ix)[ix],...Uw(this,ox)[ox],...Uw(this,sx)[sx]];try{for(let o=r;o<i.length&&n;o++){const r=i[o],s={...n,step:o};this.setState({currentUploads:{...t,[e]:s}}),await r(s.fileIDs,e),t=this.getState().currentUploads,n=t[e]}}catch(t){throw Uw(this,yx)[yx](e),t}if(n){n.fileIDs.forEach((e=>{const t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)}));const r=n.fileIDs.map((e=>this.getFile(e))),i=r.filter((e=>!e.error)),o=r.filter((e=>e.error));await this.addResultData(e,{successful:i,failed:o,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let o;return n&&(o=n.result,this.emit("complete",o),Uw(this,yx)[yx](e)),null==o&&this.log(`Not setting result for an upload that has been removed: ${e}`),o}vx.VERSION="2.3.1";var Nx,_x,jx,Ix,Lx,zx,Px,Fx=vx,Rx={},Bx=[],Ux=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Hx(e,t){for(var n in t)e[n]=t[n];return e}function $x(e){var t=e.parentNode;t&&t.removeChild(e)}function Vx(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Nx.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Wx(e,s,r,i,null)}function Wx(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++jx:i};return null==i&&null!=_x.vnode&&_x.vnode(o),o}function qx(e){return e.children}function Yx(e,t){this.props=e,this.context=t}function Qx(e,t){if(null==t)return e.__?Qx(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Qx(e):null}function Kx(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Kx(e)}}function Gx(e){(!e.__d&&(e.__d=!0)&&Lx.push(e)&&!Jx.__r++||zx!==_x.debounceRendering)&&((zx=_x.debounceRendering)||setTimeout)(Jx)}function Jx(){for(var e;Jx.__r=Lx.length;)e=Lx.sort((function(e,t){return e.__v.__b-t.__v.__b})),Lx=[],e.some((function(e){var t,n,r,i,o,s;e.__d&&(o=(i=(t=e).__v).__e,(s=t.__P)&&(n=[],(r=Hx({},i)).__v=i.__v+1,oM(s,i,r,t.__n,void 0!==s.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?Qx(i):o,i.__h),sM(n,i),i.__e!=o&&Kx(i)))}))}function Xx(e,t,n,r,i,o,s,a,l,u){var c,d,p,h,f,m,g,y=r&&r.__k||Bx,b=y.length;for(n.__k=[],c=0;c<t.length;c++)if(null!=(h=n.__k[c]=null==(h=t[c])||"boolean"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?Wx(null,h,null,null,h):Array.isArray(h)?Wx(qx,{children:h},null,null,null):h.__b>0?Wx(h.type,h.props,h.key,null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(p=y[c])||p&&h.key==p.key&&h.type===p.type)y[c]=void 0;else for(d=0;d<b;d++){if((p=y[d])&&h.key==p.key&&h.type===p.type){y[d]=void 0;break}p=null}oM(e,h,p=p||Rx,i,o,s,a,l,u),f=h.__e,(d=h.ref)&&p.ref!=d&&(g||(g=[]),p.ref&&g.push(p.ref,null,h),g.push(d,h.__c||f,h)),null!=f?(null==m&&(m=f),"function"==typeof h.type&&h.__k===p.__k?h.__d=l=Zx(h,l,e):l=eM(e,h,p,y,f,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=Qx(p))}for(n.__e=m,c=b;c--;)null!=y[c]&&("function"==typeof n.type&&null!=y[c].__e&&y[c].__e==n.__d&&(n.__d=Qx(r,c+1)),uM(y[c],y[c]));if(g)for(c=0;c<g.length;c++)lM(g[c],g[++c],g[++c])}function Zx(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?Zx(r,t,n):eM(n,r,r,i,r.__e,t));return t}function eM(e,t,n,r,i,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<r.length;l+=2)if(a==i)break e;e.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function tM(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||Ux.test(t)?n:n+"px"}function nM(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||tM(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||tM(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?iM:rM,o):e.removeEventListener(t,o?iM:rM,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function rM(e){this.l[e.type+!1](_x.event?_x.event(e):e)}function iM(e){this.l[e.type+!0](_x.event?_x.event(e):e)}function oM(e,t,n,r,i,o,s,a,l){var u,c,d,p,h,f,m,g,y,b,v,w,x,M=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(u=_x.__b)&&u(t);try{e:if("function"==typeof M){if(g=t.props,y=(u=M.contextType)&&r[u.__c],b=u?y?y.props.value:u.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:("prototype"in M&&M.prototype.render?t.__c=c=new M(g,b):(t.__c=c=new Yx(g,b),c.constructor=M,c.render=cM),y&&y.sub(c),c.props=g,c.state||(c.state={}),c.context=b,c.__n=r,d=c.__d=!0,c.__h=[]),null==c.__s&&(c.__s=c.state),null!=M.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Hx({},c.__s)),Hx(c.__s,M.getDerivedStateFromProps(g,c.__s))),p=c.props,h=c.state,d)null==M.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==M.getDerivedStateFromProps&&g!==p&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(g,b),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(g,c.__s,b)||t.__v===n.__v){c.props=g,c.state=c.__s,t.__v!==n.__v&&(c.__d=!1),c.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),c.__h.length&&s.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(g,c.__s,b),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(p,h,f)}))}if(c.context=b,c.props=g,c.__v=t,c.__P=e,v=_x.__r,w=0,"prototype"in M&&M.prototype.render)c.state=c.__s,c.__d=!1,v&&v(t),u=c.render(c.props,c.state,c.context);else do{c.__d=!1,v&&v(t),u=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++w<25);c.state=c.__s,null!=c.getChildContext&&(r=Hx(Hx({},r),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(f=c.getSnapshotBeforeUpdate(p,h)),x=null!=u&&u.type===qx&&null==u.key?u.props.children:u,Xx(e,Array.isArray(x)?x:[x],t,n,r,i,o,s,a,l),c.base=t.__e,t.__h=null,c.__h.length&&s.push(c),m&&(c.__E=c.__=null),c.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=aM(n.__e,t,n,r,i,o,s,l);(u=_x.diffed)&&u(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),_x.__e(e,t,n)}}function sM(e,t){_x.__c&&_x.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){_x.__e(e,t.__v)}}))}function aM(e,t,n,r,i,o,s,a){var l,u,c,d=n.props,p=t.props,h=t.type,f=0;if("svg"===h&&(i=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===h)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,p.is&&p),o=null,a=!1}if(null===h)d===p||a&&e.data===p||(e.data=p);else{if(o=o&&Nx.call(e.childNodes),u=(d=n.props||Rx).dangerouslySetInnerHTML,c=p.dangerouslySetInnerHTML,!a){if(null!=o)for(d={},f=0;f<e.attributes.length;f++)d[e.attributes[f].name]=e.attributes[f].value;(c||u)&&(c&&(u&&c.__html==u.__html||c.__html===e.innerHTML)||(e.innerHTML=c&&c.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||nM(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||nM(e,o,t[o],n[o],r)}(e,p,d,i,a),c)t.__k=[];else if(f=t.props.children,Xx(e,Array.isArray(f)?f:[f],t,n,r,i&&"foreignObject"!==h,o,s,o?o[0]:n.__k&&Qx(n,0),a),null!=o)for(f=o.length;f--;)null!=o[f]&&$x(o[f]);a||("value"in p&&void 0!==(f=p.value)&&(f!==e.value||"progress"===h&&!f||"option"===h&&f!==d.value)&&nM(e,"value",f,d.value,!1),"checked"in p&&void 0!==(f=p.checked)&&f!==e.checked&&nM(e,"checked",f,d.checked,!1))}return e}function lM(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){_x.__e(e,n)}}function uM(e,t,n){var r,i;if(_x.unmount&&_x.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||lM(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){_x.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&uM(r[i],t,"function"!=typeof e.type);n||null==e.__e||$x(e.__e),e.__e=e.__d=void 0}function cM(e,t,n){return this.constructor(e,n)}function dM(e,t,n){var r,i,o;_x.__&&_x.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],oM(t,e=(!r&&n||t).__k=Vx(qx,null,[e]),i||Rx,Rx,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Nx.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),sM(o,e)}Nx=Bx.slice,_x={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},jx=0,Ix=function(e){return null!=e&&void 0===e.constructor},Yx.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Hx({},this.state),"function"==typeof e&&(e=e(Hx({},n),this.props)),e&&Hx(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),Gx(this))},Yx.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Gx(this))},Yx.prototype.render=qx,Lx=[],Jx.__r=0,Px=0;var pM=Object.freeze({__proto__:null,render:dM,hydrate:function e(t,n){dM(t,n,e)},createElement:Vx,h:Vx,Fragment:qx,createRef:function(){return{current:null}},get isValidElement(){return Ix},Component:Yx,cloneElement:function(e,t,n){var r,i,o,s=Hx({},e.props);for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];return arguments.length>2&&(s.children=arguments.length>3?Nx.call(arguments,2):n),Wx(e.type,s,r||e.key,i||e.ref,null)},createContext:function(e,t){var n={__c:t="__cC"+Px++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(Gx)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},toChildArray:function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){e(t,n)})):n.push(t)),n},get options(){return _x}}),hM=rc(pM);var fM=function(e){return(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE};const mM=fM;var gM=function(e,t){return void 0===t&&(t=document),"string"==typeof e?t.querySelector(e):mM(e)?e:null};var yM=function(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir};const bM=iw;var vM=class{constructor(e,t){void 0===t&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(),this.i18nInit()}i18nInit(){const e=new bM([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}},wM=hM;function xM(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var MM=0;function DM(e){return"__private_"+MM+++"_"+e}const kM=gM,EM=yM,CM=vM;var TM=DM("updateUI");class OM extends CM{constructor(){super(...arguments),Object.defineProperty(this,TM,{writable:!0,value:void 0})}mount(e,t){const n=t.id,r=kM(e);if(r){this.isTargetDOMEl=!0;const t=document.createElement("div");return t.classList.add("uppy-Root"),xM(this,TM)[TM]=function(e){let t=null,n=null;return function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=i,t||(t=Promise.resolve().then((()=>(t=null,e(...n))))),t}}((e=>{this.uppy.getPlugin(this.id)&&((0,wM.render)(this.render(e),t),this.afterUpdate())})),this.uppy.log(`Installing ${n} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),(0,wM.render)(this.render(this.uppy.getState()),t),this.el=t,r.appendChild(t),t.dir=this.opts.direction||EM(t)||"ltr",this.onMount(),this.el}let i;if("object"==typeof e&&e instanceof OM)i=e;else if("function"==typeof e){const t=e;this.uppy.iteratePlugins((e=>{e instanceof t&&(i=e)}))}if(i)return this.uppy.log(`Installing ${n} to ${i.id}`),this.parent=i,this.el=i.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${n}`);let o=`Invalid target option given to ${n}.`;throw o+="function"==typeof e?" The given target is not a Plugin class. "+"Please check that you're not specifying a React Component instead of a plugin. "+"If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: "+"run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. "+"Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. "+"(see https://github.com/transloadit/uppy/issues/1042)\n\n"+"If you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(o)}update(e){var t,n;null!=this.el&&(null==(t=(n=xM(this,TM))[TM])||t.call(n,e))}unmount(){var e;this.isTargetDOMEl&&(null==(e=this.el)||e.remove());this.onUnmount()}onMount(){}onUnmount(){}}var SM=OM;!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Uppy=t.UIPlugin=t.BasePlugin=void 0,Object.defineProperty(t,"debugLogger",{enumerable:!0,get:function(){return n.debugLogger}});var n=jv;e.exports=Fx;const r=SM;t.UIPlugin=r;const i=vM;t.BasePlugin=i;const o=Fx;t.Uppy=o;const s=SM,a=vM;o.Uppy=o,o.UIPlugin=s,o.BasePlugin=a,o.debugLogger=n.debugLogger}(_v,_v.exports);var AM=nc(_v.exports),NM={exports:{}},_M={},jM=Array.from,IM=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];var LM=function(e,t){if(t){const n=e.querySelector(`[data-uppy-paneltype="${t}"]`);if(n)return n}return e};Object.defineProperty(_M,"__esModule",{value:!0}),_M.forInline=function(e,t,n){null===t||BM(e,t,n)},_M.forModal=BM;const zM=jM,PM=IM,FM=LM;function RM(e,t){const n=t[0];n&&(n.focus(),e.preventDefault())}function BM(e,t,n){const r=FM(n,t),i=zM(r.querySelectorAll(PM)),o=i.indexOf(document.activeElement);!function(e){return e.contains(document.activeElement)}(r)?RM(e,i):e.shiftKey&&0===o?function(e,t){const n=t[t.length-1];n&&(n.focus(),e.preventDefault())}(e,i):e.shiftKey||o!==i.length-1||RM(e,i)}var UM={exports:{}};var HM=function(e){if(!e.bytesUploaded)return 0;const t=Date.now()-e.uploadStarted;return e.bytesUploaded/(t/1e3)};var $M=function(e){return e.bytesTotal-e.bytesUploaded},VM={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"},WM={};const qM=function(e){return{hours:Math.floor(e/3600)%24,minutes:Math.floor(e/60)%60,seconds:Math.floor(e%60)}};var YM=function(e){const t=qM(e);return`${0===t.hours?"":`${t.hours}h`}${0===t.minutes?"":`${0===t.hours?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`}${0!==t.hours?"":`${0===t.minutes?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`}`};Object.defineProperty(WM,"__esModule",{value:!0}),WM.CancelBtn=function(e){const{i18n:t,uppy:n}=e;return(0,QM.h)("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>n.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},(0,QM.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},(0,QM.h)("g",{fill:"none",fillRule:"evenodd"},(0,QM.h)("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),(0,QM.h)("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))},WM.DoneBtn=function(e){const{i18n:t,doneButtonHandler:n}=e;return(0,QM.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:n,"data-uppy-super-focusable":!0},t("done"))},WM.LoadingSpinner=tD,WM.PauseResumeButton=function(e){const{isAllPaused:t,i18n:n,isAllComplete:r,resumableUploads:i,uppy:o}=e,s=n(t?"resume":"pause");return(0,QM.h)("button",{title:s,"aria-label":s,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:function(){return r?null:i?t?o.resumeAll():o.pauseAll():o.cancelAll()},"data-uppy-super-focusable":!0},(0,QM.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},(0,QM.h)("g",{fill:"none",fillRule:"evenodd"},(0,QM.h)("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),(0,QM.h)("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))},WM.ProgressBarComplete=function(e){const{i18n:t}=e;return(0,QM.h)("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete")},(0,QM.h)("div",{className:"uppy-StatusBar-status"},(0,QM.h)("div",{className:"uppy-StatusBar-statusPrimary"},(0,QM.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},(0,QM.h)("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))},WM.ProgressBarError=function(e){const{error:t,i18n:n,complete:r,numUploads:i}=e;return(0,QM.h)("div",{className:"uppy-StatusBar-content",title:n("uploadFailed")},(0,QM.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},(0,QM.h)("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),(0,QM.h)("div",{className:"uppy-StatusBar-status"},(0,QM.h)("div",{className:"uppy-StatusBar-statusPrimary"},n("uploadFailed"),(0,QM.h)("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":n("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:function(){const e=`${n("uploadFailed")} \n\n ${t}`;alert(e)},type:"button"},"?")),(0,QM.h)(rD,{i18n:n,complete:r,numUploads:i})))},WM.ProgressBarProcessing=function(e){const{progress:t}=e,{value:n,mode:r,message:i}=t,o=Math.round(100*n),s=`·`;return(0,QM.h)("div",{className:"uppy-StatusBar-content"},(0,QM.h)(tD,null),"determinate"===r?`${o}% ${s} `:"",i)},WM.ProgressBarUploading=function(e){const{i18n:t,supportsUploadProgress:n,totalProgress:r,showProgressDetails:i,isUploadStarted:o,isAllComplete:s,isAllPaused:a,newFiles:l,numUploads:u,complete:c,totalUploadedSize:d,totalSize:p,totalETA:h,startUpload:f}=e,m=l&&o;if(!o||s)return null;const g=t(a?"paused":"uploading");return(0,QM.h)("div",{className:"uppy-StatusBar-content","aria-label":g,title:g},a?null:(0,QM.h)(tD,null),(0,QM.h)("div",{className:"uppy-StatusBar-status"},(0,QM.h)("div",{className:"uppy-StatusBar-statusPrimary"},n?`${g}: ${r}%`:g),a||m||!i?null:n?(0,QM.h)(oD,{numUploads:u,complete:c,totalUploadedSize:d,totalSize:p,totalETA:h,i18n:t}):(0,QM.h)(rD,{i18n:t,complete:c,numUploads:u}),m?(0,QM.h)(iD,{i18n:t,newFiles:l,startUpload:f}):null))},WM.ProgressDetails=nD,WM.RetryBtn=function(e){const{i18n:t,uppy:n}=e;return(0,QM.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>n.retryAll(),"data-uppy-super-focusable":!0},(0,QM.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},(0,QM.h)("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),t("retry"))},WM.UploadBtn=function(e){const{newFiles:t,isUploadStarted:n,recoveredState:r,i18n:i,uploadState:o,isSomeGhost:s,startUpload:a}=e,l=KM("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":o===XM.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":s}),u=i(t&&n&&!r?"uploadXNewFiles":"uploadXFiles",{smart_count:t});return(0,QM.h)("button",{type:"button",className:l,"aria-label":i("uploadXFiles",{smart_count:t}),onClick:a,disabled:s,"data-uppy-super-focusable":!0},u)};var QM=hM;const KM=oc.exports,GM=Hv,JM=YM,XM=VM,ZM=`·`,eD=()=>` ${ZM} `;function tD(){return(0,QM.h)("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},(0,QM.h)("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function nD(e){const{numUploads:t,complete:n,totalUploadedSize:r,totalSize:i,totalETA:o,i18n:s}=e,a=t>1;return(0,QM.h)("div",{className:"uppy-StatusBar-statusSecondary"},a&&s("filesUploadedOfTotal",{complete:n,smart_count:t}),(0,QM.h)("span",{className:"uppy-StatusBar-additionalInfo"},a&&eD(),s("dataUploadedOfTotal",{complete:GM(r),total:GM(i)}),eD(),s("xTimeLeft",{time:JM(o)})))}function rD(e){const{i18n:t,complete:n,numUploads:r}=e;return(0,QM.h)("div",{className:"uppy-StatusBar-statusSecondary"},t("filesUploadedOfTotal",{complete:n,smart_count:r}))}function iD(e){const{i18n:t,newFiles:n,startUpload:r}=e,i=KM("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return(0,QM.h)("div",{className:"uppy-StatusBar-statusSecondary"},(0,QM.h)("div",{className:"uppy-StatusBar-statusSecondaryHint"},t("xMoreFilesAdded",{smart_count:n})),(0,QM.h)("button",{type:"button",className:i,"aria-label":t("uploadXFiles",{smart_count:n}),onClick:r},t("upload")))}const oD=kw(nD,500,{leading:!0,trailing:!0});var sD=hM,aD=WM;const lD=oc.exports,uD=VM,cD=function(e){const t=[];let n,r;for(const{progress:i}of Object.values(e)){const{preprocess:e,postprocess:o}=i;null==r&&(e||o)&&({mode:n,message:r}=e||o),"determinate"===(null==e?void 0:e.mode)&&t.push(e.value),"determinate"===(null==o?void 0:o.mode)&&t.push(o.value)}return{mode:n,message:r,value:t.reduce(((e,n)=>e+n/t.length),0)}},{STATE_ERROR:dD,STATE_WAITING:pD,STATE_PREPROCESSING:hD,STATE_UPLOADING:fD,STATE_POSTPROCESSING:mD,STATE_COMPLETE:gD}=uD;var yD=function(e){const{newFiles:t,allowNewUpload:n,isUploadInProgress:r,isAllPaused:i,resumableUploads:o,error:s,hideUploadButton:a,hidePauseResumeButton:l,hideCancelButton:u,hideRetryButton:c,recoveredState:d,uploadState:p,totalProgress:h,files:f,supportsUploadProgress:m,hideAfterFinish:g,isSomeGhost:y,doneButtonHandler:b,isUploadStarted:v,i18n:w,startUpload:x,uppy:M,isAllComplete:D,showProgressDetails:k,numUploads:E,complete:C,totalSize:T,totalETA:O,totalUploadedSize:S}=e,A=function(){switch(p){case mD:case hD:{const e=cD(f);return"determinate"===e.mode?100*e.value:h}case dD:return null;case fD:return m?h:null;default:return h}}(),N=function(){if(d)return!1;switch(p){case pD:return a||0===t;case gD:return g;default:return!1}}(),_=null!=A?A:100,j=!s&&t&&!r&&!i&&n&&!a,I=!u&&p!==pD&&p!==gD,L=o&&!l&&p===fD,z=s&&!D&&!c,P=b&&p===gD,F=lD("uppy-StatusBar-progress",{"is-indeterminate":function(){switch(p){case mD:case hD:{const{mode:e}=cD(f);return"indeterminate"===e}case fD:return!m;default:return!1}}()}),R=lD("uppy-StatusBar",`is-${p}`,{"has-ghosts":y});return(0,sD.h)("div",{className:R,"aria-hidden":N},(0,sD.h)("div",{className:F,style:{width:`${_}%`},role:"progressbar","aria-label":`${_}%`,"aria-valuetext":`${_}%`,"aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":A}),(()=>{switch(p){case hD:case mD:return(0,sD.h)(aD.ProgressBarProcessing,{progress:cD(f)});case gD:return(0,sD.h)(aD.ProgressBarComplete,{i18n:w});case dD:return(0,sD.h)(aD.ProgressBarError,{error:s,i18n:w,numUploads:E,complete:C});case fD:return(0,sD.h)(aD.ProgressBarUploading,{i18n:w,supportsUploadProgress:m,totalProgress:h,showProgressDetails:k,isUploadStarted:v,isAllComplete:D,isAllPaused:i,newFiles:t,numUploads:E,complete:C,totalUploadedSize:S,totalSize:T,totalETA:O,startUpload:x});default:return null}})(),(0,sD.h)("div",{className:"uppy-StatusBar-actions"},d||j?(0,sD.h)(aD.UploadBtn,{newFiles:t,isUploadStarted:v,recoveredState:d,i18n:w,isSomeGhost:y,startUpload:x,uploadState:p}):null,z?(0,sD.h)(aD.RetryBtn,{i18n:w,uppy:M}):null,L?(0,sD.h)(aD.PauseResumeButton,{isAllPaused:i,i18n:w,isAllComplete:D,resumableUploads:o,uppy:M}):null,I?(0,sD.h)(aD.CancelBtn,{i18n:w,uppy:M}):null,P?(0,sD.h)(aD.DoneBtn,{i18n:w,doneButtonHandler:b}):null))},bD=_v.exports;const vD=HM,wD=$M,xD=yM,MD=VM,DD=yD,kD={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function ED(e){const t=function(e){let t=0;return e.forEach((e=>{t+=vD(e.progress)})),t}(e);if(0===t)return 0;const n=e.reduce(((e,t)=>e+wD(t.progress)),0);return Math.round(n/t*10)/10}function CD(e,t,n,r){if(e&&!t)return MD.STATE_ERROR;if(t)return MD.STATE_COMPLETE;if(n)return MD.STATE_WAITING;let i=MD.STATE_WAITING;const o=Object.keys(r);for(let e=0;e<o.length;e++){const{progress:t}=r[o[e]];if(t.uploadStarted&&!t.uploadComplete)return MD.STATE_UPLOADING;t.preprocess&&i!==MD.STATE_UPLOADING&&(i=MD.STATE_PREPROCESSING),t.postprocess&&i!==MD.STATE_UPLOADING&&i!==MD.STATE_PREPROCESSING&&(i=MD.STATE_POSTPROCESSING)}return i}class TD extends bD.UIPlugin{constructor(e,t){super(e,t),this.startUpload=()=>{const{recoveredState:e}=this.uppy.getState();if(!e)return this.uppy.upload().catch((()=>{}));this.uppy.emit("restore-confirmed")},this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=kD;this.opts={target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null,...t},this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){const{capabilities:t,files:n,allowNewUpload:r,totalProgress:i,error:o,recoveredState:s}=e,{newFiles:a,startedFiles:l,completeFiles:u,inProgressNotPausedFiles:c,isUploadStarted:d,isAllComplete:p,isAllErrored:h,isAllPaused:f,isUploadInProgress:m,isSomeGhost:g}=this.uppy.getObjectOfFilesPerState(),y=s?Object.values(n):a,b=ED(c),v=!!t.resumableUploads,w=!1!==t.uploadProgress;let x=0,M=0;return l.forEach((e=>{x+=e.progress.bytesTotal||0,M+=e.progress.bytesUploaded||0})),DD({error:o,uploadState:CD(o,p,s,e.files||{}),allowNewUpload:r,totalProgress:i,totalSize:x,totalUploadedSize:M,isAllComplete:!1,isAllPaused:f,isAllErrored:h,isUploadStarted:d,isUploadInProgress:m,isSomeGhost:g,recoveredState:s,complete:u.length,newFiles:y.length,numUploads:l.length,totalETA:b,files:n,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:v,supportsUploadProgress:w,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish,isTargetDOMEl:this.isTargetDOMEl})}onMount(){const e=this.el;xD(e)||(e.dir="ltr")}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}TD.VERSION="2.2.1",UM.exports=TD;var OD={exports:{}},SD=hM;const AD=300;class ND extends SD.Component{constructor(){super(...arguments),this.ref=(0,SD.createRef)()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,AD)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,AD)}render(){const{children:e}=this.props;return(0,SD.h)("div",{className:"uppy-Informer-animated",ref:this.ref},e)}}var _D=ND,jD=hM;function ID(e,t){const n=e._ptgLinkedRefs||(e._ptgLinkedRefs={});return n[t]||(n[t]=n=>{e.refs[t]=n})}function LD(e){const t={};for(let o=0;o<e.length;o++)if(null!=e[o]){t[(n=e[o],r=o.toString(36),i=void 0,null!=(i=null==n?void 0:n.key)?i:r)]=e[o]}var n,r,i;return t}function zD(e,t){e=e||{},t=t||{};const n=n=>t.hasOwnProperty(n)?t[n]:e[n],r={};let i=[];for(const n in e)t.hasOwnProperty(n)?i.length&&(r[n]=i,i=[]):i.push(n);const o={};for(const e in t){if(r.hasOwnProperty(e))for(let t=0;t<r[e].length;t++){const i=r[e][t];o[r[e][t]]=n(i)}o[e]=n(e)}for(let e=0;e<i.length;e++)o[i[e]]=n(i[e]);return o}class PD extends jD.Component{constructor(e,t){super(e,t),this.refs={},this.state={children:LD((0,jD.toChildArray)((0,jD.toChildArray)(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){const e=this.state.children;for(const t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){const t=LD((0,jD.toChildArray)(e.children)||[]),n=this.state.children;let r;for(r in this.setState((e=>({children:zD(e.children,t)}))),t)if(t.hasOwnProperty(r)){const e=n&&n.hasOwnProperty(r);t[r]&&e&&this.currentlyTransitioningKeys[r]?(this.keysToEnter.push(r),this.keysToAbortLeave.push(r)):!t[r]||e||this.currentlyTransitioningKeys[r]||this.keysToEnter.push(r)}for(r in n)if(n.hasOwnProperty(r)){const e=t&&t.hasOwnProperty(r);!n[r]||e||this.currentlyTransitioningKeys[r]||this.keysToLeave.push(r)}}componentDidUpdate(){const{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);const{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){const t=this.keysToAbortLeave.indexOf(e);-1!==t&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){const t=this.refs[e];t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const n=LD((0,jD.toChildArray)(this.props.children)||[]);n&&n.hasOwnProperty(e)||this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){const t=this.refs[e];t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const n=LD((0,jD.toChildArray)(this.props.children)||[]);n&&n.hasOwnProperty(e)||this.performLeave(e)}performLeave(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;const t=this.refs[e];t.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const n=LD((0,jD.toChildArray)(this.props.children)||[]);if(n&&n.hasOwnProperty(e))this.performEnter(e);else{const t=(r={},i=this.state.children,Object.assign(r,i));delete t[e],this.setState({children:t})}var r,i}render(e,t){let{childFactory:n,transitionLeave:r,transitionName:i,transitionAppear:o,transitionEnter:s,transitionLeaveTimeout:a,transitionEnterTimeout:l,transitionAppearTimeout:u,component:c,...d}=e,{children:p}=t;const h=[];for(const e in p)if(p.hasOwnProperty(e)){const t=p[e];if(t){const r=ID(this,e),i=(0,jD.cloneElement)(n(t),{ref:r,key:e});h.push(i)}}return(0,jD.h)(c,d,h)}}PD.defaultProps={component:"span",childFactory:e=>e};var FD=hM,RD=_v.exports;const BD=_D,UD=PD;class HD extends RD.UIPlugin{constructor(e,t){super(e,t),this.render=e=>(0,FD.h)("div",{className:"uppy uppy-Informer"},(0,FD.h)(UD,null,e.info.map((e=>(0,FD.h)(BD,{key:e.message},(0,FD.h)("p",{role:"alert"},e.message," ",e.details&&(0,FD.h)("span",{"aria-label":e.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${e.message} \n\n ${e.details}`)},"?"))))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer";this.opts={...t}}install(){const{target:e}=this.opts;e&&this.mount(e,this)}}HD.VERSION="2.1.0",OD.exports=HD;var $D={exports:{}};!function(e){function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n="undefined"!=typeof self?self:tc;const r="undefined"!=typeof navigator,i=r&&"undefined"==typeof HTMLImageElement,o=!(void 0===tc||"undefined"==typeof process||!process.versions||!process.versions.node),s=n.Buffer,a=!!s,l=e=>void 0!==e;function u(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(l).length)}function c(e){let t=new Error(e);throw delete t.stack,t}function d(e){let t=function(e){let t=0;return e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048}(e);return e.jfif.enabled&&(t+=50),e.xmp.enabled&&(t+=2e4),e.iptc.enabled&&(t+=14e3),e.icc.enabled&&(t+=6e3),t}const p=e=>String.fromCharCode.apply(null,e),h="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;class f{static from(e,t){return e instanceof this&&e.le===t?e:new f(e,void 0,void 0,t)}constructor(e,t=0,n,r){if("boolean"==typeof r&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===n&&(n=e.byteLength-t);let r=new DataView(e,t,n);this._swapDataView(r)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof f){void 0===n&&(n=e.byteLength-t),(t+=e.byteOffset)+n>e.byteOffset+e.byteLength&&c("Creating view outside of available memory in ArrayBuffer");let r=new DataView(e.buffer,t,n);this._swapDataView(r)}else if("number"==typeof e){let t=new DataView(new ArrayBuffer(e));this._swapDataView(t)}else c("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,n=f){return e instanceof DataView||e instanceof f?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||c("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new n(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new f(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return n=this.getUint8Array(e,t),h?h.decode(n):a?Buffer.from(n).toString("utf8"):decodeURIComponent(escape(p(n)));var n}getLatin1String(e=0,t=this.byteLength){let n=this.getUint8Array(e,t);return p(n)}getUnicodeString(e=0,t=this.byteLength){const n=[];for(let r=0;r<t&&e+r<this.byteLength;r+=2)n.push(this.getUint16(e+r));return p(n)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,n){switch(t){case 1:return this.getUint8(e,n);case 2:return this.getUint16(e,n);case 4:return this.getUint32(e,n);case 8:return this.getUint64&&this.getUint64(e,n)}}getUint(e,t,n){switch(t){case 8:return this.getUint8(e,n);case 16:return this.getUint16(e,n);case 32:return this.getUint32(e,n);case 64:return this.getUint64&&this.getUint64(e,n)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function m(e,t){c(`${e} '${t}' was not loaded, try using full build of exifr.`)}class g extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||m(this.kind,e),t&&(e in t||function(e,t){c(`Unknown ${e} '${t}'.`)}(this.kind,e),t[e].enabled||m(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var y=new g("file parser"),b=new g("segment parser"),v=new g("file reader");let w=n.fetch;const x="Invalid input argument";function M(e,t){return(n=e).startsWith("data:")||n.length>1e4?k(e,t,"base64"):o&&e.includes("://")?D(e,t,"url",E):o?k(e,t,"fs"):r?D(e,t,"url",E):void c(x);var n}async function D(e,t,n,r){return v.has(n)?k(e,t,n):r?async function(e,t){let n=await t(e);return new f(n)}(e,r):void c(`Parser ${n} is not loaded`)}async function k(e,t,n){let r=new(v.get(n))(e,t);return await r.read(),r}const E=e=>w(e).then((e=>e.arrayBuffer())),C=e=>new Promise(((t,n)=>{let r=new FileReader;r.onloadend=()=>t(r.result||new ArrayBuffer),r.onerror=n,r.readAsArrayBuffer(e)}));class T extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}}function O(e,t,n){let r=new T;for(let[e,t]of n)r.set(e,t);if(Array.isArray(t))for(let n of t)e.set(n,r);else e.set(t,r);return r}function S(e,t,n){let r,i=e.get(t);for(r of n)i.set(r[0],r[1])}const A=new Map,N=new Map,_=new Map,j=37500,I=37510,L=33723,z=34675,P=34665,F=34853,R=40965,B=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],U=["jfif","xmp","icc","iptc","ihdr"],H=["tiff",...U],$=["ifd0","ifd1","exif","gps","interop"],V=[...H,...$],W=["makerNote","userComment"],q=["translateKeys","translateValues","reviveValues","multiSegment"],Y=[...q,"sanitize","mergeOutput","silentErrors"];class Q{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class K extends Q{get needed(){return this.enabled||this.deps.size>0}constructor(e,n,r,i){if(super(),t(this,"enabled",!1),t(this,"skip",new Set),t(this,"pick",new Set),t(this,"deps",new Set),t(this,"translateKeys",!1),t(this,"translateValues",!1),t(this,"reviveValues",!1),this.key=e,this.enabled=n,this.parse=this.enabled,this.applyInheritables(i),this.canBeFiltered=$.includes(e),this.canBeFiltered&&(this.dict=A.get(e)),void 0!==r)if(Array.isArray(r))this.parse=this.enabled=!0,this.canBeFiltered&&r.length>0&&this.translateTagSet(r,this.pick);else if("object"==typeof r){if(this.enabled=!0,this.parse=!1!==r.parse,this.canBeFiltered){let{pick:e,skip:t}=r;e&&e.length>0&&this.translateTagSet(e,this.pick),t&&t.length>0&&this.translateTagSet(t,this.skip)}this.applyInheritables(r)}else!0===r||!1===r?this.parse=this.enabled=r:c(`Invalid options argument: ${r}`)}applyInheritables(e){let t,n;for(t of q)n=e[t],void 0!==n&&(this[t]=n)}translateTagSet(e,t){if(this.dict){let n,r,{tagKeys:i,tagValues:o}=this.dict;for(n of e)"string"==typeof n?(r=o.indexOf(n),-1===r&&(r=i.indexOf(Number(n))),-1!==r&&t.add(Number(i[r]))):t.add(n)}else for(let n of e)t.add(n)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,te(this.pick,this.deps)):this.enabled&&this.pick.size>0&&te(this.pick,this.deps)}}var G={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},J=new Map;class X extends Q{static useCached(e){let t=J.get(e);return void 0!==t||(t=new this(e),J.set(e,t)),t}constructor(e){super(),!0===e?this.setupFromTrue():void 0===e?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):"object"==typeof e?this.setupFromObject(e):c(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=r?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of B)this[e]=G[e];for(e of Y)this[e]=G[e];for(e of W)this[e]=G[e];for(e of V)this[e]=new K(e,G[e],void 0,this)}setupFromTrue(){let e;for(e of B)this[e]=G[e];for(e of Y)this[e]=G[e];for(e of W)this[e]=!0;for(e of V)this[e]=new K(e,!0,void 0,this)}setupFromArray(e){let t;for(t of B)this[t]=G[t];for(t of Y)this[t]=G[t];for(t of W)this[t]=G[t];for(t of V)this[t]=new K(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,$)}setupFromObject(e){let t;for(t of($.ifd0=$.ifd0||$.image,$.ifd1=$.ifd1||$.thumbnail,Object.assign(this,e),B))this[t]=ee(e[t],G[t]);for(t of Y)this[t]=ee(e[t],G[t]);for(t of W)this[t]=ee(e[t],G[t]);for(t of H)this[t]=new K(t,G[t],e[t],this);for(t of $)this[t]=new K(t,G[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,$,V),!0===e.tiff?this.batchEnableWithBool($,!0):!1===e.tiff?this.batchEnableWithUserValue($,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,$):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,$)}batchEnableWithBool(e,t){for(let n of e)this[n].enabled=t}batchEnableWithUserValue(e,t){for(let n of e){let e=t[n];this[n].enabled=!1!==e&&void 0!==e}}setupGlobalFilters(e,t,n,r=n){if(e&&e.length){for(let e of r)this[e].enabled=!1;let t=Z(e,n);for(let[e,n]of t)te(this[e].pick,n),this[e].enabled=!0}else if(t&&t.length){let e=Z(t,n);for(let[t,n]of e)te(this[t].skip,n)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:n,iptc:r,icc:i}=this;this.makerNote?t.deps.add(j):t.skip.add(j),this.userComment?t.deps.add(I):t.skip.add(I),n.enabled||e.skip.add(700),r.enabled||e.skip.add(L),i.enabled||e.skip.add(z)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:n,interop:r}=this;r.needed&&(t.deps.add(R),e.deps.add(R)),t.needed&&e.deps.add(P),n.needed&&e.deps.add(F),this.tiff.enabled=$.some((e=>!0===this[e].enabled))||this.makerNote||this.userComment;for(let e of $)this[e].finalizeFilters()}get onlyTiff(){return!U.map((e=>this[e].enabled)).some((e=>!0===e))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of H)this[e].enabled&&!b.has(e)&&m("segment parser",e)}}function Z(e,t){let n,r,i,o,s=[];for(i of t){for(o of(n=A.get(i),r=[],n))(e.includes(o[0])||e.includes(o[1]))&&r.push(o[0]);r.length&&s.push([i,r])}return s}function ee(e,t){return void 0!==e?e:void 0!==t?t:void 0}function te(e,t){for(let n of t)e.add(n)}t(X,"default",G);class ne{constructor(e){t(this,"parsers",{}),t(this,"output",{}),t(this,"errors",[]),t(this,"pushToErrors",(e=>this.errors.push(e))),this.options=X.useCached(e)}async read(e){this.file=await function(e,t){return"string"==typeof e?M(e,t):r&&!i&&e instanceof HTMLImageElement?M(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new f(e):r&&e instanceof Blob?D(e,t,"blob",C):void c(x)}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[n,r]of y)if(r.canHandle(e,t))return this.fileParser=new r(this.options,this.file,this.parsers),e[n]=!0;this.file.close&&this.file.close(),c("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),u(n=e)?void 0:n;var n}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async t=>{let n=await t.parse();t.assignToOutput(e,n)}));this.options.silentErrors&&(t=t.map((e=>e.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,n=b.get("tiff",e);var r;if(t.tiff?r={start:0,type:"tiff"}:t.jpeg&&(r=await this.fileParser.getOrFindSegment("tiff")),void 0===r)return;let i=await this.fileParser.ensureSegmentChunk(r),o=this.parsers.tiff=new n(i,e,t),s=await o.extractThumbnail();return t.close&&t.close(),s}}async function re(e,t){let n=new ne(t);return await n.read(e),n.parse()}var ie=Object.freeze({__proto__:null,parse:re,Exifr:ne,fileParsers:y,segmentParsers:b,fileReaders:v,tagKeys:A,tagValues:N,tagRevivers:_,createDictionary:O,extendDictionary:S,fetchUrlAsArrayBuffer:E,readBlobAsArrayBuffer:C,chunkedProps:B,otherSegments:U,segments:H,tiffBlocks:$,segmentsAndBlocks:V,tiffExtractables:W,inheritables:q,allFormatters:Y,Options:X});class oe{static findPosition(e,t){let n=e.getUint16(t+2)+2,r="function"==typeof this.headerLength?this.headerLength(e,t,n):this.headerLength,i=t+r,o=n-r;return{offset:t,length:n,headerLength:r,start:i,size:o,end:i+o}}static parse(e,t={}){return new this(e,new X({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof f?e:new f(e)}constructor(e,n={},r){t(this,"errors",[]),t(this,"raw",new Map),t(this,"handleError",(e=>{if(!this.options.silentErrors)throw e;this.errors.push(e.message)})),this.chunk=this.normalizeInput(e),this.file=r,this.type=this.constructor.type,this.globalOptions=this.options=n,this.localOptions=n[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let n=_.get(t),r=N.get(t),i=A.get(t),o=this.options[t],s=o.reviveValues&&!!n,a=o.translateValues&&!!r,l=o.translateKeys&&!!i,u={};for(let[t,o]of e)s&&n.has(t)?o=n.get(t)(o):a&&r.has(t)&&(o=this.translateValue(o,r.get(t))),l&&i.has(t)&&(t=i.get(t)||t),u[t]=o;return u}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,n){if(this.globalOptions.mergeOutput)return Object.assign(e,n);e[t]?Object.assign(e[t],n):e[t]=n}}function se(e){return 192===e||194===e||196===e||219===e||221===e||218===e||254===e}function ae(e){return e>=224&&e<=239}function le(e,t,n){for(let[r,i]of b)if(i.canHandle(e,t,n))return r}t(oe,"headerLength",4),t(oe,"type",void 0),t(oe,"multiSegment",!1),t(oe,"canHandle",(()=>!1));class ue extends class{constructor(e,n,r){t(this,"errors",[]),t(this,"ensureSegmentChunk",(async e=>{let t=e.start,n=e.size||65536;if(this.file.chunked)if(this.file.available(t,n))e.chunk=this.file.subarray(t,n);else try{e.chunk=await this.file.readChunk(t,n)}catch(t){c(`Couldn't read segment: ${JSON.stringify(e)}. ${t.message}`)}else this.file.byteLength>t+n?e.chunk=this.file.subarray(t,n):void 0===e.size?e.chunk=this.file.subarray(t):c("Segment unreachable: "+JSON.stringify(e));return e.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=n,this.parsers=r}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let n=new(b.get(e))(t,this.options,this.file);return this.parsers[e]=n}createParsers(e){for(let t of e){let{type:e,chunk:n}=t,r=this.options[e];if(r&&r.enabled){let t=this.parsers[e];t&&t.append||t||this.createParser(e,n)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),t(this,"appSegments",[]),t(this,"jpegSegments",[]),t(this,"unknownSegments",[])}static canHandle(e,t){return 65496===t}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){!0===e?(this.findAll=!0,this.wanted=new Set(b.keyList())):(e=void 0===e?b.keyList().filter((e=>this.options[e].enabled)):e.filter((e=>this.options[e].enabled&&b.has(e))),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:n,findAll:r,wanted:i,remaining:o}=this;if(!r&&this.file.chunked&&(r=Array.from(i).some((e=>{let t=b.get(e),n=this.options[e];return t.multiSegment&&n.multiSegment})),r&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,n.byteLength),!this.options.onlyTiff&&n.chunked){let t=!1;for(;o.size>0&&!t&&(n.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:r}=n,i=this.appSegments.some((e=>!this.file.available(e.offset||e.start,e.length||e.size)));if(t=e>r&&!i?!await n.readNextChunk(e):!await n.readNextChunk(r),void 0===(e=this.findAppSegmentsInRange(e,n.byteLength)))return}}}findAppSegmentsInRange(e,t){t-=2;let n,r,i,o,s,a,{file:l,findAll:u,wanted:c,remaining:d,options:p}=this;for(;e<t;e++)if(255===l.getUint8(e))if(n=l.getUint8(e+1),ae(n)){if(r=l.getUint16(e+2),i=le(l,e,r),i&&c.has(i)&&(o=b.get(i),s=o.findPosition(l,e),a=p[i],s.type=i,this.appSegments.push(s),!u&&(o.multiSegment&&a.multiSegment?(this.unfinishedMultiSegment=s.chunkNumber<s.chunkCount,this.unfinishedMultiSegment||d.delete(i)):d.delete(i),0===d.size)))break;p.recordUnknownSegments&&(s=oe.findPosition(l,e),s.marker=n,this.unknownSegments.push(s)),e+=r+1}else if(se(n)){if(r=l.getUint16(e+2),218===n&&!1!==p.stopAfterSos)return;p.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:n}),e+=r+1}return e}mergeMultiSegments(){if(!this.appSegments.some((e=>e.multiSegment)))return;let e=function(e,t){let n,r,i,o=new Map;for(let s=0;s<e.length;s++)n=e[s],r=n[t],o.has(r)?i=o.get(r):o.set(r,i=[]),i.push(n);return Array.from(o)}(this.appSegments,"type");this.mergedAppSegments=e.map((([e,t])=>{let n=b.get(e,this.options);return n.handleMultiSegments?{type:e,chunk:n.handleMultiSegments(t)}:t[0]}))}getSegment(e){return this.appSegments.find((t=>t.type===e))}async getOrFindSegment(e){let t=this.getSegment(e);return void 0===t&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}t(ue,"type","jpeg"),y.set("jpeg",ue);const ce=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class de extends oe{parseHeader(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,n=new Map){let{pick:r,skip:i}=this.options[t];r=new Set(r);let o=r.size>0,s=0===i.size,a=this.chunk.getUint16(e);e+=2;for(let l=0;l<a;l++){let a=this.chunk.getUint16(e);if(o){if(r.has(a)&&(n.set(a,this.parseTag(e,a,t)),r.delete(a),0===r.size))break}else!s&&i.has(a)||n.set(a,this.parseTag(e,a,t));e+=12}return n}parseTag(e,t,n){let{chunk:r}=this,i=r.getUint16(e+2),o=r.getUint32(e+4),s=ce[i];if(s*o<=4?e+=8:e=r.getUint32(e+8),(i<1||i>13)&&c(`Invalid TIFF value type. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${i}, offset ${e}`),e>r.byteLength&&c(`Invalid TIFF value offset. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${i}, offset ${e} is outside of chunk size ${r.byteLength}`),1===i)return r.getUint8Array(e,o);if(2===i)return""===(a=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(a=r.getString(e,o)).trim())?void 0:a;var a;if(7===i)return r.getUint8Array(e,o);if(1===o)return this.parseTagValue(i,e);{let t=new(function(e){switch(e){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:case 10:default:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 11:return Float32Array;case 12:return Float64Array}}(i))(o),n=s;for(let r=0;r<o;r++)t[r]=this.parseTagValue(i,e),e+=n;return t}}parseTagValue(e,t){let{chunk:n}=this;switch(e){case 1:return n.getUint8(t);case 3:return n.getUint16(t);case 4:case 13:return n.getUint32(t);case 5:return n.getUint32(t)/n.getUint32(t+4);case 6:return n.getInt8(t);case 8:return n.getInt16(t);case 9:return n.getInt32(t);case 10:return n.getInt32(t)/n.getInt32(t+4);case 11:return n.getFloat(t);case 12:return n.getDouble(t);default:c(`Invalid tiff type ${e}`)}}}class pe extends de{static canHandle(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}findIfd0Offset(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(void 0===this.ifd1Offset){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let n=new Map;return this[t]=n,this.parseTags(e,t,n),n}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&c("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&c(`IFD0 offset points to outside of file.\nthis.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,d(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return 0!==t.size?(this.exifOffset=t.get(P),this.interopOffset=t.get(R),this.gpsOffset=t.get(F),this.xmp=t.get(700),this.iptc=t.get(L),this.icc=t.get(z),this.options.sanitize&&(t.delete(P),t.delete(R),t.delete(F),t.delete(700),t.delete(L),t.delete(z)),t):void 0}async parseExifBlock(){if(this.exif)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.exifOffset)return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,d(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(R)),this.makerNote=e.get(j),this.userComment=e.get(I),this.options.sanitize&&(e.delete(R),e.delete(j),e.delete(I)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let n=e.get(t);n&&1===n.length&&e.set(t,n[0])}async parseGpsBlock(){if(this.gps)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.gpsOffset)return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",he(...e.get(2),e.get(1))),e.set("longitude",he(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),void 0!==this.interopOffset||this.exif||await this.parseExifBlock(),void 0!==this.interopOffset))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),void 0===this.ifd1)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,n,r={};for(t of $)if(e=this[t],!u(e))if(n=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if("ifd1"===t)continue;Object.assign(r,n)}else r[t]=n;return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[n,r]of Object.entries(t))this.assignObjectToOutput(e,n,r)}}function he(e,t,n,r){var i=e+t/60+n/3600;return"S"!==r&&"W"!==r||(i*=-1),i}t(pe,"type","tiff"),t(pe,"headerLength",10),b.set("tiff",pe);var fe=Object.freeze({__proto__:null,default:ie,Exifr:ne,fileParsers:y,segmentParsers:b,fileReaders:v,tagKeys:A,tagValues:N,tagRevivers:_,createDictionary:O,extendDictionary:S,fetchUrlAsArrayBuffer:E,readBlobAsArrayBuffer:C,chunkedProps:B,otherSegments:U,segments:H,tiffBlocks:$,segmentsAndBlocks:V,tiffExtractables:W,inheritables:q,allFormatters:Y,Options:X,parse:re});const me={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},ge=Object.assign({},me,{firstChunkSize:4e4,gps:[1,2,3,4]}),ye=Object.assign({},me,{tiff:!1,ifd1:!0,mergeOutput:!1}),be=Object.assign({},me,{firstChunkSize:4e4,ifd0:[274]});async function ve(e){let t=new ne(be);await t.read(e);let n=await t.parse();if(n&&n.ifd0)return n.ifd0[274]}const we=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}});if(e.rotateCanvas=!0,e.rotateCss=!0,"object"==typeof navigator){let t=navigator.userAgent;if(t.includes("iPad")||t.includes("iPhone")){let n=t.match(/OS (\d+)_(\d+)/);if(n){let[,t,r]=n,i=Number(t)+.1*Number(r);e.rotateCanvas=i<13.4,e.rotateCss=!1}}else if(t.includes("OS X 10")){let[,n]=t.match(/OS X 10[_.](\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<15}if(t.includes("Chrome/")){let[,n]=t.match(/Chrome\/(\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<81}else if(t.includes("Firefox/")){let[,n]=t.match(/Firefox\/(\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<77}}class xe extends f{constructor(...e){super(...e),t(this,"ranges",new Me),0!==this.byteLength&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,n){if(0===e&&0===this.byteLength&&n){let e=new DataView(n.buffer||n,n.byteOffset,n.byteLength);this._swapDataView(e)}else{let n=e+t;if(n>this.byteLength){let{dataView:e}=this._extend(n);this._swapDataView(e)}}}_extend(e){let t;t=a?s.allocUnsafe(e):new Uint8Array(e);let n=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:n}}subarray(e,t,n=!1){return t=t||this._lengthToEnd(e),n&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,n=!1){n&&this._tryExtend(t,e.byteLength,e);let r=super.set(e,t);return this.ranges.add(t,r.byteLength),r}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}}class Me{constructor(){t(this,"list",[])}get length(){return this.list.length}add(e,t,n=0){let r=e+t,i=this.list.filter((t=>De(e,t.offset,r)||De(e,t.end,r)));if(i.length>0){e=Math.min(e,...i.map((e=>e.offset))),r=Math.max(r,...i.map((e=>e.end))),t=r-e;let n=i.shift();n.offset=e,n.length=t,n.end=r,this.list=this.list.filter((e=>!i.includes(e)))}else this.list.push({offset:e,length:t,end:r})}available(e,t){let n=e+t;return this.list.some((t=>t.offset<=e&&n<=t.end))}}function De(e,t,n){return e<=t&&t<=n}class ke extends xe{constructor(e,n){super(0),t(this,"chunksRead",0),this.input=e,this.options=n}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,n=await this.readChunk(e,t);return!!n&&n.byteLength===t}async readChunk(e,t){if(this.chunksRead++,0!==(t=this.safeWrapAddress(e,t)))return this._readChunk(e,t)}safeWrapAddress(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return void 0!==this.size&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}v.set("blob",class extends ke{async readWhole(){this.chunked=!1;let e=await C(this.input);this._swapArrayBuffer(e)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(e,t){let n=t?e+t:void 0,r=this.input.slice(e,n),i=await C(r);return this.set(i,e,!0)}}),e.Exifr=ne,e.Options=X,e.allFormatters=Y,e.chunkedProps=B,e.createDictionary=O,e.default=fe,e.extendDictionary=S,e.fetchUrlAsArrayBuffer=E,e.fileParsers=y,e.fileReaders=v,e.gps=async function(e){let t=new ne(ge);await t.read(e);let n=await t.parse();if(n&&n.gps){let{latitude:e,longitude:t}=n.gps;return{latitude:e,longitude:t}}},e.gpsOnlyOptions=ge,e.inheritables=q,e.orientation=ve,e.orientationOnlyOptions=be,e.otherSegments=U,e.parse=re,e.readBlobAsArrayBuffer=C,e.rotation=async function(t){let n=await ve(t);return Object.assign({canvas:e.rotateCanvas,css:e.rotateCss},we[n])},e.rotations=we,e.segmentParsers=b,e.segments=H,e.segmentsAndBlocks=V,e.tagKeys=A,e.tagRevivers=_,e.tagValues=N,e.thumbnail=async function(e){let t=new ne(ye);await t.read(e);let n=await t.extractThumbnail();return n&&a?s.from(n):n},e.thumbnailOnlyOptions=ye,e.thumbnailUrl=async function(e){let t=await this.thumbnail(e);if(void 0!==t){let e=new Blob([t]);return URL.createObjectURL(e)}},e.tiffBlocks=$,e.tiffExtractables=W,Object.defineProperty(e,"__esModule",{value:!0})}($D.exports);const VD=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;var WD=function(e,t,n){var r,i;const o=VD.exec(e),s=null!=(r=null!=(i=t.mimeType)?i:null==o?void 0:o[1])?r:"plain/text";let a;if(null!=o[2]){const e=atob(decodeURIComponent(o[3])),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);a=[t]}else a=[decodeURIComponent(o[3])];return n?new File(a,t.name||"",{type:s}):new Blob(a,{type:s})};var qD=_v.exports,YD=$D.exports;const QD=WD,KD=function(e){return e.startsWith("blob:")},GD=function(e){return!!e&&/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e)},JD={strings:{generatingThumbnails:"Generating thumbnails..."}};class XD extends qD.UIPlugin{constructor(e,t){super(e,t),this.onFileAdded=e=>{!e.preview&&e.data&&GD(e.type)&&!e.isRemote&&this.addToQueue(e.id)},this.onCancelRequest=e=>{const t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1)},this.onFileRemoved=e=>{const t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1),e.preview&&KD(e.preview)&&URL.revokeObjectURL(e.preview)},this.onRestored=()=>{this.uppy.getFiles().filter((e=>e.isRestored)).forEach((e=>{e.preview&&!KD(e.preview)||this.addToQueue(e.id)}))},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=e=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})}));const t=()=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-complete",t)}))};return new Promise((e=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",(()=>{t(),e()})):(t(),e())}))},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType||"image/jpeg",this.defaultLocale=JD;if(this.opts={thumbnailWidth:null,thumbnailHeight:null,waitForThumbnailsBeforeUpload:!1,lazy:!1,...t},this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,n){const r=URL.createObjectURL(e.data),i=new Promise(((e,t)=>{const n=new Image;n.src=r,n.addEventListener("load",(()=>{URL.revokeObjectURL(r),e(n)})),n.addEventListener("error",(e=>{URL.revokeObjectURL(r),t(e.error||new Error("Could not create thumbnail"))}))})),o=(0,YD.rotation)(e.data).catch((()=>1));return Promise.all([i,o]).then((e=>{let[r,i]=e;const o=this.getProportionalDimensions(r,t,n,i.deg),s=this.rotateImage(r,i),a=this.resizeImage(s,o.width,o.height);return this.canvasToBlob(a,this.thumbnailType,80)})).then((e=>URL.createObjectURL(e)))}getProportionalDimensions(e,t,n,r){let i=e.width/e.height;return 90!==r&&270!==r||(i=e.height/e.width),null!=t?{width:t,height:Math.round(t/i)}:null!=n?{width:Math.round(n*i),height:n}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/i)}}resizeImage(e,t,n){let r=this.protect(e),i=Math.ceil(Math.log2(r.width/t));i<1&&(i=1);let o=t*2**(i-1),s=n*2**(i-1);const a=2;for(;i--;){const e=document.createElement("canvas");e.width=o,e.height=s,e.getContext("2d").drawImage(r,0,0,o,s),r=e,o=Math.round(o/a),s=Math.round(s/a)}return r}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){const e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch((()=>{})).then((()=>this.processQueue())):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return GD(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then((t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)})).catch((t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)})):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}}XD.VERSION="2.2.0";var ZD=XD;XD.prototype.canvasToBlob=function(e,t,n){try{e.getContext("2d").getImageData(0,0,1,1)}catch(e){if(18===e.code)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise((r=>{e.toBlob(r,t,n)})).then((e=>{if(null===e)throw new Error("cannot read image, probably an svg with external resources");return e})):Promise.resolve().then((()=>QD(e.toDataURL(t,n),{}))).then((e=>{if(null===e)throw new Error("could not extract blob, probably an old browser");return e}))},XD.prototype.protect=function(e){const t=e.width/e.height,n=5e6,r=4096;let i=Math.floor(Math.sqrt(n*t)),o=Math.floor(n/Math.sqrt(n*t));if(i>r&&(i=r,o=Math.round(i/t)),o>r&&(o=r,i=Math.round(t*o)),e.width>i){const t=document.createElement("canvas");return t.width=i,t.height=o,t.getContext("2d").drawImage(e,0,0,i,o),t}return e},XD.prototype.rotateImage=function(e,t){let n=e.width,r=e.height;90!==t.deg&&270!==t.deg||(n=e.height,r=e.width);const i=document.createElement("canvas");i.width=n,i.height=r;const o=i.getContext("2d");return o.translate(n/2,r/2),t.canvas&&(o.rotate(t.rad),o.scale(t.scaleX,t.scaleY)),o.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),i};const ek=fM;var tk=function(e){if("string"==typeof e){const t=document.querySelectorAll(e);return 0===t.length?null:Array.from(t)}return"object"==typeof e&&ek(e)?[e]:null};var nk=function e(t,n,r,i){let{onSuccess:o}=i;t.readEntries((i=>{const s=[...n,...i];i.length?setTimeout((()=>{e(t,s,r,{onSuccess:o})}),0):o(s)}),(e=>{r(e),o(n)}))};const rk=function(e){return e.fullPath&&e.fullPath!==`/${e.name}`?e.fullPath:null},ik=nk,ok=jM;const sk=jM;const ak=function(e,t){const n=[],r=[],i=e=>new Promise((r=>{if(e.isFile)e.file((t=>{t.relativePath=rk(e),n.push(t),r()}),(e=>{t(e),r()}));else if(e.isDirectory){const n=e.createReader();ik(n,[],t,{onSuccess:e=>r(Promise.all(e.map(i)))})}}));return ok(e.items).forEach((e=>{const t=e.webkitGetAsEntry();t&&r.push(i(t))})),Promise.all(r).then((()=>n))},lk=function(e){const t=sk(e.files);return Promise.resolve(t)};var uk=function(e,t){var n;let{logDropError:r=(()=>{})}=void 0===t?{}:t;return null!=(n=e.items)&&n[0]&&"webkitGetAsEntry"in e.items[0]?ak(e,r):lk(e)},ck=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function dk(e,t){return e===t||!(!ck(e)||!ck(t))}function pk(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!dk(e[n],t[n]))return!1;return!0}var hk=Object.freeze({__proto__:null,default:function(e,t){var n;void 0===t&&(t=pk);var r,i=[],o=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return o&&n===this&&t(s,i)||(r=e.apply(this,s),o=!0,n=this,i=s),r}}}),fk=rc(hk),mk="Expected a function",gk=0/0,yk="[object Symbol]",bk=/^\s+|\s+$/g,vk=/^[-+]0x[0-9a-f]+$/i,wk=/^0b[01]+$/i,xk=/^0o[0-7]+$/i,Mk=parseInt,Dk="object"==typeof tc&&tc&&tc.Object===Object&&tc,kk="object"==typeof self&&self&&self.Object===Object&&self,Ek=Dk||kk||Function("return this")(),Ck=Object.prototype.toString,Tk=Math.max,Ok=Math.min,Sk=function(){return Ek.Date.now()};function Ak(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Nk(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Ck.call(e)==yk}(e))return gk;if(Ak(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ak(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(bk,"");var n=wk.test(e);return n||xk.test(e)?Mk(e.slice(2),n?2:8):vk.test(e)?gk:+e}var _k=function(e,t,n){var r,i,o,s,a,l,u=0,c=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError(mk);function h(t){var n=r,o=i;return r=i=void 0,u=t,s=e.apply(o,n)}function f(e){return u=e,a=setTimeout(g,t),c?h(e):s}function m(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-u>=o}function g(){var e=Sk();if(m(e))return y(e);a=setTimeout(g,function(e){var n=t-(e-l);return d?Ok(n,o-(e-u)):n}(e))}function y(e){return a=void 0,p&&r?h(e):(r=i=void 0,s)}function b(){var e=Sk(),n=m(e);if(r=arguments,i=this,l=e,n){if(void 0===a)return f(l);if(d)return a=setTimeout(g,t),h(l)}return void 0===a&&(a=setTimeout(g,t)),s}return t=Nk(t)||0,Ak(n)&&(c=!!n.leading,o=(d="maxWait"in n)?Tk(Nk(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p),b.cancel=function(){void 0!==a&&clearTimeout(a),u=0,r=l=i=a=void 0},b.flush=function(){return void 0===a?s:y(Sk())},b};const jk=_k,Ik=IM,Lk=LM;var zk=function(){let e=!1;return jk(((t,n)=>{const r=Lk(t,n),i=r.contains(document.activeElement);if(i&&e)return;const o=r.querySelector("[data-uppy-super-focusable]");if(!i||o)if(o)o.focus({preventScroll:!0}),e=!0;else{const t=r.querySelector(Ik);null==t||t.focus({preventScroll:!0}),e=!1}}),260)};var Pk=function(){const e=document.body;return"draggable"in e&&"ondragstart"in e&&"ondrop"in e&&("FormData"in window&&"FileReader"in window)},Fk=hM;var Rk=function(e){const t={color:"#838999",icon:(0,Fk.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,Fk.h)("g",{fill:"#A7AFB7",fillRule:"nonzero"},(0,Fk.h)("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),(0,Fk.h)("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))};if(!e)return t;const n=e.split("/")[0],r=e.split("/")[1];return"text"===n?{color:"#5a5e69",icon:(0,Fk.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,Fk.h)("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}:"image"===n?{color:"#686de0",icon:(0,Fk.h)("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},(0,Fk.h)("g",{fill:"#686DE0",fillRule:"evenodd"},(0,Fk.h)("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),(0,Fk.h)("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),(0,Fk.h)("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}:"audio"===n?{color:"#068dbb",icon:(0,Fk.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,Fk.h)("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}:"video"===n?{color:"#19af67",icon:(0,Fk.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,Fk.h)("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}:"application"===n&&"pdf"===r?{color:"#e25149",icon:(0,Fk.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,Fk.h)("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}:"application"===n&&-1!==["zip","x-7z-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)?{color:"#00C469",icon:(0,Fk.h)("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},(0,Fk.h)("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}:t},Bk=hM;const Uk=Rk;var Hk=function(e){const{file:t}=e;if(t.preview)return(0,Bk.h)("img",{className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});const{color:n,icon:r}=Uk(t.type);return(0,Bk.h)("div",{className:"uppy-Dashboard-Item-previewIconWrap"},(0,Bk.h)("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:n}},r),(0,Bk.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},(0,Bk.h)("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))},$k=hM;var Vk=function(e){const{file:t,toggleFileCard:n,i18n:r,metaFields:i}=e,{missingRequiredMetaFields:o}=t;if(null==o||!o.length)return null;const s=o.map((e=>((e,t)=>{const n=t.filter((t=>t.id===e));return n[0].name})(e,i))).join(", ");return(0,$k.h)("div",{className:"uppy-Dashboard-Item-errorMessage"},r("missingRequiredMetaFields",{smart_count:o.length,fields:s})," ",(0,$k.h)("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>n(!0,t.id)},r("editFile")))},Wk=hM;const qk=Hk,Yk=Vk,Qk=Rk;var Kk=hM;function Gk(e){return e.isUploaded?e.i18n("uploadComplete"):e.error?e.i18n("retryUpload"):e.resumableUploads?e.file.isPaused?e.i18n("resumeUpload"):e.i18n("pauseUpload"):e.individualCancellation?e.i18n("cancelUpload"):""}function Jk(e){return(0,Kk.h)("div",{className:"uppy-Dashboard-Item-progress"},(0,Kk.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":Gk(e),title:Gk(e),onClick:()=>function(e){e.isUploaded||(!e.error||e.hideRetryButton?e.resumableUploads&&!e.hidePauseResumeButton?e.uppy.pauseResume(e.file.id):e.individualCancellation&&!e.hideCancelButton&&e.uppy.removeFile(e.file.id):e.uppy.retryUpload(e.file.id))}(e)},e.children))}function Xk(e){let{children:t}=e;return(0,Kk.h)("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},t)}function Zk(e){let{progress:t}=e;const n=2*Math.PI*15;return(0,Kk.h)("g",null,(0,Kk.h)("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),(0,Kk.h)("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":n,"stroke-dashoffset":n-n/100*t}))}const eE="...";var tE=hM;const nE=Hv,rE=function(e,t){if(0===t)return"";if(e.length<=t)return e;if(t<=eE.length+1)return`${e.slice(0,t-1)}…`;const n=t-eE.length,r=Math.ceil(n/2),i=Math.floor(n/2);return e.slice(0,r)+eE+e.slice(-i)},iE=Vk,oE=e=>{let{file:t,onClick:n}=e;return t.error?(0,tE.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-errorDetails","aria-label":t.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:n,type:"button"},"?"):null};var sE=hM;const aE=function(e,t){return t||(t="Copy the URL below"),new Promise((n=>{const r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=e,document.body.appendChild(r),r.select();const i=()=>{document.body.removeChild(r),window.prompt(t,e),n()};try{return document.execCommand("copy")?(document.body.removeChild(r),n()):i()}catch(e){return document.body.removeChild(r),i()}}))};function lE(e){let{file:t,uploadInProgressOrComplete:n,metaFields:r,canEditFile:i,i18n:o,onClick:s}=e;return!n&&r&&r.length>0||!n&&i(t)?(0,sE.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":o("editFileWithFilename",{file:t.meta.name}),title:o("editFileWithFilename",{file:t.meta.name}),onClick:()=>s()},(0,sE.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},(0,sE.h)("g",{fillRule:"evenodd"},(0,sE.h)("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),(0,sE.h)("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),(0,sE.h)("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function uE(e){let{i18n:t,onClick:n,file:r}=e;return(0,sE.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":t("removeFile",{file:r.meta.name}),title:t("removeFile",{file:r.meta.name}),onClick:()=>n()},(0,sE.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},(0,sE.h)("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),(0,sE.h)("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}function cE(e){const{i18n:t}=e;return(0,sE.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":t("copyLink"),title:t("copyLink"),onClick:t=>((e,t)=>{aE(t.file.uploadURL,t.i18n("copyLinkToClipboardFallback")).then((()=>{t.uppy.log("Link copied to clipboard."),t.uppy.info(t.i18n("copyLinkToClipboardSuccess"),"info",3e3)})).catch(t.uppy.log).then((()=>e.target.focus({preventScroll:!0})))})(t,e)},(0,sE.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},(0,sE.h)("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}var dE=function(e){const{uppy:t,file:n,uploadInProgressOrComplete:r,canEditFile:i,metaFields:o,showLinkToFileUploadResult:s,showRemoveButton:a,i18n:l,toggleFileCard:u,openFileEditor:c}=e;return(0,sE.h)("div",{className:"uppy-Dashboard-Item-actionWrapper"},(0,sE.h)(lE,{i18n:l,file:n,uploadInProgressOrComplete:r,canEditFile:i,metaFields:o,onClick:()=>{o&&o.length>0?u(!0,n.id):c(n)}}),s&&n.uploadURL?(0,sE.h)(cE,{file:n,uppy:t,i18n:l}):null,a?(0,sE.h)(uE,{i18n:l,file:n,uppy:t,onClick:()=>e.uppy.removeFile(n.id,"removed-by-user")}):null)},pE=hM;const hE=oc.exports,fE=function(e,t){if(e===t)return!0;for(var n in e)if(!(n in t))return!1;for(var n in t)if(e[n]!==t[n])return!1;return!0},mE=function(e){return(0,Wk.h)("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:Qk(e.file.type).color}},e.showLinkToFileUploadResult&&e.file.uploadURL&&(0,Wk.h)("a",{className:"uppy-Dashboard-Item-previewLink",href:e.file.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.file.meta.name},(0,Wk.h)("span",{hidden:!0},e.file.meta.name)),(0,Wk.h)(qk,{file:e.file}),(0,Wk.h)(Yk,{file:e.file,i18n:e.i18n,toggleFileCard:e.toggleFileCard,metaFields:e.metaFields}))},gE=function(e){return e.file.progress.uploadStarted?e.isUploaded?(0,Kk.h)("div",{className:"uppy-Dashboard-Item-progress"},(0,Kk.h)("div",{className:"uppy-Dashboard-Item-progressIndicator"},(0,Kk.h)(Xk,null,(0,Kk.h)("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),(0,Kk.h)("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):e.recoveredState?void 0:e.error&&!e.hideRetryButton?(0,Kk.h)(Jk,e,(0,Kk.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},(0,Kk.h)("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),(0,Kk.h)("path",{d:"M7.9 3H10v2H7.9z"}),(0,Kk.h)("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),(0,Kk.h)("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):e.resumableUploads&&!e.hidePauseResumeButton?(0,Kk.h)(Jk,e,(0,Kk.h)(Xk,null,(0,Kk.h)(Zk,{progress:e.file.progress.percentage}),e.file.isPaused?(0,Kk.h)("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):(0,Kk.h)("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},(0,Kk.h)("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),(0,Kk.h)("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?(0,Kk.h)("div",{className:"uppy-Dashboard-Item-progress"},(0,Kk.h)("div",{className:"uppy-Dashboard-Item-progressIndicator"},(0,Kk.h)(Xk,null,(0,Kk.h)(Zk,{progress:e.file.progress.percentage})))):(0,Kk.h)(Jk,e,(0,Kk.h)(Xk,null,(0,Kk.h)(Zk,{progress:e.file.progress.percentage}),(0,Kk.h)("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):null},yE=function(e){const{file:t}=e;return(0,tE.h)("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source},(0,tE.h)("div",{className:"uppy-Dashboard-Item-fileName"},(e=>{const{author:t,name:n}=e.file.meta;return(0,tE.h)("div",{className:"uppy-Dashboard-Item-name",title:n},rE(n,e.containerWidth<=352?35:e.containerWidth<=576?60:t?20:30))})(e),(0,tE.h)(oE,{file:e.file,onClick:()=>alert(e.file.error)})),(0,tE.h)("div",{className:"uppy-Dashboard-Item-status"},(e=>{const{author:t}=e.file.meta,{providerName:n}=e.file.remote,r=`·`;return t?(0,tE.h)("div",{className:"uppy-Dashboard-Item-author"},(0,tE.h)("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},rE(t.name,13)),n?(0,tE.h)(tE.Fragment,null,` ${r} `,n,` ${r} `):null):null})(e),(e=>e.file.size&&(0,tE.h)("div",{className:"uppy-Dashboard-Item-statusSize"},nE(e.file.size)))(e),(e=>e.file.isGhost&&(0,tE.h)("span",null," • ",(0,tE.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:e.toggleAddFilesPanel},e.i18n("reSelect"))))(e)),(0,tE.h)(iE,{file:e.file,i18n:e.i18n,toggleFileCard:e.toggleFileCard,metaFields:e.metaFields}))},bE=dE;class vE extends pE.Component{componentDidMount(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!fE(this.props,e)}componentDidUpdate(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){const{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){const{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,n=e.progress.uploadComplete&&!t&&!e.error,r=e.progress.uploadStarted||t,i=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,{isGhost:s}=e;let a=(this.props.individualCancellation||!i)&&!n;n&&this.props.showRemoveButtonAfterComplete&&(a=!0);const l=hE({"uppy-Dashboard-Item":!0,"is-inprogress":i&&!this.props.recoveredState,"is-processing":t,"is-complete":n,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":s});return(0,pE.h)("div",{className:l,id:`uppy_${e.id}`,role:this.props.role},(0,pE.h)("div",{className:"uppy-Dashboard-Item-preview"},(0,pE.h)(mE,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),(0,pE.h)(gE,{uppy:this.props.uppy,file:e,error:o,isUploaded:n,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,showRemoveButtonAfterComplete:this.props.showRemoveButtonAfterComplete,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),(0,pE.h)("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},(0,pE.h)(yE,{file:e,id:this.props.id,acquirers:this.props.acquirers,containerWidth:this.props.containerWidth,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),(0,pE.h)(bE,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:a,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}}var wE=vE,xE=hM;function ME(){return ME=Object.assign||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},ME.apply(this,arguments)}const DE={position:"relative",width:"100%",minHeight:"100%"},kE={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class EE extends xE.Component{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){const{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:n,renderRow:r,overscanCount:i=10,...o}=e;const{offset:s,height:a}=this.state;let l=Math.floor(s/n),u=Math.floor(a/n);i&&(l=Math.max(0,l-l%i),u+=i);const c=l+u+4,d=t.slice(l,c),p={...DE,height:t.length*n},h={...kE,top:l*n};return(0,xE.h)("div",ME({onScroll:this.handleScroll},o),(0,xE.h)("div",{role:"presentation",style:p},(0,xE.h)("div",{role:"presentation",style:h},d.map(r))))}}var CE=hM;function TE(){return TE=Object.assign||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},TE.apply(this,arguments)}const OE=oc.exports,SE=wE,AE=EE;var NE=hM;let _E;_E=Symbol.for("uppy test: disable unused locale key warning");class jE extends NE.Component{constructor(){super(...arguments),this.triggerFileInputClick=()=>{this.fileInput.click()},this.triggerFolderInputClick=()=>{this.folderInput.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.target.value=null},this.renderHiddenInput=(e,t)=>(0,NE.h)("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:1!==this.props.maxNumberOfFiles,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes,ref:t}),this.renderMyDeviceAcquirer=()=>(0,NE.h)("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},(0,NE.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},(0,NE.h)("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},(0,NE.h)("g",{fill:"none",fillRule:"evenodd"},(0,NE.h)("rect",{className:"uppy-ProviderIconBg",width:"32",height:"32",rx:"16",fill:"#2275D7"}),(0,NE.h)("path",{d:"M21.973 21.152H9.863l-1.108-5.087h14.464l-1.246 5.087zM9.935 11.37h3.958l.886 1.444a.673.673 0 0 0 .585.316h6.506v1.37H9.935v-3.13zm14.898 3.44a.793.793 0 0 0-.616-.31h-.978v-2.126c0-.379-.275-.613-.653-.613H15.75l-.886-1.445a.673.673 0 0 0-.585-.316H9.232c-.378 0-.667.209-.667.587V14.5h-.782a.793.793 0 0 0-.61.303.795.795 0 0 0-.155.663l1.45 6.633c.078.36.396.618.764.618h13.354c.36 0 .674-.246.76-.595l1.631-6.636a.795.795 0 0 0-.144-.675z",fill:"#FFF"}))),(0,NE.h)("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderBrowseButton=(e,t)=>{const n=this.props.acquirers.length;return(0,NE.h)("button",{type:"button",className:"uppy-u-reset uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":0===n},e)},this.renderDropPasteBrowseTagline=()=>{const e=this.props.acquirers.length,t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),n=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),r=this.props.fileManagerSelectionType,i=r.charAt(0).toUpperCase()+r.slice(1);return(0,NE.h)("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${i}`,{browseFiles:t,browseFolders:n,browse:t}):this.props.i18nArray(`dropPaste${i}`,{browseFiles:t,browseFolders:n,browse:t}))},this.renderAcquirer=e=>(0,NE.h)("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},(0,NE.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":this.props.activePickerPanel.id===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},e.icon(),(0,NE.h)("div",{className:"uppy-DashboardTab-name"},e.name))),this.renderAcquirers=(e,t)=>{const n=[...e],r=n.splice(e.length-2,e.length);return(0,NE.h)("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},!t&&this.renderMyDeviceAcquirer(),n.map((e=>this.renderAcquirer(e))),(0,NE.h)("span",{role:"presentation",style:{"white-space":"nowrap"}},r.map((e=>this.renderAcquirer(e)))))}}[_E](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){const{i18nArray:e}=this.props,t=e("poweredBy",{uppy:(0,NE.h)("span",null,(0,NE.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},(0,NE.h)("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),(0,NE.h)("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy"))});return(0,NE.h)("a",{tabIndex:"-1",href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},t)}render(){return(0,NE.h)("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,(e=>{this.fileInput=e})),this.renderHiddenInput(!0,(e=>{this.folderInput=e})),this.renderDropPasteBrowseTagline(),this.props.acquirers.length>0&&this.renderAcquirers(this.props.acquirers,this.props.disableLocalFiles),(0,NE.h)("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&(0,NE.h)("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))}}var IE=jE,LE=hM;const zE=oc.exports,PE=IE;var FE=e=>(0,LE.h)("div",{className:zE("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":e.showAddFilesPanel},(0,LE.h)("div",{className:"uppy-DashboardContent-bar"},(0,LE.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("addingMoreFiles")),(0,LE.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>e.toggleAddFilesPanel(!1)},e.i18n("back"))),(0,LE.h)(PE,e));var RE=function(e){const{tagName:t}=e.target;"INPUT"!==t&&"TEXTAREA"!==t?(e.preventDefault(),e.stopPropagation()):e.stopPropagation()},BE=hM;const UE=oc.exports,HE=RE;var $E=function(e){let{activePickerPanel:t,className:n,hideAllPanels:r,i18n:i,state:o,uppy:s}=e;return(0,BE.h)("div",{className:UE("uppy-DashboardContent-panel",n),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${t.id}`,onDragOver:HE,onDragLeave:HE,onDrop:HE,onPaste:HE},(0,BE.h)("div",{className:"uppy-DashboardContent-bar"},(0,BE.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i("importFrom",{name:t.name})),(0,BE.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:r},i("cancel"))),(0,BE.h)("div",{className:"uppy-DashboardContent-panelBody"},s.getPlugin(t.id).render(o)))},VE=hM;const WE=oc.exports;var qE=function(e){const t=e.files[e.fileCardFor];return(0,VE.h)("div",{className:WE("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},(0,VE.h)("div",{className:"uppy-DashboardContent-bar"},(0,VE.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18nArray("editing",{file:(0,VE.h)("span",{className:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),(0,VE.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e.hideAllPanels},e.i18n("cancel")),(0,VE.h)("button",{className:"uppy-DashboardContent-save",type:"button",onClick:e.saveFileEditor},e.i18n("save"))),(0,VE.h)("div",{className:"uppy-DashboardContent-panelBody"},e.editors.map((t=>e.uppy.getPlugin(t.id).render(e.state)))))},YE=hM;const QE="error",KE="waiting",GE="preprocessing",JE="uploading",XE="postprocessing",ZE="complete",eC="paused";function tC(e){let{files:t,i18n:n,isAllComplete:r,isAllErrored:i,isAllPaused:o,inProgressNotPausedFiles:s,newFiles:a,processingFiles:l}=e;const u=function(e,t,n,r){if(void 0===r&&(r={}),e)return QE;if(t)return ZE;if(n)return eC;let i=KE;const o=Object.keys(r);for(let e=0;e<o.length;e++){const{progress:t}=r[o[e]];if(t.uploadStarted&&!t.uploadComplete)return JE;t.preprocess&&i!==JE&&(i=GE),t.postprocess&&i!==JE&&i!==GE&&(i=XE)}return i}(i,r,o,t);switch(u){case"uploading":return n("uploadingXFiles",{smart_count:s.length});case"preprocessing":case"postprocessing":return n("processingXFiles",{smart_count:l.length});case"paused":return n("uploadPaused");case"waiting":return n("xFilesSelected",{smart_count:a.length});case"complete":return n("uploadComplete")}}var nC=function(e){const{i18n:t,isAllComplete:n,hideCancelButton:r,maxNumberOfFiles:i,toggleAddFilesPanel:o,uppy:s}=e;let{allowNewUpload:a}=e;return a&&i&&(a=e.totalFileCount<e.maxNumberOfFiles),(0,YE.h)("div",{className:"uppy-DashboardContent-bar"},n||r?(0,YE.h)("div",null):(0,YE.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>s.cancelAll()},t("cancel")),(0,YE.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},(0,YE.h)(tC,e)),a?(0,YE.h)("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>o(!0)},(0,YE.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},(0,YE.h)("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),(0,YE.h)("span",{className:"uppy-DashboardContent-addMoreCaption"},t("addMore"))):(0,YE.h)("div",null))},rC=hM,iC=Bv;const oC=oc.exports,sC=Rk,aC=RE,lC=Hk;class uC extends rC.Component{constructor(e){super(e),this.form=document.createElement("form"),this.updateMeta=(e,t)=>{this.setState((n=>{let{formState:r}=n;return{formState:{...r,[t]:e}}}))},this.handleSave=e=>{e.preventDefault();const t=this.props.fileCardFor;this.props.saveFileCard(this.state.formState,t)},this.handleCancel=()=>{const{currentImage:e}=this.getPluginState(),t=this.props.uppy.getFile(e.id);this.props.uppy.emit("file-editor:cancel",t),this.props.toggleFileCard(!1)},this.saveOnEnter=e=>{if(13===e.keyCode){e.stopPropagation(),e.preventDefault();const t=this.props.files[this.props.fileCardFor];this.props.saveFileCard(this.state.formState,t.id)}},this.renderMetaFields=()=>{const e=this.getMetaFields()||[],t={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map((e=>{const n=`uppy-Dashboard-FileCard-input-${e.id}`,r=this.props.requiredMetaFields.includes(e.id);return(0,rC.h)("fieldset",{key:e.id,className:"uppy-Dashboard-FileCard-fieldset"},(0,rC.h)("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:n},e.name),void 0!==e.render?e.render({value:this.state.formState[e.id],onChange:t=>this.updateMeta(t,e.id),fieldCSSClasses:t,required:r,form:this.form.id},rC.h):(0,rC.h)("input",{className:t.text,id:n,form:this.form.id,type:e.type||"text",required:r,value:this.state.formState[e.id],placeholder:e.placeholder,onKeyUp:"form"in HTMLInputElement.prototype?void 0:this.saveOnEnter,onKeyDown:"form"in HTMLInputElement.prototype?void 0:this.saveOnEnter,onKeyPress:"form"in HTMLInputElement.prototype?void 0:this.saveOnEnter,onInput:t=>this.updateMeta(t.target.value,e.id),"data-uppy-super-focusable":!0}))}))};const t=this.props.files[this.props.fileCardFor],n=this.getMetaFields()||[],r={};n.forEach((e=>{r[e.id]=t.meta[e.id]||""})),this.state={formState:r},this.form.id=(0,iC.nanoid)()}componentWillMount(){this.form.addEventListener("submit",this.handleSave),document.body.appendChild(this.form)}componentWillUnmount(){this.form.removeEventListener("submit",this.handleSave),document.body.removeChild(this.form)}getMetaFields(){return"function"==typeof this.props.metaFields?this.props.metaFields(this.props.files[this.props.fileCardFor]):this.props.metaFields}render(){const e=this.props.files[this.props.fileCardFor],t=this.props.canEditFile(e);return(0,rC.h)("div",{className:oC("uppy-Dashboard-FileCard",this.props.className),"data-uppy-panelType":"FileCard",onDragOver:aC,onDragLeave:aC,onDrop:aC,onPaste:aC},(0,rC.h)("div",{className:"uppy-DashboardContent-bar"},(0,rC.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},this.props.i18nArray("editing",{file:(0,rC.h)("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),(0,rC.h)("button",{className:"uppy-DashboardContent-back",type:"button",form:this.form.id,title:this.props.i18n("finishEditingFile"),onClick:this.handleCancel},this.props.i18n("cancel"))),(0,rC.h)("div",{className:"uppy-Dashboard-FileCard-inner"},(0,rC.h)("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:sC(e.type).color}},(0,rC.h)(lC,{file:e}),t&&(0,rC.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:t=>{this.handleSave(t),this.props.openFileEditor(e)},form:this.form.id},this.props.i18n("editFile"))),(0,rC.h)("div",{className:"uppy-Dashboard-FileCard-info"},this.renderMetaFields()),(0,rC.h)("div",{className:"uppy-Dashboard-FileCard-actions"},(0,rC.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"form"in HTMLButtonElement.prototype?"submit":"button",onClick:"form"in HTMLButtonElement.prototype?void 0:this.handleSave,form:this.form.id},this.props.i18n("saveChanges")),(0,rC.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:this.handleCancel,form:this.form.id},this.props.i18n("cancel")))))}}var cC=uC,dC=hM;const pC=oc.exports,hC="uppy-transition-slideDownUp",fC=250;class mC extends dC.Component{constructor(e){super(e),this.state={cachedChildren:null,className:""}}componentWillUpdate(e){const{cachedChildren:t}=this.state,n=(0,dC.toChildArray)(e.children)[0];if(t===n)return null;const r={cachedChildren:n};n&&!t&&(r.className=`${hC}-enter`,cancelAnimationFrame(this.animationFrame),clearTimeout(this.leaveTimeout),this.leaveTimeout=void 0,this.animationFrame=requestAnimationFrame((()=>{this.setState({className:`${hC}-enter ${hC}-enter-active`}),this.enterTimeout=setTimeout((()=>{this.setState({className:""})}),fC)}))),t&&!n&&void 0===this.leaveTimeout&&(r.cachedChildren=t,r.className=`${hC}-leave`,cancelAnimationFrame(this.animationFrame),clearTimeout(this.enterTimeout),this.enterTimeout=void 0,this.animationFrame=requestAnimationFrame((()=>{this.setState({className:`${hC}-leave ${hC}-leave-active`}),this.leaveTimeout=setTimeout((()=>{this.setState({cachedChildren:null,className:""})}),fC)}))),this.setState(r)}render(){const{cachedChildren:e,className:t}=this.state;return e?(0,dC.cloneElement)(e,{className:pC(t,e.props.className)}):null}}var gC=hM;function yC(){return yC=Object.assign||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},yC.apply(this,arguments)}const bC=oc.exports,vC=Pk,wC=e=>{const t=0===e.totalFileCount,n=OE("uppy-Dashboard-files",{"uppy-Dashboard-files--noFiles":t}),r=1===e.itemsPerRow?71:200,i={id:e.id,error:e.error,i18n:e.i18n,uppy:e.uppy,acquirers:e.acquirers,resumableUploads:e.resumableUploads,individualCancellation:e.individualCancellation,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,showLinkToFileUploadResult:e.showLinkToFileUploadResult,showRemoveButtonAfterComplete:e.showRemoveButtonAfterComplete,isWide:e.isWide,metaFields:e.metaFields,recoveredState:e.recoveredState,toggleFileCard:e.toggleFileCard,handleRequestThumbnail:e.handleRequestThumbnail,handleCancelThumbnail:e.handleCancelThumbnail},o=Object.keys(e.files);e.recoveredState&&o.sort(((t,n)=>e.files[n].isGhost-e.files[t].isGhost));const s=function(e,t){const n=[];let r=[];return e.forEach((e=>{r.length<t?r.push(e):(n.push(r),r=[e])})),r.length&&n.push(r),n}(o,e.itemsPerRow);return(0,CE.h)(AE,{class:n,role:"list",data:s,renderRow:t=>(0,CE.h)("div",{role:"presentation",key:t[0]},t.map((t=>(0,CE.h)(SE,TE({key:t,uppy:e.uppy},i,{role:"listitem",openFileEditor:e.openFileEditor,canEditFile:e.canEditFile,toggleAddFilesPanel:e.toggleAddFilesPanel,file:e.files[t]}))))),rowHeight:r})},xC=IE,MC=FE,DC=$E,kC=qE,EC=nC,CC=cC,TC=mC,OC=900,SC=700,AC=576,NC=400;var _C=hM,jC=_v.exports,IC=Bv,LC=_M;function zC(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var PC=0;function FC(e){return"__private_"+PC+++"_"+e}const RC=UM.exports,BC=OD.exports,UC=ZD,HC=tk,$C=jM,VC=uk,WC=fk,qC=IM,YC=zk,QC=function(e){const t=0===e.totalFileCount,n=e.containerWidth>AC,r=bC({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":e.disabled,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>AC,"uppy-size--lg":e.containerWidth>SC,"uppy-size--xl":e.containerWidth>OC,"uppy-size--height-md":e.containerHeight>NC,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible});let i=1;e.containerWidth>OC?i=5:e.containerWidth>SC?i=4:e.containerWidth>AC&&(i=3);const o=e.showSelectedFiles&&!t,s=e.recoveredState?Object.keys(e.recoveredState.files).length:null,a=e.files?Object.keys(e.files).filter((t=>e.files[t].isGhost)).length:null;return(0,gC.h)("div",{className:r,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&vC(),"aria-hidden":e.inline?"false":e.isHidden,"aria-disabled":e.disabled,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onPaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop},(0,gC.h)("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),(0,gC.h)("div",{className:"uppy-Dashboard-inner","aria-modal":!e.inline&&"true",role:!e.inline&&"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""}},e.inline?null:(0,gC.h)("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal},(0,gC.h)("span",{"aria-hidden":"true"},"×")),(0,gC.h)("div",{className:"uppy-Dashboard-innerWrap"},(0,gC.h)("div",{className:"uppy-Dashboard-dropFilesHereHint"},e.i18n("dropHint")),o&&(0,gC.h)(EC,e),s&&(0,gC.h)("div",{className:"uppy-Dashboard-serviceMsg"},(0,gC.h)("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},(0,gC.h)("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},(0,gC.h)("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),(0,gC.h)("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),(0,gC.h)("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),(0,gC.h)("strong",{className:"uppy-Dashboard-serviceMsg-title"},e.i18n("sessionRestored")),(0,gC.h)("div",{className:"uppy-Dashboard-serviceMsg-text"},a>0?e.i18n("recoveredXFiles",{smart_count:a}):e.i18n("recoveredAllFiles"))),o?(0,gC.h)(wC,yC({},e,{itemsPerRow:i})):(0,gC.h)(xC,yC({},e,{isSizeMD:n})),(0,gC.h)(TC,null,e.showAddFilesPanel?(0,gC.h)(MC,yC({key:"AddFiles"},e,{isSizeMD:n})):null),(0,gC.h)(TC,null,e.fileCardFor?(0,gC.h)(CC,yC({key:"FileCard"},e)):null),(0,gC.h)(TC,null,e.activePickerPanel?(0,gC.h)(DC,yC({key:"Picker"},e)):null),(0,gC.h)(TC,null,e.showFileEditor?(0,gC.h)(kC,yC({key:"Editor"},e)):null),(0,gC.h)("div",{className:"uppy-Dashboard-progressindicators"},e.progressindicators.map((t=>e.uppy.getPlugin(t.id).render(e.state)))))))},KC={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editing:"Editing %{file}",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."}}},GC=WC.default||WC,JC=9,XC=27;function ZC(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}function eT(){return(0,_C.h)("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},(0,_C.h)("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var tT=FC("openFileEditorWhenFilesAdded"),nT=FC("attachRenderFunctionToTarget"),rT=FC("isTargetSupported"),iT=FC("getAcquirers"),oT=FC("getProgressIndicators"),sT=FC("getEditors");class aT extends jC.UIPlugin{constructor(e,t){var n;super(e,t),n=this,this.removeTarget=e=>{const t=this.getPluginState().targets.filter((t=>t.id!==e.id));this.setPluginState({targets:t})},this.addTarget=e=>{const t=e.id||e.constructor.name,n=e.title||t,r=e.type;if("acquirer"!==r&&"progressindicator"!==r&&"editor"!==r){const e="Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor";return void this.uppy.log(e,"error")}const i={id:t,name:n,type:r},o=this.getPluginState().targets.slice();return o.push(i),this.setPluginState({targets:o}),this.el},this.hideAllPanels=()=>{const e=this.getPluginState(),t={activePickerPanel:!1,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};e.activePickerPanel===t.activePickerPanel&&e.showAddFilesPanel===t.showAddFilesPanel&&e.showFileEditor===t.showFileEditor&&e.activeOverlayType===t.activeOverlayType||this.setPluginState(t)},this.showPanel=e=>{const{targets:t}=this.getPluginState(),n=t.filter((t=>"acquirer"===t.type&&t.id===e))[0];this.setPluginState({activePickerPanel:n,activeOverlayType:"PickerPanel"})},this.canEditFile=e=>{const{targets:t}=this.getPluginState();return zC(this,sT)[sT](t).some((t=>this.uppy.getPlugin(t.id).canEditFile(e)))},this.openFileEditor=e=>{const{targets:t}=this.getPluginState(),n=zC(this,sT)[sT](t);this.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),n.forEach((t=>{this.uppy.getPlugin(t.id).selectFile(e)}))},this.saveFileEditor=()=>{const{targets:e}=this.getPluginState();zC(this,sT)[sT](e).forEach((e=>{this.uppy.getPlugin(e.id).save()})),this.hideAllPanels()},this.openModal=()=>{const{promise:e,resolve:t}=ZC();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){const e=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",e,!1),t()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!1}),t();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),e},this.closeModal=function(e){void 0===e&&(e={});const{manualClose:t=!0}=e,{isHidden:r,isClosing:i}=n.getPluginState();if(r||i)return;const{promise:o,resolve:s}=ZC();if(n.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),n.opts.animateOpenClose){n.setPluginState({isClosing:!0});const e=()=>{n.setPluginState({isHidden:!0,isClosing:!1}),n.superFocus.cancel(),n.savedActiveElement.focus(),n.el.removeEventListener("animationend",e,!1),s()};n.el.addEventListener("animationend",e,!1)}else n.setPluginState({isHidden:!0}),n.superFocus.cancel(),n.savedActiveElement.focus(),s();var a;(document.removeEventListener("keydown",n.handleKeyDownInModal),t)&&(n.opts.browserBackButtonClose&&null!=(a=history.state)&&a[n.modalName]&&history.back());return n.uppy.emit("dashboard:modal-closed"),o},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=e=>{const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,darkMode:e}})},this.handleSystemDarkModeChange=e=>{const t=e.matches;this.uppy.log(`[Dashboard] Dark mode is ${t?"on":"off"}`),this.setDarkModeCapability(t)},this.toggleFileCard=(e,t)=>{const n=this.uppy.getFile(t);e?this.uppy.emit("dashboard:file-edit-start",n):this.uppy.emit("dashboard:file-edit-complete",n),this.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})},this.toggleAddFilesPanel=e=>{this.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})},this.addFiles=e=>{const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||e.webkitRelativePath||null}})));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver((e=>{const t=e[0],{width:n,height:r}=t.contentRect;this.uppy.log(`[Dashboard] resized: ${n} / ${r}`,"debug"),this.setPluginState({containerWidth:n,containerHeight:r,areInsidesReadyToBeVisible:!0})})),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout((()=>{const e=this.getPluginState(),t=!this.opts.inline&&e.isHidden;e.areInsidesReadyToBeVisible||t||(this.uppy.log("[Dashboard] resize event didn't fire on time: defaulted to mobile layout","debug"),this.setPluginState({areInsidesReadyToBeVisible:!0}))}),1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=e=>{this.el.contains(e.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableAllFocusableElements=e=>{const t=$C(this.el.querySelectorAll(qC));e?t.forEach((e=>{const t=e.getAttribute("tabindex");t&&(e.dataset.inertTabindex=t),e.setAttribute("tabindex","-1")})):t.forEach((e=>{"inertTabindex"in e.dataset?e.setAttribute("tabindex",e.dataset.inertTabindex):e.removeAttribute("tabindex")})),this.dashboardIsDisabled=e},this.updateBrowserHistory=()=>{var e;null!=(e=history.state)&&e[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=e=>{var t;!this.isModalOpen()||e.state&&e.state[this.modalName]||this.closeModal({manualClose:!1}),!this.isModalOpen()&&null!=(t=e.state)&&t[this.modalName]&&history.back()},this.handleKeyDownInModal=e=>{e.keyCode===XC&&this.requestCloseModal(e),e.keyCode===JC&&LC.forModal(e,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=e=>{this.uppy.iteratePlugins((t=>{"acquirer"===t.type&&(null==t.handleRootPaste||t.handleRootPaste(e))}));const t=$C(e.clipboardData.files);t.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(t))},this.handleInputChange=e=>{e.preventDefault();const t=$C(e.target.files);t.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(t))},this.handleDragOver=e=>{var t,n;e.preventDefault(),e.stopPropagation();const r=(()=>{let t=!0;return this.uppy.iteratePlugins((n=>{null!=n.canHandleRootDrop&&n.canHandleRootDrop(e)&&(t=!0)})),t})(),i=(()=>{const{types:t}=e.dataTransfer;return t.some((e=>"Files"===e))})();if(!r&&!i||this.opts.disabled||this.opts.disableLocalFiles&&(i||!r)||!this.uppy.getState().allowNewUpload)return e.dataTransfer.dropEffect="none",void clearTimeout(this.removeDragOverClassTimeout);e.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),null==(t=(n=this.opts).onDragOver)||t.call(n,e)},this.handleDragLeave=e=>{var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout((()=>{this.setPluginState({isDraggingOver:!1})}),50),null==(t=(n=this.opts).onDragLeave)||t.call(n,e)},this.handleDrop=async e=>{var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins((t=>{"acquirer"===t.type&&(null==t.handleRootDrop||t.handleRootDrop(e))}));let r=!1;const i=await VC(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error"),r||(this.uppy.info(e.message,"error"),r=!0)}});i.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(i)),null==(t=(n=this.opts).onDrop)||t.call(n,e)},this.handleRequestThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",e)},this.handleCancelThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",e)},this.handleKeyDownInInline=e=>{e.keyCode===JC&&LC.forInline(e,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=e=>{this.el.contains(document.activeElement)&&this.handlePaste(e)},this.handleComplete=e=>{let{failed:t}=e;this.opts.closeAfterFinish&&0===t.length&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,tT,{writable:!0,value:e=>{const t=e[0];this.canEditFile(t)&&this.openFileEditor(t)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){const e=HC(this.opts.trigger);e?e.forEach((e=>e.addEventListener("click",this.openModal))):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("file-editor:complete",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpenFileEditor&&this.uppy.on("files-added",zC(this,tT)[tT])},this.removeEvents=()=>{const e=HC(this.opts.trigger);!this.opts.inline&&e&&e.forEach((e=>e.removeEventListener("click",this.openModal))),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("file-editor:complete",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpenFileEditor&&this.uppy.off("files-added",zC(this,tT)[tT])},this.superFocusOnEachUpdate=()=>{const e=this.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,n=0===this.uppy.getState().info.length,r=!this.opts.inline;n&&(r||e||t&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{!this.opts.disabled||this.dashboardIsDisabled?(!this.opts.disabled&&this.dashboardIsDisabled&&this.disableAllFocusableElements(!1),this.superFocusOnEachUpdate()):this.disableAllFocusableElements(!0)},this.saveFileCard=(e,t)=>{this.uppy.setFileMeta(t,e),this.toggleFileCard(!1,t)},Object.defineProperty(this,nT,{writable:!0,value:e=>{const t=this.uppy.getPlugin(e.id);return{...e,icon:t.icon||this.opts.defaultPickerIcon,render:t.render}}}),Object.defineProperty(this,rT,{writable:!0,value:e=>{const t=this.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()}}),Object.defineProperty(this,iT,{writable:!0,value:GC((e=>e.filter((e=>"acquirer"===e.type&&zC(this,rT)[rT](e))).map(zC(this,nT)[nT])))}),Object.defineProperty(this,oT,{writable:!0,value:GC((e=>e.filter((e=>"progressindicator"===e.type)).map(zC(this,nT)[nT])))}),Object.defineProperty(this,sT,{writable:!0,value:GC((e=>e.filter((e=>"editor"===e.type)).map(zC(this,nT)[nT])))}),this.render=e=>{const t=this.getPluginState(),{files:n,capabilities:r,allowNewUpload:i}=e,{newFiles:o,uploadStartedFiles:s,completeFiles:a,erroredFiles:l,inProgressFiles:u,inProgressNotPausedFiles:c,processingFiles:d,isUploadStarted:p,isAllComplete:h,isAllErrored:f,isAllPaused:m}=this.uppy.getObjectOfFilesPerState(),g=zC(this,iT)[iT](t.targets),y=zC(this,oT)[oT](t.targets),b=zC(this,sT)[sT](t.targets);let v;return v="auto"===this.opts.theme?r.darkMode?"dark":"light":this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),QC({state:e,isHidden:t.isHidden,files:n,newFiles:o,uploadStartedFiles:s,completeFiles:a,erroredFiles:l,inProgressFiles:u,inProgressNotPausedFiles:c,processingFiles:d,isUploadStarted:p,isAllComplete:h,isAllErrored:f,isAllPaused:m,totalFileCount:Object.keys(n).length,totalProgress:e.totalProgress,allowNewUpload:i,acquirers:g,theme:v,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:t.activePickerPanel,showFileEditor:t.showFileEditor,saveFileEditor:this.saveFileEditor,disableAllFocusableElements:this.disableAllFocusableElements,animateOpenClose:this.opts.animateOpenClose,isClosing:t.isClosing,progressindicators:y,editors:b,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:e.recoveredState,metaFields:t.metaFields,resumableUploads:r.resumableUploads||!1,individualCancellation:r.individualCancellation,isMobileDevice:r.isMobileDevice,fileCardFor:t.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:t.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:t.containerWidth,containerHeight:t.containerHeight,areInsidesReadyToBeVisible:t.areInsidesReadyToBeVisible,isTargetDOMEl:this.isTargetDOMEl,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:t.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},this.discoverProviderPlugins=()=>{this.uppy.iteratePlugins((e=>{e&&!e.target&&e.opts&&e.opts.target===this.constructor&&this.addTarget(e)}))},this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:!1,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});const{inline:e,closeAfterFinish:t}=this.opts;if(e&&t)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");const{allowMultipleUploads:n,allowMultipleUploadBatches:r}=this.uppy.opts;(n||r)&&t&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");const{target:i}=this.opts;i&&this.mount(i,this);(this.opts.plugins||[]).forEach((e=>{const t=this.uppy.getPlugin(e);t&&t.mount(this,t)})),this.opts.disableStatusBar||this.uppy.use(RC,{id:`${this.id}:StatusBar`,target:this,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,showProgressDetails:this.opts.showProgressDetails,hideAfterFinish:this.opts.hideProgressAfterFinish,locale:this.opts.locale,doneButtonHandler:this.opts.doneButtonHandler}),this.opts.disableInformer||this.uppy.use(BC,{id:`${this.id}:Informer`,target:this}),this.opts.disableThumbnailGenerator||this.uppy.use(UC,{id:`${this.id}:ThumbnailGenerator`,thumbnailWidth:this.opts.thumbnailWidth,thumbnailHeight:this.opts.thumbnailHeight,thumbnailType:this.opts.thumbnailType,waitForThumbnailsBeforeUpload:this.opts.waitForThumbnailsBeforeUpload,lazy:!this.opts.waitForThumbnailsBeforeUpload}),this.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const o=!!this.darkModeMediaQuery&&this.darkModeMediaQuery.matches;this.uppy.log(`[Dashboard] Dark mode is ${o?"on":"off"}`),this.setDarkModeCapability(o),"auto"===this.opts.theme&&this.darkModeMediaQuery.addListener(this.handleSystemDarkModeChange),this.discoverProviderPlugins(),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){const e=this.uppy.getPlugin(`${this.id}:Informer`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableStatusBar){const e=this.uppy.getPlugin(`${this.id}:StatusBar`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableThumbnailGenerator){const e=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);e&&this.uppy.removePlugin(e)}(this.opts.plugins||[]).forEach((e=>{const t=this.uppy.getPlugin(e);t&&t.unmount()})),"auto"===this.opts.theme&&this.darkModeMediaQuery.removeListener(this.handleSystemDarkModeChange),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.modalName=`uppy-Dashboard-${(0,IC.nanoid)()}`,this.defaultLocale=KC;const r={target:"body",metaFields:[],trigger:null,inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:eT,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,doneButtonHandler:()=>{this.uppy.reset(),this.requestCloseModal()},note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,onRequestCloseModal:()=>this.closeModal(),showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,theme:"light",autoOpenFileEditor:!1,disabled:!1,disableLocalFiles:!1};this.opts={...r,...t},this.i18nInit(),this.superFocus=YC(),this.ifFocusedOnUppyRecently=!1,this.makeDashboardInsidesVisibleAnywayTimeout=null,this.removeDragOverClassTimeout=null}}aT.VERSION="2.4.0",NM.exports=aT;const lT=qf.exports,uT=_v.exports.Uppy,cT=lT.instanceOf(uT).isRequired,dT=lT.arrayOf(lT.string),pT=lT.shape({strings:lT.object,pluralize:lT.func}),hT=lT.shape({id:lT.string.isRequired,name:lT.string.isRequired,placeholder:lT.string}),fT=lT.oneOfType([lT.arrayOf(hT),lT.func]),mT=lT.oneOfType([lT.string,lT.number]);var gT={uppy:cT,locale:pT,dashboard:{uppy:cT,inline:lT.bool,plugins:dT,width:mT,height:mT,showProgressDetails:lT.bool,hideUploadButton:lT.bool,hideProgressAfterFinish:lT.bool,note:lT.string,metaFields:fT,proudlyDisplayPoweredByUppy:lT.bool,disableStatusBar:lT.bool,disableInformer:lT.bool,disableThumbnailGenerator:lT.bool,thumbnailWidth:lT.number,locale:pT}};const yT=["defaultChecked","defaultValue","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML","accessKey","className","contentEditable","contextMenu","dir","draggable","hidden","id","lang","placeholder","slot","spellCheck","style","tabIndex","title","translate","radioGroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","autoSave","color","itemProp","itemScope","itemType","itemID","itemRef","results","security","unselectable","inputMode","is","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],bT=/^(aria-|data-)/;var vT=e=>Object.fromEntries(Object.entries(e).filter((e=>{let[t]=e;return bT.test(t)||yT.includes(t)})));var wT=function(e,t){return Object.keys(e.props).some((n=>!((e,t)=>Object.prototype.hasOwnProperty.call(e,t))(e.validProps,n)&&e.props[n]!==t[n]))};const xT=t,MT=NM.exports,DT=gT.dashboard,kT=vT,ET=wT,CT=xT.createElement;class TT extends xT.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(ET(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:Dashboard",...this.props,target:this.container};delete t.uppy,e.use(MT,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=kT(this.props),CT("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}TT.propTypes=DT,TT.defaultProps={inline:!0};const OT=t,ST=qf.exports,AT=NM.exports,NT=gT.dashboard,_T=vT,jT=wT,IT=OT.createElement;class LT extends OT.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(jT(this,e)){const e={...this.props,onRequestCloseModal:this.props.onRequestClose};delete e.uppy,this.plugin.setOptions(e)}e.open&&!this.props.open?this.plugin.closeModal():!e.open&&this.props.open&&this.plugin.openModal()}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:DashboardModal",...this.props,onRequestCloseModal:this.props.onRequestClose};t.target||(t.target=this.container),delete t.uppy,e.use(AT,t),this.plugin=e.getPlugin(t.id),this.props.open&&this.plugin.openModal()}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=_T(this.props),IT("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}LT.propTypes={target:"undefined"!=typeof window?ST.instanceOf(window.HTMLElement):ST.any,open:ST.bool,onRequestClose:ST.func,closeModalOnClickOutside:ST.bool,disablePageScrollWhenModalOpen:ST.bool,...NT};var zT={exports:{}},PT=_v.exports,FT=hM;const RT=jM,BT=Pk,UT=uk,HT={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};class $T extends PT.UIPlugin{constructor(e,t){super(e,t),this.handleDrop=async e=>{var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1});const r=await UT(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error")}});r.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(r)),null==(t=(n=this.opts).onDrop)||t.call(n,e)},this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=HT;this.opts={target:null,inputName:"files[]",width:"100%",height:"100%",note:null,...t},this.i18nInit(),this.isDragDropSupported=BT(),this.removeDragOverClassTimeout=null,this.onInputChange=this.onInputChange.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragLeave=this.handleDragLeave.bind(this),this.handleDrop=this.handleDrop.bind(this),this.addFiles=this.addFiles.bind(this),this.render=this.render.bind(this)}addFiles(e){const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}})));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}}onInputChange(e){const t=RT(e.target.files);t.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(t)),e.target.value=null}handleDragOver(e){var t,n;e.preventDefault(),e.stopPropagation();const{types:r}=e.dataTransfer,i=r.some((e=>"Files"===e)),{allowNewUpload:o}=this.uppy.getState();if(!i||!o)return e.dataTransfer.dropEffect="none",void clearTimeout(this.removeDragOverClassTimeout);e.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),null==(t=(n=this.opts).onDragOver)||t.call(n,e)}handleDragLeave(e){var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout((()=>{this.setPluginState({isDraggingOver:!1})}),50),null==(t=(n=this.opts).onDragLeave)||t.call(n,e)}renderHiddenFileInput(){const{restrictions:e}=this.uppy.opts;return(0,FT.h)("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:e=>{this.fileInputRef=e},name:this.opts.inputName,multiple:1!==e.maxNumberOfFiles,accept:e.allowedFileTypes,onChange:this.onInputChange})}static renderArrowSvg(){return(0,FT.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},(0,FT.h)("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return(0,FT.h)("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:(0,FT.h)("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return(0,FT.h)("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){const e=`uppy-u-reset\n uppy-DragDrop-container\n ${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}\n ${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}\n `,t={width:this.opts.width,height:this.opts.height};return(0,FT.h)("button",{type:"button",className:e,style:t,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),(0,FT.h)("div",{className:"uppy-DragDrop-inner"},$T.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){const{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}}$T.VERSION="2.1.1";const VT=t,WT=zT.exports=$T,qT=gT,YT=vT,QT=wT,KT=VT.createElement;class GT extends VT.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(QT(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:DragDrop",...this.props,target:this.container};delete t.uppy,e.use(WT,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=YT(this.props),KT("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}GT.propTypes={uppy:qT.uppy,locale:qT.locale},GT.defaultProps={};var JT=GT,XT={exports:{}},ZT=hM,eO=_v.exports;class tO extends eO.UIPlugin{constructor(e,t){super(e,t),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator";this.opts={target:"body",fixed:!1,hideAfterFinish:!0,...t},this.render=this.render.bind(this)}render(e){const t=e.totalProgress||0,n=(0===t||100===t)&&this.opts.hideAfterFinish;return(0,ZT.h)("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":n},(0,ZT.h)("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),(0,ZT.h)("div",{className:"uppy-ProgressBar-percentage"},t))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}tO.VERSION="2.1.1",XT.exports=tO;const nO=t,rO=qf.exports,iO=XT.exports,oO=gT.uppy,sO=vT,aO=wT,lO=nO.createElement;class uO extends nO.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(aO(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:ProgressBar",...this.props,target:this.container};delete t.uppy,e.use(iO,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=sO(this.props),lO("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}uO.propTypes={uppy:oO,fixed:rO.bool,hideAfterFinish:rO.bool},uO.defaultProps={};const cO=t,dO=qf.exports,pO=UM.exports,hO=gT.uppy,fO=vT,mO=wT,gO=cO.createElement;class yO extends cO.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(mO(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:StatusBar",...this.props,target:this.container};delete t.uppy,e.use(pO,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=fO(this.props),gO("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}yO.propTypes={uppy:hO,hideAfterFinish:dO.bool,showProgressDetails:dO.bool},yO.defaultProps={};var bO={exports:{}},vO=_v.exports,wO=hM;const xO=jM,MO={strings:{chooseFiles:"Choose files"}};class DO extends vO.UIPlugin{constructor(e,t){super(e,t),this.id=this.opts.id||"FileInput",this.title="File Input",this.type="acquirer",this.defaultLocale=MO;this.opts={target:null,pretty:!0,inputName:"files[]",...t},this.i18nInit(),this.render=this.render.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleClick=this.handleClick.bind(this)}addFiles(e){const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e})));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}}handleInputChange(e){this.uppy.log("[FileInput] Something selected through input...");const t=xO(e.target.files);this.addFiles(t),e.target.value=null}handleClick(){this.input.click()}render(){const{restrictions:e}=this.uppy.opts,t=e.allowedFileTypes?e.allowedFileTypes.join(","):null;return(0,wO.h)("div",{className:"uppy-FileInput-container"},(0,wO.h)("input",{className:"uppy-FileInput-input",style:this.opts.pretty&&{width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},type:"file",name:this.opts.inputName,onChange:this.handleInputChange,multiple:1!==e.maxNumberOfFiles,accept:t,ref:e=>{this.input=e}}),this.opts.pretty&&(0,wO.h)("button",{className:"uppy-FileInput-btn",type:"button",onClick:this.handleClick},this.i18n("chooseFiles")))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}DO.VERSION="2.1.1",bO.exports=DO;const kO=qf.exports,EO=t,CO=bO.exports,TO=gT,OO=EO.createElement;class SO extends EO.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){e.uppy!==this.props.uppy&&(this.uninstallPlugin(e),this.installPlugin())}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:FileInput",...this.props,target:this.container};delete t.uppy,e.use(CO,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return OO("div",{className:"uppy-Container",ref:e=>{this.container=e}})}}SO.propTypes={uppy:TO.uppy,locale:TO.locale,pretty:kO.bool,inputName:kO.string},SO.defaultProps={};const{useEffect:AO,useRef:NO}=t,_O=_v.exports.Uppy;var jO={};class IO extends Error{constructor(e,t){void 0===t&&(t=null),super(`This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.`),this.cause=e,this.isNetworkError=!0,this.request=t}}var LO=IO;const zO=LO;var PO=function(){return fetch(...arguments).catch((e=>{throw"AbortError"===e.name?e:new zO(e)}))};const FO=Kv;class RO extends Error{constructor(e,t){void 0===t&&(t={}),super(e),this.cause=t.cause,this.cause&&FO(this.cause,"isNetworkError")&&(this.isNetworkError=this.cause.isNetworkError)}}var BO=RO;class UO extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}let HO;function $O(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var VO=0;function WO(e){return"__private_"+VO+++"_"+e}const qO=PO,YO=BO,QO=UO;async function KO(e){if(401===e.status)throw new QO;const t=e.json();if(e.status<200||e.status>300){let n=`Failed request with status: ${e.status}. ${e.statusText}`;try{const e=await t;n=e.message?`${n} message: ${e.message}`:n,n=e.requestId?`${n} request-Id: ${e.requestId}`:n}finally{throw new Error(n)}}return t}var GO=WO("companionHeaders"),JO=WO("getPostResponseFunc"),XO=WO("getUrl"),ZO=WO("errorHandler");HO=Symbol.for("uppy test: getCompanionHeaders");class eS{constructor(e,t){Object.defineProperty(this,ZO,{value:nS}),Object.defineProperty(this,XO,{value:tS}),Object.defineProperty(this,GO,{writable:!0,value:void 0}),Object.defineProperty(this,JO,{writable:!0,value:e=>t=>e?t:this.onReceiveResponse(t)}),this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=["accept","content-type","uppy-auth-token"],this.preflightDone=!1,$O(this,GO)[GO]=null==t?void 0:t.companionHeaders}setCompanionHeaders(e){$O(this,GO)[GO]=e}[HO](){return $O(this,GO)[GO]}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e&&e[t]?e[t]:t).replace(/\/$/,"")}headers(){return Promise.resolve({...eS.defaultHeaders,...$O(this,GO)[GO]})}onReceiveResponse(e){const t=this.uppy.getState().companion||{},n=this.opts.companionUrl,{headers:r}=e;return r.has("i-am")&&r.get("i-am")!==t[n]&&this.uppy.setState({companion:{...t,[n]:r.get("i-am")}}),e}preflight(e){return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch($O(this,XO)[XO](e),{method:"OPTIONS"}).then((e=>(e.headers.has("access-control-allow-headers")&&(this.allowedHeaders=e.headers.get("access-control-allow-headers").split(",").map((e=>e.trim().toLowerCase()))),this.preflightDone=!0,this.allowedHeaders.slice()))).catch((e=>(this.uppy.log(`[CompanionClient] unable to make preflight request ${e}`,"warning"),this.preflightDone=!0,this.allowedHeaders.slice())))}preflightAndHeaders(e){return Promise.all([this.preflight(e),this.headers()]).then((e=>{let[t,n]=e;return Object.keys(n).forEach((e=>{t.includes(e.toLowerCase())||(this.uppy.log(`[CompanionClient] excluding disallowed header ${e}`),delete n[e])})),n}))}get(e,t){const n="get";return this.preflightAndHeaders(e).then((t=>qO($O(this,XO)[XO](e),{method:n,headers:t,credentials:this.opts.companionCookiesRule||"same-origin"}))).then($O(this,JO)[JO](t)).then(KO).catch($O(this,ZO)[ZO](n,e))}post(e,t,n){const r="post";return this.preflightAndHeaders(e).then((n=>qO($O(this,XO)[XO](e),{method:r,headers:n,credentials:this.opts.companionCookiesRule||"same-origin",body:JSON.stringify(t)}))).then($O(this,JO)[JO](n)).then(KO).catch($O(this,ZO)[ZO](r,e))}delete(e,t,n){const r="delete";return this.preflightAndHeaders(e).then((n=>qO(`${this.hostname}/${e}`,{method:r,headers:n,credentials:this.opts.companionCookiesRule||"same-origin",body:t?JSON.stringify(t):null}))).then($O(this,JO)[JO](n)).then(KO).catch($O(this,ZO)[ZO](r,e))}}function tS(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}function nS(e,t){return n=>{var r;return null!=(r=n)&&r.isAuthError||(n=new YO(`Could not ${e} ${$O(this,XO)[XO](t)}`,{cause:n})),Promise.reject(n)}}eS.VERSION="2.2.1",eS.defaultHeaders={Accept:"application/json","Content-Type":"application/json","Uppy-Versions":`@uppy/companion-client=${eS.VERSION}`};var rS=eS,iS={};Object.defineProperty(iS,"__esModule",{value:!0}),iS.getItem=function(e){return Promise.resolve(localStorage.getItem(e))},iS.removeItem=function(e){return new Promise((t=>{localStorage.removeItem(e),t()}))},iS.setItem=function(e,t){return new Promise((n=>{localStorage.setItem(e,t),n()}))};var oS=iS;const sS=rS;var aS=class extends sS{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||(e=>e.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "))(this.id),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null}headers(){return Promise.all([super.headers(),this.getAuthToken()]).then((e=>{let[t,n]=e;const r={};return n&&(r["uppy-auth-token"]=n),this.companionKeysParams&&(r["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),{...t,...r}}))}onReceiveResponse(e){e=super.onReceiveResponse(e);const t=this.uppy.getPlugin(this.pluginId),n=t.getPluginState().authenticated?401!==e.status:e.status<400;return t.setPluginState({authenticated:n}),e}setAuthToken(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)}getAuthToken(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)}async ensurePreAuth(){if(this.companionKeysParams&&!this.preAuthToken&&(await this.fetchPreAuthToken(),!this.preAuthToken))throw new Error("Could not load authentication data required for third-party login. Please try again later.")}authUrl(e){void 0===e&&(e={});const t=new URLSearchParams(e);return this.preAuthToken&&t.set("uppyPreAuthToken",this.preAuthToken),`${this.hostname}/${this.id}/connect?${t}`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}async fetchPreAuthToken(){if(this.companionKeysParams)try{const e=await this.post(`${this.id}/preauth/`,{params:this.companionKeysParams});this.preAuthToken=e.token}catch(e){this.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${e}`,"warning")}}list(e){return this.get(`${this.id}/list/${e||""}`)}logout(){return this.get(`${this.id}/logout`).then((e=>Promise.all([e,this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)]))).then((e=>{let[t]=e;return t}))}static initPlugin(e,t,n){if(e.type="acquirer",e.files=[],n&&(e.opts={...n,...t}),t.serverUrl||t.serverPattern)throw new Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(t.companionAllowedHosts){const n=t.companionAllowedHosts;if(!("string"==typeof n||Array.isArray(n)||n instanceof RegExp))throw new TypeError(`${e.id}: the option "companionAllowedHosts" must be one of string, Array, RegExp`);e.opts.companionAllowedHosts=n}else/^(?!https?:\/\/).*$/i.test(t.companionUrl)?e.opts.companionAllowedHosts=`https://${t.companionUrl.replace(/^\/\//,"")}`:e.opts.companionAllowedHosts=new URL(t.companionUrl).origin;e.storage=e.opts.storage||oS}};const lS=rS;var uS=class extends lS{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||(e=>e.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "))(this.id),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t?`&${t}`:""}`)}};let cS,dS;function pS(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var hS=0;function fS(e){return"__private_"+hS+++"_"+e}const mS=ow;var gS=fS("queued"),yS=fS("emitter"),bS=fS("isOpen"),vS=fS("socket"),wS=fS("handleMessage");cS=Symbol.for("uppy test: getSocket"),dS=Symbol.for("uppy test: getQueued");var xS=class{constructor(e){Object.defineProperty(this,gS,{writable:!0,value:[]}),Object.defineProperty(this,yS,{writable:!0,value:mS()}),Object.defineProperty(this,bS,{writable:!0,value:!1}),Object.defineProperty(this,vS,{writable:!0,value:void 0}),Object.defineProperty(this,wS,{writable:!0,value:e=>{try{const t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(e){console.log(e)}}}),this.opts=e,e&&!1===e.autoOpen||this.open()}get isOpen(){return pS(this,bS)[bS]}[cS](){return pS(this,vS)[vS]}[dS](){return pS(this,gS)[gS]}open(){pS(this,vS)[vS]=new WebSocket(this.opts.target),pS(this,vS)[vS].onopen=()=>{for(pS(this,bS)[bS]=!0;pS(this,gS)[gS].length>0&&pS(this,bS)[bS];){const e=pS(this,gS)[gS].shift();this.send(e.action,e.payload)}},pS(this,vS)[vS].onclose=()=>{pS(this,bS)[bS]=!1},pS(this,vS)[vS].onmessage=pS(this,wS)[wS]}close(){var e;null==(e=pS(this,vS)[vS])||e.close()}send(e,t){pS(this,bS)[bS]?pS(this,vS)[vS].send(JSON.stringify({action:e,payload:t})):pS(this,gS)[gS].push({action:e,payload:t})}on(e,t){pS(this,yS)[yS].on(e,t)}emit(e,t){pS(this,yS)[yS].emit(e,t)}once(e,t){pS(this,yS)[yS].once(e,t)}};Object.defineProperty(jO,"__esModule",{value:!0}),jO.Socket=jO.SearchProvider=jO.RequestClient=jO.Provider=void 0;const MS=rS;jO.RequestClient=MS;const DS=aS;jO.Provider=DS;const kS=uS;jO.SearchProvider=kS;const ES=xS;jO.Socket=ES;var CS={};function TS(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Object.defineProperty(CS,"__esModule",{value:!0}),CS.internalRateLimitedQueue=CS.RateLimitedQueue=void 0;var OS=0;function SS(e){return"__private_"+OS+++"_"+e}function AS(){return new Error("Cancelled")}var NS=SS("activeRequests"),_S=SS("queuedHandlers"),jS=SS("paused"),IS=SS("pauseTimer"),LS=SS("downLimit"),zS=SS("upperLimit"),PS=SS("rateLimitingTimer"),FS=SS("call"),RS=SS("queueNext"),BS=SS("next"),US=SS("queue"),HS=SS("dequeue"),$S=SS("resume"),VS=SS("increaseLimit");function WS(e){TS(this,NS)[NS]+=1;let t,n=!1;try{t=e()}catch(e){throw TS(this,NS)[NS]-=1,e}return{abort:()=>{n||(n=!0,TS(this,NS)[NS]-=1,t(),TS(this,RS)[RS]())},done:()=>{n||(n=!0,TS(this,NS)[NS]-=1,TS(this,RS)[RS]())}}}function qS(){queueMicrotask((()=>TS(this,BS)[BS]()))}function YS(){if(TS(this,jS)[jS]||TS(this,NS)[NS]>=this.limit)return;if(0===TS(this,_S)[_S].length)return;const e=TS(this,_S)[_S].shift(),t=TS(this,FS)[FS](e.fn);e.abort=t.abort,e.done=t.done}function QS(e,t){void 0===t&&(t={});const n={fn:e,priority:t.priority||0,abort:()=>{TS(this,HS)[HS](n)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=TS(this,_S)[_S].findIndex((e=>n.priority>e.priority));return-1===r?TS(this,_S)[_S].push(n):TS(this,_S)[_S].splice(r,0,n),n}function KS(e){const t=TS(this,_S)[_S].indexOf(e);-1!==t&&TS(this,_S)[_S].splice(t,1)}CS.RateLimitedQueue=class{constructor(e){Object.defineProperty(this,HS,{value:KS}),Object.defineProperty(this,US,{value:QS}),Object.defineProperty(this,BS,{value:YS}),Object.defineProperty(this,RS,{value:qS}),Object.defineProperty(this,FS,{value:WS}),Object.defineProperty(this,NS,{writable:!0,value:0}),Object.defineProperty(this,_S,{writable:!0,value:[]}),Object.defineProperty(this,jS,{writable:!0,value:!1}),Object.defineProperty(this,IS,{writable:!0,value:void 0}),Object.defineProperty(this,LS,{writable:!0,value:1}),Object.defineProperty(this,zS,{writable:!0,value:void 0}),Object.defineProperty(this,PS,{writable:!0,value:void 0}),Object.defineProperty(this,$S,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,VS,{writable:!0,value:()=>{if(TS(this,jS)[jS])TS(this,PS)[PS]=setTimeout(TS(this,VS)[VS],0);else{TS(this,LS)[LS]=this.limit,this.limit=Math.ceil((TS(this,zS)[zS]+TS(this,LS)[LS])/2);for(let e=TS(this,LS)[LS];e<=this.limit;e++)TS(this,RS)[RS]();TS(this,zS)[zS]-TS(this,LS)[LS]>3?TS(this,PS)[PS]=setTimeout(TS(this,VS)[VS],2e3):TS(this,LS)[LS]=Math.floor(TS(this,LS)[LS]/2)}}}),this.limit="number"!=typeof e||0===e?1/0:e}run(e,t){return!TS(this,jS)[jS]&&TS(this,NS)[NS]<this.limit?TS(this,FS)[FS](e):TS(this,US)[US](e,t)}wrapPromiseFunction(e,t){var n=this;return function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];let s;const a=new Promise(((r,o)=>{s=n.run((()=>{let t,n;try{n=Promise.resolve(e(...i))}catch(e){n=Promise.reject(e)}return n.then((e=>{t?o(t):(s.done(),r(e))}),(e=>{t?o(t):(s.done(),o(e))})),()=>{t=AS()}}),t)}));return a.abort=()=>{s.abort()},a}}resume(){TS(this,jS)[jS]=!1,clearTimeout(TS(this,IS)[IS]);for(let e=0;e<this.limit;e++)TS(this,RS)[RS]()}pause(e){void 0===e&&(e=null),TS(this,jS)[jS]=!0,clearTimeout(TS(this,IS)[IS]),null!=e&&(TS(this,IS)[IS]=setTimeout(TS(this,$S)[$S],e))}rateLimit(e){clearTimeout(TS(this,PS)[PS]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(TS(this,zS)[zS]=this.limit-1,this.limit=TS(this,LS)[LS],TS(this,PS)[PS]=setTimeout(TS(this,VS)[VS],e))}get isPaused(){return TS(this,jS)[jS]}};const GS=Symbol("__queue");CS.internalRateLimitedQueue=GS;var JS=kw((function(e,t,n){const{progress:r,bytesUploaded:i,bytesTotal:o}=t;r&&(e.uppy.log(`Upload progress: ${r}`),e.uppy.emit("upload-progress",n,{uploader:e,bytesUploaded:i,bytesTotal:o}))}),300,{leading:!0,trailing:!0});var XS=function(e){const t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(e)[1];return`${/^http:\/\//i.test(e)?"ws":"wss"}://${t}`};var ZS=function(e){const t=[],n=[];function r(e){t.push(e)}function i(e){n.push(e)}return Promise.all(e.map((e=>e.then(r,i)))).then((()=>({successful:t,failed:n})))};function eA(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var tA=0;function nA(e){return"__private_"+tA+++"_"+e}var rA=nA("emitter"),iA=nA("events");var oA=class{constructor(e){Object.defineProperty(this,rA,{writable:!0,value:void 0}),Object.defineProperty(this,iA,{writable:!0,value:[]}),eA(this,rA)[rA]=e}on(e,t){return eA(this,iA)[iA].push([e,t]),eA(this,rA)[rA].on(e,t)}remove(){for(const[e,t]of eA(this,iA)[iA].splice(0))eA(this,rA)[rA].off(e,t)}};function sA(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var aA=0;function lA(e){return"__private_"+aA+++"_"+e}var uA=lA("aliveTimer"),cA=lA("isDone"),dA=lA("onTimedOut"),pA=lA("timeout");var hA=function(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)},fA=Bv,mA=jO,gA=CS;const yA=vM,bA=JS,vA=XS,wA=ZS,xA=oA,MA=class{constructor(e,t){Object.defineProperty(this,uA,{writable:!0,value:void 0}),Object.defineProperty(this,cA,{writable:!0,value:!1}),Object.defineProperty(this,dA,{writable:!0,value:void 0}),Object.defineProperty(this,pA,{writable:!0,value:void 0}),sA(this,pA)[pA]=e,sA(this,dA)[dA]=t}progress(){sA(this,cA)[cA]||sA(this,pA)[pA]>0&&(clearTimeout(sA(this,uA)[uA]),sA(this,uA)[uA]=setTimeout(sA(this,dA)[dA],sA(this,pA)[pA]))}done(){sA(this,cA)[cA]||(clearTimeout(sA(this,uA)[uA]),sA(this,uA)[uA]=null,sA(this,cA)[cA]=!0)}},DA=LO,kA=hA,EA={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}};function CA(e,t){let n=t;return n||(n=new Error("Upload error")),"string"==typeof n&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),kA(e)?(n=new DA(n,e),n):(n.request=e,n)}function TA(e){return e.data.slice(0,e.data.size,e.meta.type)}class OA extends yA{constructor(e,t){super(e,t),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.title="XHRUpload",this.defaultLocale=EA;const n={formData:!0,fieldName:t.bundle?"files[]":"file",method:"post",metaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:"",getResponseData(t){let n={};try{n=JSON.parse(t)}catch(t){e.log(t)}return n},getResponseError(e,t){let n=new Error("Upload error");return kA(t)&&(n=new DA(n,t)),n},validateStatus:e=>e>=200&&e<300};if(this.opts={...n,...t},this.i18nInit(),this.handleUpload=this.handleUpload.bind(this),gA.internalRateLimitedQueue in this.opts?this.requests=this.opts[gA.internalRateLimitedQueue]:this.requests=new gA.RateLimitedQueue(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");this.uploaderEvents=Object.create(null)}getOptions(e){const t=this.uppy.getState().xhrUpload,{headers:n}=this.opts,r={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return"function"==typeof n?r.headers=n(e):Object.assign(r.headers,this.opts.headers),t&&Object.assign(r.headers,t.headers),e.xhrUpload&&Object.assign(r.headers,e.xhrUpload.headers),r}addMetadata(e,t,n){(Array.isArray(n.metaFields)?n.metaFields:Object.keys(t)).forEach((n=>{e.append(n,t[n])}))}createFormDataUpload(e,t){const n=new FormData;this.addMetadata(n,e.meta,t);const r=TA(e);return e.name?n.append(t.fieldName,r,e.meta.name):n.append(t.fieldName,r),n}createBundledUpload(e,t){const n=new FormData,{meta:r}=this.uppy.getState();return this.addMetadata(n,r,t),e.forEach((e=>{const t=this.getOptions(e),r=TA(e);e.name?n.append(t.fieldName,r,e.name):n.append(t.fieldName,r)})),n}upload(e,t,n){const r=this.getOptions(e);return this.uppy.log(`uploading ${t} of ${n}`),new Promise(((t,n)=>{this.uppy.emit("upload-started",e);const i=r.formData?this.createFormDataUpload(e,r):e.data,o=new XMLHttpRequest;let s;this.uploaderEvents[e.id]=new xA(this.uppy);const a=new MA(r.timeout,(()=>{o.abort(),s.done();const t=new Error(this.i18n("timedOut",{seconds:Math.ceil(r.timeout/1e3)}));this.uppy.emit("upload-error",e,t),n(t)})),l=(0,fA.nanoid)();o.upload.addEventListener("loadstart",(()=>{this.uppy.log(`[XHRUpload] ${l} started`)})),o.upload.addEventListener("progress",(t=>{this.uppy.log(`[XHRUpload] ${l} progress: ${t.loaded} / ${t.total}`),a.progress(),t.lengthComputable&&this.uppy.emit("upload-progress",e,{uploader:this,bytesUploaded:t.loaded,bytesTotal:t.total})})),o.addEventListener("load",(()=>{if(this.uppy.log(`[XHRUpload] ${l} finished`),a.done(),s.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),r.validateStatus(o.status,o.responseText,o)){const n=r.getResponseData(o.responseText,o),i=n[r.responseUrlFieldName],s={status:o.status,body:n,uploadURL:i};return this.uppy.emit("upload-success",e,s),i&&this.uppy.log(`Download ${e.name} from ${i}`),t(e)}const i=r.getResponseData(o.responseText,o),u=CA(o,r.getResponseError(o.responseText,o)),c={status:o.status,body:i};return this.uppy.emit("upload-error",e,u,c),n(u)})),o.addEventListener("error",(()=>{this.uppy.log(`[XHRUpload] ${l} errored`),a.done(),s.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null);const t=CA(o,r.getResponseError(o.responseText,o));return this.uppy.emit("upload-error",e,t),n(t)})),o.open(r.method.toUpperCase(),r.endpoint,!0),o.withCredentials=r.withCredentials,""!==r.responseType&&(o.responseType=r.responseType),s=this.requests.run((()=>{this.uppy.emit("upload-started",e);const t=this.getOptions(e);return Object.keys(t.headers).forEach((e=>{o.setRequestHeader(e,t.headers[e])})),o.send(i),()=>{a.done(),o.abort()}})),this.onFileRemove(e.id,(()=>{s.abort(),n(new Error("File removed"))})),this.onCancelAll(e.id,(e=>{let{reason:t}=e;"user"===t&&s.abort(),n(new Error("Upload cancelled"))}))}))}uploadRemote(e){const t=this.getOptions(e);return new Promise(((n,r)=>{this.uppy.emit("upload-started",e);const i={};(Array.isArray(t.metaFields)?t.metaFields:Object.keys(e.meta)).forEach((t=>{i[t]=e.meta[t]}));new(e.remote.providerOptions.provider?mA.Provider:mA.RequestClient)(this.uppy,e.remote.providerOptions).post(e.remote.url,{...e.remote.body,endpoint:t.endpoint,size:e.data.size,fieldname:t.fieldName,metadata:i,httpMethod:t.method,useFormData:t.formData,headers:t.headers}).then((i=>{const{token:o}=i,s=vA(e.remote.companionUrl),a=new mA.Socket({target:`${s}/api/${o}`,autoOpen:!1});let l;this.uploaderEvents[e.id]=new xA(this.uppy),this.onFileRemove(e.id,(()=>{a.send("cancel",{}),l.abort(),n(`upload ${e.id} was removed`)})),this.onCancelAll(e.id,(function(t){let{reason:r}=void 0===t?{}:t;"user"===r&&(a.send("cancel",{}),l.abort()),n(`upload ${e.id} was canceled`)})),this.onRetry(e.id,(()=>{a.send("pause",{}),a.send("resume",{})})),this.onRetryAll(e.id,(()=>{a.send("pause",{}),a.send("resume",{})})),a.on("progress",(t=>bA(this,t,e))),a.on("success",(r=>{const i=t.getResponseData(r.response.responseText,r.response),o=i[t.responseUrlFieldName],s={status:r.response.status,body:i,uploadURL:o};return this.uppy.emit("upload-success",e,s),l.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),n()})),a.on("error",(n=>{const i=n.response,o=i?t.getResponseError(i.responseText,i):Object.assign(new Error(n.error.message),{cause:n.error});this.uppy.emit("upload-error",e,o),l.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),r(o)})),l=this.requests.run((()=>(a.open(),e.isPaused&&a.send("pause",{}),()=>a.close())))})).catch((t=>{this.uppy.emit("upload-error",e,t),r(t)}))}))}uploadBundle(e){return new Promise(((t,n)=>{const{endpoint:r}=this.opts,{method:i}=this.opts,o=this.uppy.getState().xhrUpload,s=this.createBundledUpload(e,{...this.opts,...o||{}}),a=new XMLHttpRequest,l=t=>{e.forEach((e=>{this.uppy.emit("upload-error",e,t)}))},u=new MA(this.opts.timeout,(()=>{a.abort();const e=new Error(this.i18n("timedOut",{seconds:Math.ceil(this.opts.timeout/1e3)}));l(e),n(e)}));a.upload.addEventListener("loadstart",(()=>{this.uppy.log("[XHRUpload] started uploading bundle"),u.progress()})),a.upload.addEventListener("progress",(t=>{u.progress(),t.lengthComputable&&e.forEach((e=>{this.uppy.emit("upload-progress",e,{uploader:this,bytesUploaded:t.loaded/t.total*e.size,bytesTotal:e.size})}))})),a.addEventListener("load",(r=>{if(u.done(),this.opts.validateStatus(r.target.status,a.responseText,a)){const n=this.opts.getResponseData(a.responseText,a),i={status:r.target.status,body:n};return e.forEach((e=>{this.uppy.emit("upload-success",e,i)})),t()}const i=this.opts.getResponseError(a.responseText,a)||new Error("Upload error");return i.request=a,l(i),n(i)})),a.addEventListener("error",(()=>{u.done();const e=this.opts.getResponseError(a.responseText,a)||new Error("Upload error");return l(e),n(e)})),this.uppy.on("cancel-all",(function(e){let{reason:t}=void 0===e?{}:e;"user"===t&&(u.done(),a.abort())})),a.open(i.toUpperCase(),r,!0),a.withCredentials=this.opts.withCredentials,""!==this.opts.responseType&&(a.responseType=this.opts.responseType),Object.keys(this.opts.headers).forEach((e=>{a.setRequestHeader(e,this.opts.headers[e])})),a.send(s),e.forEach((e=>{this.uppy.emit("upload-started",e)}))}))}uploadFiles(e){const t=e.map(((t,n)=>{const r=parseInt(n,10)+1,i=e.length;return t.error?Promise.reject(new Error(t.error)):t.isRemote?this.uploadRemote(t,r,i):this.upload(t,r,i)}));return wA(t)}onFileRemove(e,t){this.uploaderEvents[e].on("file-removed",(n=>{e===n.id&&t(n.id)}))}onRetry(e,t){this.uploaderEvents[e].on("upload-retry",(n=>{e===n&&t()}))}onRetryAll(e,t){this.uploaderEvents[e].on("retry-all",(()=>{this.uppy.getFile(e)&&t()}))}onCancelAll(e,t){var n=this;this.uploaderEvents[e].on("cancel-all",(function(){n.uppy.getFile(e)&&t(...arguments)}))}handleUpload(e){if(0===e.length)return this.uppy.log("[XHRUpload] No files to upload!"),Promise.resolve();0!==this.opts.limit||this.opts[gA.internalRateLimitedQueue]||this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const t=e.map((e=>this.uppy.getFile(e)));if(this.opts.bundle){if(t.some((e=>e.isRemote)))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if("function"==typeof this.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");return this.uploadBundle(t)}return this.uploadFiles(t).then((()=>null))}install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(this.handleUpload)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(this.handleUpload)}}OA.VERSION="2.1.2";var SA=OA;const AA=e=>{var n;let{uppy:r}=e;const[s,a]=i(0);o((()=>{r.on("progress",a)}),[r]);const l="".concat(s,"%");return t.createElement("div",{className:"neeto-editor-image-uploader__progress"},t.createElement("p",{className:"neeto-editor-image-uploader__progress-title"},"Uploading..."),t.createElement("p",{className:"neeto-editor-image-uploader__progress-file"},null===(n=r.getFiles()[0])||void 0===n?void 0:n.name),t.createElement("div",{className:"neeto-editor-progress-bar__wrapper","data-cy":"neeto-editor-image-upload-progress-bar"},t.createElement("div",{className:"neeto-editor-progress-bar__percent"},t.createElement("p",null,l),t.createElement(Ld,{icon:th,onClick:()=>r.cancelAll(),size:"small",style:"text"})),t.createElement("div",{className:"neeto-editor-progress-bar__indicator"},t.createElement("div",{style:{width:l},className:"neeto-editor-progress-bar__indicator-inner"}))))},NA=e=>{const t=["B","KB","MB","GB"];let n=0;for(;e>=1024&&n<t.length;)e/=1024,++n;return"".concat(e.toFixed(1)," ").concat(t[n])},_A=e=>{let{endpoint:n=Av,onSuccess:r,uploadConfig:o}=e;const[s,a]=i(!1),[l,u]=i(""),c={...Ov,...o},d=function(e){if("function"!=typeof e)throw new TypeError("useUppy: expected a function that returns a new Uppy instance");const t=NO(void 0);if(void 0===t.current&&(t.current=e(),!(t.current instanceof _O)))throw new TypeError(`useUppy: factory function must return an Uppy instance, got ${typeof t.current}`);return AO((()=>()=>{t.current.close({reason:"unmount"}),t.current=void 0}),[t]),t.current}((()=>new AM({...c,onBeforeFileAdded:e=>{const{maxFileSize:t,allowedFileTypes:n}=c.restrictions;return e.size>t?(u("File size is too large. Max size is ".concat(NA(c.restrictions.maxFileSize),".")),!1):!!n.includes(".".concat(e.extension))||(u("File type is not permitted. Allowed file types are: ".concat(n.join(", "),".")),!1)}}).use(SA,{endpoint:n,...Sv}).on("upload",(()=>a(!0))).on("upload-success",((e,t)=>r(t.body.imageURL))).on("cancel-all",(()=>a(!1))).on("complete",(()=>a(!1)))));return s?t.createElement(AA,{uppy:d}):t.createElement("div",{className:"neeto-editor-image-uploader__dnd-wrapper"},t.createElement(JT,{className:"neeto-editor-image-uploader__dnd",note:"Max. File Size: ".concat(NA(c.restrictions.maxFileSize)),locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},uppy:d,"data-cy":"neeto-editor-image-local-uploader"}),l&&t.createElement("p",{className:"neeto-editor-image-uploader__dnd--error"},l))},jA=()=>t.createElement("div",{className:"neeto-editor-loader"},t.createElement("span",{className:"neeto-editor-loader__spinner-icon"}));var IA={},LA=Object.assign||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},zA=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.create(null);function n(e,n){return t[e]=t[e]||[],t[e].push(n),this}function r(e,t){return t._once=!0,n(e,t),this}function i(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n?t[e].splice(t[e].indexOf(n),1):delete t[e],this}function o(e){for(var n=this,r=arguments.length,o=Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];var a=t[e]&&t[e].slice();return a&&a.forEach((function(t){t._once&&i(e,t),t.apply(n,o)})),this}return LA({},e,{on:n,once:r,off:i,emit:o})},PA=Object.freeze({__proto__:null,default:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=void 0,n=void 0,r=void 0,i=void 0,o=void 0,s=void 0,a=void 0,l=void 0,u=void 0,c=void 0,d=void 0,p=void 0,h=void 0,f=0===e.packed.indexOf("data-")?e.packed:"data-"+e.packed,m=e.sizes.slice().reverse(),g=!1!==e.position,y=e.container.nodeType?e.container:document.querySelector(e.container),b={all:function(){return D(y.children)},new:function(){return D(y.children).filter((function(e){return!e.hasAttribute(""+f)}))}},v=[C,T,O],w=[S,A,N,_],x=zA({pack:L,update:z,resize:P});return x;function M(e){e.forEach((function(e){return e()}))}function D(e){return Array.prototype.slice.call(e)}function k(e){return Array.apply(null,Array(e)).map((function(){return 0}))}function E(){return m.map((function(e){return e.mq&&window.matchMedia("(min-width: "+e.mq+")").matches})).indexOf(!0)}function C(){r=E()}function T(){i=-1===r?m[m.length-1]:m[r]}function O(){s=k(i.columns)}function S(){d=b[t?"new":"all"]()}function A(){0!==d.length&&(p=d.map((function(e){return e.clientWidth})),h=d.map((function(e){return e.clientHeight})))}function N(){d.forEach((function(e,t){o=s.indexOf(Math.min.apply(Math,s)),e.style.position="absolute",a=s[o]+"px",l=o*p[t]+o*i.gutter+"px",g?(e.style.top=a,e.style.left=l):e.style.transform="translate3d("+l+", "+a+", 0)",e.setAttribute(f,""),u=p[t],c=h[t],u&&c&&(s[o]+=c+i.gutter)}))}function _(){y.style.position="relative",y.style.width=i.columns*u+(i.columns-1)*i.gutter+"px",y.style.height=Math.max.apply(Math,s)-i.gutter+"px"}function j(){n||(window.requestAnimationFrame(I),n=!0)}function I(){r!==E()&&(L(),x.emit("resize",i)),n=!1}function L(){return t=!1,M(v.concat(w)),x.emit("pack")}function z(){return t=!0,M(w),x.emit("update")}function P(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?"addEventListener":"removeEventListener";return window[t]("resize",j),x}}}),FA=rc(PA),RA={exports:{}},BA={exports:{}};!function(e,n){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=t,o=a(i),s=a(qf.exports);function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.scrollListener=n.scrollListener.bind(n),n.eventListenerOptions=n.eventListenerOptions.bind(n),n.mousewheelListener=n.mousewheelListener.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var e=!1,t={get passive(){e=!0}};try{document.addEventListener("test",null,t),document.removeEventListener("test",null,t)}catch(e){}return e}},{key:"eventListenerOptions",value:function(){this.props.useCapture;return this.isPassiveSupported()?{useCapture:this.props.useCapture,passive:!0}:{passive:!1}}},{key:"setDefaultLoader",value:function(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(e){var t=this.props.getScrollParent&&this.props.getScrollParent();return null!=t?t:e&&e.parentNode}},{key:"filterProps",value:function(e){return e}},{key:"attachScrollListener",value:function(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var t=window;!1===this.props.useWindow&&(t=e),t.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),t.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function(){var e=this.scrollComponent,t=window,n=this.getParentElement(e),r=void 0;if(this.props.useWindow){var i=document.documentElement||document.body.parentNode||document.body,o=void 0!==t.pageYOffset?t.pageYOffset:i.scrollTop;r=this.props.isReverse?o:this.calculateOffset(e,o)}else r=this.props.isReverse?n.scrollTop:e.scrollHeight-n.scrollTop-n.clientHeight;r<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=n.scrollHeight,this.beforeScrollTop=n.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(e,t){return e?this.calculateTopPosition(e)+(e.offsetHeight-t-window.innerHeight):0}},{key:"calculateTopPosition",value:function(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function(){var e=this,t=this.filterProps(this.props),n=t.children,r=t.element,i=t.hasMore;t.initialLoad;var s=t.isReverse,a=t.loader;t.loadMore,t.pageStart;var l=t.ref;t.threshold,t.useCapture,t.useWindow,t.getScrollParent;var u=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);u.ref=function(t){e.scrollComponent=t,l&&l(t)};var c=[n];return i&&(a?s?c.unshift(a):c.push(a):this.defaultLoader&&(s?c.unshift(this.defaultLoader):c.push(this.defaultLoader))),o.default.createElement(r,u,c)}}]),t}(i.Component);l.propTypes={children:s.default.node.isRequired,element:s.default.node,hasMore:s.default.bool,initialLoad:s.default.bool,isReverse:s.default.bool,loader:s.default.node,loadMore:s.default.func.isRequired,pageStart:s.default.number,ref:s.default.func,getScrollParent:s.default.func,threshold:s.default.number,useCapture:s.default.bool,useWindow:s.default.bool},l.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},n.default=l,e.exports=n["default"]}(BA,BA.exports),RA.exports=BA.exports,Object.defineProperty(IA,"__esModule",{value:!0});var UA,HA,$A=IA.default=void 0,VA=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),WA=t,qA=GA(WA),YA=GA(qf.exports),QA=GA(FA),KA=GA(RA.exports);function GA(e){return e&&e.__esModule?e:{default:e}}function JA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XA(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var ZA=(HA=UA=function(e){function t(){var e,n,r;JA(this,t);for(var i=arguments.length,o=Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r=XA(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.setContainerRef=function(e){r.masonryContainer=e},r.forcePack=function(){r.masonryContainer&&r.state.instance.pack()},r.forceUpdate=function(){r.masonryContainer&&r.state.instance.update()},r.createNewInstance=function(){var e=r.props,t=e.packed,n=e.sizes,i=e.children,o=e.position,s=(0,QA.default)({container:r.masonryContainer,packed:t,sizes:n,position:o});s.resize(!0),i.length>0&&s.pack(),r.setState((function(){return{instance:s}}))},XA(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,WA.Component),VA(t,[{key:"componentDidMount",value:function(){this.createNewInstance()}},{key:"componentDidUpdate",value:function(e){var t=this.props.children,n=this.state.instance;if(0!==e.children.length||0!==t.length)return 0===e.children.length&&t.length>0?n.pack():e.children.length!==t.length?this.props.pack?n.pack():n.update():void 0}},{key:"componentWillUnmount",value:function(){this.state&&this.state.instance.resize(!1)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.style;e.pack,e.packed,e.position,e.sizes;var i=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["children","className","style","pack","packed","position","sizes"]);return qA.default.createElement(KA.default,i,qA.default.createElement("div",{ref:this.setContainerRef,className:n,style:r},t))}}]),t}(),UA.propTypes={children:YA.default.arrayOf(YA.default.element).isRequired,className:YA.default.string,initialLoad:YA.default.bool,pack:YA.default.bool,packed:YA.default.string,position:YA.default.bool,sizes:YA.default.array,style:YA.default.object},UA.defaultProps={className:"",initialLoad:!0,pack:!1,packed:"data-packed",position:!0,sizes:[{columns:1,gutter:20},{mq:"768px",columns:2,gutter:20},{mq:"1024px",columns:3,gutter:20}],style:{}},HA);$A=IA.default=ZA;const eN=e=>{let{onSubmit:n,unsplashApiKey:r}=e;const s=u(null),[a,l]=i(""),[c,d]=i(!1),[p,h]=i([]),[f,m]=i(1),[g,y]=i(!0),[b,v]=i(!1),w=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800;const[n,r]=i(e);return o((()=>{const n=setTimeout((()=>{r(e)}),t);return()=>{clearTimeout(n)}}),[e]),n}(a||"latest");o((()=>{x(1)}),[w]);const x=async e=>{try{v(!0),d(!1);const t=await(e=>{let{pageNo:t,query:n,apiKey:r}=e;return by.get(fd,{headers:{Authorization:"Client-ID ".concat(r)},params:{page:t,per_page:30,order_by:"popular",query:n}})})({page:e,query:w,apiKey:r}),{data:{results:n,total_pages:i}}=t;h(1===e?n:[...p,...n]),m(e+1),y(e<i)}catch(e){d(!0)}finally{v(!1)}};return t.createElement("div",{className:"neeto-editor-unsplash-wrapper"},t.createElement(jf,{name:"text",value:a,placeholder:"Search Unsplash",onChange:e=>{let{target:{value:t}}=e;l(t)},"data-cy":"neeto-editor-unsplash-image-picker-search-input"}),c&&t.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-error"},"Something went wrong! Please try again later."),!c&&!b&&ld(p)&&t.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-no-results-error"},"No results"),!c&&t.createElement("div",{className:"neeto-editor-unsplash-container"},t.createElement($A,{ref:s,pack:!0,style:{width:"100%"},sizes:[{columns:3,gutter:0},{mq:"768px",columns:3,gutter:0},{mq:"1024px",columns:3,gutter:0}],hasMore:g,loadMore:()=>{!b&&g&&f>1&&x(f)},position:!0,useWindow:!1,className:"neeto-editor-unsplash-gallery",loader:t.createElement(jA,{key:0})},p&&p.map(((e,r)=>t.createElement("div",{key:r,className:"neeto-editor-unsplash-gallery__item","data-cy":"neeto-editor-unsplash-image-picker-result-".concat(r)},t.createElement("div",{className:"neeto-editor-unsplash-gallery__item-placeholder",style:{paddingBottom:"".concat(e.height/e.width*100,"%")}},t.createElement("div",{className:"neeto-editor-unsplash-gallery__item-inner",id:"unsplashImage".concat(r)},t.createElement("img",{src:e.urls.regular,onClick:()=>n(e.urls.small)}),t.createElement("a",{href:"https://unsplash.com/@".concat(e.user.username),target:"_blank",rel:"noreferrer"},e.user.name," "))))))),!g&&t.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"End of results")))},tN=e=>{let{buttonLabel:n="Submit",placeholder:r,onSubmit:o,className:s}=e;const[a,l]=i(""),[u,c]=i("");return t.createElement("div",{className:sc("neeto-editor-url-form__wrapper",{[s]:s})},t.createElement(jf,{name:"url",value:a,placeholder:r,onFocus:()=>c(""),error:u,onChange:e=>{let{target:{value:t}}=e;return l(t)},"data-cy":"neeto-editor-image-upload-url-input"}),t.createElement(Ld,{size:"large",label:n,onClick:e=>{e.preventDefault(),Rf.test(a)?o(a):c("Please enter a valid url")},"data-cy":"neeto-editor-image-upload-url-submit"}))},nN=e=>{let{editor:n,imageUploadUrl:r,uploadConfig:o,isVisible:s,setIsVisible:a,unsplashApiKey:l,isUnsplashImageUploadActive:u}=e;const[c,d]=(e=>{var t;const[n,r]=i(null===(t=e[0])||void 0===t?void 0:t.key);return[n,e=>r(e.key)]})(Nv),[p,h]=i(""),f=e=>{h(e)},m={local:()=>t.createElement(_A,{endpoint:r,onSuccess:f,uploadConfig:o}),link:()=>t.createElement(tN,{onSubmit:f,buttonLabel:"Upload Image",placeholder:"Paste the image link"}),unsplash:()=>t.createElement(eN,{unsplashApiKey:l,onSubmit:f})}[c];return t.createElement(Nf,{isOpen:s,onClose:()=>a(!1),closeButton:!1},t.createElement("div",{className:"neeto-editor-image-uploader"},t.createElement(Tv,null,Nv.filter((e=>"unsplash"!==e.key||u)).map((e=>t.createElement(Tv.Item,{key:e.key,active:c===e.key,onClick:()=>d(e)},e.title)))),t.createElement("div",{className:"neeto-editor-image-uploader__content"},p?t.createElement(If,{url:p,editor:n,onClose:()=>{h(null),a(!1)}}):t.createElement(m,null))))},rN=js.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter((e=>""!==e)).length}},addProseMirrorPlugins(){return[new kn({key:new Tn("characterCount"),filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n)return!0;if(r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r)return!1;if(!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,s=o-(i-n),a=o;e.deleteRange(s,a);return!(this.storage.characters({node:e.doc})>n)}})]}}),iN=Ca.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=ea(e,this.type);return!!Object.entries(n).some((([,e])=>!!e))||t.unsetMark(this.name)}}}}),oN=js.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return null===(t=e.style.color)||void 0===t?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})});function sN(e={}){return new kn({view:t=>new aN(t,e)})}class aN{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?t.bottom:t.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:t.left,right:t.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos);e={left:t.left-this.width/2,right:t.left+this.width/2,top:t.top,bottom:t.bottom}}let n,r,i=this.editorView.dom.offsetParent;if(this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!i||i==document.body&&"static"==getComputedStyle(i).position)n=-pageXOffset,r=-pageYOffset;else{let e=i.getBoundingClientRect();n=e.left-i.scrollLeft,r=e.top-i.scrollTop}this.element.style.left=e.left-n+"px",this.element.style.top=e.top-r+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&(e=Bt(this.editorView.state.doc,e,this.editorView.dragging.slice),null==e))return this.setCursor(null);this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const lN=js.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[sN(this.options)]}}),uN=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,cN=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,dN=Ca.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}`}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[xa({find:uN,type:this.type})]},addPasteRules(){return[Oa({find:cN,type:this.type})]}});function pN(e){this.j={},this.jr=[],this.jd=null,this.t=e}pN.prototype={accepts:function(){return!!this.t},tt:function(e,t){if(t&&t.j)return this.j[e]=t,t;var n=t,r=this.j[e];if(r)return n&&(r.t=n),r;r=hN();var i=yN(this,e);return i?(Object.assign(r.j,i.j),r.jr.append(i.jr),r.jr=i.jd,r.t=n||i.t):r.t=n,this.j[e]=r,r}};var hN=function(){return new pN},fN=function(e){return new pN(e)},mN=function(e,t,n){e.j[t]||(e.j[t]=n)},gN=function(e,t,n){e.jr.push([t,n])},yN=function(e,t){var n=e.j[t];if(n)return n;for(var r=0;r<e.jr.length;r++){var i=e.jr[r][0],o=e.jr[r][1];if(i.test(t))return o}return e.jd},bN=function(e,t,n){for(var r=0;r<t.length;r++)mN(e,t[r],n)},vN=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0],i=t[n][1];mN(e,r,i)}},wN=function(e,t,n,r){for(var i,o=0,s=t.length;o<s&&(i=e.j[t[o]]);)e=i,o++;if(o>=s)return[];for(;o<s-1;)i=r(),mN(e,t[o],i),e=i,o++;mN(e,t[s-1],n)},xN="DOMAIN",MN="LOCALHOST",DN="TLD",kN="NUM",EN="PROTOCOL",CN="MAILTO",TN="WS",ON="NL",SN="OPENBRACE",AN="OPENBRACKET",NN="OPENANGLEBRACKET",_N="OPENPAREN",jN="CLOSEBRACE",IN="CLOSEBRACKET",LN="CLOSEANGLEBRACKET",zN="CLOSEPAREN",PN="AMPERSAND",FN="APOSTROPHE",RN="ASTERISK",BN="AT",UN="BACKSLASH",HN="BACKTICK",$N="CARET",VN="COLON",WN="COMMA",qN="DOLLAR",YN="DOT",QN="EQUALS",KN="EXCLAMATION",GN="HYPHEN",JN="PERCENT",XN="PIPE",ZN="PLUS",e_="POUND",t_="QUERY",n_="QUOTE",r_="SEMI",i_="SLASH",o_="TILDE",s_="UNDERSCORE",a_="SYM",l_=Object.freeze({__proto__:null,DOMAIN:xN,LOCALHOST:MN,TLD:DN,NUM:kN,PROTOCOL:EN,MAILTO:CN,WS:TN,NL:ON,OPENBRACE:SN,OPENBRACKET:AN,OPENANGLEBRACKET:NN,OPENPAREN:_N,CLOSEBRACE:jN,CLOSEBRACKET:IN,CLOSEANGLEBRACKET:LN,CLOSEPAREN:zN,AMPERSAND:PN,APOSTROPHE:FN,ASTERISK:RN,AT:BN,BACKSLASH:UN,BACKTICK:HN,CARET:$N,COLON:VN,COMMA:WN,DOLLAR:qN,DOT:YN,EQUALS:QN,EXCLAMATION:KN,HYPHEN:GN,PERCENT:JN,PIPE:XN,PLUS:ZN,POUND:e_,QUERY:t_,QUOTE:n_,SEMI:r_,SLASH:i_,TILDE:o_,UNDERSCORE:s_,SYM:a_}),u_="aaa aarp abarth abb abbott abbvie abc able abogado abudhabi ac academy accenture accountant accountants aco actor ad adac ads adult ae aeg aero aetna af afamilycompany afl africa ag agakhan agency ai aig airbus airforce airtel akdn al alfaromeo alibaba alipay allfinanz allstate ally alsace alstom am amazon americanexpress americanfamily amex amfam amica amsterdam analytics android anquan anz ao aol apartments app apple aq aquarelle ar arab aramco archi army arpa art arte as asda asia associates at athleta attorney au auction audi audible audio auspost author auto autos avianca aw aws ax axa az azure ba baby baidu banamex bananarepublic band bank bar barcelona barclaycard barclays barefoot bargains baseball basketball bauhaus bayern bb bbc bbt bbva bcg bcn bd be beats beauty beer bentley berlin best bestbuy bet bf bg bh bharti bi bible bid bike bing bingo bio biz bj black blackfriday blockbuster blog bloomberg blue bm bms bmw bn bnpparibas bo boats boehringer bofa bom bond boo book booking bosch bostik boston bot boutique box br bradesco bridgestone broadway broker brother brussels bs bt budapest bugatti build builders business buy buzz bv bw by bz bzh ca cab cafe cal call calvinklein cam camera camp cancerresearch canon capetown capital capitalone car caravan cards care career careers cars casa case cash casino cat catering catholic cba cbn cbre cbs cc cd center ceo cern cf cfa cfd cg ch chanel channel charity chase chat cheap chintai christmas chrome church ci cipriani circle cisco citadel citi citic city cityeats ck cl claims cleaning click clinic clinique clothing cloud club clubmed cm cn co coach codes coffee college cologne com comcast commbank community company compare computer comsec condos construction consulting contact contractors cooking cookingchannel cool coop corsica country coupon coupons courses cpa cr credit creditcard creditunion cricket crown crs cruise cruises csc cu cuisinella cv cw cx cy cymru cyou cz dabur dad dance data date dating datsun day dclk dds de deal dealer deals degree delivery dell deloitte delta democrat dental dentist desi design dev dhl diamonds diet digital direct directory discount discover dish diy dj dk dm dnp do docs doctor dog domains dot download drive dtv dubai duck dunlop dupont durban dvag dvr dz earth eat ec eco edeka edu education ee eg email emerck energy engineer engineering enterprises epson equipment er ericsson erni es esq estate et etisalat eu eurovision eus events exchange expert exposed express extraspace fage fail fairwinds faith family fan fans farm farmers fashion fast fedex feedback ferrari ferrero fi fiat fidelity fido film final finance financial fire firestone firmdale fish fishing fit fitness fj fk flickr flights flir florist flowers fly fm fo foo food foodnetwork football ford forex forsale forum foundation fox fr free fresenius frl frogans frontdoor frontier ftr fujitsu fujixerox fun fund furniture futbol fyi ga gal gallery gallo gallup game games gap garden gay gb gbiz gd gdn ge gea gent genting george gf gg ggee gh gi gift gifts gives giving gl glade glass gle global globo gm gmail gmbh gmo gmx gn godaddy gold goldpoint golf goo goodyear goog google gop got gov gp gq gr grainger graphics gratis green gripe grocery group gs gt gu guardian gucci guge guide guitars guru gw gy hair hamburg hangout haus hbo hdfc hdfcbank health healthcare help helsinki here hermes hgtv hiphop hisamitsu hitachi hiv hk hkt hm hn hockey holdings holiday homedepot homegoods homes homesense honda horse hospital host hosting hot hoteles hotels hotmail house how hr hsbc ht hu hughes hyatt hyundai ibm icbc ice icu id ie ieee ifm ikano il im imamat imdb immo immobilien in inc industries infiniti info ing ink institute insurance insure int international intuit investments io ipiranga iq ir irish is ismaili ist istanbul it itau itv iveco jaguar java jcb je jeep jetzt jewelry jio jll jm jmp jnj jo jobs joburg jot joy jp jpmorgan jprs juegos juniper kaufen kddi ke kerryhotels kerrylogistics kerryproperties kfh kg kh ki kia kim kinder kindle kitchen kiwi km kn koeln komatsu kosher kp kpmg kpn kr krd kred kuokgroup kw ky kyoto kz la lacaixa lamborghini lamer lancaster lancia land landrover lanxess lasalle lat latino latrobe law lawyer lb lc lds lease leclerc lefrak legal lego lexus lgbt li lidl life lifeinsurance lifestyle lighting like lilly limited limo lincoln linde link lipsy live living lixil lk llc llp loan loans locker locus loft lol london lotte lotto love lpl lplfinancial lr ls lt ltd ltda lu lundbeck luxe luxury lv ly ma macys madrid maif maison makeup man management mango map market marketing markets marriott marshalls maserati mattel mba mc mckinsey md me med media meet melbourne meme memorial men menu merckmsd mg mh miami microsoft mil mini mint mit mitsubishi mk ml mlb mls mm mma mn mo mobi mobile moda moe moi mom monash money monster mormon mortgage moscow moto motorcycles mov movie mp mq mr ms msd mt mtn mtr mu museum mutual mv mw mx my mz na nab nagoya name nationwide natura navy nba nc ne nec net netbank netflix network neustar new news next nextdirect nexus nf nfl ng ngo nhk ni nico nike nikon ninja nissan nissay nl no nokia northwesternmutual norton now nowruz nowtv np nr nra nrw ntt nu nyc nz obi observer off office okinawa olayan olayangroup oldnavy ollo om omega one ong onl online onyourside ooo open oracle orange org organic origins osaka otsuka ott ovh pa page panasonic paris pars partners parts party passagens pay pccw pe pet pf pfizer pg ph pharmacy phd philips phone photo photography photos physio pics pictet pictures pid pin ping pink pioneer pizza pk pl place play playstation plumbing plus pm pn pnc pohl poker politie porn post pr pramerica praxi press prime pro prod productions prof progressive promo properties property protection pru prudential ps pt pub pw pwc py qa qpon quebec quest qvc racing radio raid re read realestate realtor realty recipes red redstone redumbrella rehab reise reisen reit reliance ren rent rentals repair report republican rest restaurant review reviews rexroth rich richardli ricoh ril rio rip rmit ro rocher rocks rodeo rogers room rs rsvp ru rugby ruhr run rw rwe ryukyu sa saarland safe safety sakura sale salon samsclub samsung sandvik sandvikcoromant sanofi sap sarl sas save saxo sb sbi sbs sc sca scb schaeffler schmidt scholarships school schule schwarz science scjohnson scot sd se search seat secure security seek select sener services ses seven sew sex sexy sfr sg sh shangrila sharp shaw shell shia shiksha shoes shop shopping shouji show showtime si silk sina singles site sj sk ski skin sky skype sl sling sm smart smile sn sncf so soccer social softbank software sohu solar solutions song sony soy spa space sport spot spreadbetting sr srl ss st stada staples star statebank statefarm stc stcgroup stockholm storage store stream studio study style su sucks supplies supply support surf surgery suzuki sv swatch swiftcover swiss sx sy sydney systems sz tab taipei talk taobao target tatamotors tatar tattoo tax taxi tc tci td tdk team tech technology tel temasek tennis teva tf tg th thd theater theatre tiaa tickets tienda tiffany tips tires tirol tj tjmaxx tjx tk tkmaxx tl tm tmall tn to today tokyo tools top toray toshiba total tours town toyota toys tr trade trading training travel travelchannel travelers travelersinsurance trust trv tt tube tui tunes tushu tv tvs tw tz ua ubank ubs ug uk unicom university uno uol ups us uy uz va vacations vana vanguard vc ve vegas ventures verisign versicherung vet vg vi viajes video vig viking villas vin vip virgin visa vision viva vivo vlaanderen vn vodka volkswagen volvo vote voting voto voyage vu vuelos wales walmart walter wang wanggou watch watches weather weatherchannel webcam weber website wed wedding weibo weir wf whoswho wien wiki williamhill win windows wine winners wme wolterskluwer woodside work works world wow ws wtc wtf xbox xerox xfinity xihuan xin xxx xyz yachts yahoo yamaxun yandex ye yodobashi yoga yokohama you youtube yt yun za zappos zara zero zip zm zone zuerich zw vermögensberater-ctb vermögensberatung-pwb ελ ευ бг бел дети ею католик ком қаз мкд мон москва онлайн орг рус рф сайт срб укр გე հայ ישראל קום ابوظبي اتصالات ارامكو الاردن البحرين الجزائر السعودية العليان المغرب امارات ایران بارت بازار بھارت بيتك پاکستان ڀارت تونس سودان سورية شبكة عراق عرب عمان فلسطين قطر كاثوليك كوم مصر مليسيا موريتانيا موقع همراه कॉम नेट भारत भारतम् भारोत संगठन বাংলা ভারত ভাৰত ਭਾਰਤ ભારત ଭାରତ இந்தியா இலங்கை சிங்கப்பூர் భారత్ ಭಾರತ ഭാരതം ලංකා คอม ไทย ລາວ 닷넷 닷컴 삼성 한국 アマゾン グーグル クラウド コム ストア セール ファッション ポイント みんな 世界 中信 中国 中國 中文网 亚马逊 企业 佛山 信息 健康 八卦 公司 公益 台湾 台灣 商城 商店 商标 嘉里 嘉里大酒店 在线 大众汽车 大拿 天主教 娱乐 家電 广东 微博 慈善 我爱你 手机 招聘 政务 政府 新加坡 新闻 时尚 書籍 机构 淡马锡 游戏 澳門 点看 移动 组织机构 网址 网店 网站 网络 联通 诺基亚 谷歌 购物 通販 集团 電訊盈科 飞利浦 食品 餐厅 香格里拉 香港".split(" "),c_=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/,d_=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEDD-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC5\uDED0-\uDED9\uDEE0-\uDEE7\uDEF0-\uDEF6])/,p_=/\uFE0F/,h_=/\d/,f_=/\s/;function m_(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=hN(),n=fN(kN),r=fN(xN),i=hN(),o=fN(TN),s=[[h_,r],[c_,r],[d_,r],[p_,r]],a=function(){var e=fN(xN);return e.j={"-":i},e.jr=[].concat(s),e},l=function(e){var t=a();return t.t=e,t};vN(t,[["'",fN(FN)],["{",fN(SN)],["[",fN(AN)],["<",fN(NN)],["(",fN(_N)],["}",fN(jN)],["]",fN(IN)],[">",fN(LN)],[")",fN(zN)],["&",fN(PN)],["*",fN(RN)],["@",fN(BN)],["`",fN(HN)],["^",fN($N)],[":",fN(VN)],[",",fN(WN)],["$",fN(qN)],[".",fN(YN)],["=",fN(QN)],["!",fN(KN)],["-",fN(GN)],["%",fN(JN)],["|",fN(XN)],["+",fN(ZN)],["#",fN(e_)],["?",fN(t_)],['"',fN(n_)],["/",fN(i_)],[";",fN(r_)],["~",fN(o_)],["_",fN(s_)],["\\",fN(UN)]]),mN(t,"\n",fN(ON)),gN(t,f_,o),mN(o,"\n",hN()),gN(o,f_,o);for(var u=0;u<u_.length;u++)wN(t,u_[u],l(DN),a);var c=a(),d=a(),p=a(),h=a();wN(t,"file",c,a),wN(t,"ftp",d,a),wN(t,"http",p,a),wN(t,"mailto",h,a);var f=a(),m=fN(EN),g=fN(CN);mN(d,"s",f),mN(d,":",m),mN(p,"s",f),mN(p,":",m),mN(c,":",m),mN(f,":",m),mN(h,":",g);for(var y=a(),b=0;b<e.length;b++)wN(t,e[b],y,a);return mN(y,":",m),wN(t,"localhost",l(MN),a),gN(t,h_,n),gN(t,c_,r),gN(t,d_,r),gN(t,p_,r),gN(n,h_,n),gN(n,c_,r),gN(n,d_,r),gN(n,p_,r),mN(n,"-",i),mN(r,"-",i),mN(i,"-",i),gN(r,h_,r),gN(r,c_,r),gN(r,d_,r),gN(r,p_,r),gN(i,h_,r),gN(i,c_,r),gN(i,d_,r),gN(i,p_,r),t.jd=fN(a_),t}var g_={defaultProtocol:"http",events:null,format:y_,formatHref:y_,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function y_(e){return e}function b_(){}function v_(e,t){function n(t,n){this.t=e,this.v=t,this.tk=n}return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object.create(e.prototype);for(var i in n)r[i]=n[i];r.constructor=t,t.prototype=r}(b_,n,t),n}b_.prototype={t:"token",isLink:!1,toString:function(){return this.v},toHref:function(){return this.toString()},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g_.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}}};var w_=v_("email",{isLink:!0}),x_=v_("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),M_=v_("text"),D_=v_("nl"),k_=v_("url",{isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g_.defaultProtocol,t=this.tk,n=!1,r=!1,i=[],o=0;t[o].t===EN;)n=!0,i.push(t[o].v),o++;for(;t[o].t===i_;)r=!0,i.push(t[o].v),o++;for(;o<t.length;o++)i.push(t[o].v);return i=i.join(""),n||r||(i="".concat(e,"://").concat(i)),i},hasProtocol:function(){return this.tk[0].t===EN}}),E_=Object.freeze({__proto__:null,MultiToken:b_,Base:b_,createTokenClass:v_,MailtoEmail:w_,Email:x_,Text:M_,Nl:D_,Url:k_});function C_(){var e=hN(),t=hN(),n=hN(),r=hN(),i=hN(),o=hN(),s=hN(),a=fN(k_),l=hN(),u=fN(k_),c=fN(k_),d=hN(),p=hN(),h=hN(),f=hN(),m=hN(),g=fN(k_),y=fN(k_),b=fN(k_),v=fN(k_),w=hN(),x=hN(),M=hN(),D=hN(),k=hN(),E=hN(),C=fN(x_),T=hN(),O=fN(x_),S=fN(w_),A=hN(),N=hN(),_=hN(),j=hN(),I=fN(D_);mN(e,ON,I),mN(e,EN,t),mN(e,CN,n),mN(t,i_,r),mN(r,i_,i),mN(e,DN,o),mN(e,xN,o),mN(e,MN,a),mN(e,kN,o),mN(i,DN,c),mN(i,xN,c),mN(i,kN,c),mN(i,MN,c),mN(o,YN,s),mN(k,YN,E),mN(s,DN,a),mN(s,xN,o),mN(s,kN,o),mN(s,MN,o),mN(E,DN,C),mN(E,xN,k),mN(E,kN,k),mN(E,MN,k),mN(a,YN,s),mN(C,YN,E),mN(a,VN,l),mN(a,i_,c),mN(l,kN,u),mN(u,i_,c),mN(C,VN,T),mN(T,kN,O);var L=[PN,RN,BN,UN,HN,$N,qN,xN,QN,GN,MN,kN,JN,XN,ZN,e_,EN,i_,a_,o_,DN,s_],z=[FN,LN,jN,IN,zN,VN,WN,YN,KN,NN,SN,AN,_N,t_,n_,r_];mN(c,SN,p),mN(c,AN,h),mN(c,NN,f),mN(c,_N,m),mN(d,SN,p),mN(d,AN,h),mN(d,NN,f),mN(d,_N,m),mN(p,jN,c),mN(h,IN,c),mN(f,LN,c),mN(m,zN,c),mN(g,jN,c),mN(y,IN,c),mN(b,LN,c),mN(v,zN,c),mN(w,jN,c),mN(x,IN,c),mN(M,LN,c),mN(D,zN,c),bN(p,L,g),bN(h,L,y),bN(f,L,b),bN(m,L,v),bN(p,z,w),bN(h,z,x),bN(f,z,M),bN(m,z,D),bN(g,L,g),bN(y,L,y),bN(b,L,b),bN(v,L,v),bN(g,z,g),bN(y,z,y),bN(b,z,b),bN(v,z,v),bN(w,L,g),bN(x,L,y),bN(M,L,b),bN(D,L,v),bN(w,z,w),bN(x,z,x),bN(M,z,M),bN(D,z,D),bN(c,L,c),bN(d,L,c),bN(c,z,d),bN(d,z,d),mN(n,DN,S),mN(n,xN,S),mN(n,kN,S),mN(n,MN,S),bN(S,L,S),bN(S,z,A),bN(A,L,S),bN(A,z,A);var P=[PN,FN,RN,UN,HN,$N,jN,qN,xN,QN,GN,kN,SN,JN,XN,ZN,e_,t_,i_,a_,o_,DN,s_];return bN(o,P,N),mN(o,BN,_),bN(a,P,N),mN(a,BN,_),bN(s,P,N),bN(N,P,N),mN(N,BN,_),mN(N,YN,j),bN(j,P,N),mN(_,DN,k),mN(_,xN,k),mN(_,kN,k),mN(_,MN,C),e}function T_(e,t,n){var r=n[0].s,i=n[n.length-1].e;return new e(t.substr(r,i-r),n)}var O_="undefined"!=typeof console&&console&&console.warn||function(){},S_={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function A_(e){if(S_.initialized&&O_('linkifyjs: already initialized - will not register custom protocol "'.concat(e,'" until you manually call linkify.init(). To avoid this warning, please register all custom protocols before invoking linkify the first time.')),!/^[a-z-]+$/.test(e))throw Error("linkifyjs: protocols containing characters other than a-z or - (hyphen) are not supported");S_.customProtocols.push(e)}function N_(e){return S_.initialized||function(){S_.scanner={start:m_(S_.customProtocols),tokens:l_},S_.parser={start:C_(),tokens:E_};for(var e={createTokenClass:v_},t=0;t<S_.pluginQueue.length;t++)S_.pluginQueue[t][1]({scanner:S_.scanner,parser:S_.parser,utils:e});S_.initialized=!0}(),function(e,t,n){for(var r=n.length,i=0,o=[],s=[];i<r;){for(var a=e,l=null,u=null,c=0,d=null,p=-1;i<r&&!(l=yN(a,n[i].t));)s.push(n[i++]);for(;i<r&&(u=l||yN(a,n[i].t));)l=null,(a=u).accepts()?(p=0,d=a):p>=0&&p++,i++,c++;if(p<0)for(var h=i-c;h<i;h++)s.push(n[h]);else{s.length>0&&(o.push(T_(M_,t,s)),s=[]),i-=p,c-=p;var f=d.t,m=n.slice(i-c,i);o.push(T_(f,t,m))}}return s.length>0&&o.push(T_(M_,t,s)),o}(S_.parser.start,e,function(e,t){for(var n=function(e){for(var t=[],n=e.length,r=0;r<n;){var i=e.charCodeAt(r),o=void 0,s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,(function(e){return e.toLowerCase()}))),r=n.length,i=[],o=0,s=0;s<r;){for(var a=e,l=null,u=0,c=null,d=-1,p=-1;s<r&&(l=yN(a,n[s]));)(a=l).accepts()?(d=0,p=0,c=a):d>=0&&(d+=n[s].length,p++),u+=n[s].length,o+=n[s].length,s++;o-=d,s-=p,u-=d,i.push({t:c.t,v:t.substr(o-u,u),s:o-u,e:o})}return i}(S_.scanner.start,e))}function __(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=N_(e),r=[],i=0;i<n.length;i++){var o=n[i];!o.isLink||t&&o.t!==t||r.push(o.toObject())}return r}function j_(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=N_(e);return 1===n.length&&n[0].isLink&&(!t||n[0].t===t)}function I_(e){return new kn({key:new Tn("autolink"),appendTransaction:(t,n,r)=>{const i=t.some((e=>e.docChanged))&&!n.doc.eq(r.doc),o=t.some((e=>e.getMeta("preventAutolink")));if(!i||o)return;const{tr:s}=r,a=function(e,t){const n=new Zt(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(n.doc,[...t]),{mapping:l}=a,u=function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,i)=>{const o=[];if(e.ranges.length)e.forEach(((e,t)=>{o.push({from:e,to:t})}));else{const{from:e,to:t}=n[i];if(void 0===e||void 0===t)return;o.push({from:e,to:t})}o.forEach((({from:e,to:n})=>{const o=t.slice(i).map(e,-1),s=t.slice(i).map(n),a=t.invert().map(o,-1),l=t.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:o,to:s}})}))})),ba(r)}(a);return u.forEach((({oldRange:t,newRange:i})=>{va(t.from,t.to,n.doc).filter((t=>t.mark.type===e.type)).forEach((t=>{const i=va(l.map(t.from),l.map(t.to),r.doc).filter((t=>t.mark.type===e.type));if(!i.length)return;const o=i[0],a=n.doc.textBetween(t.from,t.to,void 0," "),u=r.doc.textBetween(o.from,o.to,void 0," "),c=j_(a),d=j_(u);c&&!d&&s.removeMark(o.from,o.to,e.type)})),function(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,((e,t)=>{n(e)&&r.push({node:e,pos:t})})),r}(r.doc,i,(e=>e.isTextblock)).forEach((t=>{__(r.doc.textBetween(t.pos,t.pos+t.node.nodeSize,void 0," ")).filter((e=>e.isLink)).filter((t=>!e.validate||e.validate(t.value))).map((e=>({...e,from:t.pos+e.start+1,to:t.pos+e.end+1}))).filter((e=>{const t=i.from>=e.from&&i.from<=e.to,n=i.to>=e.from&&i.to<=e.to;return t||n})).forEach((t=>{s.addMark(t.from,t.to,e.type.create({href:t.href}))}))}))})),s.steps.length?s:void 0}})}const L_=Ca.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(A_)},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:e}){return["a",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setLink:e=>({chain:t})=>t().setMark(this.name,e).setMeta("preventAutolink",!0).run(),toggleLink:e=>({chain:t})=>t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Oa({find:e=>__(e).filter((e=>!this.options.validate||this.options.validate(e.value))).filter((e=>e.isLink)).map((e=>({text:e.value,index:e.start,data:e}))),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];var t;return this.options.autolink&&e.push(I_({type:this.type,validate:this.options.validate})),this.options.openOnClick&&e.push((t={type:this.type},new kn({key:new Tn("handleClickLink"),props:{handleClick:(e,n,r)=>{var i;const o=ma(e.state,t.type.name);return!(!(null===(i=r.target)||void 0===i?void 0:i.closest("a"))||!o.href||(window.open(o.href,o.target),0))}}}))),this.options.linkOnPaste&&e.push(function(e){return new kn({key:new Tn("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:i}=t,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach((e=>{a+=e.textContent}));const l=__(a).find((e=>e.isLink&&e.value===a));return!(!a||!l||(e.editor.commands.setMark(e.type,{href:l.href}),0))}}})}({editor:this.editor,type:this.type})),e}}),z_=Ca.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),P_=/^\s*>\s$/,F_=Ta.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Ea({find:P_,type:this.type})]}}),R_=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,B_=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,U_=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,H_=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,$_=Ca.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[xa({find:R_,type:this.type}),xa({find:U_,type:this.type})]},addPasteRules(){return[Oa({find:B_,type:this.type}),Oa({find:H_,type:this.type})]}}),V_=/^\s*([-+*])\s$/,W_=Ta.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[Ea({find:V_,type:this.type})]}}),q_=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,Y_=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Q_=Ca.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[xa({find:q_,type:this.type})]},addPasteRules(){return[Oa({find:Y_,type:this.type})]}}),K_=/^```([a-z]+)?[\s\n]$/,G_=/^~~~([a-z]+)?[\s\n]$/,J_=Ta.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,r=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter((e=>e.startsWith(n))).map((e=>e.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",ms(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!o||!s)&&e.chain().command((({tr:e})=>(e.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type)return!1;if(!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();if(void 0===s)return!1;return!r.nodeAt(s)&&e.commands.exitCode()}}},addInputRules(){return[Da({find:K_,type:this.type,getAttributes:e=>({language:e[1]})}),Da({find:G_,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new kn({key:new Tn("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;const{tr:s}=e.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(sn.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,"\n")),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),X_=Ta.create({name:"doc",topNode:!0,content:"block+"}),Z_="undefined"!=typeof navigator?navigator:null,ej="undefined"!=typeof document?document:null,tj=Z_&&Z_.userAgent||"",nj=/Edge\/(\d+)/.exec(tj),rj=/MSIE \d/.exec(tj),ij=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(tj),oj=!!(rj||ij||nj),sj=rj?document.documentMode:ij?+ij[1]:nj?+nj[1]:0,aj=!oj&&/gecko\/(\d+)/i.test(tj);aj&&(/Firefox\/(\d+)/.exec(tj)||[0,0])[1];const lj=!oj&&/Chrome\/(\d+)/.exec(tj),uj=!!lj,cj=lj?+lj[1]:0,dj=!oj&&!!Z_&&/Apple Computer/.test(Z_.vendor),pj=dj&&(/Mobile\/\w+/.test(tj)||!!Z_&&Z_.maxTouchPoints>2),hj=pj||!!Z_&&/Mac/.test(Z_.platform),fj=/Android \d/.test(tj),mj=!!ej&&"webkitFontSmoothing"in ej.documentElement.style,gj=mj?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,yj=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},bj=/^(img|br|input|textarea|hr)$/i;function vj(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:wj(e))){let n=e.parentNode;if(!n||1!=n.nodeType||xj(e)||bj.test(e.nodeName)||"false"==e.contentEditable)return!1;t=yj(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?wj(e):0}}}function wj(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function xj(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 Mj=function(e){let t=e.isCollapsed;return t&&uj&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function Dj(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function kj(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,u=r.resolve(s);if(Mj(n)){for(a=u;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&ln.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==wj(e);r||i;){if(e==n)return!0;let t=yj(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==wj(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new ln(s==e?u:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=_j(e,a,u,"pointer"==t||e.state.selection.head<u.pos&&!o?1:-1)}return l}function Ej(e){return e.editable?e.hasFocus():function(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}}(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Cj(e,t=!1){let n=e.state.selection;if(function(e,t){if(t instanceof ln){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Nj(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Nj(e)}(e,n),Ej(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&uj){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&(r=t.anchorNode,i=t.anchorOffset,o=n.anchorNode,s=n.anchorOffset,o&&(vj(r,i,o,s,-1)||vj(r,i,o,s,1))))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}var r,i,o,s;if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,yj(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&oj&&sj<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,i,{anchor:o,head:s}=n;!Tj||n instanceof sn||(n.$from.parent.inlineContent||(r=Oj(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=Oj(e,n.to))),e.docView.setSelection(o,s,e.root,t),Tj&&(r&&Aj(r),i&&Aj(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Ej(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Tj=dj||uj&&cj<63;function Oj(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(dj&&i&&"false"==i.contentEditable)return Sj(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return Sj(i);if(o)return Sj(o)}}function Sj(e){return e.contentEditable="true",dj&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Aj(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Nj(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function _j(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||sn.between(t,n,r)}function jj(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&tn.findFrom(o,t)}function Ij(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Lj(e,t,n){let r=e.state.selection;if(!(r instanceof sn)){if(r instanceof ln&&r.node.isInline)return Ij(e,new sn(t>0?r.$to:r.$from));{let n=jj(e.state,t);return!!n&&Ij(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=jj(e.state,t);return!!(n&&n instanceof ln)&&Ij(e,n)}if(!(hj&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(ln.isSelectable(o)?Ij(e,new ln(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!mj&&Ij(e,new sn(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function zj(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Pj(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Fj(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(aj&&1==n.nodeType&&r<zj(n)&&Pj(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(Pj(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Bj(n))break;{let t=n.previousSibling;for(;t&&Pj(t);)i=n.parentNode,o=yj(t),t=t.previousSibling;if(t)n=t,r=zj(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Uj(e,t,n,r):i&&Uj(e,t,i,o)}function Rj(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=zj(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!Pj(n.childNodes[r]))break;i=n,o=++r}else{if(Bj(n))break;{let t=n.nextSibling;for(;t&&Pj(t);)i=t.parentNode,o=yj(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=zj(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&Uj(e,t,i,o)}function Bj(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Uj(e,t,n,r){if(Mj(t)){let e=document.createRange();e.setEnd(n,r),e.setStart(n,r),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&Cj(e)}),50)}function Hj(e,t,n){let r=e.state.selection;if(r instanceof sn&&!r.empty||n.indexOf("s")>-1)return!1;if(hj&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=jj(e.state,t);if(n&&n instanceof ln)return Ij(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof cn?tn.near(n,t):tn.findFrom(n,t);return!!s&&Ij(e,s)}return!1}function $j(e,t){if(!(e.state.selection instanceof sn))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function Vj(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Wj(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||hj&&72==n&&"c"==r?$j(e,-1)||Fj(e):46==n||hj&&68==n&&"c"==r?$j(e,1)||Rj(e):13==n||27==n||(37==n||hj&&66==n&&"c"==r?Lj(e,-1,r)||Fj(e):39==n||hj&&70==n&&"c"==r?Lj(e,1,r)||Rj(e):38==n||hj&&80==n&&"c"==r?Hj(e,-1,r)||Fj(e):40==n||hj&&78==n&&"c"==r?function(e){if(!dj||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;Vj(e,n,"true"),setTimeout((()=>Vj(e,n,"false")),20)}return!1}(e)||Hj(e,1,r)||Rj(e):r==(hj?"m":"c")&&(66==n||73==n||89==n||90==n))}function qj(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||dt.fromSchema(e.state.schema),a=nI(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&1==c.nodeType&&(u=eI[c.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=a.createElement(u[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}c=l.firstChild}c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n");return{dom:l,text:p}}function Yj(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new fe(le.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):fe.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=dt.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=nI().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&eI[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=e,n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),mj&&function(e){let t=e.querySelectorAll(uj?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let e=+c[3];e>0&&o.firstChild;e--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Xe.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!c),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Qj.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(c)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=le.from(t.create(n[e+1],i)),o++,s++}return new fe(i,o,s)}(Zj(s,+c[1],+c[2]),c[4]);else if(s=fe.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&Gj(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Jj(o[o.length-1],r.length));let t=Kj(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return le.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Zj(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const Qj=/^(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 Kj(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,le.from(e));return e}function Gj(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=Gj(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(le.from(Kj(n,e,i+1))))}}function Jj(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Jj(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(le.empty,!0);return e.copy(n.append(r))}function Xj(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return i<r-1&&(a=Xj(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(le.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Zj(e,t,n){return t<e.openStart&&(e=new fe(Xj(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new fe(Xj(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const eI={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 tI=null;function nI(){return tI||(tI=document.implementation.createHTMLDocument("title"))}const rI={};let iI={};function oI(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function sI(e){return{left:e.clientX,top:e.clientY}}function aI(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,(t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1))))return!0;return!1}function lI(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function uI(e,t,n,r,i){return aI(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof ln&&(n=i.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(ln.isSelectable(t)){r=n&&i.$from.depth>0&&e>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(e);break}}return null!=r&&(lI(e,ln.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&ln.isSelectable(r))&&(lI(e,new ln(n),"pointer"),!0)}(e,n))}function cI(e,t,n,r){return aI(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function dI(e,t,n,r){return aI(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&&(lI(e,sn.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)lI(e,sn.create(r,o+1,o+1+n.content.size),"pointer");else{if(!ln.isSelectable(n))continue;lI(e,ln.create(r,o),"pointer")}return!0}}(e,n,r)}function pI(e){return vI(e)}iI.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!mI(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!fj||!uj||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!pj||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||Wj(e,n)?n.preventDefault():oI(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,Dj(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},iI.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},iI.keypress=(e,t)=>{let n=t;if(mI(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||hj&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof sn&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const hI=hj?"metaKey":"ctrlKey";rI.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=pI(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[hI]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(sI(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new fI(e,s,n,!!r)):("doubleClick"==o?cI:dI)(e,s.pos,s.inside,n)?n.preventDefault():oI(e,"pointer"))};class fI{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[hI],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof ln&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!aj||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)),oI(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((()=>Cj(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(sI(e))),this.allowDefault||!t?oI(this.view,"pointer"):uI(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||dj&&this.mightDrag&&!this.mightDrag.node.isAtom||uj&&!(this.view.state.selection instanceof sn)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(lI(this.view,tn.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):oI(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),oI(this.view,"pointer"),0==e.buttons&&this.done()}}function mI(e,t){return!!e.composing||!!(dj&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}rI.touchdown=e=>{pI(e),oI(e,"pointer")},rI.contextmenu=e=>pI(e);const gI=fj?5e3:-1;function yI(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>vI(e)),t))}function bI(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 vI(e,t=!1){if(!(fj&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),bI(e),t||e.docView&&e.docView.dirty){let t=kj(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}iI.compositionstart=iI.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(),vI(e,!0),e.markCursor=null;else if(vI(e),aj&&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}yI(e,gI)},iI.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,yI(e,20))};const wI=oj&&sj<15||pj&&gj<604;function xI(e,t,n,r){let i=Yj(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||fe.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}rI.copy=iI.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=wI?null:n.clipboardData,s=r.content(),{dom:a,text:l}=qj(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},iI.paste=(e,t)=>{let n=t;if(e.composing&&!fj)return;let r=wI?null:n.clipboardData;r&&xI(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?xI(e,r.value,null,t):xI(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class MI{constructor(e,t){this.slice=e,this.move=t}}const DI=hj?"altKey":"ctrlKey";rI.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(sI(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof ln?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(ln.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(ln.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=qj(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(wI?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",wI||n.dataTransfer.setData("text/plain",l),e.dragging=new MI(s,!n[DI])},rI.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},iI.dragover=iI.dragenter=(e,t)=>t.preventDefault(),iI.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(sI(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Yj(e,n.dataTransfer.getData(wI?"Text":"text/plain"),wI?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[DI]);if(e.someProp("handleDrop",(t=>t(e,n,s||fe.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?Bt(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let u=e.state.tr;a&&u.deleteSelection();let c=u.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(p))return;let h=u.doc.resolve(c);if(d&&ln.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new ln(h));else{let t=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),u.setSelection(_j(e,h,u.doc.resolve(t)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))},rI.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())&&Cj(e)}),20))},rI.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)},rI.beforeinput=(e,t)=>{if(uj&&fj&&"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,Dj(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 iI)rI[e]=iI[e];function kI(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 EI{constructor(e,t){this.toDOM=e,this.spec=t||AI,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new OI(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof EI&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&kI(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class CI{constructor(e,t){this.attrs=e,this.spec=t||AI}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new OI(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof CI&&kI(this.attrs,e.attrs)&&kI(this.spec,e.spec)}static is(e){return e.type instanceof CI}destroy(){}}class TI{constructor(e,t){this.attrs=e,this.spec=t||AI}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new OI(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof TI&&kI(this.attrs,e.attrs)&&kI(this.spec,e.spec)}destroy(){}}class OI{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new OI(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 OI(e,e,new EI(t,n))}static inline(e,t,n,r){return new OI(e,t,new CI(n,r))}static node(e,t,n,r){return new OI(e,t,new TI(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof CI}}const SI=[],AI={};class NI{constructor(e,t){this.local=e.length?e:SI,this.children=t.length?t:SI}static create(e,t){return t.length?PI(t,e,0,AI):_I}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==_I||0==e.maps.length?this:this.mapInner(e,t,0,0,n||AI)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice(),l=(e,t,n,r)=>{for(let s=0;s<a.length;s+=3){let l,u=a[s+1];if(u<0||e>u+o)continue;let c=a[s]+o;t>=c?a[s+1]=e<=c?-2:-1:n>=i&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l)}};for(let e=0;e<n.maps.length;e++)n.maps[e].forEach(l);let u=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){u=!0,a[t+1]=-1;continue}let l=n.map(e[t]+o),c=l-i;if(c<0||c>=r.content.size){u=!0;continue}let d=n.map(e[t+1]+o,-1)-i,{index:p,offset:h}=r.content.findIndex(c),f=r.maybeChild(p);if(f&&h==c&&h+f.nodeSize==d){let r=a[t+2].mapInner(n,f,l+1,e[t]+o+1,s);r!=_I?(a[t]=c,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,u=!0)}else u=!0}if(u){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(r,i,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+o+1);return n}(a,e,t,n,i,o,s),u=PI(l,r,0,s);t=u.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<u.children.length;e+=3){let n=u.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,u.children[e],u.children[e+1],u.children[e+2])}}return new NI(t.sort(FI),a)}(this.children,o||[],e,t,n,r,i):o?new NI(o.sort(FI),SI):_I}add(e,t){return t.length?this==_I?NI.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,a=o+n;if(s=LI(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,a+1):r.splice(i,0,o,o+e.nodeSize,PI(s,e,a+1,AI)),i+=3}}));let o=II(i?zI(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new NI(o.length?this.local.concat(o).sort(FI):this.local,r||this.children)}remove(e){return 0==e.length||this==_I?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(i||(i=[])).push(t));if(!i)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(i,o+1);a!=_I?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,i=0;i<e.length;i++)if(n=e[i])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new NI(r,n):_I}forChild(e,t){if(this==_I)return this;if(t.isLeaf)return NI.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof CI){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new NI(r.sort(FI),SI);return n?new jI([e,n]):e}return n||_I}eq(e){if(this==e)return!0;if(!(e instanceof NI)||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 RI(this.localsInner(e))}localsInner(e){if(this==_I)return SI;if(e.inlineContent||!this.local.some(CI.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof CI||t.push(this.local[e]);return t}}NI.empty=new NI([],[]),NI.removeOverlap=RI;const _I=NI.empty;class jI{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,AI)));return jI.from(n)}forChild(e,t){if(t.isLeaf)return NI.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=_I&&(i instanceof jI?n=n.concat(i.members):n.push(i))}return jI.from(n)}eq(e){if(!(e instanceof jI)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?RI(n?t:t.sort(FI)):SI}static from(e){switch(e.length){case 0:return _I;case 1:return e[0];default:return new jI(e)}}}function II(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new OI(i.from+t,i.to+t,i.type))}return n}function LI(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t,o=0;o<e.length;o++)(t=e[o])&&t.from>n&&t.to<r&&((i||(i=[])).push(t),e[o]=null);return i}function zI(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function PI(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=LI(e,t,s+n);if(a){o=!0;let e=PI(a,t,n+s+1,r);e!=_I&&i.push(s,s+t.nodeSize,e)}}));let s=II(o?zI(e):e,-n).sort(FI);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new NI(s,i):_I}function FI(e,t){return e.from-t.from||e.to-t.to}function RI(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),BI(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),BI(t,i+1,o.copy(r.to,o.to)))}}return t}function BI(e,t,n){for(;t<e.length&&FI(n,e[t])>0;)t++;e.splice(t,0,n)}class UI extends tn{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return UI.valid(n)?new UI(n):tn.near(n)}content(){return fe.empty}eq(e){return e instanceof UI&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new UI(e.resolve(t.pos))}getBookmark(){return new HI(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&UI.valid(e))return e;let r=e.pos,i=null;for(let n=e.depth;;n--){let o=e.node(n);if(t>0?e.indexAfter(n)<o.childCount:e.index(n)>0){i=o.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(UI.valid(s))return s}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!ln.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*t),n=!1;continue e}break}i=o,r+=t;let s=e.doc.resolve(r);if(UI.valid(s))return s}return null}}}UI.prototype.visible=!1,UI.findFrom=UI.findGapCursorFrom,tn.jsonID("gapcursor",UI);class HI{constructor(e){this.pos=e}map(e){return new HI(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return UI.valid(t)?new UI(t):tn.near(t)}}const $I=Go({ArrowLeft:VI("horiz",-1),ArrowRight:VI("horiz",1),ArrowUp:VI("vert",-1),ArrowDown:VI("vert",1)});function VI(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){let o=e.selection,s=t>0?o.$to:o.$from,a=o.empty;if(o instanceof sn){if(!i.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=UI.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new UI(l))),!0)}}function WI(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!UI.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&ln.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new UI(r))),!0)}function qI(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof UI))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=le.empty;for(let e=r.length-1;e>=0;e--)i=le.from(r[e].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new fe(i,0,0));return o.setSelection(sn.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function YI(e){if(!(e.selection instanceof UI))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",NI.create(e.doc,[OI.widget(e.selection.head,t,{key:"gapcursor"})])}const QI=js.create({name:"gapCursor",addProseMirrorPlugins:()=>[new kn({props:{decorations:YI,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&UI.valid(n)?new UI(n):null,handleClick:WI,handleKeyDown:$I,handleDOMEvents:{beforeinput:qI}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=bs(ds(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),KI=Ta.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",ms(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,a=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&o){const t=a.filter((e=>s.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),GI=Ta.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,ms(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>Da({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}});var JI=200,XI=function(){};XI.prototype.append=function(e){return e.length?(e=XI.from(e),!this.length&&e||e.length<JI&&this.leafAppend(e)||this.length<JI&&e.leafPrepend(this)||this.appendInner(e)):this},XI.prototype.prepend=function(e){return e.length?XI.from(e).append(this):this},XI.prototype.appendInner=function(e){return new eL(this,e)},XI.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?XI.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},XI.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},XI.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},XI.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},XI.from=function(e){return e instanceof XI?e:e&&e.length?new ZI(e):XI.empty};var ZI=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=JI)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=JI)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(XI);XI.empty=new ZI([]);var eL=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(XI),tL=XI;const nL=500;class rL{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,a=e.tr,l=[],u=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void u.push(e);if(n){u.push(new iL(e.map));let t,i=e.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new iL(t,void 0,void 0,l.length+u.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new rL(this.items.slice(0,i).append(u.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,u=e.steps[n].invert(e.docs[n]),c=new iL(e.mapping.maps[n],u,t);(l=a&&a.merge(c))&&(c=l,n?i.pop():s=s.slice(0,s.length-1)),i.push(c),t&&(o++,t=void 0),r||(a=c)}let l=o-n.depth;return l>sL&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),o-=l),new rL(s.append(i),o)}remapping(e,t){let n=new kt;return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new rL(this.items.append(e.map((e=>new iL(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),u=t.selection&&t.selection.map(i.slice(a+1,r));u&&s++,n.push(new iL(l,o,u))}else n.push(new iL(l))}),r);let l=[];for(let e=t;e<o;e++)l.push(new iL(i.maps[e]));let u=this.items.slice(0,r).append(l).append(n),c=new rL(u,s);return c.emptyItemCount()>nL&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l,u=new iL(s.invert(),e,a),c=r.length-1;(l=r.length&&r[c].merge(u))?r[c]=l:r.push(u)}}else o.map&&n--}),this.items.length,0),new rL(tL.from(r.reverse()),i)}}rL.empty=new rL(tL.empty,0);class iL{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new iL(t.getMap().invert(),t,this.selection)}}}class oL{constructor(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r}}const sL=20;function aL(e){let t=[];return e.forEach(((e,n,r,i)=>t.push(r,i))),t}function lL(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function uL(e,t,n,r){let i=pL(t),o=hL.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,i);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),o,i),u=new oL(r?l:s.remaining,r?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(hL,{redo:r,historyState:u}).scrollIntoView())}let cL=!1,dL=null;function pL(e){let t=e.plugins;if(dL!=t){cL=!1,dL=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){cL=!0;break}}return cL}const hL=new Tn("history"),fL=new Tn("closeHistory");function mL(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new kn({key:hL,state:{init:()=>new oL(rL.empty,rL.empty,null,0),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(hL);if(o)return o.historyState;n.getMeta(fL)&&(e=new oL(e.done,e.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(hL))return s.getMeta(hL).redo?new oL(e.done.addTransform(n,void 0,r,pL(t)),e.undone,aL(n.mapping.maps[n.steps.length-1]),e.prevTime):new oL(e.done,e.undone.addTransform(n,void 0,r,pL(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new oL(e.done.rebased(n,i),e.undone.rebased(n,i),lL(e.prevRanges,n.mapping),e.prevTime):new oL(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),lL(e.prevRanges,n.mapping),e.prevTime);{let i=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)})),n}(n,e.prevRanges)),o=s?lL(e.prevRanges,n.mapping):aL(n.mapping.maps[n.steps.length-1]);return new oL(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,pL(t)),rL.empty,o,n.time)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?gL:"historyRedo"==n?yL:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const gL=(e,t)=>{let n=hL.getState(e);return!(!n||0==n.done.eventCount)&&(t&&uL(n,e,t,!1),!0)},yL=(e,t)=>{let n=hL.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&uL(n,e,t,!0),!0)},bL=js.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>gL(e,t),redo:()=>({state:e,dispatch:t})=>yL(e,t)}),addProseMirrorPlugins(){return[mL(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),vL=Ta.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",ms(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{var n;if(t){const{$to:t}=e.selection,r=t.end();if(t.nodeAfter)e.setSelection(sn.create(e.doc,t.pos));else{const i=null===(n=t.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();i&&(e.insert(r,i),e.setSelection(sn.create(e.doc,r)))}e.scrollIntoView()}return!0})).run()}},addInputRules(){return[Ma({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),wL=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,xL=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,ML=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,DL=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,kL=Ca.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[xa({find:wL,type:this.type}),xa({find:ML,type:this.type})]},addPasteRules(){return[Oa({find:xL,type:this.type}),Oa({find:DL,type:this.type})]}}),EL=Ta.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",ms(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),CL=/^(\d+)\.\s$/,TL=Ta.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",ms(this.options.HTMLAttributes,n),0]:["ol",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[Ea({find:CL,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),OL=Ta.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),SL=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,AL=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,NL=Ca.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[xa({find:SL,type:this.type})]},addPasteRules(){return[Oa({find:AL,type:this.type})]}}),_L=Ta.create({name:"text",group:"inline"}),jL=js.create({name:"starterKit",addExtensions(){var e,t,n,r,i,o,s,a,l,u,c,d,p,h,f,m,g,y;const b=[];return!1!==this.options.blockquote&&b.push(F_.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&b.push($_.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&b.push(W_.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&b.push(Q_.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&b.push(J_.configure(null===(i=this.options)||void 0===i?void 0:i.codeBlock)),!1!==this.options.document&&b.push(X_.configure(null===(o=this.options)||void 0===o?void 0:o.document)),!1!==this.options.dropcursor&&b.push(lN.configure(null===(s=this.options)||void 0===s?void 0:s.dropcursor)),!1!==this.options.gapcursor&&b.push(QI.configure(null===(a=this.options)||void 0===a?void 0:a.gapcursor)),!1!==this.options.hardBreak&&b.push(KI.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&b.push(GI.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&b.push(bL.configure(null===(c=this.options)||void 0===c?void 0:c.history)),!1!==this.options.horizontalRule&&b.push(vL.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&b.push(kL.configure(null===(p=this.options)||void 0===p?void 0:p.italic)),!1!==this.options.listItem&&b.push(EL.configure(null===(h=this.options)||void 0===h?void 0:h.listItem)),!1!==this.options.orderedList&&b.push(TL.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&b.push(OL.configure(null===(m=this.options)||void 0===m?void 0:m.paragraph)),!1!==this.options.strike&&b.push(NL.configure(null===(g=this.options)||void 0===g?void 0:g.strike)),!1!==this.options.text&&b.push(_L.configure(null===(y=this.options)||void 0===y?void 0:y.text)),b}});function IL(e,t=[]){return e.map((e=>{const n=[...t,...e.properties?e.properties.className:[]];return e.children?IL(e.children,n):{text:e.value,classes:n}})).flat()}function LL(e){return e.value||e.children||[]}function zL({doc:e,name:t,lowlight:n,defaultLanguage:r}){const i=[];return ya(e,(e=>e.type.name===t)).forEach((e=>{let t=e.pos+1;const o=e.node.attrs.language||r,s=n.listLanguages();IL(o&&s.includes(o)?LL(n.highlight(o,e.node.textContent)):LL(n.highlightAuto(e.node.textContent))).forEach((e=>{const n=t+e.text.length;if(e.classes.length){const r=ao.inline(t,n,{class:e.classes.join(" ")});i.push(r)}t=n}))})),co.create(e,i)}function PL({name:e,lowlight:t,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every((e=>"function"==typeof t[e])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new kn({key:new Tn("lowlight"),state:{init:(r,{doc:i})=>zL({doc:i,name:e,lowlight:t,defaultLanguage:n}),apply:(r,i,o,s)=>{const a=o.selection.$head.parent.type.name,l=s.selection.$head.parent.type.name,u=ya(o.doc,(t=>t.type.name===e)),c=ya(s.doc,(t=>t.type.name===e));return r.docChanged&&([a,l].includes(e)||c.length!==u.length||r.steps.some((e=>void 0!==e.from&&void 0!==e.to&&u.some((t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))))?zL({doc:r.doc,name:e,lowlight:t,defaultLanguage:n}):i.map(r.mapping,r.doc)}},props:{decorations:e=>r.getState(e)}});return r}const FL=J_.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:{},defaultLanguage:null}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],PL({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});var RL={exports:{}};!function(e){!function(){var t;function n(e){for(var t,n,r,i,o=1,s=[].slice.call(arguments),a=0,l=e.length,u="",c=!1,d=!1,p=function(){return s[o++]},h=function(){for(var n="";/\d/.test(e[a]);)n+=e[a++],t=e[a];return n.length>0?parseInt(n):null};a<l;++a)if(t=e[a],c)switch(c=!1,"."==t?(d=!1,t=e[++a]):"0"==t&&"."==e[a+1]?(d=!0,t=e[a+=2]):d=!0,i=h(),t){case"b":u+=parseInt(p(),10).toString(2);break;case"c":u+="string"==typeof(n=p())||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":u+=parseInt(p(),10);break;case"f":r=String(parseFloat(p()).toFixed(i||6)),u+=d?r:r.replace(/^0/,"");break;case"j":u+=JSON.stringify(p());break;case"o":u+="0"+parseInt(p(),10).toString(8);break;case"s":u+=p();break;case"x":u+="0x"+parseInt(p(),10).toString(16);break;case"X":u+="0x"+parseInt(p(),10).toString(16).toUpperCase();break;default:u+=t}else"%"===t?c=!0:u+=t;return u}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()}(RL);var BL=RL.exports;const UL=Object.assign(HL(Error),{eval:HL(EvalError),range:HL(RangeError),reference:HL(ReferenceError),syntax:HL(SyntaxError),type:HL(TypeError),uri:HL(URIError)});function HL(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){const r=t?BL(t,...n):t;return new e(r)}}const $L={}.hasOwnProperty,VL="hljs-";function WL(e,t,n={}){let r=n.prefix;if("string"!=typeof e)throw UL("Expected `string` for name, got `%s`",e);if(!Z.getLanguage(e))throw UL("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw UL("Expected `string` for value, got `%s`",t);null==r&&(r=VL),Z.configure({__emitter:qL,classPrefix:r});const i=Z.highlight(t,{language:e,ignoreIllegals:!0});if(Z.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}class qL{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(""===e)return;const t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}addKeyword(e,t){this.openNode(t),this.addText(e),this.closeNode()}addSublanguage(e,t){const n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){const t=e.split(".").map(((e,t)=>t?e+"_".repeat(t):this.options.classPrefix+e)),n={type:"element",tagName:"span",properties:{className:t},children:[]};this.stack[this.stack.length-1].children.push(n),this.stack.push(n)}closeNode(){this.stack.pop()}closeAllNodes(){}finalize(){}toHTML(){return""}}const YL={highlight:WL,highlightAuto:function(e,t={}){const n=t.subset||Z.listLanguages();t.prefix;let r=-1,i={type:"root",data:{language:null,relevance:0},children:[]};if("string"!=typeof e)throw UL("Expected `string` for value, got `%s`",e);for(;++r<n.length;){const o=n[r];if(!Z.getLanguage(o))continue;const s=WL(o,e,t);s.data.relevance>i.data.relevance&&(i=s)}return i},registerLanguage:function(e,t){Z.registerLanguage(e,t)},registered:function(e){return Boolean(Z.getLanguage(e))},listLanguages:function(){return Z.listLanguages()},registerAlias:function(e,t){if("string"==typeof e)Z.registerAliases(t,{languageName:e});else{let t;for(t in e)$L.call(e,t)&&Z.registerAliases(e[t],{languageName:t})}}};YL.registerLanguage("arduino",g),YL.registerLanguage("bash",y),YL.registerLanguage("c",b),YL.registerLanguage("cpp",v),YL.registerLanguage("csharp",w),YL.registerLanguage("css",x),YL.registerLanguage("diff",M),YL.registerLanguage("go",D),YL.registerLanguage("graphql",k),YL.registerLanguage("ini",E),YL.registerLanguage("java",C),YL.registerLanguage("javascript",T),YL.registerLanguage("json",O),YL.registerLanguage("kotlin",S),YL.registerLanguage("less",A),YL.registerLanguage("lua",N),YL.registerLanguage("makefile",_),YL.registerLanguage("markdown",j),YL.registerLanguage("objectivec",I),YL.registerLanguage("perl",L),YL.registerLanguage("php",z),YL.registerLanguage("php-template",P),YL.registerLanguage("plaintext",F),YL.registerLanguage("python",R),YL.registerLanguage("python-repl",B),YL.registerLanguage("r",U),YL.registerLanguage("ruby",H),YL.registerLanguage("rust",$),YL.registerLanguage("scss",V),YL.registerLanguage("shell",W),YL.registerLanguage("sql",q),YL.registerLanguage("swift",Y),YL.registerLanguage("typescript",Q),YL.registerLanguage("vbnet",K),YL.registerLanguage("wasm",G),YL.registerLanguage("xml",J),YL.registerLanguage("yaml",X);const QL=()=>t.createElement(Gu,{"data-cy":"neeto-editor-code-block"},t.createElement("pre",null,t.createElement(Ku,{as:"code"})));var KL=FL.extend({addNodeView:()=>new Zu(QL)}).configure({lowlight:YL}),GL=js.create({name:"paste-unformatted",addCommands:()=>({pasteUnformatted:()=>async e=>{let{editor:t}=e;const n=await navigator.clipboard.readText();t.commands.insertContent(n)}})}),JL=X_.extend({content:"root",addProseMirrorPlugins(){const{editor:e}=this;return[new kn({key:new Tn("eventHandler"),props:{handleClick(t,n){const{state:r}=t,i=r.doc.lastChild,o=r.doc.resolve(n).nodeBefore;if(i&&o){const t=i.eq(o),r=i.isInline,s=["paragraph","text"].includes(i.type.name);!t||r||s||e.commands.insertContentAt(n,{type:"paragraph",content:""})}}}})]}}),XL=Ta.create({name:"external-video",addOptions:()=>({inline:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}),parseHTML:()=>[{tag:"iframe[src]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["iframe",ms(this.options.HTMLAttributes,{...t,class:"video-wrapper"})]},addCommands(){return{setExternalVideo:e=>t=>{let{commands:n}=t;return n.insertContent({type:this.name,attrs:e})}}}});const ZL=new Tn("suggestion");function ez({pluginKey:e=ZL,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:a="suggestion",command:l=(()=>null),items:u=(()=>[]),render:c=(()=>({})),allow:d=(()=>!0)}){let p;const h=null==c?void 0:c(),f=new kn({key:e,view(){return{update:async(e,n)=>{var r,i,o,s,a,c,d;const f=null===(r=this.key)||void 0===r?void 0:r.getState(n),m=null===(i=this.key)||void 0===i?void 0:i.getState(e.state),g=f.active&&m.active&&f.range.from!==m.range.from,y=!f.active&&m.active,b=f.active&&!m.active,v=y||g,w=!y&&!b&&f.query!==m.query&&!g,x=b||g;if(!v&&!w&&!x)return;const M=x&&!v?f:m,D=document.querySelector(`[data-decoration-id="${M.decorationId}"]`);p={editor:t,range:M.range,query:M.query,text:M.text,items:[],command:e=>{l({editor:t,range:M.range,props:e})},decorationNode:D,clientRect:D?()=>{var e;const{decorationId:n}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state),r=document.querySelector(`[data-decoration-id="${n}"]`);return(null==r?void 0:r.getBoundingClientRect())||null}:null},v&&(null===(o=null==h?void 0:h.onBeforeStart)||void 0===o||o.call(h,p)),w&&(null===(s=null==h?void 0:h.onBeforeUpdate)||void 0===s||s.call(h,p)),(w||v)&&(p.items=await u({editor:t,query:M.query})),x&&(null===(a=null==h?void 0:h.onExit)||void 0===a||a.call(h,p)),w&&(null===(c=null==h?void 0:h.onUpdate)||void 0===c||c.call(h,p)),v&&(null===(d=null==h?void 0:h.onStart)||void 0===d||d.call(h,p))},destroy:()=>{var e;p&&(null===(e=null==h?void 0:h.onExit)||void 0===e||e.call(h,p))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(e,s,a,l){const{isEditable:u}=t,{composing:c}=t.view,{selection:p}=e,{empty:h,from:f}=p,m={...s};if(m.composing=c,u&&(h||t.view.composing)){!(f<s.range.from||f>s.range.to)||c||s.composing||(m.active=!1);const e=function(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=e,a=n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),l=new RegExp(`\\s${a}$`),u=o?"^":"",c=r?new RegExp(`${u}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${u}(?:^)?${a}[^\\s${a}]*`,"gm"),d=(null===(t=s.nodeBefore)||void 0===t?void 0:t.isText)&&s.nodeBefore.text;if(!d)return null;const p=s.pos-d.length,h=Array.from(d.matchAll(c)).pop();if(!h||void 0===h.input||void 0===h.index)return null;const f=h.input.slice(Math.max(0,h.index-1),h.index),m=new RegExp(`^[${null==i?void 0:i.join("")}\0]?$`).test(f);if(null!==i&&!m)return null;const g=p+h.index;let y=g+h[0].length;return r&&l.test(d.slice(y-1,y+1))&&(h[0]+=" ",y+=1),g<s.pos&&y>=s.pos?{range:{from:g,to:y},query:h[0].slice(n.length),text:h[0]}:null}({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:p.$from}),a=`id_${Math.floor(4294967295*Math.random())}`;e&&d({editor:t,state:l,range:e.range})?(m.active=!0,m.decorationId=s.decorationId?s.decorationId:a,m.range=e.range,m.query=e.query,m.text=e.text):m.active=!1}else m.active=!1;return m.active||(m.decorationId=null,m.range={from:0,to:0},m.query=null,m.text=null),m}},props:{handleKeyDown(e,t){var n;const{active:r,range:i}=f.getState(e.state);return r&&(null===(n=null==h?void 0:h.onKeyDown)||void 0===n?void 0:n.call(h,{view:e,event:t,range:i}))||!1},decorations(e){const{active:t,range:n,decorationId:r}=f.getState(e);return t?co.create(e.doc,[ao.inline(n.from,n.to,{nodeName:s,class:a,"data-decoration-id":r})]):null}}});return f}const tz=new Tn("emoji-picker"),nz=Ta.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:()=>({suggestion:{char:"::",startOfLine:!1,pluginKey:tz,items:()=>[],render:()=>{let e,t;return{onStart(n){e=new Ju(cv,{props:n,editor:n.editor}),t=Iu("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onKeyDown(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit(){t[0].destroy(),e.destroy()}}}}}),addProseMirrorPlugins(){return[ez({editor:this.editor,...this.options.suggestion})]}});class rz extends t.Component{constructor(){super(...arguments),pm(this,"state",{isLoading:!1,selectedIndex:0,emojiSuggestions:[]}),pm(this,"fetchEmojiData",(async()=>{this.setState({isLoading:!0});try{const{data:e}=await by.get("https://cdn.jsdelivr.net/npm/@emoji-mart/data");return this.setState({isLoading:!1}),e}catch(e){return this.setState({isLoading:!1}),{}}})),pm(this,"searchEmoji",(async()=>(await pb.search(this.props.query||"smile")).slice(0,5))),pm(this,"searchEmojiAndSetState",(async()=>{const e=await this.searchEmoji();this.setState({emojiSuggestions:e})})),pm(this,"setEditorState",(async()=>{const e=await this.searchEmoji();this.props.editor.chain().focus().deleteRange(this.props.range).setEmoji(e[0]).run()})),pm(this,"onKeyDown",(e=>{let{event:t}=e;return"ArrowLeft"===t.key||"ArrowDown"===t.key?(this.setState((e=>{let{selectedIndex:t,emojiSuggestions:n}=e;return{selectedIndex:(t+n.length-1)%n.length}})),!0):"ArrowRight"===t.key||"ArrowUp"===t.key?(this.setState((e=>{let{selectedIndex:t,emojiSuggestions:n}=e;return{selectedIndex:(t+1)%n.length}})),!0):"Enter"===t.key?(this.selectItem(this.state.selectedIndex),!0):" "===t.key?(ld(this.props.query)?this.props.editor.chain().focus().insertContent(" ").run():this.setEditorState(),!0):"Escape"===t.key&&(this.props.editor.chain().focus().insertContent(" ").run(),!0)})),pm(this,"selectItem",(e=>{this.props.editor.chain().focus().deleteRange(this.props.range).setEmoji(this.state.emojiSuggestions[e]).run()}))}componentDidMount(){xb({data:this.fetchEmojiData,theme:"light",previewPosition:"none"}),this.searchEmojiAndSetState()}componentDidUpdate(e){this.props.query!==e.query&&this.searchEmojiAndSetState()}render(){return t.createElement("div",{className:"neeto-editor-emoji-suggestion"},this.state.isLoading&&t.createElement(jA,null),!this.state.isLoading&&(this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map(((e,n)=>t.createElement("div",{key:e.id,onClick:()=>this.selectItem(n),className:sc("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--selected":n===this.state.selectedIndex}),"data-cy":"neeto-editor-emoji-suggestion-".concat(e.id)},e.skins[0].native))):t.createElement("p",null,"No results")))}}const iz={char:":",startOfLine:!1,pluginKey:new Tn("emoji-suggestion"),command:e=>{let{editor:t,range:n,props:r}=e;t.chain().focus().deleteRange(n).setEmoji(r).run()},items:()=>[],render:()=>{let e,t;return{onStart(n){e=new Ju(rz,{props:n,editor:n.editor}),t=Iu("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit(){t[0].destroy(),e.destroy()}}}};var oz=Ta.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:()=>({HTMLAttributes:{class:"neeto-editor-emoji"},renderEmoji(e){let{node:t}=e;return t.attrs.label},suggestion:{}}),addAttributes:()=>({label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-emoji]"}],renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["span",ms({"data-emoji":""},this.options.HTMLAttributes,n),this.options.renderEmoji({node:t})]},renderText(e){let{node:t}=e;return this.options.renderEmoji({node:t})},addCommands(){return{setEmoji:e=>t=>{var n;let{chain:r}=t;r().focus().insertContent([{type:this.name,attrs:{label:(null==e?void 0:e.native)||(null==e||null===(n=e.skins[0])||void 0===n?void 0:n.native)||""}},{type:"text",text:" "}]).run()}}},addProseMirrorPlugins(){return[ez({editor:this.editor,...this.options.suggestion})]}}).configure({suggestion:iz});const sz=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,az=Ta.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",ms(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Ma({find:sz,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}});var lz,uz=void 0&&(void 0).__extends||(lz=function(e,t){return lz=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},lz(e,t)},function(e,t){function n(){this.constructor=e}lz(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),cz=void 0&&(void 0).__assign||function(){return cz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},cz.apply(this,arguments)},dz={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},pz={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},hz={width:"20px",height:"20px",position:"absolute"},fz={top:cz(cz({},dz),{top:"-5px"}),right:cz(cz({},pz),{left:void 0,right:"-5px"}),bottom:cz(cz({},dz),{top:void 0,bottom:"-5px"}),left:cz(cz({},pz),{left:"-5px"}),topRight:cz(cz({},hz),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:cz(cz({},hz),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:cz(cz({},hz),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:cz(cz({},hz),{left:"-10px",top:"-10px",cursor:"nw-resize"})},mz=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.onMouseDown=function(t){e.props.onResizeStart(t,e.props.direction)},e.onTouchStart=function(t){e.props.onResizeStart(t,e.props.direction)},e}return uz(n,t),n.prototype.render=function(){return e.createElement("div",{className:this.props.className||"",style:cz(cz({position:"absolute",userSelect:"none"},fz[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},n}(e.PureComponent),gz=void 0&&(void 0).__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yz=void 0&&(void 0).__assign||function(){return yz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},yz.apply(this,arguments)},bz={width:"auto",height:"auto"},vz=function(e,t,n){return Math.max(Math.min(e,n),t)},wz=function(e,t){return Math.round(e/t)*t},xz=function(e,t){return new RegExp(e,"i").test(t)},Mz=function(e){return Boolean(e.touches&&e.touches.length)},Dz=function(e,t,n){void 0===n&&(n=0);var r=t.reduce((function(n,r,i){return Math.abs(r-e)<Math.abs(t[n]-e)?i:n}),0),i=Math.abs(t[r]-e);return 0===n||i<n?t[r]:e},kz=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},Ez=function(e,t,n,r){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return n*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return r*(Number(e.replace("vh",""))/100)}return e},Cz=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],Tz="__resizable_base__",Oz=function(t){function n(e){var n=t.call(this,e)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableRight=0,n.resizableTop=0,n.resizableBottom=0,n.targetLeft=0,n.targetTop=0,n.appendBase=function(){if(!n.resizable||!n.window)return null;var e=n.parentNode;if(!e)return null;var t=n.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(Tz):t.className+=Tz,e.appendChild(t),t},n.removeBase=function(e){var t=n.parentNode;t&&t.removeChild(e)},n.ref=function(e){e&&(n.resizable=e)},n.state={isResizing:!1,width:void 0===(n.propsSize&&n.propsSize.width)?"auto":n.propsSize&&n.propsSize.width,height:void 0===(n.propsSize&&n.propsSize.height)?"auto":n.propsSize&&n.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return gz(n,t),Object.defineProperty(n.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||bz},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,i=this.resizable.style.position;"relative"!==i&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:n,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:r,this.resizable.style.position=i}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,n=function(t){if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&e.propsSize[t].toString().endsWith("%")){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var n=e.getParentSize();return Number(e.state[t].toString().replace("px",""))/n[t]*100+"%"}return kz(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?kz(t.width):n("width"),height:t&&void 0!==t.height&&!this.state.isResizing?kz(t.height):n("height")}},enumerable:!1,configurable:!0}),n.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;"wrap"!==n&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),r},n.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},n.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},n.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},n.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},n.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==n&&"auto"!==n?e:"auto"},n.prototype.calculateNewMaxFromBoundary=function(e,t){var n,r,i=this.props.boundsByDirection,o=this.state.direction,s=i&&xz("left",o),a=i&&xz("top",o);if("parent"===this.props.bounds){var l=this.parentNode;l&&(n=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),r=a?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(n=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,r=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(n=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),r=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return n&&Number.isFinite(n)&&(e=e&&e<n?e:n),r&&Number.isFinite(r)&&(t=t&&t<r?t:r),{maxWidth:e,maxHeight:t}},n.prototype.calculateNewSizeFromDirection=function(e,t){var n=this.props.scale||1,r=this.props.resizeRatio||1,i=this.state,o=i.direction,s=i.original,a=this.props,l=a.lockAspectRatio,u=a.lockAspectRatioExtraHeight,c=a.lockAspectRatioExtraWidth,d=s.width,p=s.height,h=u||0,f=c||0;return xz("right",o)&&(d=s.width+(e-s.x)*r/n,l&&(p=(d-f)/this.ratio+h)),xz("left",o)&&(d=s.width-(e-s.x)*r/n,l&&(p=(d-f)/this.ratio+h)),xz("bottom",o)&&(p=s.height+(t-s.y)*r/n,l&&(d=(p-h)*this.ratio+f)),xz("top",o)&&(p=s.height-(t-s.y)*r/n,l&&(d=(p-h)*this.ratio+f)),{newWidth:d,newHeight:p}},n.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var i=this.props,o=i.lockAspectRatio,s=i.lockAspectRatioExtraHeight,a=i.lockAspectRatioExtraWidth,l=void 0===r.width?10:r.width,u=void 0===n.width||n.width<0?e:n.width,c=void 0===r.height?10:r.height,d=void 0===n.height||n.height<0?t:n.height,p=s||0,h=a||0;if(o){var f=(c-p)*this.ratio+h,m=(d-p)*this.ratio+h,g=(l-h)/this.ratio+p,y=(u-h)/this.ratio+p,b=Math.max(l,f),v=Math.min(u,m),w=Math.max(c,g),x=Math.min(d,y);e=vz(e,b,v),t=vz(t,w,x)}else e=vz(e,l,u),t=vz(t,c,d);return{newWidth:e,newHeight:t}},n.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var e=this.parentNode;if(e){var t=e.getBoundingClientRect();this.parentLeft=t.left,this.parentTop=t.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var n=this.props.bounds.getBoundingClientRect();this.targetLeft=n.left,this.targetTop=n.top}if(this.resizable){var r=this.resizable.getBoundingClientRect(),i=r.left,o=r.top,s=r.right,a=r.bottom;this.resizableLeft=i,this.resizableRight=s,this.resizableTop=o,this.resizableBottom=a}},n.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var n,r=0,i=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(r=e.nativeEvent.clientX,i=e.nativeEvent.clientY):e.nativeEvent&&Mz(e.nativeEvent)&&(r=e.nativeEvent.touches[0].clientX,i=e.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var o=this.window.getComputedStyle(this.resizable);if("auto"!==o.flexBasis){var s=this.parentNode;if(s){var a=this.window.getComputedStyle(s).flexDirection;this.flexDir=a.startsWith("row")?"row":"column",n=o.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:r,y:i,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:yz(yz({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:n};this.setState(l)}},n.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&Mz(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var n=this.props,r=n.maxWidth,i=n.maxHeight,o=n.minWidth,s=n.minHeight,a=Mz(e)?e.touches[0].clientX:e.clientX,l=Mz(e)?e.touches[0].clientY:e.clientY,u=this.state,c=u.direction,d=u.original,p=u.width,h=u.height,f=this.getParentSize(),g=function(e,t,n,r,i,o,s){return r=Ez(r,e.width,t,n),i=Ez(i,e.height,t,n),o=Ez(o,e.width,t,n),s=Ez(s,e.height,t,n),{maxWidth:void 0===r?void 0:Number(r),maxHeight:void 0===i?void 0:Number(i),minWidth:void 0===o?void 0:Number(o),minHeight:void 0===s?void 0:Number(s)}}(f,this.window.innerWidth,this.window.innerHeight,r,i,o,s);r=g.maxWidth,i=g.maxHeight,o=g.minWidth,s=g.minHeight;var y=this.calculateNewSizeFromDirection(a,l),b=y.newHeight,v=y.newWidth,w=this.calculateNewMaxFromBoundary(r,i);this.props.snap&&this.props.snap.x&&(v=Dz(v,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(b=Dz(b,this.props.snap.y,this.props.snapGap));var x=this.calculateNewSizeFromAspectRatio(v,b,{width:w.maxWidth,height:w.maxHeight},{width:o,height:s});if(v=x.newWidth,b=x.newHeight,this.props.grid){var M=wz(v,this.props.grid[0]),D=wz(b,this.props.grid[1]),k=this.props.snapGap||0;v=0===k||Math.abs(M-v)<=k?M:v,b=0===k||Math.abs(D-b)<=k?D:b}var E={width:v-d.width,height:b-d.height};if(p&&"string"==typeof p)if(p.endsWith("%"))v=v/f.width*100+"%";else if(p.endsWith("vw")){v=v/this.window.innerWidth*100+"vw"}else if(p.endsWith("vh")){v=v/this.window.innerHeight*100+"vh"}if(h&&"string"==typeof h)if(h.endsWith("%"))b=b/f.height*100+"%";else if(h.endsWith("vw")){b=b/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){b=b/this.window.innerHeight*100+"vh"}var C={width:this.createSizeForCssProperty(v,"width"),height:this.createSizeForCssProperty(b,"height")};"row"===this.flexDir?C.flexBasis=C.width:"column"===this.flexDir&&(C.flexBasis=C.height),m((function(){t.setState(C)})),this.props.onResize&&this.props.onResize(e,c,this.resizable,E)}},n.prototype.onMouseUp=function(e){var t=this.state,n=t.isResizing,r=t.direction,i=t.original;if(n&&this.resizable){var o={width:this.size.width-i.width,height:this.size.height-i.height};this.props.onResizeStop&&this.props.onResizeStop(e,r,this.resizable,o),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:yz(yz({},this.state.backgroundStyle),{cursor:"auto"})})}},n.prototype.updateSize=function(e){this.setState({width:e.width,height:e.height})},n.prototype.renderResizer=function(){var t=this,n=this.props,r=n.enable,i=n.handleStyles,o=n.handleClasses,s=n.handleWrapperStyle,a=n.handleWrapperClass,l=n.handleComponent;if(!r)return null;var u=Object.keys(r).map((function(n){return!1!==r[n]?e.createElement(mz,{key:n,direction:n,onResizeStart:t.onResizeStart,replaceStyles:i&&i[n],className:o&&o[n]},l&&l[n]?l[n]:null):null}));return e.createElement("div",{className:a,style:s},u)},n.prototype.render=function(){var t=this,n=Object.keys(this.props).reduce((function(e,n){return-1!==Cz.indexOf(n)||(e[n]=t.props[n]),e}),{}),r=yz(yz(yz({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(r.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return e.createElement(i,yz({ref:this.ref,style:r,className:this.props.className},n),this.state.isResizing&&e.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},n.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},n}(e.PureComponent);const Sz=e=>{let{node:n,editor:r,getPos:i}=e;const{alt:o,src:s,float:a,align:l,height:u,width:c}=n.attrs,d=o||"",{view:p}=r;return t.createElement(Gu,null,t.createElement(Oz,{lockAspectRatio:!0,className:"neeto-editor__image neeto-editor__image--".concat(a," neeto-editor__image--").concat(l),size:{height:u,width:c},onResizeStop:(e,t,o,s)=>{p.dispatch(p.state.tr.setNodeMarkup(i(),void 0,{...n.attrs,height:u+s.height,width:c+s.width})),r.commands.focus()}},t.createElement("figure",null,t.createElement("img",{alt:d,src:s}),t.createElement("figcaption",null,d))))};var Az=az.extend({name:"image",addAttributes:()=>({...az.config.addAttributes(),height:{default:"auto",rendered:!1},width:{default:384,rendered:!1},float:{default:"none",rendered:!1},align:{default:"center",rendered:!1}}),addCommands(){return{setImage:e=>t=>{var n,r,i;let{tr:o,commands:s}=t;return"image"===(null===(n=o.selection)||void 0===n||null===(r=n.node)||void 0===r||null===(i=r.type)||void 0===i?void 0:i.name)?s.updateAttributes("image",e):s.insertContent({type:this.name,attrs:e})},setImageAttributes:e=>t=>{let{tr:n}=t;const{selection:r}=n,i={...r.node.attrs,...e},o=this.type.create(i);n.replaceRangeWith(r.from,r.to,o)}}},renderHTML(e){let{node:t}=e;const{alt:n,src:r,float:i,align:o,height:s,width:a}=t.attrs,l=n||"",u="height:".concat(s,"px;width:").concat(a,"px;");return["a",{class:"neeto-editor__image neeto-editor__image--".concat(i," neeto-editor__image--").concat(o),style:u,href:r,target:"_blank",rel:"noopener noreferrer"},["figure",{},["img",{src:r,caption:l}],["figcaption",l]]]},addNodeView:()=>Zu(Sz)});const Nz=e=>{let{handleSubmit:t,shortcuts:n}=e;return js.create({addKeyboardShortcuts(){return{"Mod-Enter":()=>(null==t||t(this.editor.getHTML()),this.editor.commands.blur(),!0),...n}}})};var _z=e=>{let{handleSubmit:t,shortcuts:n}=e;return Nz({handleSubmit:t,shortcuts:n})};const jz=new Tn("mention"),Iz=Ta.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var n;return`${e.suggestion.char}${null!==(n=t.attrs.label)&&void 0!==n?n:t.attrs.id}`},suggestion:{char:"@",pluginKey:jz,command:({editor:e,range:t,props:n})=>{var r,i;const o=e.view.state.selection.$to.nodeAfter;(null===(r=null==o?void 0:o.text)||void 0===r?void 0:r.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),null===(i=window.getSelection())||void 0===i||i.collapseToEnd()},allow:({state:e,range:t})=>{const n=e.doc.resolve(t.from),r=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){return["span",ms({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command((({tr:e,state:t})=>{let n=!1;const{selection:r}=t,{empty:i,anchor:o}=r;return!!i&&(t.doc.nodesBetween(o-1,o,((t,r)=>{if(t.type.name===this.name)return n=!0,e.insertText(this.options.suggestion.char||"",r,r+t.nodeSize),!1})),n)}))}},addProseMirrorPlugins(){return[ez({editor:this.editor,...this.options.suggestion})]}}),Lz=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],{showImage:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.map(((e,n)=>({showImage:t,key:"".concat(sd(e.name),"-").concat(n),...e}))).sort(((e,t)=>e.name.localeCompare(t.name)));return e=>{let{query:t}=e;return n.filter((e=>{let{name:n}=e;return n.toLowerCase().includes(t.toLowerCase())}))}},zz=e=>{let{wrapperRef:t,index:n}=e;if(!t.current||n>=t.current.children.length)return;const r=8,i=t.current,o=i.children[n],s=o.clientHeight+r;let a=i.scrollTop;o.offsetTop+s>a+i.clientHeight?a=o.offsetTop-i.clientHeight+s:a>o.offsetTop&&(a=o.offsetTop-r),t.current.scrollTop=a};class Pz extends t.Component{constructor(e){super(e),pm(this,"selectItem",(e=>{const{items:t,command:n}=this.props,r=t[e];r&&n({label:r.name,id:r.key})})),pm(this,"upHandler",(()=>{const{items:e}=this.props;this.setState((t=>{const{selectedIndex:n}=t;return{selectedIndex:(n+e.length-1)%e.length}}))})),pm(this,"downHandler",(()=>{const{items:e}=this.props;this.setState((t=>{const{selectedIndex:n}=t;return{selectedIndex:(n+1)%e.length}}))})),pm(this,"enterHandler",(()=>{const{selectedIndex:e}=this.state;this.selectItem(e)})),pm(this,"onKeyDown",(e=>{let{event:t}=e;const n={ArrowUp:this.upHandler,ArrowDown:this.downHandler,Enter:this.enterHandler};return!!Object.prototype.hasOwnProperty.call(n,t.key)&&(n[t.key](),!0)})),this.state={selectedIndex:0},this.mentionRef=t.createRef()}componentDidUpdate(e){const{items:t}=this.props;t!==e.items&&this.setState({selectedIndex:0}),zz({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}render(){const{selectedIndex:e}=this.state,{items:n}=this.props;return 0===n.length?t.createElement("div",{className:"neeto-editor-mentions__wrapper"},t.createElement("p",{className:"neeto-editor-mentions__item"},"No Results")):t.createElement("div",{ref:this.mentionRef,className:"neeto-editor-mentions__wrapper","data-cy":"neeto-editor-mention-list"},n.map(((n,r)=>{let{key:i,name:o,imageUrl:s,showImage:a}=n;return t.createElement("button",{className:sc("neeto-editor-mentions__item",{active:r===e}),key:i,onClick:()=>this.selectItem(r),type:"button","data-cy":"neeto-editor-mention-list-".concat(o)},a&&t.createElement(vv,{user:{name:o,imageUrl:s}}),t.createElement("p",null,o))})))}}const Fz={render:()=>{let e,t;return{onStart:n=>{e=new Ju(Pz,{props:n,editor:n.editor}),t=Iu("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var r;return"Escape"===n.event.key?(t[0].hide(),!0):null===(r=e.ref)||void 0===r?void 0:r.onKeyDown(n)},onExit(){t[0].destroy(),e.destroy()}}}},Rz=Iz.extend({addCommands(){return{setMention:e=>t=>{let{chain:n}=t;n().focus().insertContent([{type:this.name,attrs:{id:e,label:e}},{type:"text",text:" "}]).run()}}}});var Bz=e=>{let{suggestion:t={},...n}=e;return Rz.configure({...n,suggestion:{...Fz,...t}})},Uz="[object Object]";var Hz,$z,Vz=Function.prototype,Wz=Object.prototype,qz=Vz.toString,Yz=Wz.hasOwnProperty,Qz=qz.call(Object),Kz=Wz.toString,Gz=(Hz=Object.getPrototypeOf,$z=Object,function(e){return Hz($z(e))});var Jz=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||Kz.call(e)!=Uz||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=Gz(e);if(null===t)return!0;var n=Yz.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&qz.call(n)==Qz};const Xz=e=>{const t=typeof e;return"string"===t||"funtion"===t?e:Jz(e)?t=>{let{node:n}=t;const{name:r}=n.type;return e[r]}:""};var Zz=js.create({name:"placeholder",addOptions:()=>({excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!1}),addProseMirrorPlugins(){return[new kn({props:{decorations:e=>{let{doc:t,selection:n}=e;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];return r?(t.descendants(((e,t)=>{const n=i>=t&&i<=t+e.nodeSize,r=!e.isLeaf&&!e.childCount,s=this.options.excludeNodeTypes.includes(e.type.name);if((n||!this.options.showOnlyCurrent)&&!s&&r){const n=[this.options.emptyNodeClass];this.editor.isEmpty&&n.push(this.options.emptyEditorClass);const r=ao.node(t,t+e.nodeSize,{class:n.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t}):this.options.placeholder});o.push(r)}return this.options.includeChildren})),co.create(t,o)):null}}})]}});class eP extends t.Component{constructor(e){super(e),pm(this,"keydownHandler",(e=>{const t={Enter:this.enterHandler,ArrowUp:this.upHandler,ArrowDown:this.downHandler,ArrowLeft:this.leftArrowHandler,ArrowRight:this.rightArrowHandler};e.key in t&&t[e.key](e)})),pm(this,"selectItem",(e=>{const{items:t,editor:n,range:r}=this.props,i=t[e],o=i&&i.command,s=ld(i.items);o&&s&&i.command({editor:n,range:r})})),pm(this,"upHandler",(()=>{const{items:e}=this.props,{selectedIndex:t}=this.state;this.setState({selectedIndex:(t+e.length-1)%e.length})})),pm(this,"downHandler",(()=>{const{items:e}=this.props,{selectedIndex:t}=this.state;this.setState({selectedIndex:(t+1)%e.length})})),pm(this,"enterHandler",(()=>{const{selectedIndex:e}=this.state;this.selectItem(e)})),pm(this,"leftArrowHandler",(()=>{const{menuIndex:e,setActiveMenuIndex:t}=this.props;e>0&&t(e-1)})),pm(this,"rightArrowHandler",(()=>{const{menuIndex:e,setActiveMenuIndex:t,items:n}=this.props,{selectedIndex:r}=this.state,i=n[r];i&&!ld(i.items)&&t(e+1)})),this.state={selectedIndex:0},this.menuRef=t.createRef()}componentDidMount(){const{menuIndex:e,activeMenuIndex:t}=this.props;e===t&&document.addEventListener("keydown",this.keydownHandler)}componentWillUnmount(){document.removeEventListener("keydown",this.keydownHandler)}componentDidUpdate(e){const{items:t,menuIndex:n,activeMenuIndex:r}=this.props,i=n===r;t!==e.items&&this.setState({selectedIndex:0}),zz({wrapperRef:this.menuRef,index:this.state.selectedIndex}),i?document.addEventListener("keydown",this.keydownHandler):document.removeEventListener("keydown",this.keydownHandler)}render(){const{items:e,menuIndex:n,activeMenuIndex:r}=this.props,{selectedIndex:i}=this.state,o=n===r;return t.createElement("div",{ref:this.menuRef,className:"neeto-editor-slash-commands__wrapper"},e.map(((e,r)=>{const s=ld(e.items),a=t.createElement(tP,{key:e.title,item:e,index:r,selectedIndex:o?i:-1,selectItem:()=>s&&this.selectItem(r),onHover:()=>this.setState({selectedIndex:r})});return s?a:t.createElement(Sd,{key:e.title,interactive:!0,placement:"right",content:t.createElement(eP,ie({},this.props,{items:e.items,menuIndex:n+1})),onCreate:e=>{let{popper:t}=e;return t.style.width="max-content"},visible:i===r,onShow:()=>{this.isSubmenuOpened=!0},onHide:()=>{this.isSubmenuOpened=!1}},a)})))}}const tP=s(((e,n)=>{let{item:r,selectedIndex:i,index:o,selectItem:s,onHover:a}=e;const{Icon:l}=r;return t.createElement("div",{className:sc("neeto-editor-slash-commands__item",{active:o===i}),onClick:s,ref:n,"data-cy":"neeto-editor-command-list-item-".concat(o),onMouseEnter:a},l&&t.createElement(l,{size:20}),t.createElement("div",{className:"neeto-editor-slash-commands__item-content"},t.createElement("h5",null,r.title),t.createElement("p",null,r.description)))}));class nP extends t.Component{constructor(){super(...arguments),pm(this,"state",{activeMenuIndex:0}),pm(this,"onKeyDown",(e=>{let{event:t}=e;return["Enter","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)})),pm(this,"setActiveMenuIndex",(e=>this.setState({activeMenuIndex:e})))}render(){return t.createElement(eP,ie({},this.props,{menuIndex:0,activeMenuIndex:this.state.activeMenuIndex,setActiveMenuIndex:this.setActiveMenuIndex}))}}const rP={PARAGRAPH:{optionName:md.PARAGRAPH,title:"Paragraph",description:"Add a plain text block.",Icon:Sh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("paragraph").run()}},H1:{optionName:md.H1,title:"H1",description:"Add a big heading.",Icon:Uh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:1}).run()}},H2:{optionName:md.H2,title:"H2",description:"Add a sub-heading.",Icon:$h,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:2}).run()}},H3:{optionName:md.H3,title:"H3",description:"Add a sub-heading of level 3.",Icon:Yh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:3}).run()}},H4:{optionName:md.H4,title:"H4",description:"Add a sub-heading of level 4.",Icon:Yh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:4}).run()}},H5:{optionName:md.H5,title:"H5",description:"Add a sub-heading of level 5.",Icon:Yh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:5}).run()}},H6:{optionName:md.H6,title:"H6",description:"Add a sub-heading of level 6.",Icon:Yh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:6}).run()}},LIST_ORDERED:{optionName:md.LIST_ORDERED,title:"Numbered list",description:"Add a list with numbering.",Icon:Dh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).toggleOrderedList().run()}},LIST_BULLETS:{optionName:md.LIST_BULLETS,title:"Bulleted list",description:"Add a list with bullets.",Icon:xh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).toggleBulletList().run()}},BLOCKQUOTE:{optionName:md.BLOCKQUOTE,title:"Blockquote",description:"Add a quote.",Icon:Jp,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).toggleBlockquote().run()}},IMAGE:{optionName:md.IMAGE_UPLOAD,title:"Image",description:"Add an image.",Icon:hh,command:e=>{let{editor:t,range:n}=e;return t.chain().focus().deleteRange(n).run()}},CODE:{optionName:md.CODE_BLOCK,title:"Code block",description:"Add a code block with syntax highlighting.",Icon:rh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).toggleCodeBlock().run()}},EMOJI:{optionName:md.EMOJI,title:"Emoji",description:"Add an emoji.",Icon:Lh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).insertContent("::").run()}},DIVIDER:{optionName:md.DIVIDER,title:"Divider",description:"Add an horizontal line to separate sections.",Icon:Eh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setHorizontalRule().run()}},VIDEO:{optionName:md.VIDEO_EMBED,title:"Embed Youtube/Vimeo",description:"Embed a video from major services.",Icon:Zh,command:e=>{let{editor:t,range:n}=e;const r=prompt("Please enter Youtube/Vimeo embed URL."),i=(e=>{const t=e.match(Bf);return t&&"https://www.youtube.com/embed/".concat(t[5])})(r)||(e=>{const t=e.match(Uf);return t&&"https://player.vimeo.com/video/".concat(t[4],"?h=").concat(t[5])})(r);i?t.chain().focus().deleteRange(n).setExternalVideo({src:i}).run():t.chain().focus().deleteRange(n).insertContent("#invalid").run()}},PASTE_UNFORMATTED:{optionName:md.PASTE_UNFORMATTED,title:"Paste Unformatted",description:"Paste by removing all styles.",Icon:Th,command:e=>{let{editor:t,range:n}=e;return t.chain().focus().deleteRange(n).pasteUnformatted().run()}},NO_RESULT:{title:"No results",command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).run()}}},iP=new Tn("commands");var oP=e=>{let{setImageUploadVisible:t,addonCommands:n,options:r}=e,i=[rP.PARAGRAPH,rP.H1,rP.H2,rP.H3,rP.H4,rP.H5,rP.H6,rP.LIST_ORDERED,rP.LIST_BULLETS,rP.BLOCKQUOTE,{...rP.IMAGE,command:function(){t(!0),rP.IMAGE.command(...arguments)}},rP.CODE,rP.EMOJI,rP.DIVIDER,rP.VIDEO,rP.PASTE_UNFORMATTED];return ld(r)||(i=i.filter((e=>{let{optionName:t}=e;return r.includes(t)}))),ld(n)||(i=i.concat(n)),js.create({addOptions:()=>({HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:iP,command:e=>{let{editor:t,range:n,props:r}=e;r.command({editor:t,range:n})},items:e=>{let{query:t}=e;const n=i.filter((e=>{let{title:n}=e;return n.toLowerCase().includes(t.toLowerCase())}));return ld(n)?[rP.NO_RESULT]:n},render:()=>{let e,t;return{onStart:n=>{e=new Ju(nP,{props:n,editor:n.editor}),t=Iu("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1,zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit(){t&&t[0].destroy(),e&&e.destroy()}}}}}),addProseMirrorPlugins(){return[ez({editor:this.editor,...this.options.suggestion})]}})},sP=GI.extend({name:"title",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML:()=>[{tag:"h1"}],renderHTML(e){let{_node:t,HTMLAttributes:n}=e;return["h1",ms(this.options.HTMLAttributes,n),0]}});const aP=ka({find:/--$/,replace:"—"}),lP=ka({find:/\.\.\.$/,replace:"…"}),uP=ka({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),cP=ka({find:/"$/,replace:"”"}),dP=ka({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),pP=ka({find:/'$/,replace:"’"}),hP=ka({find:/<-$/,replace:"←"}),fP=ka({find:/->$/,replace:"→"}),mP=ka({find:/\(c\)$/,replace:"©"}),gP=ka({find:/\(tm\)$/,replace:"™"}),yP=ka({find:/\(r\)$/,replace:"®"}),bP=ka({find:/1\/2$/,replace:"½"}),vP=ka({find:/\+\/-$/,replace:"±"}),wP=ka({find:/!=$/,replace:"≠"}),xP=ka({find:/<<$/,replace:"«"}),MP=ka({find:/>>$/,replace:"»"}),DP=ka({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),kP=ka({find:/\^2$/,replace:"²"}),EP=ka({find:/\^3$/,replace:"³"}),CP=ka({find:/1\/4$/,replace:"¼"}),TP=ka({find:/3\/4$/,replace:"¾"});var OP=js.create({name:"typography",addInputRules(){const e=[];return!1!==this.options.emDash&&e.push(aP),!1!==this.options.ellipsis&&e.push(lP),!1!==this.options.openDoubleQuote&&e.push(uP),!1!==this.options.closeDoubleQuote&&e.push(cP),!1!==this.options.openSingleQuote&&e.push(dP),!1!==this.options.closeSingleQuote&&e.push(pP),!1!==this.options.leftArrow&&e.push(hP),!1!==this.options.rightArrow&&e.push(fP),!1!==this.options.copyright&&e.push(mP),!1!==this.options.trademark&&e.push(gP),!1!==this.options.registeredTrademark&&e.push(yP),!1!==this.options.oneHalf&&e.push(bP),!1!==this.options.plusMinus&&e.push(vP),!1!==this.options.notEqual&&e.push(wP),!1!==this.options.laquo&&e.push(xP),!1!==this.options.raquo&&e.push(MP),!1!==this.options.multiplication&&e.push(DP),!1!==this.options.superscriptTwo&&e.push(kP),!1!==this.options.superscriptThree&&e.push(EP),!1!==this.options.oneQuarter&&e.push(CP),!1!==this.options.threeQuarters&&e.push(TP),e}}).configure({emDash:!1,openDoubleQuote:!1,closeDoubleQuote:!1,openSingleQuote:!1,closeSingleQuote:!1});const SP=e=>{let{items:n,command:r}=e;return t.createElement("div",{className:"neeto-editor-variables-suggestion"},t.createElement(xv,{variables:n,onClickVariable:e=>{const{category_key:t,key:n}=e,i=t?"".concat(t,".").concat(n):n;r({label:i,id:i})}}))},AP=new Tn("variables"),NP=Ta.create({name:"variable",addOptions:()=>({HTMLAttributes:{class:"neeto-editor-variable"},charOpen:"{{",charClose:"}}",renderLabel(e){let{options:t,node:n}=e;return"".concat(t.charOpen).concat(n.attrs.label||n.attrs.id).concat(t.charClose)},suggestion:{}}),group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-variable]"}],renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["span",ms({"data-variable":""},this.options.HTMLAttributes,n),this.options.renderLabel({options:this.options,node:t})]},renderText(e){let{node:t}=e;return this.options.renderLabel({options:this.options,node:t})},addCommands(){return{setVariable:e=>t=>{let{chain:n}=t;n().focus().insertContent([{type:this.name,attrs:e},{type:"text",text:" "}]).run()}}},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command((e=>{let{tr:t,state:n}=e,r=!1;const{selection:i}=n,{empty:o,anchor:s}=i;return!!o&&(n.doc.nodesBetween(s-1,s,((e,n)=>{if(e.type.name===this.name)return r=!0,t.insertText("",n,n+e.nodeSize),!1})),r)}))}},addProseMirrorPlugins(){return[ez({editor:this.editor,...this.options.suggestion})]}}),_P={char:"{{",startOfLine:!1,pluginKey:AP,command:e=>{let{editor:t,range:n,props:r}=e;t.chain().focus().deleteRange(n).setVariable(r).run()},items:()=>[],render:()=>{let e,t;return{onStart:n=>{e=new Ju(SP,{props:n,editor:n.editor}),t=Iu("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onExit(){t[0].destroy(),e.destroy()}}}};var jP=e=>{let{suggestion:t={}}=e;return NP.configure({suggestion:{..._P,...t}})};const IP=(e,t)=>{const n=[];e.split(/\n/).forEach((e=>{const r={type:"paragraph"};e.length>0&&(r.content=[{type:"text",text:e}]);const i=_e.fromJSON(t.doc.type.schema,r);n.push(i)}));const r=le.fromArray(n);return fe.maxOpen(r)},LP=(e,n)=>{let{forceTitle:r=!1,titleError:s=!1,hideSlashCommands:a=!1,defaults:l=gd,addons:u=[],addonCommands:c,className:d,uploadEndpoint:p,uploadConfig:h={},initialValue:f="",onChange:m=(()=>{}),onFocus:g=(()=>{}),onBlur:y=(()=>{}),menuType:b="fixed",variables:v,mentions:w,showImageInMention:x=!1,placeholder:M=(r?{title:"Untitled"}:null),extensions:D,contentClassName:k,characterLimit:E,editorSecrets:C,rows:T=6,autoFocus:O=!1,onSubmit:S,heightStrategy:A="fixed",characterCountStrategy:N="hidden",keyboardShortcuts:_=[],error:j=null,...I}=e;const[L,z]=i(!1),P="fixed"===b,F="bubble"===b,R=!a,B=(e=>{if(e){if("string"==typeof e&&e.length)return!0;if("object"==typeof e&&Object.keys(e).length)return!0;if("function"==typeof e)return!0}return!1})(M),U=!B&&R,H=u.includes("image-upload-unsplash"),$="hidden"!==N,V=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],{includeImageUpload:n}=arguments.length>2?arguments[2]:void 0;const r=t.map((e=>e.toLowerCase()));return n&&r.push(md.IMAGE_UPLOAD),[].concat(e,r)}(l,u,{includeImageUpload:H}),W=(e=>{let{forceTitle:t,placeholder:n,extensions:r,mentions:i,variables:o,isSlashCommandsActive:s,showImageInMention:a,setImageUploadVisible:l,options:u,addonCommands:c,characterLimit:d,onSubmit:p,keyboardShortcuts:h}=e,f=[sP,JL.extend({content:t?"title block*":"block+"}),jL.configure({document:!1,codeBlock:!1}),z_,OP,iN,dN,KL,Az,lN,XL,L_,oN,Zz.configure({placeholder:Xz(n)}),oz,nz,GL,rN.configure({limit:d}),_z({handleSubmit:p,shortcuts:h})];return s&&f.push(oP({setImageUploadVisible:l,options:u,addonCommands:c})),ld(i)||f.push(Bz({suggestion:{items:Lz(i,{showImage:a})}})),ld(o)||f.push(jP({suggestion:{items:()=>o}})),ld(r)||(f=f.concat(r)),f})({contentClassName:k,forceTitle:r,placeholder:M,extensions:D,mentions:w,variables:v,isSlashCommandsActive:R,showImageInMention:x,setImageUploadVisible:z,options:V,addonCommands:c,characterLimit:E,keyboardShortcuts:_,onSubmit:S}),q=sc("neeto-editor",{"slash-active":U,"fixed-menu-active border":P,"bubble-menu-active":F,"force-title":r,"force-title--error":s,"placeholder-active":B,[d]:d}),Y=(e=>{let{heightStrategy:t,rows:n}=e;const r={},i=n*hd+2*(dd+pd);return"flexible"===t?r["min-height"]="".concat(i,"px"):r.height="".concat(i,"px"),r})({heightStrategy:A,rows:T}),Q=ec({extensions:W,content:f,injectCSS:!1,autofocus:O&&"end",editorProps:{attributes:{class:q,style:ad(Y)},clipboardTextParser:IP},parseOptions:{preserveWhitespace:!0},onUpdate:e=>{let{editor:t}=e;return m(t.getHTML())},onFocus:g,onBlur:y});return t.useImperativeHandle(n,(()=>({editor:Q}))),o((()=>{![process.env.RAILS_ENV,"production"].includes("production")&&ld(f)&&console.warn('[neeto-editor]: Empty value of "initialValue" in needtoEditor is expected to be "<p></p>" instead of "'.concat(f,'".'))}),[f]),t.createElement(ud,{error:j,isFixedMenuActive:P},P&&t.createElement(kv,{editor:Q,variables:v,setImageUploadVisible:z,options:V,mentions:w,showImageInMention:x}),F&&t.createElement(Vf,{editor:Q,options:V}),t.createElement(nN,{isVisible:L,setIsVisible:z,editor:Q,imageUploadUrl:p,uploadConfig:h,isUnsplashImageUploadActive:H,unsplashApiKey:null==C?void 0:C.unsplash}),t.createElement(qu,ie({editor:Q},I)),$&&t.createElement(Wf,{count:null==Q?void 0:Q.storage.characterCount.characters(),limit:E,strategy:N}))};var zP=t.forwardRef(LP),PP={exports:{}},FP=PP.exports=function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function r(e,i,o){return r=n()?Reflect.construct:function(e,n,r){var i=[null];i.push.apply(i,n);var o=new(Function.bind.apply(e,i));return r&&t(o,r.prototype),o},r.apply(null,arguments)}function i(e){return o(e)||s(e)||a(e)||u()}function o(e){if(Array.isArray(e))return l(e)}function s(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c=Object.hasOwnProperty,d=Object.setPrototypeOf,p=Object.isFrozen,h=Object.getPrototypeOf,f=Object.getOwnPropertyDescriptor,m=Object.freeze,g=Object.seal,y=Object.create,b="undefined"!=typeof Reflect&&Reflect,v=b.apply,w=b.construct;v||(v=function(e,t,n){return e.apply(t,n)}),m||(m=function(e){return e}),g||(g=function(e){return e}),w||(w=function(e,t){return r(e,i(t))});var x=N(Array.prototype.forEach),M=N(Array.prototype.pop),D=N(Array.prototype.push),k=N(String.prototype.toLowerCase),E=N(String.prototype.match),C=N(String.prototype.replace),T=N(String.prototype.indexOf),O=N(String.prototype.trim),S=N(RegExp.prototype.test),A=_(TypeError);function N(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return v(e,t,r)}}function _(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return w(e,n)}}function j(e,t,n){n=n||k,d&&d(e,null);for(var r=t.length;r--;){var i=t[r];if("string"==typeof i){var o=n(i);o!==i&&(p(t)||(t[r]=o),i=o)}e[i]=!0}return e}function I(e){var t,n=y(null);for(t in e)v(c,e,[t])&&(n[t]=e[t]);return n}function L(e,t){for(;null!==e;){var n=f(e,t);if(n){if(n.get)return N(n.get);if("function"==typeof n.value)return N(n.value)}e=h(e)}function r(e){return console.warn("fallback value for",e),null}return r}var z=m(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),P=m(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),F=m(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),R=m(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),B=m(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),U=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),H=m(["#text"]),$=m(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),V=m(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),W=m(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),q=m(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Y=g(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Q=g(/<%[\w\W]*|[\w\W]*%>/gm),K=g(/^data-[\-\w.\u00B7-\uFFFF]/),G=g(/^aria-[\-\w]+$/),J=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),X=g(/^(?:\w+script|data):/i),Z=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ee=g(/^html$/i),te=function(){return"undefined"==typeof window?null:window},ne=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,i="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(i)&&(r=n.currentScript.getAttribute(i));var o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function re(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te(),n=function(e){return re(e)};if(n.version="2.3.10",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,s=t.DocumentFragment,a=t.HTMLTemplateElement,l=t.Node,u=t.Element,c=t.NodeFilter,d=t.NamedNodeMap,p=void 0===d?t.NamedNodeMap||t.MozNamedAttrMap:d,h=t.HTMLFormElement,f=t.DOMParser,g=t.trustedTypes,y=u.prototype,b=L(y,"cloneNode"),v=L(y,"nextSibling"),w=L(y,"childNodes"),N=L(y,"parentNode");if("function"==typeof a){var _=o.createElement("template");_.content&&_.content.ownerDocument&&(o=_.content.ownerDocument)}var ie=ne(g,r),oe=ie?ie.createHTML(""):"",se=o,ae=se.implementation,le=se.createNodeIterator,ue=se.createDocumentFragment,ce=se.getElementsByTagName,de=r.importNode,pe={};try{pe=I(o).documentMode?o.documentMode:{}}catch(e){}var he={};n.isSupported="function"==typeof N&&ae&&void 0!==ae.createHTMLDocument&&9!==pe;var fe,me,ge=Y,ye=Q,be=K,ve=G,we=X,xe=Z,Me=J,De=null,ke=j({},[].concat(i(z),i(P),i(F),i(B),i(H))),Ee=null,Ce=j({},[].concat(i($),i(V),i(W),i(q))),Te=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,Se=null,Ae=!0,Ne=!0,_e=!1,je=!1,Ie=!1,Le=!1,ze=!1,Pe=!1,Fe=!1,Re=!1,Be=!0,Ue=!0,He=!1,$e={},Ve=null,We=j({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),qe=null,Ye=j({},["audio","video","img","source","image","track"]),Qe=null,Ke=j({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ge="http://www.w3.org/1998/Math/MathML",Je="http://www.w3.org/2000/svg",Xe="http://www.w3.org/1999/xhtml",Ze=Xe,et=!1,tt=["application/xhtml+xml","text/html"],nt="text/html",rt=null,it=o.createElement("form"),ot=function(e){return e instanceof RegExp||e instanceof Function},st=function(t){rt&&rt===t||(t&&"object"===e(t)||(t={}),t=I(t),fe=fe=-1===tt.indexOf(t.PARSER_MEDIA_TYPE)?nt:t.PARSER_MEDIA_TYPE,me="application/xhtml+xml"===fe?function(e){return e}:k,De="ALLOWED_TAGS"in t?j({},t.ALLOWED_TAGS,me):ke,Ee="ALLOWED_ATTR"in t?j({},t.ALLOWED_ATTR,me):Ce,Qe="ADD_URI_SAFE_ATTR"in t?j(I(Ke),t.ADD_URI_SAFE_ATTR,me):Ke,qe="ADD_DATA_URI_TAGS"in t?j(I(Ye),t.ADD_DATA_URI_TAGS,me):Ye,Ve="FORBID_CONTENTS"in t?j({},t.FORBID_CONTENTS,me):We,Oe="FORBID_TAGS"in t?j({},t.FORBID_TAGS,me):{},Se="FORBID_ATTR"in t?j({},t.FORBID_ATTR,me):{},$e="USE_PROFILES"in t&&t.USE_PROFILES,Ae=!1!==t.ALLOW_ARIA_ATTR,Ne=!1!==t.ALLOW_DATA_ATTR,_e=t.ALLOW_UNKNOWN_PROTOCOLS||!1,je=t.SAFE_FOR_TEMPLATES||!1,Ie=t.WHOLE_DOCUMENT||!1,Pe=t.RETURN_DOM||!1,Fe=t.RETURN_DOM_FRAGMENT||!1,Re=t.RETURN_TRUSTED_TYPE||!1,ze=t.FORCE_BODY||!1,Be=!1!==t.SANITIZE_DOM,Ue=!1!==t.KEEP_CONTENT,He=t.IN_PLACE||!1,Me=t.ALLOWED_URI_REGEXP||Me,Ze=t.NAMESPACE||Xe,t.CUSTOM_ELEMENT_HANDLING&&ot(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Te.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ot(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Te.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Te.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),je&&(Ne=!1),Fe&&(Pe=!0),$e&&(De=j({},i(H)),Ee=[],!0===$e.html&&(j(De,z),j(Ee,$)),!0===$e.svg&&(j(De,P),j(Ee,V),j(Ee,q)),!0===$e.svgFilters&&(j(De,F),j(Ee,V),j(Ee,q)),!0===$e.mathMl&&(j(De,B),j(Ee,W),j(Ee,q))),t.ADD_TAGS&&(De===ke&&(De=I(De)),j(De,t.ADD_TAGS,me)),t.ADD_ATTR&&(Ee===Ce&&(Ee=I(Ee)),j(Ee,t.ADD_ATTR,me)),t.ADD_URI_SAFE_ATTR&&j(Qe,t.ADD_URI_SAFE_ATTR,me),t.FORBID_CONTENTS&&(Ve===We&&(Ve=I(Ve)),j(Ve,t.FORBID_CONTENTS,me)),Ue&&(De["#text"]=!0),Ie&&j(De,["html","head","body"]),De.table&&(j(De,["tbody"]),delete Oe.tbody),m&&m(t),rt=t)},at=j({},["mi","mo","mn","ms","mtext"]),lt=j({},["foreignobject","desc","title","annotation-xml"]),ut=j({},["title","style","font","a","script"]),ct=j({},P);j(ct,F),j(ct,R);var dt=j({},B);j(dt,U);var pt=function(e){var t=N(e);t&&t.tagName||(t={namespaceURI:Xe,tagName:"template"});var n=k(e.tagName),r=k(t.tagName);return e.namespaceURI===Je?t.namespaceURI===Xe?"svg"===n:t.namespaceURI===Ge?"svg"===n&&("annotation-xml"===r||at[r]):Boolean(ct[n]):e.namespaceURI===Ge?t.namespaceURI===Xe?"math"===n:t.namespaceURI===Je?"math"===n&&lt[r]:Boolean(dt[n]):e.namespaceURI===Xe&&!(t.namespaceURI===Je&&!lt[r])&&!(t.namespaceURI===Ge&&!at[r])&&!dt[n]&&(ut[n]||!ct[n])},ht=function(e){D(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=oe}catch(t){e.remove()}}},ft=function(e,t){try{D(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){D(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ee[e])if(Pe||Fe)try{ht(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},mt=function(e){var t,n;if(ze)e="<remove></remove>"+e;else{var r=E(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===fe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=ie?ie.createHTML(e):e;if(Ze===Xe)try{t=(new f).parseFromString(i,fe)}catch(e){}if(!t||!t.documentElement){t=ae.createDocument(Ze,"template",null);try{t.documentElement.innerHTML=et?"":i}catch(e){}}var s=t.body||t.documentElement;return e&&n&&s.insertBefore(o.createTextNode(n),s.childNodes[0]||null),Ze===Xe?ce.call(t,Ie?"html":"body")[0]:Ie?t.documentElement:s},gt=function(e){return le.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},yt=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof p)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},bt=function(t){return"object"===e(l)?t instanceof l:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},vt=function(e,t,r){he[e]&&x(he[e],(function(e){e.call(n,t,r,rt)}))},wt=function(e){var t;if(vt("beforeSanitizeElements",e,null),yt(e))return ht(e),!0;if(S(/[\u0080-\uFFFF]/,e.nodeName))return ht(e),!0;var r=me(e.nodeName);if(vt("uponSanitizeElement",e,{tagName:r,allowedTags:De}),e.hasChildNodes()&&!bt(e.firstElementChild)&&(!bt(e.content)||!bt(e.content.firstElementChild))&&S(/<[/\w]/g,e.innerHTML)&&S(/<[/\w]/g,e.textContent))return ht(e),!0;if("select"===r&&S(/<template/i,e.innerHTML))return ht(e),!0;if(!De[r]||Oe[r]){if(!Oe[r]&&Mt(r)){if(Te.tagNameCheck instanceof RegExp&&S(Te.tagNameCheck,r))return!1;if(Te.tagNameCheck instanceof Function&&Te.tagNameCheck(r))return!1}if(Ue&&!Ve[r]){var i=N(e)||e.parentNode,o=w(e)||e.childNodes;if(o&&i)for(var s=o.length-1;s>=0;--s)i.insertBefore(b(o[s],!0),v(e))}return ht(e),!0}return e instanceof u&&!pt(e)?(ht(e),!0):"noscript"!==r&&"noembed"!==r||!S(/<\/no(script|embed)/i,e.innerHTML)?(je&&3===e.nodeType&&(t=e.textContent,t=C(t,ge," "),t=C(t,ye," "),e.textContent!==t&&(D(n.removed,{element:e.cloneNode()}),e.textContent=t)),vt("afterSanitizeElements",e,null),!1):(ht(e),!0)},xt=function(e,t,n){if(Be&&("id"===t||"name"===t)&&(n in o||n in it))return!1;if(Ne&&!Se[t]&&S(be,t));else if(Ae&&S(ve,t));else if(!Ee[t]||Se[t]){if(!(Mt(e)&&(Te.tagNameCheck instanceof RegExp&&S(Te.tagNameCheck,e)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(e))&&(Te.attributeNameCheck instanceof RegExp&&S(Te.attributeNameCheck,t)||Te.attributeNameCheck instanceof Function&&Te.attributeNameCheck(t))||"is"===t&&Te.allowCustomizedBuiltInElements&&(Te.tagNameCheck instanceof RegExp&&S(Te.tagNameCheck,n)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(n))))return!1}else if(Qe[t]);else if(S(Me,C(n,xe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==T(n,"data:")||!qe[e])if(_e&&!S(we,C(n,xe,"")));else if(n)return!1;return!0},Mt=function(e){return e.indexOf("-")>0},Dt=function(t){var r,i,o,s;vt("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ee};for(s=a.length;s--;){var u=r=a[s],c=u.name,d=u.namespaceURI;if(i="value"===c?r.value:O(r.value),o=me(c),l.attrName=o,l.attrValue=i,l.keepAttr=!0,l.forceKeepAttr=void 0,vt("uponSanitizeAttribute",t,l),i=l.attrValue,!l.forceKeepAttr&&(ft(c,t),l.keepAttr))if(S(/\/>/i,i))ft(c,t);else{je&&(i=C(i,ge," "),i=C(i,ye," "));var p=me(t.nodeName);if(xt(p,o,i)){if(ie&&"object"===e(g)&&"function"==typeof g.getAttributeType)if(d);else switch(g.getAttributeType(p,o)){case"TrustedHTML":i=ie.createHTML(i);break;case"TrustedScriptURL":i=ie.createScriptURL(i)}try{d?t.setAttributeNS(d,c,i):t.setAttribute(c,i),M(n.removed)}catch(e){}}}}vt("afterSanitizeAttributes",t,null)}},kt=function e(t){var n,r=gt(t);for(vt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)vt("uponSanitizeShadowNode",n,null),wt(n)||(n.content instanceof s&&e(n.content),Dt(n));vt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(i,o){var a,u,c,d,p;if((et=!i)&&(i="\x3c!--\x3e"),"string"!=typeof i&&!bt(i)){if("function"!=typeof i.toString)throw A("toString is not a function");if("string"!=typeof(i=i.toString()))throw A("dirty is not a string, aborting")}if(!n.isSupported){if("object"===e(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof i)return t.toStaticHTML(i);if(bt(i))return t.toStaticHTML(i.outerHTML)}return i}if(Le||st(o),n.removed=[],"string"==typeof i&&(He=!1),He){if(i.nodeName){var h=me(i.nodeName);if(!De[h]||Oe[h])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof l)1===(u=(a=mt("\x3c!----\x3e")).ownerDocument.importNode(i,!0)).nodeType&&"BODY"===u.nodeName||"HTML"===u.nodeName?a=u:a.appendChild(u);else{if(!Pe&&!je&&!Ie&&-1===i.indexOf("<"))return ie&&Re?ie.createHTML(i):i;if(!(a=mt(i)))return Pe?null:Re?oe:""}a&&ze&&ht(a.firstChild);for(var f=gt(He?i:a);c=f.nextNode();)3===c.nodeType&&c===d||wt(c)||(c.content instanceof s&&kt(c.content),Dt(c),d=c);if(d=null,He)return i;if(Pe){if(Fe)for(p=ue.call(a.ownerDocument);a.firstChild;)p.appendChild(a.firstChild);else p=a;return Ee.shadowroot&&(p=de.call(r,p,!0)),p}var m=Ie?a.outerHTML:a.innerHTML;return Ie&&De["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&S(ee,a.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+a.ownerDocument.doctype.name+">\n"+m),je&&(m=C(m,ge," "),m=C(m,ye," ")),ie&&Re?ie.createHTML(m):m},n.setConfig=function(e){st(e),Le=!0},n.clearConfig=function(){rt=null,Le=!1},n.isValidAttribute=function(e,t,n){rt||st({});var r=me(e),i=me(t);return xt(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(he[e]=he[e]||[],D(he[e],t))},n.removeHook=function(e){if(he[e])return M(he[e])},n.removeHooks=function(e){he[e]&&(he[e]=[])},n.removeAllHooks=function(){he={}},n}return re()}();const RP=e=>{let{content:n="",className:r,...i}=e;o((()=>{document.querySelectorAll("div.".concat(cd," pre code")).forEach((e=>{ee.highlightElement(e)}))}),[n]);const s=FP.sanitize;return t.createElement("div",ie({className:sc(cd,{[r]:r}),dangerouslySetInnerHTML:{__html:s(n,{ADD_ATTR:["target"]})},"data-cy":"neeto-editor-content"},i))};export{md as EDITOR_OPTIONS,zP as Editor,RP as EditorContent};
43
+ */function sw(e,t){const n=/\$/g,r="$$$$";let i=[e];if(null==t)return i;for(const e of Object.keys(t))if("_"!==e){let o=t[e];"string"==typeof o&&(o=n[Symbol.replace](o,r)),i=ow(i,new RegExp(`%\\{${e}\\}`,"g"),o)}return i}var aw=rw("apply");function lw(e){if(null==e||!e.strings)return;const t=this.locale;this.locale={...t,strings:{...t.strings,...e.strings}},this.locale.pluralize=e.pluralize||t.pluralize}var uw=class{constructor(e){Object.defineProperty(this,aw,{value:lw}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(e)?e.forEach(tw(this,aw)[aw],this):tw(this,aw)[aw](e)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!iw(this.locale.strings,e))throw new Error(`missing string: ${e}`);const n=this.locale.strings[e];if("object"==typeof n){if(t&&void 0!==t.smart_count){return sw(n[this.locale.pluralize(t.smart_count)],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return sw(n,t)}},cw=function(){var e={},t=e._fns={};return e.emit=function(e,n,r,i,o,s,a){var l=function(e){var n=t[e]?t[e]:[],r=e.indexOf(":"),i=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],o=Object.keys(t),s=0,a=o.length;for(;s<a;s++){var l=o[s];if("*"===l&&(n=n.concat(t[l])),2===i.length&&i[0]===l){n=n.concat(t[l]);break}}return n}(e);l.length&&function(e,t,n){var r=0,i=t.length;for(;r<i&&t[r];r++)t[r].event=e,t[r].apply(t[r],n)}(e,l,[n,r,i,o,s,a])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){this.on(t,(function r(){n.apply(this,arguments),e.off(t,r)}))},e.off=function(e,t){var n=[];if(e&&t)for(var r=this._fns[e],i=0,o=r?r.length:0;i<o;i++)r[i]!==t&&n.push(r[i]);n.length?this._fns[e]=n:delete this._fns[e]},e},dw="Expected a function",pw=0/0,hw="[object Symbol]",fw=/^\s+|\s+$/g,mw=/^[-+]0x[0-9a-f]+$/i,gw=/^0b[01]+$/i,yw=/^0o[0-7]+$/i,bw=parseInt,vw="object"==typeof tc&&tc&&tc.Object===Object&&tc,ww="object"==typeof self&&self&&self.Object===Object&&self,xw=vw||ww||Function("return this")(),Mw=Object.prototype.toString,Dw=Math.max,kw=Math.min,Ew=function(){return xw.Date.now()};function Cw(e,t,n){var r,i,o,s,a,l,u=0,c=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError(dw);function h(t){var n=r,o=i;return r=i=void 0,u=t,s=e.apply(o,n)}function f(e){return u=e,a=setTimeout(g,t),c?h(e):s}function m(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-u>=o}function g(){var e=Ew();if(m(e))return y(e);a=setTimeout(g,function(e){var n=t-(e-l);return d?kw(n,o-(e-u)):n}(e))}function y(e){return a=void 0,p&&r?h(e):(r=i=void 0,s)}function b(){var e=Ew(),n=m(e);if(r=arguments,i=this,l=e,n){if(void 0===a)return f(l);if(d)return a=setTimeout(g,t),h(l)}return void 0===a&&(a=setTimeout(g,t)),s}return t=Ow(t)||0,Tw(n)&&(c=!!n.leading,o=(d="maxWait"in n)?Dw(Ow(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p),b.cancel=function(){void 0!==a&&clearTimeout(a),u=0,r=l=i=a=void 0},b.flush=function(){return void 0===a?s:y(Ew())},b}function Tw(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ow(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Mw.call(e)==hw}(e))return pw;if(Tw(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Tw(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(fw,"");var n=gw.test(e);return n||yw.test(e)?bw(e.slice(2),n?2:8):mw.test(e)?pw:+e}var Sw=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError(dw);return Tw(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Cw(e,t,{leading:r,maxWait:t,trailing:i})};var Aw=0;function Nw(e){return"__private_"+Aw+++"_"+e}var _w=Nw("publish");class jw{constructor(){Object.defineProperty(this,_w,{value:Iw}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t={...this.state},n={...this.state,...e};this.state=n,function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(this,_w)[_w](t,n,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function Iw(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.callbacks.forEach((e=>{e(...t)}))}jw.VERSION="2.1.0";var Lw=function(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}};const zw=Lw,Pw={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Fw(e){let t="";return e.replace(/[^A-Z0-9]/gi,(e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/")))+t}var Rw=function(e){let t="uppy";return"string"==typeof e.name&&(t+=`-${Fw(e.name.toLowerCase())}`),void 0!==e.type&&(t+=`-${e.type}`),e.meta&&"string"==typeof e.meta.relativePath&&(t+=`-${Fw(e.meta.relativePath.toLowerCase())}`),void 0!==e.data.size&&(t+=`-${e.data.size}`),void 0!==e.data.lastModified&&(t+=`-${e.data.lastModified}`),t};var Bw=function(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const n=t[1];let[r,i]=n.split(".");return r=parseInt(r,10),i=parseInt(i,10),r<15||15===r&&i<15063||(r>18||18===r&&i>=18218)};var Uw=Wv,Hw=Fv,$w=qv;let Vw,Ww;function qw(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Yw=0;function Qw(e){return"__private_"+Yw+++"_"+e}const Kw=uw,Gw=cw,Jw=Sw,Xw=function(){return new jw},Zw=function(e){var t;if(e.type)return e.type;const n=e.name?null==(t=zw(e.name).extension)?void 0:t.toLowerCase():null;return n&&n in Pw?Pw[n]:"application/octet-stream"},ex=Lw,tx=Rw,nx=Bw,rx=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"},ix={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",emptyFolderAdded:"No files were added from empty folder",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}};var ox=Qw("plugins"),sx=Qw("restricter"),ax=Qw("storeUnsubscribe"),lx=Qw("emitter"),ux=Qw("preProcessors"),cx=Qw("uploaders"),dx=Qw("postProcessors"),px=Qw("informAndEmit"),hx=Qw("checkRequiredMetaFieldsOnFile"),fx=Qw("checkRequiredMetaFields"),mx=Qw("assertNewUploadAllowed"),gx=Qw("checkAndCreateFileStateObject"),yx=Qw("startIfAutoProceed"),bx=Qw("addListeners"),vx=Qw("updateOnlineStatus"),wx=Qw("createUpload"),xx=Qw("getUpload"),Mx=Qw("removeUpload"),Dx=Qw("runUpload");Vw=Symbol.for("uppy test: getPlugins"),Ww=Symbol.for("uppy test: createUpload");class kx{constructor(e){Object.defineProperty(this,Dx,{value:Lx}),Object.defineProperty(this,Mx,{value:Ix}),Object.defineProperty(this,xx,{value:jx}),Object.defineProperty(this,wx,{value:_x}),Object.defineProperty(this,bx,{value:Nx}),Object.defineProperty(this,yx,{value:Ax}),Object.defineProperty(this,gx,{value:Sx}),Object.defineProperty(this,mx,{value:Ox}),Object.defineProperty(this,fx,{value:Tx}),Object.defineProperty(this,hx,{value:Cx}),Object.defineProperty(this,px,{value:Ex}),Object.defineProperty(this,ox,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,sx,{writable:!0,value:void 0}),Object.defineProperty(this,ax,{writable:!0,value:void 0}),Object.defineProperty(this,lx,{writable:!0,value:Gw()}),Object.defineProperty(this,ux,{writable:!0,value:new Set}),Object.defineProperty(this,cx,{writable:!0,value:new Set}),Object.defineProperty(this,dx,{writable:!0,value:new Set}),Object.defineProperty(this,vx,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=ix;const t={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:$w.defaultOptions,meta:{},onBeforeFileAdded:e=>e,onBeforeUpload:e=>e,store:Xw(),logger:Hw.justErrorsLogger,infoTimeout:5e3};this.opts={...t,...e,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=Hw.debugLogger),this.log(`Using Core v${this.constructor.VERSION}`),this.i18nInit(),this.calculateProgress=Jw(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:nx(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:{...this.opts.meta},info:[],recoveredState:null}),qw(this,sx)[sx]=new $w.Restricter((()=>this.opts),this.i18n),qw(this,ax)[ax]=this.store.subscribe(((e,t,n)=>{this.emit("state-update",e,t,n),this.updateAll(t)})),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),qw(this,bx)[bx]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];qw(this,lx)[lx].emit(e,...n)}on(e,t){return qw(this,lx)[lx].on(e,t),this}once(e,t){return qw(this,lx)[lx].once(e,t),this}off(e,t){return qw(this,lx)[lx].off(e,t),this}updateAll(e){this.iteratePlugins((t=>{t.update(e)}))}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:{...this.getState().files,[e]:{...this.getState().files[e],...t}}})}i18nInit(){const e=new Kw([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e&&e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins((e=>{e.setOptions()})),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},n={};Object.keys(t).forEach((r=>{const i={...t[r]};i.progress={...i.progress,...e},n[r]=i})),this.setState({files:n,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){qw(this,ux)[ux].add(e)}removePreProcessor(e){return qw(this,ux)[ux].delete(e)}addPostProcessor(e){qw(this,dx)[dx].add(e)}removePostProcessor(e){return qw(this,dx)[dx].delete(e)}addUploader(e){qw(this,cx)[cx].add(e)}removeUploader(e){return qw(this,cx)[cx].delete(e)}setMeta(e){const t={...this.getState().meta,...e},n={...this.getState().files};Object.keys(n).forEach((t=>{n[t]={...n[t],meta:{...n[t].meta,...e}}})),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){const n={...this.getState().files};if(!n[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const r={...n[e].meta,...t};n[e]={...n[e],meta:r},this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),i=r.filter((e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted})),o=r.filter((e=>!e.progress.uploadStarted)),s=r.filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess)),a=r.filter((e=>e.progress.uploadStarted)),l=r.filter((e=>e.isPaused)),u=r.filter((e=>e.progress.uploadComplete)),c=r.filter((e=>e.error)),d=i.filter((e=>!e.isPaused)),p=r.filter((e=>e.progress.preprocess||e.progress.postprocess));return{newFiles:o,startedFiles:s,uploadStartedFiles:a,pausedFiles:l,completeFiles:u,erroredFiles:c,inProgressFiles:i,inProgressNotPausedFiles:d,processingFiles:p,isUploadStarted:a.length>0,isAllComplete:100===t&&u.length===r.length&&0===p.length,isAllErrored:!!n&&c.length===r.length,isAllPaused:0!==i.length&&l.length===i.length,isUploadInProgress:i.length>0,isSomeGhost:r.some((e=>e.isGhost))}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{return qw(this,sx)[sx].validate(e,t),{result:!0}}catch(e){return{result:!1,reason:e.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){qw(this,mx)[mx](e);const{files:t}=this.getState();let n=qw(this,gx)[gx](t,e);return t[n.id]&&t[n.id].isGhost&&(n={...t[n.id],data:e.data,isGhost:!1},this.log(`Replaced the blob in the restored ghost file: ${n.name}, ${n.id}`)),this.setState({files:{...t,[n.id]:n}}),this.emit("file-added",n),this.emit("files-added",[n]),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),qw(this,yx)[yx](),n.id}addFiles(e){qw(this,mx)[mx]();const t={...this.getState().files},n=[],r=[];for(let i=0;i<e.length;i++)try{let r=qw(this,gx)[gx](t,e[i]);t[r.id]&&t[r.id].isGhost&&(r={...t[r.id],data:e[i].data,isGhost:!1},this.log(`Replaced blob in a ghost file: ${r.name}, ${r.id}`)),t[r.id]=r,n.push(r)}catch(e){e.isRestriction||r.push(e)}if(this.setState({files:t}),n.forEach((e=>{this.emit("file-added",e)})),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.keys(n).forEach((e=>{this.log(`Added file: ${n[e].name}\n id: ${n[e].id}\n type: ${n[e].type}`)})),n.length>0&&qw(this,yx)[yx](),r.length>0){let e="Multiple errors occurred while adding files:\n";if(r.forEach((t=>{e+=`\n * ${t.message}`})),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(r,e);{const t=new Error(e);throw t.errors=r,t}}}removeFiles(e,t){const{files:n,currentUploads:r}=this.getState(),i={...n},o={...r},s=Object.create(null);function a(e){return void 0===s[e]}e.forEach((e=>{n[e]&&(s[e]=n[e],delete i[e])})),Object.keys(o).forEach((e=>{const t=r[e].fileIDs.filter(a);0!==t.length?o[e]={...r[e],fileIDs:t}:delete o[e]}));const l={currentUploads:o,files:i};0===Object.keys(i).length&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.calculateTotalProgress();const u=Object.keys(s);u.forEach((e=>{this.emit("file-removed",s[e],t)})),u.length>5?this.log(`Removed ${u.length} files`):this.log(`Removed files: ${u.join(", ")}`)}removeFile(e,t){void 0===t&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;const t=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const n={...e[t],isPaused:!0};e[t]=n})),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n})),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter((t=>e[t].error));if(t.forEach((t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n})),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});const n=qw(this,wx)[wx](t,{forceAllowNewUpload:!0});return qw(this,Dx)[Dx](n)}cancelAll(e){let{reason:t="user"}=void 0===e?{}:e;if(this.emit("cancel-all",{reason:t}),"user"===t){const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=qw(this,wx)[wx]([e],{forceAllowNewUpload:!0});return qw(this,Dx)[Dx](t)}reset(){this.cancelAll(...arguments)}logout(){this.iteratePlugins((e=>{e.provider&&e.provider.logout&&e.provider.logout()}))}calculateProgress(e,t){if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){const e=this.getFiles().filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess));if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter((e=>null!=e.progress.bytesTotal)),n=e.filter((e=>null==e.progress.bytesTotal));if(0===t.length){const t=100*e.length,r=n.reduce(((e,t)=>e+t.progress.percentage),0),i=Math.round(r/t*100);return void this.setState({totalProgress:i})}let r=t.reduce(((e,t)=>e+t.progress.bytesTotal),0);const i=r/t.length;r+=i*n.length;let o=0;t.forEach((e=>{o+=e.progress.bytesUploaded})),n.forEach((e=>{o+=i*(e.progress.percentage||0)/100}));let s=0===r?0:Math.round(o/r*100);s>100&&(s=100),this.setState({totalProgress:s}),this.emit("progress",s)}updateOnlineStatus(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if("function"!=typeof e){throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}.`+" Please verify that the plugin was imported and spelled correctly.")}const n=new e(this,t),r=n.id;if(!r)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const i=this.getPlugin(r);if(i){const e=`Already found a plugin named '${i.id}'. `+`Tried to use: '${r}'.\n`+"Uppy plugins must have unique `id` options. See https://uppy.io/docs/plugins/#id.";throw new Error(e)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),n.type in qw(this,ox)[ox]?qw(this,ox)[ox][n.type].push(n):qw(this,ox)[ox][n.type]=[n],n.install(),this}getPlugin(e){for(const t of Object.values(qw(this,ox)[ox])){const n=t.find((t=>t.id===e));if(null!=n)return n}}[Vw](e){return qw(this,ox)[ox][e]}iteratePlugins(e){Object.values(qw(this,ox)[ox]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=qw(this,ox)[ox][e.type],n=t.findIndex((t=>t.id===e.id));-1!==n&&t.splice(n,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}close(e){let{reason:t}=void 0===e?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),qw(this,ax)[ax](),this.iteratePlugins((e=>{this.removePlugin(e)})),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",qw(this,vx)[vx]),window.removeEventListener("offline",qw(this,vx)[vx]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){void 0===t&&(t="info"),void 0===n&&(n=3e3);const r="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout((()=>this.hideInfo()),n),this.emit("info-visible")}log(e,t){const{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e)}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?qw(this,Dx)[Dx](e):(qw(this,Mx)[Mx](e),Promise.reject(new Error("Nonexistent upload")))}[Ww](){return qw(this,wx)[wx](...arguments)}addResultData(e,t){if(!qw(this,xx)[xx](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:n}=this.getState(),r={...n[e],result:{...n[e].result,...t}};this.setState({currentUploads:{...n,[e]:r}})}upload(){var e;null!=(e=qw(this,ox)[ox].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const n=this.opts.onBeforeUpload(t);return!1===n?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(n&&"object"==typeof n&&(t=n,this.setState({files:t})),Promise.resolve().then((()=>qw(this,sx)[sx].validateMinNumberOfFiles(t))).catch((e=>{throw qw(this,px)[px](e),e})).then((()=>{if(!qw(this,fx)[fx](t))throw new $w.RestrictionError(this.i18n("missingRequiredMetaField"))})).catch((e=>{throw e})).then((()=>{const{currentUploads:e}=this.getState(),n=Object.values(e).flatMap((e=>e.fileIDs)),r=[];Object.keys(t).forEach((e=>{const t=this.getFile(e);t.progress.uploadStarted||-1!==n.indexOf(e)||r.push(t.id)}));const i=qw(this,wx)[wx](r);return qw(this,Dx)[Dx](i)})).catch((e=>{throw this.emit("error",e),this.log(e,"error"),e})))}}function Ex(e,t){const{message:n,details:r=""}=e;e.isRestriction?this.emit("restriction-failed",t,e):this.emit("error",e),this.info({message:n,details:r},"error",this.opts.infoTimeout),this.log(`${n} ${r}`.trim(),"error")}function Cx(e){const{missingFields:t,error:n}=qw(this,sx)[sx].getMissingRequiredMetaFields(e);return!(t.length>0)||(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(n.message),this.emit("restriction-failed",e,n),!1)}function Tx(e){let t=!0;for(const n of Object.values(e))qw(this,hx)[hx](n)||(t=!1);return t}function Ox(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new $w.RestrictionError(this.i18n("noMoreFilesAllowed"));throw qw(this,px)[px](t,e),t}}function Sx(e,t){const n=Zw(t),r=rx(n,t),i=ex(r).extension,o=Boolean(t.isRemote),s=tx({...t,type:n});if(this.checkIfFileAlreadyExists(s)){const e=new $w.RestrictionError(this.i18n("noDuplicates",{fileName:r}));throw qw(this,px)[px](e,t),e}const a=t.meta||{};a.name=r,a.type=n;const l=Number.isFinite(t.data.size)?t.data.size:null;let u={source:t.source||"",id:s,name:r,extension:i||"",meta:{...this.getState().meta,...a},type:n,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isRemote:o,remote:t.remote||"",preview:t.preview};const c=this.opts.onBeforeFileAdded(u,e);if(!1===c){const e=new $w.RestrictionError("Cannot add the file because onBeforeFileAdded returned false.");throw this.emit("restriction-failed",t,e),e}"object"==typeof c&&null!==c&&(u=c);try{const t=Object.keys(e).map((t=>e[t]));qw(this,sx)[sx].validate(u,t)}catch(e){throw qw(this,px)[px](e,u),e}return u}function Ax(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout((()=>{this.scheduledAutoProceed=null,this.upload().catch((e=>{e.isRestriction||this.log(e.stack||e.message||e)}))}),4))}function Nx(){const e=(e,t,n)=>{let r=e.message||"Unknown error";e.details&&(r+=` ${e.details}`),this.setState({error:r}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:n})};this.on("error",e),this.on("upload-error",((t,n,r)=>{if(e(n,t,r),"object"==typeof n&&n.message){const e=new Error(n.message);e.details=n.message,n.details&&(e.details+=` ${n.details}`),e.message=this.i18n("failedToUpload",{file:null==t?void 0:t.name}),qw(this,px)[px](e)}else qw(this,px)[px](n)})),this.on("upload",(()=>{this.setState({error:null})})),this.on("upload-started",(e=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("upload-progress",this.calculateProgress),this.on("upload-success",((e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...n,postprocess:qw(this,dx)[dx].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()})),this.on("preprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("preprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})})),this.on("postprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("postprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})})),this.on("restored",(()=>{this.calculateTotalProgress()})),this.on("dashboard:file-edit-complete",(e=>{e&&qw(this,hx)[hx](e)})),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",qw(this,vx)[vx]),window.addEventListener("offline",qw(this,vx)[vx]),setTimeout(qw(this,vx)[vx],3e3))}function _x(e,t){void 0===t&&(t={});const{forceAllowNewUpload:n=!1}=t,{allowNewUpload:r,currentUploads:i}=this.getState();if(!r&&!n)throw new Error("Cannot create a new upload: already uploading.");const o=(0,Uw.nanoid)();return this.emit("upload",{id:o,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...i,[o]:{fileIDs:e,step:0,result:{}}}}),o}function jx(e){const{currentUploads:t}=this.getState();return t[e]}function Ix(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function Lx(e){let{currentUploads:t}=this.getState(),n=t[e];const r=n.step||0,i=[...qw(this,ux)[ux],...qw(this,cx)[cx],...qw(this,dx)[dx]];try{for(let o=r;o<i.length&&n;o++){const r=i[o],s={...n,step:o};this.setState({currentUploads:{...t,[e]:s}}),await r(s.fileIDs,e),t=this.getState().currentUploads,n=t[e]}}catch(t){throw qw(this,Mx)[Mx](e),t}if(n){n.fileIDs.forEach((e=>{const t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)}));const r=n.fileIDs.map((e=>this.getFile(e))),i=r.filter((e=>!e.error)),o=r.filter((e=>e.error));await this.addResultData(e,{successful:i,failed:o,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let o;return n&&(o=n.result,this.emit("complete",o),qw(this,Mx)[Mx](e)),null==o&&this.log(`Not setting result for an upload that has been removed: ${e}`),o}kx.VERSION="2.3.1";var zx,Px,Fx,Rx,Bx,Ux,Hx,$x=kx,Vx={},Wx=[],qx=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Yx(e,t){for(var n in t)e[n]=t[n];return e}function Qx(e){var t=e.parentNode;t&&t.removeChild(e)}function Kx(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?zx.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Gx(e,s,r,i,null)}function Gx(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Fx:i};return null==i&&null!=Px.vnode&&Px.vnode(o),o}function Jx(e){return e.children}function Xx(e,t){this.props=e,this.context=t}function Zx(e,t){if(null==t)return e.__?Zx(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Zx(e):null}function eM(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return eM(e)}}function tM(e){(!e.__d&&(e.__d=!0)&&Bx.push(e)&&!nM.__r++||Ux!==Px.debounceRendering)&&((Ux=Px.debounceRendering)||setTimeout)(nM)}function nM(){for(var e;nM.__r=Bx.length;)e=Bx.sort((function(e,t){return e.__v.__b-t.__v.__b})),Bx=[],e.some((function(e){var t,n,r,i,o,s;e.__d&&(o=(i=(t=e).__v).__e,(s=t.__P)&&(n=[],(r=Yx({},i)).__v=i.__v+1,cM(s,i,r,t.__n,void 0!==s.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?Zx(i):o,i.__h),dM(n,i),i.__e!=o&&eM(i)))}))}function rM(e,t,n,r,i,o,s,a,l,u){var c,d,p,h,f,m,g,y=r&&r.__k||Wx,b=y.length;for(n.__k=[],c=0;c<t.length;c++)if(null!=(h=n.__k[c]=null==(h=t[c])||"boolean"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?Gx(null,h,null,null,h):Array.isArray(h)?Gx(Jx,{children:h},null,null,null):h.__b>0?Gx(h.type,h.props,h.key,null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(p=y[c])||p&&h.key==p.key&&h.type===p.type)y[c]=void 0;else for(d=0;d<b;d++){if((p=y[d])&&h.key==p.key&&h.type===p.type){y[d]=void 0;break}p=null}cM(e,h,p=p||Vx,i,o,s,a,l,u),f=h.__e,(d=h.ref)&&p.ref!=d&&(g||(g=[]),p.ref&&g.push(p.ref,null,h),g.push(d,h.__c||f,h)),null!=f?(null==m&&(m=f),"function"==typeof h.type&&h.__k===p.__k?h.__d=l=iM(h,l,e):l=oM(e,h,p,y,f,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=Zx(p))}for(n.__e=m,c=b;c--;)null!=y[c]&&("function"==typeof n.type&&null!=y[c].__e&&y[c].__e==n.__d&&(n.__d=Zx(r,c+1)),fM(y[c],y[c]));if(g)for(c=0;c<g.length;c++)hM(g[c],g[++c],g[++c])}function iM(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?iM(r,t,n):oM(n,r,r,i,r.__e,t));return t}function oM(e,t,n,r,i,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<r.length;l+=2)if(a==i)break e;e.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function sM(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||qx.test(t)?n:n+"px"}function aM(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||sM(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||sM(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?uM:lM,o):e.removeEventListener(t,o?uM:lM,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function lM(e){this.l[e.type+!1](Px.event?Px.event(e):e)}function uM(e){this.l[e.type+!0](Px.event?Px.event(e):e)}function cM(e,t,n,r,i,o,s,a,l){var u,c,d,p,h,f,m,g,y,b,v,w,x,M=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(u=Px.__b)&&u(t);try{e:if("function"==typeof M){if(g=t.props,y=(u=M.contextType)&&r[u.__c],b=u?y?y.props.value:u.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:("prototype"in M&&M.prototype.render?t.__c=c=new M(g,b):(t.__c=c=new Xx(g,b),c.constructor=M,c.render=mM),y&&y.sub(c),c.props=g,c.state||(c.state={}),c.context=b,c.__n=r,d=c.__d=!0,c.__h=[]),null==c.__s&&(c.__s=c.state),null!=M.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Yx({},c.__s)),Yx(c.__s,M.getDerivedStateFromProps(g,c.__s))),p=c.props,h=c.state,d)null==M.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==M.getDerivedStateFromProps&&g!==p&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(g,b),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(g,c.__s,b)||t.__v===n.__v){c.props=g,c.state=c.__s,t.__v!==n.__v&&(c.__d=!1),c.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),c.__h.length&&s.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(g,c.__s,b),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(p,h,f)}))}if(c.context=b,c.props=g,c.__v=t,c.__P=e,v=Px.__r,w=0,"prototype"in M&&M.prototype.render)c.state=c.__s,c.__d=!1,v&&v(t),u=c.render(c.props,c.state,c.context);else do{c.__d=!1,v&&v(t),u=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++w<25);c.state=c.__s,null!=c.getChildContext&&(r=Yx(Yx({},r),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(f=c.getSnapshotBeforeUpdate(p,h)),x=null!=u&&u.type===Jx&&null==u.key?u.props.children:u,rM(e,Array.isArray(x)?x:[x],t,n,r,i,o,s,a,l),c.base=t.__e,t.__h=null,c.__h.length&&s.push(c),m&&(c.__E=c.__=null),c.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=pM(n.__e,t,n,r,i,o,s,l);(u=Px.diffed)&&u(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),Px.__e(e,t,n)}}function dM(e,t){Px.__c&&Px.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Px.__e(e,t.__v)}}))}function pM(e,t,n,r,i,o,s,a){var l,u,c,d=n.props,p=t.props,h=t.type,f=0;if("svg"===h&&(i=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===h)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,p.is&&p),o=null,a=!1}if(null===h)d===p||a&&e.data===p||(e.data=p);else{if(o=o&&zx.call(e.childNodes),u=(d=n.props||Vx).dangerouslySetInnerHTML,c=p.dangerouslySetInnerHTML,!a){if(null!=o)for(d={},f=0;f<e.attributes.length;f++)d[e.attributes[f].name]=e.attributes[f].value;(c||u)&&(c&&(u&&c.__html==u.__html||c.__html===e.innerHTML)||(e.innerHTML=c&&c.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||aM(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||aM(e,o,t[o],n[o],r)}(e,p,d,i,a),c)t.__k=[];else if(f=t.props.children,rM(e,Array.isArray(f)?f:[f],t,n,r,i&&"foreignObject"!==h,o,s,o?o[0]:n.__k&&Zx(n,0),a),null!=o)for(f=o.length;f--;)null!=o[f]&&Qx(o[f]);a||("value"in p&&void 0!==(f=p.value)&&(f!==e.value||"progress"===h&&!f||"option"===h&&f!==d.value)&&aM(e,"value",f,d.value,!1),"checked"in p&&void 0!==(f=p.checked)&&f!==e.checked&&aM(e,"checked",f,d.checked,!1))}return e}function hM(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Px.__e(e,n)}}function fM(e,t,n){var r,i;if(Px.unmount&&Px.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||hM(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Px.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&fM(r[i],t,"function"!=typeof e.type);n||null==e.__e||Qx(e.__e),e.__e=e.__d=void 0}function mM(e,t,n){return this.constructor(e,n)}function gM(e,t,n){var r,i,o;Px.__&&Px.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],cM(t,e=(!r&&n||t).__k=Kx(Jx,null,[e]),i||Vx,Vx,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?zx.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),dM(o,e)}zx=Wx.slice,Px={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},Fx=0,Rx=function(e){return null!=e&&void 0===e.constructor},Xx.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Yx({},this.state),"function"==typeof e&&(e=e(Yx({},n),this.props)),e&&Yx(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),tM(this))},Xx.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),tM(this))},Xx.prototype.render=Jx,Bx=[],nM.__r=0,Hx=0;var yM=Object.freeze({__proto__:null,render:gM,hydrate:function e(t,n){gM(t,n,e)},createElement:Kx,h:Kx,Fragment:Jx,createRef:function(){return{current:null}},get isValidElement(){return Rx},Component:Xx,cloneElement:function(e,t,n){var r,i,o,s=Yx({},e.props);for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];return arguments.length>2&&(s.children=arguments.length>3?zx.call(arguments,2):n),Gx(e.type,s,r||e.key,i||e.ref,null)},createContext:function(e,t){var n={__c:t="__cC"+Hx++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(tM)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},toChildArray:function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){e(t,n)})):n.push(t)),n},get options(){return Px}}),bM=rc(yM);var vM=function(e){return(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE};const wM=vM;var xM=function(e,t){return void 0===t&&(t=document),"string"==typeof e?t.querySelector(e):wM(e)?e:null};var MM=function(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir};const DM=uw;var kM=class{constructor(e,t){void 0===t&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(),this.i18nInit()}i18nInit(){const e=new DM([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}},EM=bM;function CM(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var TM=0;function OM(e){return"__private_"+TM+++"_"+e}const SM=xM,AM=MM,NM=kM;var _M=OM("updateUI");class jM extends NM{constructor(){super(...arguments),Object.defineProperty(this,_M,{writable:!0,value:void 0})}mount(e,t){const n=t.id,r=SM(e);if(r){this.isTargetDOMEl=!0;const t=document.createElement("div");return t.classList.add("uppy-Root"),CM(this,_M)[_M]=function(e){let t=null,n=null;return function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=i,t||(t=Promise.resolve().then((()=>(t=null,e(...n))))),t}}((e=>{this.uppy.getPlugin(this.id)&&((0,EM.render)(this.render(e),t),this.afterUpdate())})),this.uppy.log(`Installing ${n} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),(0,EM.render)(this.render(this.uppy.getState()),t),this.el=t,r.appendChild(t),t.dir=this.opts.direction||AM(t)||"ltr",this.onMount(),this.el}let i;if("object"==typeof e&&e instanceof jM)i=e;else if("function"==typeof e){const t=e;this.uppy.iteratePlugins((e=>{e instanceof t&&(i=e)}))}if(i)return this.uppy.log(`Installing ${n} to ${i.id}`),this.parent=i,this.el=i.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${n}`);let o=`Invalid target option given to ${n}.`;throw o+="function"==typeof e?" The given target is not a Plugin class. "+"Please check that you're not specifying a React Component instead of a plugin. "+"If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: "+"run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. "+"Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. "+"(see https://github.com/transloadit/uppy/issues/1042)\n\n"+"If you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(o)}update(e){var t,n;null!=this.el&&(null==(t=(n=CM(this,_M))[_M])||t.call(n,e))}unmount(){var e;this.isTargetDOMEl&&(null==(e=this.el)||e.remove());this.onUnmount()}onMount(){}onUnmount(){}}var IM=jM;!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Uppy=t.UIPlugin=t.BasePlugin=void 0,Object.defineProperty(t,"debugLogger",{enumerable:!0,get:function(){return n.debugLogger}});var n=Fv;e.exports=$x;const r=IM;t.UIPlugin=r;const i=kM;t.BasePlugin=i;const o=$x;t.Uppy=o;const s=IM,a=kM;o.Uppy=o,o.UIPlugin=s,o.BasePlugin=a,o.debugLogger=n.debugLogger}(Pv,Pv.exports);var LM=nc(Pv.exports),zM={exports:{}},PM={},FM=Array.from,RM=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];var BM=function(e,t){if(t){const n=e.querySelector(`[data-uppy-paneltype="${t}"]`);if(n)return n}return e};Object.defineProperty(PM,"__esModule",{value:!0}),PM.forInline=function(e,t,n){null===t||WM(e,t,n)},PM.forModal=WM;const UM=FM,HM=RM,$M=BM;function VM(e,t){const n=t[0];n&&(n.focus(),e.preventDefault())}function WM(e,t,n){const r=$M(n,t),i=UM(r.querySelectorAll(HM)),o=i.indexOf(document.activeElement);!function(e){return e.contains(document.activeElement)}(r)?VM(e,i):e.shiftKey&&0===o?function(e,t){const n=t[t.length-1];n&&(n.focus(),e.preventDefault())}(e,i):e.shiftKey||o!==i.length-1||VM(e,i)}var qM={exports:{}};var YM=function(e){if(!e.bytesUploaded)return 0;const t=Date.now()-e.uploadStarted;return e.bytesUploaded/(t/1e3)};var QM=function(e){return e.bytesTotal-e.bytesUploaded},KM={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"},GM={};const JM=function(e){return{hours:Math.floor(e/3600)%24,minutes:Math.floor(e/60)%60,seconds:Math.floor(e%60)}};var XM=function(e){const t=JM(e);return`${0===t.hours?"":`${t.hours}h`}${0===t.minutes?"":`${0===t.hours?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`}${0!==t.hours?"":`${0===t.minutes?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`}`};Object.defineProperty(GM,"__esModule",{value:!0}),GM.CancelBtn=function(e){const{i18n:t,uppy:n}=e;return(0,ZM.h)("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>n.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},(0,ZM.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},(0,ZM.h)("g",{fill:"none",fillRule:"evenodd"},(0,ZM.h)("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),(0,ZM.h)("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))},GM.DoneBtn=function(e){const{i18n:t,doneButtonHandler:n}=e;return(0,ZM.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:n,"data-uppy-super-focusable":!0},t("done"))},GM.LoadingSpinner=sD,GM.PauseResumeButton=function(e){const{isAllPaused:t,i18n:n,isAllComplete:r,resumableUploads:i,uppy:o}=e,s=n(t?"resume":"pause");return(0,ZM.h)("button",{title:s,"aria-label":s,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:function(){return r?null:i?t?o.resumeAll():o.pauseAll():o.cancelAll()},"data-uppy-super-focusable":!0},(0,ZM.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},(0,ZM.h)("g",{fill:"none",fillRule:"evenodd"},(0,ZM.h)("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),(0,ZM.h)("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))},GM.ProgressBarComplete=function(e){const{i18n:t}=e;return(0,ZM.h)("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete")},(0,ZM.h)("div",{className:"uppy-StatusBar-status"},(0,ZM.h)("div",{className:"uppy-StatusBar-statusPrimary"},(0,ZM.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},(0,ZM.h)("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))},GM.ProgressBarError=function(e){const{error:t,i18n:n,complete:r,numUploads:i}=e;return(0,ZM.h)("div",{className:"uppy-StatusBar-content",title:n("uploadFailed")},(0,ZM.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},(0,ZM.h)("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),(0,ZM.h)("div",{className:"uppy-StatusBar-status"},(0,ZM.h)("div",{className:"uppy-StatusBar-statusPrimary"},n("uploadFailed"),(0,ZM.h)("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":n("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:function(){const e=`${n("uploadFailed")} \n\n ${t}`;alert(e)},type:"button"},"?")),(0,ZM.h)(lD,{i18n:n,complete:r,numUploads:i})))},GM.ProgressBarProcessing=function(e){const{progress:t}=e,{value:n,mode:r,message:i}=t,o=Math.round(100*n),s=`·`;return(0,ZM.h)("div",{className:"uppy-StatusBar-content"},(0,ZM.h)(sD,null),"determinate"===r?`${o}% ${s} `:"",i)},GM.ProgressBarUploading=function(e){const{i18n:t,supportsUploadProgress:n,totalProgress:r,showProgressDetails:i,isUploadStarted:o,isAllComplete:s,isAllPaused:a,newFiles:l,numUploads:u,complete:c,totalUploadedSize:d,totalSize:p,totalETA:h,startUpload:f}=e,m=l&&o;if(!o||s)return null;const g=t(a?"paused":"uploading");return(0,ZM.h)("div",{className:"uppy-StatusBar-content","aria-label":g,title:g},a?null:(0,ZM.h)(sD,null),(0,ZM.h)("div",{className:"uppy-StatusBar-status"},(0,ZM.h)("div",{className:"uppy-StatusBar-statusPrimary"},n?`${g}: ${r}%`:g),a||m||!i?null:n?(0,ZM.h)(cD,{numUploads:u,complete:c,totalUploadedSize:d,totalSize:p,totalETA:h,i18n:t}):(0,ZM.h)(lD,{i18n:t,complete:c,numUploads:u}),m?(0,ZM.h)(uD,{i18n:t,newFiles:l,startUpload:f}):null))},GM.ProgressDetails=aD,GM.RetryBtn=function(e){const{i18n:t,uppy:n}=e;return(0,ZM.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>n.retryAll(),"data-uppy-super-focusable":!0},(0,ZM.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},(0,ZM.h)("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),t("retry"))},GM.UploadBtn=function(e){const{newFiles:t,isUploadStarted:n,recoveredState:r,i18n:i,uploadState:o,isSomeGhost:s,startUpload:a}=e,l=eD("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":o===rD.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":s}),u=i(t&&n&&!r?"uploadXNewFiles":"uploadXFiles",{smart_count:t});return(0,ZM.h)("button",{type:"button",className:l,"aria-label":i("uploadXFiles",{smart_count:t}),onClick:a,disabled:s,"data-uppy-super-focusable":!0},u)};var ZM=bM;const eD=oc.exports,tD=Yv,nD=XM,rD=KM,iD=`·`,oD=()=>` ${iD} `;function sD(){return(0,ZM.h)("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},(0,ZM.h)("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function aD(e){const{numUploads:t,complete:n,totalUploadedSize:r,totalSize:i,totalETA:o,i18n:s}=e,a=t>1;return(0,ZM.h)("div",{className:"uppy-StatusBar-statusSecondary"},a&&s("filesUploadedOfTotal",{complete:n,smart_count:t}),(0,ZM.h)("span",{className:"uppy-StatusBar-additionalInfo"},a&&oD(),s("dataUploadedOfTotal",{complete:tD(r),total:tD(i)}),oD(),s("xTimeLeft",{time:nD(o)})))}function lD(e){const{i18n:t,complete:n,numUploads:r}=e;return(0,ZM.h)("div",{className:"uppy-StatusBar-statusSecondary"},t("filesUploadedOfTotal",{complete:n,smart_count:r}))}function uD(e){const{i18n:t,newFiles:n,startUpload:r}=e,i=eD("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return(0,ZM.h)("div",{className:"uppy-StatusBar-statusSecondary"},(0,ZM.h)("div",{className:"uppy-StatusBar-statusSecondaryHint"},t("xMoreFilesAdded",{smart_count:n})),(0,ZM.h)("button",{type:"button",className:i,"aria-label":t("uploadXFiles",{smart_count:n}),onClick:r},t("upload")))}const cD=Sw(aD,500,{leading:!0,trailing:!0});var dD=bM,pD=GM;const hD=oc.exports,fD=KM,mD=function(e){const t=[];let n,r;for(const{progress:i}of Object.values(e)){const{preprocess:e,postprocess:o}=i;null==r&&(e||o)&&({mode:n,message:r}=e||o),"determinate"===(null==e?void 0:e.mode)&&t.push(e.value),"determinate"===(null==o?void 0:o.mode)&&t.push(o.value)}return{mode:n,message:r,value:t.reduce(((e,n)=>e+n/t.length),0)}},{STATE_ERROR:gD,STATE_WAITING:yD,STATE_PREPROCESSING:bD,STATE_UPLOADING:vD,STATE_POSTPROCESSING:wD,STATE_COMPLETE:xD}=fD;var MD=function(e){const{newFiles:t,allowNewUpload:n,isUploadInProgress:r,isAllPaused:i,resumableUploads:o,error:s,hideUploadButton:a,hidePauseResumeButton:l,hideCancelButton:u,hideRetryButton:c,recoveredState:d,uploadState:p,totalProgress:h,files:f,supportsUploadProgress:m,hideAfterFinish:g,isSomeGhost:y,doneButtonHandler:b,isUploadStarted:v,i18n:w,startUpload:x,uppy:M,isAllComplete:D,showProgressDetails:k,numUploads:E,complete:C,totalSize:T,totalETA:O,totalUploadedSize:S}=e,A=function(){switch(p){case wD:case bD:{const e=mD(f);return"determinate"===e.mode?100*e.value:h}case gD:return null;case vD:return m?h:null;default:return h}}(),N=function(){if(d)return!1;switch(p){case yD:return a||0===t;case xD:return g;default:return!1}}(),_=null!=A?A:100,j=!s&&t&&!r&&!i&&n&&!a,I=!u&&p!==yD&&p!==xD,L=o&&!l&&p===vD,z=s&&!D&&!c,P=b&&p===xD,F=hD("uppy-StatusBar-progress",{"is-indeterminate":function(){switch(p){case wD:case bD:{const{mode:e}=mD(f);return"indeterminate"===e}case vD:return!m;default:return!1}}()}),R=hD("uppy-StatusBar",`is-${p}`,{"has-ghosts":y});return(0,dD.h)("div",{className:R,"aria-hidden":N},(0,dD.h)("div",{className:F,style:{width:`${_}%`},role:"progressbar","aria-label":`${_}%`,"aria-valuetext":`${_}%`,"aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":A}),(()=>{switch(p){case bD:case wD:return(0,dD.h)(pD.ProgressBarProcessing,{progress:mD(f)});case xD:return(0,dD.h)(pD.ProgressBarComplete,{i18n:w});case gD:return(0,dD.h)(pD.ProgressBarError,{error:s,i18n:w,numUploads:E,complete:C});case vD:return(0,dD.h)(pD.ProgressBarUploading,{i18n:w,supportsUploadProgress:m,totalProgress:h,showProgressDetails:k,isUploadStarted:v,isAllComplete:D,isAllPaused:i,newFiles:t,numUploads:E,complete:C,totalUploadedSize:S,totalSize:T,totalETA:O,startUpload:x});default:return null}})(),(0,dD.h)("div",{className:"uppy-StatusBar-actions"},d||j?(0,dD.h)(pD.UploadBtn,{newFiles:t,isUploadStarted:v,recoveredState:d,i18n:w,isSomeGhost:y,startUpload:x,uploadState:p}):null,z?(0,dD.h)(pD.RetryBtn,{i18n:w,uppy:M}):null,L?(0,dD.h)(pD.PauseResumeButton,{isAllPaused:i,i18n:w,isAllComplete:D,resumableUploads:o,uppy:M}):null,I?(0,dD.h)(pD.CancelBtn,{i18n:w,uppy:M}):null,P?(0,dD.h)(pD.DoneBtn,{i18n:w,doneButtonHandler:b}):null))},DD=Pv.exports;const kD=YM,ED=QM,CD=MM,TD=KM,OD=MD,SD={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function AD(e){const t=function(e){let t=0;return e.forEach((e=>{t+=kD(e.progress)})),t}(e);if(0===t)return 0;const n=e.reduce(((e,t)=>e+ED(t.progress)),0);return Math.round(n/t*10)/10}function ND(e,t,n,r){if(e&&!t)return TD.STATE_ERROR;if(t)return TD.STATE_COMPLETE;if(n)return TD.STATE_WAITING;let i=TD.STATE_WAITING;const o=Object.keys(r);for(let e=0;e<o.length;e++){const{progress:t}=r[o[e]];if(t.uploadStarted&&!t.uploadComplete)return TD.STATE_UPLOADING;t.preprocess&&i!==TD.STATE_UPLOADING&&(i=TD.STATE_PREPROCESSING),t.postprocess&&i!==TD.STATE_UPLOADING&&i!==TD.STATE_PREPROCESSING&&(i=TD.STATE_POSTPROCESSING)}return i}class _D extends DD.UIPlugin{constructor(e,t){super(e,t),this.startUpload=()=>{const{recoveredState:e}=this.uppy.getState();if(!e)return this.uppy.upload().catch((()=>{}));this.uppy.emit("restore-confirmed")},this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=SD;this.opts={target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null,...t},this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){const{capabilities:t,files:n,allowNewUpload:r,totalProgress:i,error:o,recoveredState:s}=e,{newFiles:a,startedFiles:l,completeFiles:u,inProgressNotPausedFiles:c,isUploadStarted:d,isAllComplete:p,isAllErrored:h,isAllPaused:f,isUploadInProgress:m,isSomeGhost:g}=this.uppy.getObjectOfFilesPerState(),y=s?Object.values(n):a,b=AD(c),v=!!t.resumableUploads,w=!1!==t.uploadProgress;let x=0,M=0;return l.forEach((e=>{x+=e.progress.bytesTotal||0,M+=e.progress.bytesUploaded||0})),OD({error:o,uploadState:ND(o,p,s,e.files||{}),allowNewUpload:r,totalProgress:i,totalSize:x,totalUploadedSize:M,isAllComplete:!1,isAllPaused:f,isAllErrored:h,isUploadStarted:d,isUploadInProgress:m,isSomeGhost:g,recoveredState:s,complete:u.length,newFiles:y.length,numUploads:l.length,totalETA:b,files:n,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:v,supportsUploadProgress:w,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish,isTargetDOMEl:this.isTargetDOMEl})}onMount(){const e=this.el;CD(e)||(e.dir="ltr")}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}_D.VERSION="2.2.1",qM.exports=_D;var jD={exports:{}},ID=bM;const LD=300;class zD extends ID.Component{constructor(){super(...arguments),this.ref=(0,ID.createRef)()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,LD)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,LD)}render(){const{children:e}=this.props;return(0,ID.h)("div",{className:"uppy-Informer-animated",ref:this.ref},e)}}var PD=zD,FD=bM;function RD(e,t){const n=e._ptgLinkedRefs||(e._ptgLinkedRefs={});return n[t]||(n[t]=n=>{e.refs[t]=n})}function BD(e){const t={};for(let o=0;o<e.length;o++)if(null!=e[o]){t[(n=e[o],r=o.toString(36),i=void 0,null!=(i=null==n?void 0:n.key)?i:r)]=e[o]}var n,r,i;return t}function UD(e,t){e=e||{},t=t||{};const n=n=>t.hasOwnProperty(n)?t[n]:e[n],r={};let i=[];for(const n in e)t.hasOwnProperty(n)?i.length&&(r[n]=i,i=[]):i.push(n);const o={};for(const e in t){if(r.hasOwnProperty(e))for(let t=0;t<r[e].length;t++){const i=r[e][t];o[r[e][t]]=n(i)}o[e]=n(e)}for(let e=0;e<i.length;e++)o[i[e]]=n(i[e]);return o}class HD extends FD.Component{constructor(e,t){super(e,t),this.refs={},this.state={children:BD((0,FD.toChildArray)((0,FD.toChildArray)(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){const e=this.state.children;for(const t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){const t=BD((0,FD.toChildArray)(e.children)||[]),n=this.state.children;let r;for(r in this.setState((e=>({children:UD(e.children,t)}))),t)if(t.hasOwnProperty(r)){const e=n&&n.hasOwnProperty(r);t[r]&&e&&this.currentlyTransitioningKeys[r]?(this.keysToEnter.push(r),this.keysToAbortLeave.push(r)):!t[r]||e||this.currentlyTransitioningKeys[r]||this.keysToEnter.push(r)}for(r in n)if(n.hasOwnProperty(r)){const e=t&&t.hasOwnProperty(r);!n[r]||e||this.currentlyTransitioningKeys[r]||this.keysToLeave.push(r)}}componentDidUpdate(){const{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);const{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){const t=this.keysToAbortLeave.indexOf(e);-1!==t&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){const t=this.refs[e];t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const n=BD((0,FD.toChildArray)(this.props.children)||[]);n&&n.hasOwnProperty(e)||this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){const t=this.refs[e];t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const n=BD((0,FD.toChildArray)(this.props.children)||[]);n&&n.hasOwnProperty(e)||this.performLeave(e)}performLeave(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;const t=this.refs[e];t.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const n=BD((0,FD.toChildArray)(this.props.children)||[]);if(n&&n.hasOwnProperty(e))this.performEnter(e);else{const t=(r={},i=this.state.children,Object.assign(r,i));delete t[e],this.setState({children:t})}var r,i}render(e,t){let{childFactory:n,transitionLeave:r,transitionName:i,transitionAppear:o,transitionEnter:s,transitionLeaveTimeout:a,transitionEnterTimeout:l,transitionAppearTimeout:u,component:c,...d}=e,{children:p}=t;const h=[];for(const e in p)if(p.hasOwnProperty(e)){const t=p[e];if(t){const r=RD(this,e),i=(0,FD.cloneElement)(n(t),{ref:r,key:e});h.push(i)}}return(0,FD.h)(c,d,h)}}HD.defaultProps={component:"span",childFactory:e=>e};var $D=bM,VD=Pv.exports;const WD=PD,qD=HD;class YD extends VD.UIPlugin{constructor(e,t){super(e,t),this.render=e=>(0,$D.h)("div",{className:"uppy uppy-Informer"},(0,$D.h)(qD,null,e.info.map((e=>(0,$D.h)(WD,{key:e.message},(0,$D.h)("p",{role:"alert"},e.message," ",e.details&&(0,$D.h)("span",{"aria-label":e.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${e.message} \n\n ${e.details}`)},"?"))))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer";this.opts={...t}}install(){const{target:e}=this.opts;e&&this.mount(e,this)}}YD.VERSION="2.1.0",jD.exports=YD;var QD={exports:{}};!function(e){function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n="undefined"!=typeof self?self:tc;const r="undefined"!=typeof navigator,i=r&&"undefined"==typeof HTMLImageElement,o=!(void 0===tc||"undefined"==typeof process||!process.versions||!process.versions.node),s=n.Buffer,a=!!s,l=e=>void 0!==e;function u(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(l).length)}function c(e){let t=new Error(e);throw delete t.stack,t}function d(e){let t=function(e){let t=0;return e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048}(e);return e.jfif.enabled&&(t+=50),e.xmp.enabled&&(t+=2e4),e.iptc.enabled&&(t+=14e3),e.icc.enabled&&(t+=6e3),t}const p=e=>String.fromCharCode.apply(null,e),h="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;class f{static from(e,t){return e instanceof this&&e.le===t?e:new f(e,void 0,void 0,t)}constructor(e,t=0,n,r){if("boolean"==typeof r&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===n&&(n=e.byteLength-t);let r=new DataView(e,t,n);this._swapDataView(r)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof f){void 0===n&&(n=e.byteLength-t),(t+=e.byteOffset)+n>e.byteOffset+e.byteLength&&c("Creating view outside of available memory in ArrayBuffer");let r=new DataView(e.buffer,t,n);this._swapDataView(r)}else if("number"==typeof e){let t=new DataView(new ArrayBuffer(e));this._swapDataView(t)}else c("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,n=f){return e instanceof DataView||e instanceof f?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||c("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new n(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new f(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return n=this.getUint8Array(e,t),h?h.decode(n):a?Buffer.from(n).toString("utf8"):decodeURIComponent(escape(p(n)));var n}getLatin1String(e=0,t=this.byteLength){let n=this.getUint8Array(e,t);return p(n)}getUnicodeString(e=0,t=this.byteLength){const n=[];for(let r=0;r<t&&e+r<this.byteLength;r+=2)n.push(this.getUint16(e+r));return p(n)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,n){switch(t){case 1:return this.getUint8(e,n);case 2:return this.getUint16(e,n);case 4:return this.getUint32(e,n);case 8:return this.getUint64&&this.getUint64(e,n)}}getUint(e,t,n){switch(t){case 8:return this.getUint8(e,n);case 16:return this.getUint16(e,n);case 32:return this.getUint32(e,n);case 64:return this.getUint64&&this.getUint64(e,n)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function m(e,t){c(`${e} '${t}' was not loaded, try using full build of exifr.`)}class g extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||m(this.kind,e),t&&(e in t||function(e,t){c(`Unknown ${e} '${t}'.`)}(this.kind,e),t[e].enabled||m(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var y=new g("file parser"),b=new g("segment parser"),v=new g("file reader");let w=n.fetch;const x="Invalid input argument";function M(e,t){return(n=e).startsWith("data:")||n.length>1e4?k(e,t,"base64"):o&&e.includes("://")?D(e,t,"url",E):o?k(e,t,"fs"):r?D(e,t,"url",E):void c(x);var n}async function D(e,t,n,r){return v.has(n)?k(e,t,n):r?async function(e,t){let n=await t(e);return new f(n)}(e,r):void c(`Parser ${n} is not loaded`)}async function k(e,t,n){let r=new(v.get(n))(e,t);return await r.read(),r}const E=e=>w(e).then((e=>e.arrayBuffer())),C=e=>new Promise(((t,n)=>{let r=new FileReader;r.onloadend=()=>t(r.result||new ArrayBuffer),r.onerror=n,r.readAsArrayBuffer(e)}));class T extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}}function O(e,t,n){let r=new T;for(let[e,t]of n)r.set(e,t);if(Array.isArray(t))for(let n of t)e.set(n,r);else e.set(t,r);return r}function S(e,t,n){let r,i=e.get(t);for(r of n)i.set(r[0],r[1])}const A=new Map,N=new Map,_=new Map,j=37500,I=37510,L=33723,z=34675,P=34665,F=34853,R=40965,B=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],U=["jfif","xmp","icc","iptc","ihdr"],H=["tiff",...U],$=["ifd0","ifd1","exif","gps","interop"],V=[...H,...$],W=["makerNote","userComment"],q=["translateKeys","translateValues","reviveValues","multiSegment"],Y=[...q,"sanitize","mergeOutput","silentErrors"];class Q{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class K extends Q{get needed(){return this.enabled||this.deps.size>0}constructor(e,n,r,i){if(super(),t(this,"enabled",!1),t(this,"skip",new Set),t(this,"pick",new Set),t(this,"deps",new Set),t(this,"translateKeys",!1),t(this,"translateValues",!1),t(this,"reviveValues",!1),this.key=e,this.enabled=n,this.parse=this.enabled,this.applyInheritables(i),this.canBeFiltered=$.includes(e),this.canBeFiltered&&(this.dict=A.get(e)),void 0!==r)if(Array.isArray(r))this.parse=this.enabled=!0,this.canBeFiltered&&r.length>0&&this.translateTagSet(r,this.pick);else if("object"==typeof r){if(this.enabled=!0,this.parse=!1!==r.parse,this.canBeFiltered){let{pick:e,skip:t}=r;e&&e.length>0&&this.translateTagSet(e,this.pick),t&&t.length>0&&this.translateTagSet(t,this.skip)}this.applyInheritables(r)}else!0===r||!1===r?this.parse=this.enabled=r:c(`Invalid options argument: ${r}`)}applyInheritables(e){let t,n;for(t of q)n=e[t],void 0!==n&&(this[t]=n)}translateTagSet(e,t){if(this.dict){let n,r,{tagKeys:i,tagValues:o}=this.dict;for(n of e)"string"==typeof n?(r=o.indexOf(n),-1===r&&(r=i.indexOf(Number(n))),-1!==r&&t.add(Number(i[r]))):t.add(n)}else for(let n of e)t.add(n)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,te(this.pick,this.deps)):this.enabled&&this.pick.size>0&&te(this.pick,this.deps)}}var G={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},J=new Map;class X extends Q{static useCached(e){let t=J.get(e);return void 0!==t||(t=new this(e),J.set(e,t)),t}constructor(e){super(),!0===e?this.setupFromTrue():void 0===e?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):"object"==typeof e?this.setupFromObject(e):c(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=r?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of B)this[e]=G[e];for(e of Y)this[e]=G[e];for(e of W)this[e]=G[e];for(e of V)this[e]=new K(e,G[e],void 0,this)}setupFromTrue(){let e;for(e of B)this[e]=G[e];for(e of Y)this[e]=G[e];for(e of W)this[e]=!0;for(e of V)this[e]=new K(e,!0,void 0,this)}setupFromArray(e){let t;for(t of B)this[t]=G[t];for(t of Y)this[t]=G[t];for(t of W)this[t]=G[t];for(t of V)this[t]=new K(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,$)}setupFromObject(e){let t;for(t of($.ifd0=$.ifd0||$.image,$.ifd1=$.ifd1||$.thumbnail,Object.assign(this,e),B))this[t]=ee(e[t],G[t]);for(t of Y)this[t]=ee(e[t],G[t]);for(t of W)this[t]=ee(e[t],G[t]);for(t of H)this[t]=new K(t,G[t],e[t],this);for(t of $)this[t]=new K(t,G[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,$,V),!0===e.tiff?this.batchEnableWithBool($,!0):!1===e.tiff?this.batchEnableWithUserValue($,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,$):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,$)}batchEnableWithBool(e,t){for(let n of e)this[n].enabled=t}batchEnableWithUserValue(e,t){for(let n of e){let e=t[n];this[n].enabled=!1!==e&&void 0!==e}}setupGlobalFilters(e,t,n,r=n){if(e&&e.length){for(let e of r)this[e].enabled=!1;let t=Z(e,n);for(let[e,n]of t)te(this[e].pick,n),this[e].enabled=!0}else if(t&&t.length){let e=Z(t,n);for(let[t,n]of e)te(this[t].skip,n)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:n,iptc:r,icc:i}=this;this.makerNote?t.deps.add(j):t.skip.add(j),this.userComment?t.deps.add(I):t.skip.add(I),n.enabled||e.skip.add(700),r.enabled||e.skip.add(L),i.enabled||e.skip.add(z)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:n,interop:r}=this;r.needed&&(t.deps.add(R),e.deps.add(R)),t.needed&&e.deps.add(P),n.needed&&e.deps.add(F),this.tiff.enabled=$.some((e=>!0===this[e].enabled))||this.makerNote||this.userComment;for(let e of $)this[e].finalizeFilters()}get onlyTiff(){return!U.map((e=>this[e].enabled)).some((e=>!0===e))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of H)this[e].enabled&&!b.has(e)&&m("segment parser",e)}}function Z(e,t){let n,r,i,o,s=[];for(i of t){for(o of(n=A.get(i),r=[],n))(e.includes(o[0])||e.includes(o[1]))&&r.push(o[0]);r.length&&s.push([i,r])}return s}function ee(e,t){return void 0!==e?e:void 0!==t?t:void 0}function te(e,t){for(let n of t)e.add(n)}t(X,"default",G);class ne{constructor(e){t(this,"parsers",{}),t(this,"output",{}),t(this,"errors",[]),t(this,"pushToErrors",(e=>this.errors.push(e))),this.options=X.useCached(e)}async read(e){this.file=await function(e,t){return"string"==typeof e?M(e,t):r&&!i&&e instanceof HTMLImageElement?M(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new f(e):r&&e instanceof Blob?D(e,t,"blob",C):void c(x)}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[n,r]of y)if(r.canHandle(e,t))return this.fileParser=new r(this.options,this.file,this.parsers),e[n]=!0;this.file.close&&this.file.close(),c("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),u(n=e)?void 0:n;var n}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async t=>{let n=await t.parse();t.assignToOutput(e,n)}));this.options.silentErrors&&(t=t.map((e=>e.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,n=b.get("tiff",e);var r;if(t.tiff?r={start:0,type:"tiff"}:t.jpeg&&(r=await this.fileParser.getOrFindSegment("tiff")),void 0===r)return;let i=await this.fileParser.ensureSegmentChunk(r),o=this.parsers.tiff=new n(i,e,t),s=await o.extractThumbnail();return t.close&&t.close(),s}}async function re(e,t){let n=new ne(t);return await n.read(e),n.parse()}var ie=Object.freeze({__proto__:null,parse:re,Exifr:ne,fileParsers:y,segmentParsers:b,fileReaders:v,tagKeys:A,tagValues:N,tagRevivers:_,createDictionary:O,extendDictionary:S,fetchUrlAsArrayBuffer:E,readBlobAsArrayBuffer:C,chunkedProps:B,otherSegments:U,segments:H,tiffBlocks:$,segmentsAndBlocks:V,tiffExtractables:W,inheritables:q,allFormatters:Y,Options:X});class oe{static findPosition(e,t){let n=e.getUint16(t+2)+2,r="function"==typeof this.headerLength?this.headerLength(e,t,n):this.headerLength,i=t+r,o=n-r;return{offset:t,length:n,headerLength:r,start:i,size:o,end:i+o}}static parse(e,t={}){return new this(e,new X({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof f?e:new f(e)}constructor(e,n={},r){t(this,"errors",[]),t(this,"raw",new Map),t(this,"handleError",(e=>{if(!this.options.silentErrors)throw e;this.errors.push(e.message)})),this.chunk=this.normalizeInput(e),this.file=r,this.type=this.constructor.type,this.globalOptions=this.options=n,this.localOptions=n[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let n=_.get(t),r=N.get(t),i=A.get(t),o=this.options[t],s=o.reviveValues&&!!n,a=o.translateValues&&!!r,l=o.translateKeys&&!!i,u={};for(let[t,o]of e)s&&n.has(t)?o=n.get(t)(o):a&&r.has(t)&&(o=this.translateValue(o,r.get(t))),l&&i.has(t)&&(t=i.get(t)||t),u[t]=o;return u}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,n){if(this.globalOptions.mergeOutput)return Object.assign(e,n);e[t]?Object.assign(e[t],n):e[t]=n}}function se(e){return 192===e||194===e||196===e||219===e||221===e||218===e||254===e}function ae(e){return e>=224&&e<=239}function le(e,t,n){for(let[r,i]of b)if(i.canHandle(e,t,n))return r}t(oe,"headerLength",4),t(oe,"type",void 0),t(oe,"multiSegment",!1),t(oe,"canHandle",(()=>!1));class ue extends class{constructor(e,n,r){t(this,"errors",[]),t(this,"ensureSegmentChunk",(async e=>{let t=e.start,n=e.size||65536;if(this.file.chunked)if(this.file.available(t,n))e.chunk=this.file.subarray(t,n);else try{e.chunk=await this.file.readChunk(t,n)}catch(t){c(`Couldn't read segment: ${JSON.stringify(e)}. ${t.message}`)}else this.file.byteLength>t+n?e.chunk=this.file.subarray(t,n):void 0===e.size?e.chunk=this.file.subarray(t):c("Segment unreachable: "+JSON.stringify(e));return e.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=n,this.parsers=r}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let n=new(b.get(e))(t,this.options,this.file);return this.parsers[e]=n}createParsers(e){for(let t of e){let{type:e,chunk:n}=t,r=this.options[e];if(r&&r.enabled){let t=this.parsers[e];t&&t.append||t||this.createParser(e,n)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),t(this,"appSegments",[]),t(this,"jpegSegments",[]),t(this,"unknownSegments",[])}static canHandle(e,t){return 65496===t}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){!0===e?(this.findAll=!0,this.wanted=new Set(b.keyList())):(e=void 0===e?b.keyList().filter((e=>this.options[e].enabled)):e.filter((e=>this.options[e].enabled&&b.has(e))),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:n,findAll:r,wanted:i,remaining:o}=this;if(!r&&this.file.chunked&&(r=Array.from(i).some((e=>{let t=b.get(e),n=this.options[e];return t.multiSegment&&n.multiSegment})),r&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,n.byteLength),!this.options.onlyTiff&&n.chunked){let t=!1;for(;o.size>0&&!t&&(n.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:r}=n,i=this.appSegments.some((e=>!this.file.available(e.offset||e.start,e.length||e.size)));if(t=e>r&&!i?!await n.readNextChunk(e):!await n.readNextChunk(r),void 0===(e=this.findAppSegmentsInRange(e,n.byteLength)))return}}}findAppSegmentsInRange(e,t){t-=2;let n,r,i,o,s,a,{file:l,findAll:u,wanted:c,remaining:d,options:p}=this;for(;e<t;e++)if(255===l.getUint8(e))if(n=l.getUint8(e+1),ae(n)){if(r=l.getUint16(e+2),i=le(l,e,r),i&&c.has(i)&&(o=b.get(i),s=o.findPosition(l,e),a=p[i],s.type=i,this.appSegments.push(s),!u&&(o.multiSegment&&a.multiSegment?(this.unfinishedMultiSegment=s.chunkNumber<s.chunkCount,this.unfinishedMultiSegment||d.delete(i)):d.delete(i),0===d.size)))break;p.recordUnknownSegments&&(s=oe.findPosition(l,e),s.marker=n,this.unknownSegments.push(s)),e+=r+1}else if(se(n)){if(r=l.getUint16(e+2),218===n&&!1!==p.stopAfterSos)return;p.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:n}),e+=r+1}return e}mergeMultiSegments(){if(!this.appSegments.some((e=>e.multiSegment)))return;let e=function(e,t){let n,r,i,o=new Map;for(let s=0;s<e.length;s++)n=e[s],r=n[t],o.has(r)?i=o.get(r):o.set(r,i=[]),i.push(n);return Array.from(o)}(this.appSegments,"type");this.mergedAppSegments=e.map((([e,t])=>{let n=b.get(e,this.options);return n.handleMultiSegments?{type:e,chunk:n.handleMultiSegments(t)}:t[0]}))}getSegment(e){return this.appSegments.find((t=>t.type===e))}async getOrFindSegment(e){let t=this.getSegment(e);return void 0===t&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}t(ue,"type","jpeg"),y.set("jpeg",ue);const ce=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class de extends oe{parseHeader(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,n=new Map){let{pick:r,skip:i}=this.options[t];r=new Set(r);let o=r.size>0,s=0===i.size,a=this.chunk.getUint16(e);e+=2;for(let l=0;l<a;l++){let a=this.chunk.getUint16(e);if(o){if(r.has(a)&&(n.set(a,this.parseTag(e,a,t)),r.delete(a),0===r.size))break}else!s&&i.has(a)||n.set(a,this.parseTag(e,a,t));e+=12}return n}parseTag(e,t,n){let{chunk:r}=this,i=r.getUint16(e+2),o=r.getUint32(e+4),s=ce[i];if(s*o<=4?e+=8:e=r.getUint32(e+8),(i<1||i>13)&&c(`Invalid TIFF value type. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${i}, offset ${e}`),e>r.byteLength&&c(`Invalid TIFF value offset. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${i}, offset ${e} is outside of chunk size ${r.byteLength}`),1===i)return r.getUint8Array(e,o);if(2===i)return""===(a=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(a=r.getString(e,o)).trim())?void 0:a;var a;if(7===i)return r.getUint8Array(e,o);if(1===o)return this.parseTagValue(i,e);{let t=new(function(e){switch(e){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:case 10:default:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 11:return Float32Array;case 12:return Float64Array}}(i))(o),n=s;for(let r=0;r<o;r++)t[r]=this.parseTagValue(i,e),e+=n;return t}}parseTagValue(e,t){let{chunk:n}=this;switch(e){case 1:return n.getUint8(t);case 3:return n.getUint16(t);case 4:case 13:return n.getUint32(t);case 5:return n.getUint32(t)/n.getUint32(t+4);case 6:return n.getInt8(t);case 8:return n.getInt16(t);case 9:return n.getInt32(t);case 10:return n.getInt32(t)/n.getInt32(t+4);case 11:return n.getFloat(t);case 12:return n.getDouble(t);default:c(`Invalid tiff type ${e}`)}}}class pe extends de{static canHandle(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}findIfd0Offset(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(void 0===this.ifd1Offset){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let n=new Map;return this[t]=n,this.parseTags(e,t,n),n}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&c("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&c(`IFD0 offset points to outside of file.\nthis.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,d(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return 0!==t.size?(this.exifOffset=t.get(P),this.interopOffset=t.get(R),this.gpsOffset=t.get(F),this.xmp=t.get(700),this.iptc=t.get(L),this.icc=t.get(z),this.options.sanitize&&(t.delete(P),t.delete(R),t.delete(F),t.delete(700),t.delete(L),t.delete(z)),t):void 0}async parseExifBlock(){if(this.exif)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.exifOffset)return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,d(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(R)),this.makerNote=e.get(j),this.userComment=e.get(I),this.options.sanitize&&(e.delete(R),e.delete(j),e.delete(I)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let n=e.get(t);n&&1===n.length&&e.set(t,n[0])}async parseGpsBlock(){if(this.gps)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.gpsOffset)return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",he(...e.get(2),e.get(1))),e.set("longitude",he(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),void 0!==this.interopOffset||this.exif||await this.parseExifBlock(),void 0!==this.interopOffset))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),void 0===this.ifd1)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,n,r={};for(t of $)if(e=this[t],!u(e))if(n=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if("ifd1"===t)continue;Object.assign(r,n)}else r[t]=n;return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[n,r]of Object.entries(t))this.assignObjectToOutput(e,n,r)}}function he(e,t,n,r){var i=e+t/60+n/3600;return"S"!==r&&"W"!==r||(i*=-1),i}t(pe,"type","tiff"),t(pe,"headerLength",10),b.set("tiff",pe);var fe=Object.freeze({__proto__:null,default:ie,Exifr:ne,fileParsers:y,segmentParsers:b,fileReaders:v,tagKeys:A,tagValues:N,tagRevivers:_,createDictionary:O,extendDictionary:S,fetchUrlAsArrayBuffer:E,readBlobAsArrayBuffer:C,chunkedProps:B,otherSegments:U,segments:H,tiffBlocks:$,segmentsAndBlocks:V,tiffExtractables:W,inheritables:q,allFormatters:Y,Options:X,parse:re});const me={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},ge=Object.assign({},me,{firstChunkSize:4e4,gps:[1,2,3,4]}),ye=Object.assign({},me,{tiff:!1,ifd1:!0,mergeOutput:!1}),be=Object.assign({},me,{firstChunkSize:4e4,ifd0:[274]});async function ve(e){let t=new ne(be);await t.read(e);let n=await t.parse();if(n&&n.ifd0)return n.ifd0[274]}const we=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}});if(e.rotateCanvas=!0,e.rotateCss=!0,"object"==typeof navigator){let t=navigator.userAgent;if(t.includes("iPad")||t.includes("iPhone")){let n=t.match(/OS (\d+)_(\d+)/);if(n){let[,t,r]=n,i=Number(t)+.1*Number(r);e.rotateCanvas=i<13.4,e.rotateCss=!1}}else if(t.includes("OS X 10")){let[,n]=t.match(/OS X 10[_.](\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<15}if(t.includes("Chrome/")){let[,n]=t.match(/Chrome\/(\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<81}else if(t.includes("Firefox/")){let[,n]=t.match(/Firefox\/(\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<77}}class xe extends f{constructor(...e){super(...e),t(this,"ranges",new Me),0!==this.byteLength&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,n){if(0===e&&0===this.byteLength&&n){let e=new DataView(n.buffer||n,n.byteOffset,n.byteLength);this._swapDataView(e)}else{let n=e+t;if(n>this.byteLength){let{dataView:e}=this._extend(n);this._swapDataView(e)}}}_extend(e){let t;t=a?s.allocUnsafe(e):new Uint8Array(e);let n=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:n}}subarray(e,t,n=!1){return t=t||this._lengthToEnd(e),n&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,n=!1){n&&this._tryExtend(t,e.byteLength,e);let r=super.set(e,t);return this.ranges.add(t,r.byteLength),r}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}}class Me{constructor(){t(this,"list",[])}get length(){return this.list.length}add(e,t,n=0){let r=e+t,i=this.list.filter((t=>De(e,t.offset,r)||De(e,t.end,r)));if(i.length>0){e=Math.min(e,...i.map((e=>e.offset))),r=Math.max(r,...i.map((e=>e.end))),t=r-e;let n=i.shift();n.offset=e,n.length=t,n.end=r,this.list=this.list.filter((e=>!i.includes(e)))}else this.list.push({offset:e,length:t,end:r})}available(e,t){let n=e+t;return this.list.some((t=>t.offset<=e&&n<=t.end))}}function De(e,t,n){return e<=t&&t<=n}class ke extends xe{constructor(e,n){super(0),t(this,"chunksRead",0),this.input=e,this.options=n}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,n=await this.readChunk(e,t);return!!n&&n.byteLength===t}async readChunk(e,t){if(this.chunksRead++,0!==(t=this.safeWrapAddress(e,t)))return this._readChunk(e,t)}safeWrapAddress(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return void 0!==this.size&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}v.set("blob",class extends ke{async readWhole(){this.chunked=!1;let e=await C(this.input);this._swapArrayBuffer(e)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(e,t){let n=t?e+t:void 0,r=this.input.slice(e,n),i=await C(r);return this.set(i,e,!0)}}),e.Exifr=ne,e.Options=X,e.allFormatters=Y,e.chunkedProps=B,e.createDictionary=O,e.default=fe,e.extendDictionary=S,e.fetchUrlAsArrayBuffer=E,e.fileParsers=y,e.fileReaders=v,e.gps=async function(e){let t=new ne(ge);await t.read(e);let n=await t.parse();if(n&&n.gps){let{latitude:e,longitude:t}=n.gps;return{latitude:e,longitude:t}}},e.gpsOnlyOptions=ge,e.inheritables=q,e.orientation=ve,e.orientationOnlyOptions=be,e.otherSegments=U,e.parse=re,e.readBlobAsArrayBuffer=C,e.rotation=async function(t){let n=await ve(t);return Object.assign({canvas:e.rotateCanvas,css:e.rotateCss},we[n])},e.rotations=we,e.segmentParsers=b,e.segments=H,e.segmentsAndBlocks=V,e.tagKeys=A,e.tagRevivers=_,e.tagValues=N,e.thumbnail=async function(e){let t=new ne(ye);await t.read(e);let n=await t.extractThumbnail();return n&&a?s.from(n):n},e.thumbnailOnlyOptions=ye,e.thumbnailUrl=async function(e){let t=await this.thumbnail(e);if(void 0!==t){let e=new Blob([t]);return URL.createObjectURL(e)}},e.tiffBlocks=$,e.tiffExtractables=W,Object.defineProperty(e,"__esModule",{value:!0})}(QD.exports);const KD=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;var GD=function(e,t,n){var r,i;const o=KD.exec(e),s=null!=(r=null!=(i=t.mimeType)?i:null==o?void 0:o[1])?r:"plain/text";let a;if(null!=o[2]){const e=atob(decodeURIComponent(o[3])),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);a=[t]}else a=[decodeURIComponent(o[3])];return n?new File(a,t.name||"",{type:s}):new Blob(a,{type:s})};var JD=Pv.exports,XD=QD.exports;const ZD=GD,ek=function(e){return e.startsWith("blob:")},tk=function(e){return!!e&&/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e)},nk={strings:{generatingThumbnails:"Generating thumbnails..."}};class rk extends JD.UIPlugin{constructor(e,t){super(e,t),this.onFileAdded=e=>{!e.preview&&e.data&&tk(e.type)&&!e.isRemote&&this.addToQueue(e.id)},this.onCancelRequest=e=>{const t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1)},this.onFileRemoved=e=>{const t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1),e.preview&&ek(e.preview)&&URL.revokeObjectURL(e.preview)},this.onRestored=()=>{this.uppy.getFiles().filter((e=>e.isRestored)).forEach((e=>{e.preview&&!ek(e.preview)||this.addToQueue(e.id)}))},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=e=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})}));const t=()=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-complete",t)}))};return new Promise((e=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",(()=>{t(),e()})):(t(),e())}))},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType||"image/jpeg",this.defaultLocale=nk;if(this.opts={thumbnailWidth:null,thumbnailHeight:null,waitForThumbnailsBeforeUpload:!1,lazy:!1,...t},this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,n){const r=URL.createObjectURL(e.data),i=new Promise(((e,t)=>{const n=new Image;n.src=r,n.addEventListener("load",(()=>{URL.revokeObjectURL(r),e(n)})),n.addEventListener("error",(e=>{URL.revokeObjectURL(r),t(e.error||new Error("Could not create thumbnail"))}))})),o=(0,XD.rotation)(e.data).catch((()=>1));return Promise.all([i,o]).then((e=>{let[r,i]=e;const o=this.getProportionalDimensions(r,t,n,i.deg),s=this.rotateImage(r,i),a=this.resizeImage(s,o.width,o.height);return this.canvasToBlob(a,this.thumbnailType,80)})).then((e=>URL.createObjectURL(e)))}getProportionalDimensions(e,t,n,r){let i=e.width/e.height;return 90!==r&&270!==r||(i=e.height/e.width),null!=t?{width:t,height:Math.round(t/i)}:null!=n?{width:Math.round(n*i),height:n}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/i)}}resizeImage(e,t,n){let r=this.protect(e),i=Math.ceil(Math.log2(r.width/t));i<1&&(i=1);let o=t*2**(i-1),s=n*2**(i-1);const a=2;for(;i--;){const e=document.createElement("canvas");e.width=o,e.height=s,e.getContext("2d").drawImage(r,0,0,o,s),r=e,o=Math.round(o/a),s=Math.round(s/a)}return r}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){const e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch((()=>{})).then((()=>this.processQueue())):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return tk(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then((t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)})).catch((t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)})):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}}rk.VERSION="2.2.0";var ik=rk;rk.prototype.canvasToBlob=function(e,t,n){try{e.getContext("2d").getImageData(0,0,1,1)}catch(e){if(18===e.code)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise((r=>{e.toBlob(r,t,n)})).then((e=>{if(null===e)throw new Error("cannot read image, probably an svg with external resources");return e})):Promise.resolve().then((()=>ZD(e.toDataURL(t,n),{}))).then((e=>{if(null===e)throw new Error("could not extract blob, probably an old browser");return e}))},rk.prototype.protect=function(e){const t=e.width/e.height,n=5e6,r=4096;let i=Math.floor(Math.sqrt(n*t)),o=Math.floor(n/Math.sqrt(n*t));if(i>r&&(i=r,o=Math.round(i/t)),o>r&&(o=r,i=Math.round(t*o)),e.width>i){const t=document.createElement("canvas");return t.width=i,t.height=o,t.getContext("2d").drawImage(e,0,0,i,o),t}return e},rk.prototype.rotateImage=function(e,t){let n=e.width,r=e.height;90!==t.deg&&270!==t.deg||(n=e.height,r=e.width);const i=document.createElement("canvas");i.width=n,i.height=r;const o=i.getContext("2d");return o.translate(n/2,r/2),t.canvas&&(o.rotate(t.rad),o.scale(t.scaleX,t.scaleY)),o.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),i};const ok=vM;var sk=function(e){if("string"==typeof e){const t=document.querySelectorAll(e);return 0===t.length?null:Array.from(t)}return"object"==typeof e&&ok(e)?[e]:null};var ak=function e(t,n,r,i){let{onSuccess:o}=i;t.readEntries((i=>{const s=[...n,...i];i.length?setTimeout((()=>{e(t,s,r,{onSuccess:o})}),0):o(s)}),(e=>{r(e),o(n)}))};const lk=function(e){return e.fullPath&&e.fullPath!==`/${e.name}`?e.fullPath:null},uk=ak,ck=FM;const dk=FM;const pk=function(e,t){const n=[],r=[],i=e=>new Promise((r=>{if(e.isFile)e.file((t=>{t.relativePath=lk(e),n.push(t),r()}),(e=>{t(e),r()}));else if(e.isDirectory){const n=e.createReader();uk(n,[],t,{onSuccess:e=>r(Promise.all(e.map(i)))})}}));return ck(e.items).forEach((e=>{const t=e.webkitGetAsEntry();t&&r.push(i(t))})),Promise.all(r).then((()=>n))},hk=function(e){const t=dk(e.files);return Promise.resolve(t)};var fk=function(e,t){var n;let{logDropError:r=(()=>{})}=void 0===t?{}:t;return null!=(n=e.items)&&n[0]&&"webkitGetAsEntry"in e.items[0]?pk(e,r):hk(e)},mk=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function gk(e,t){return e===t||!(!mk(e)||!mk(t))}function yk(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!gk(e[n],t[n]))return!1;return!0}var bk=Object.freeze({__proto__:null,default:function(e,t){var n;void 0===t&&(t=yk);var r,i=[],o=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return o&&n===this&&t(s,i)||(r=e.apply(this,s),o=!0,n=this,i=s),r}}}),vk=rc(bk),wk="Expected a function",xk=0/0,Mk="[object Symbol]",Dk=/^\s+|\s+$/g,kk=/^[-+]0x[0-9a-f]+$/i,Ek=/^0b[01]+$/i,Ck=/^0o[0-7]+$/i,Tk=parseInt,Ok="object"==typeof tc&&tc&&tc.Object===Object&&tc,Sk="object"==typeof self&&self&&self.Object===Object&&self,Ak=Ok||Sk||Function("return this")(),Nk=Object.prototype.toString,_k=Math.max,jk=Math.min,Ik=function(){return Ak.Date.now()};function Lk(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function zk(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Nk.call(e)==Mk}(e))return xk;if(Lk(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Lk(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Dk,"");var n=Ek.test(e);return n||Ck.test(e)?Tk(e.slice(2),n?2:8):kk.test(e)?xk:+e}var Pk=function(e,t,n){var r,i,o,s,a,l,u=0,c=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError(wk);function h(t){var n=r,o=i;return r=i=void 0,u=t,s=e.apply(o,n)}function f(e){return u=e,a=setTimeout(g,t),c?h(e):s}function m(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-u>=o}function g(){var e=Ik();if(m(e))return y(e);a=setTimeout(g,function(e){var n=t-(e-l);return d?jk(n,o-(e-u)):n}(e))}function y(e){return a=void 0,p&&r?h(e):(r=i=void 0,s)}function b(){var e=Ik(),n=m(e);if(r=arguments,i=this,l=e,n){if(void 0===a)return f(l);if(d)return a=setTimeout(g,t),h(l)}return void 0===a&&(a=setTimeout(g,t)),s}return t=zk(t)||0,Lk(n)&&(c=!!n.leading,o=(d="maxWait"in n)?_k(zk(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p),b.cancel=function(){void 0!==a&&clearTimeout(a),u=0,r=l=i=a=void 0},b.flush=function(){return void 0===a?s:y(Ik())},b};const Fk=Pk,Rk=RM,Bk=BM;var Uk=function(){let e=!1;return Fk(((t,n)=>{const r=Bk(t,n),i=r.contains(document.activeElement);if(i&&e)return;const o=r.querySelector("[data-uppy-super-focusable]");if(!i||o)if(o)o.focus({preventScroll:!0}),e=!0;else{const t=r.querySelector(Rk);null==t||t.focus({preventScroll:!0}),e=!1}}),260)};var Hk=function(){const e=document.body;return"draggable"in e&&"ondragstart"in e&&"ondrop"in e&&("FormData"in window&&"FileReader"in window)},$k=bM;var Vk=function(e){const t={color:"#838999",icon:(0,$k.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,$k.h)("g",{fill:"#A7AFB7",fillRule:"nonzero"},(0,$k.h)("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),(0,$k.h)("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))};if(!e)return t;const n=e.split("/")[0],r=e.split("/")[1];return"text"===n?{color:"#5a5e69",icon:(0,$k.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,$k.h)("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}:"image"===n?{color:"#686de0",icon:(0,$k.h)("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},(0,$k.h)("g",{fill:"#686DE0",fillRule:"evenodd"},(0,$k.h)("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),(0,$k.h)("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),(0,$k.h)("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}:"audio"===n?{color:"#068dbb",icon:(0,$k.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,$k.h)("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}:"video"===n?{color:"#19af67",icon:(0,$k.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,$k.h)("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}:"application"===n&&"pdf"===r?{color:"#e25149",icon:(0,$k.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,$k.h)("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}:"application"===n&&-1!==["zip","x-7z-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)?{color:"#00C469",icon:(0,$k.h)("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},(0,$k.h)("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}:t},Wk=bM;const qk=Vk;var Yk=function(e){const{file:t}=e;if(t.preview)return(0,Wk.h)("img",{className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});const{color:n,icon:r}=qk(t.type);return(0,Wk.h)("div",{className:"uppy-Dashboard-Item-previewIconWrap"},(0,Wk.h)("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:n}},r),(0,Wk.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},(0,Wk.h)("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))},Qk=bM;var Kk=function(e){const{file:t,toggleFileCard:n,i18n:r,metaFields:i}=e,{missingRequiredMetaFields:o}=t;if(null==o||!o.length)return null;const s=o.map((e=>((e,t)=>{const n=t.filter((t=>t.id===e));return n[0].name})(e,i))).join(", ");return(0,Qk.h)("div",{className:"uppy-Dashboard-Item-errorMessage"},r("missingRequiredMetaFields",{smart_count:o.length,fields:s})," ",(0,Qk.h)("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>n(!0,t.id)},r("editFile")))},Gk=bM;const Jk=Yk,Xk=Kk,Zk=Vk;var eE=bM;function tE(e){return e.isUploaded?e.i18n("uploadComplete"):e.error?e.i18n("retryUpload"):e.resumableUploads?e.file.isPaused?e.i18n("resumeUpload"):e.i18n("pauseUpload"):e.individualCancellation?e.i18n("cancelUpload"):""}function nE(e){return(0,eE.h)("div",{className:"uppy-Dashboard-Item-progress"},(0,eE.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":tE(e),title:tE(e),onClick:()=>function(e){e.isUploaded||(!e.error||e.hideRetryButton?e.resumableUploads&&!e.hidePauseResumeButton?e.uppy.pauseResume(e.file.id):e.individualCancellation&&!e.hideCancelButton&&e.uppy.removeFile(e.file.id):e.uppy.retryUpload(e.file.id))}(e)},e.children))}function rE(e){let{children:t}=e;return(0,eE.h)("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},t)}function iE(e){let{progress:t}=e;const n=2*Math.PI*15;return(0,eE.h)("g",null,(0,eE.h)("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),(0,eE.h)("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":n,"stroke-dashoffset":n-n/100*t}))}const oE="...";var sE=bM;const aE=Yv,lE=function(e,t){if(0===t)return"";if(e.length<=t)return e;if(t<=oE.length+1)return`${e.slice(0,t-1)}…`;const n=t-oE.length,r=Math.ceil(n/2),i=Math.floor(n/2);return e.slice(0,r)+oE+e.slice(-i)},uE=Kk,cE=e=>{let{file:t,onClick:n}=e;return t.error?(0,sE.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-errorDetails","aria-label":t.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:n,type:"button"},"?"):null};var dE=bM;const pE=function(e,t){return t||(t="Copy the URL below"),new Promise((n=>{const r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=e,document.body.appendChild(r),r.select();const i=()=>{document.body.removeChild(r),window.prompt(t,e),n()};try{return document.execCommand("copy")?(document.body.removeChild(r),n()):i()}catch(e){return document.body.removeChild(r),i()}}))};function hE(e){let{file:t,uploadInProgressOrComplete:n,metaFields:r,canEditFile:i,i18n:o,onClick:s}=e;return!n&&r&&r.length>0||!n&&i(t)?(0,dE.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":o("editFileWithFilename",{file:t.meta.name}),title:o("editFileWithFilename",{file:t.meta.name}),onClick:()=>s()},(0,dE.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},(0,dE.h)("g",{fillRule:"evenodd"},(0,dE.h)("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),(0,dE.h)("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),(0,dE.h)("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function fE(e){let{i18n:t,onClick:n,file:r}=e;return(0,dE.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":t("removeFile",{file:r.meta.name}),title:t("removeFile",{file:r.meta.name}),onClick:()=>n()},(0,dE.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},(0,dE.h)("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),(0,dE.h)("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}function mE(e){const{i18n:t}=e;return(0,dE.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":t("copyLink"),title:t("copyLink"),onClick:t=>((e,t)=>{pE(t.file.uploadURL,t.i18n("copyLinkToClipboardFallback")).then((()=>{t.uppy.log("Link copied to clipboard."),t.uppy.info(t.i18n("copyLinkToClipboardSuccess"),"info",3e3)})).catch(t.uppy.log).then((()=>e.target.focus({preventScroll:!0})))})(t,e)},(0,dE.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},(0,dE.h)("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}var gE=function(e){const{uppy:t,file:n,uploadInProgressOrComplete:r,canEditFile:i,metaFields:o,showLinkToFileUploadResult:s,showRemoveButton:a,i18n:l,toggleFileCard:u,openFileEditor:c}=e;return(0,dE.h)("div",{className:"uppy-Dashboard-Item-actionWrapper"},(0,dE.h)(hE,{i18n:l,file:n,uploadInProgressOrComplete:r,canEditFile:i,metaFields:o,onClick:()=>{o&&o.length>0?u(!0,n.id):c(n)}}),s&&n.uploadURL?(0,dE.h)(mE,{file:n,uppy:t,i18n:l}):null,a?(0,dE.h)(fE,{i18n:l,file:n,uppy:t,onClick:()=>e.uppy.removeFile(n.id,"removed-by-user")}):null)},yE=bM;const bE=oc.exports,vE=function(e,t){if(e===t)return!0;for(var n in e)if(!(n in t))return!1;for(var n in t)if(e[n]!==t[n])return!1;return!0},wE=function(e){return(0,Gk.h)("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:Zk(e.file.type).color}},e.showLinkToFileUploadResult&&e.file.uploadURL&&(0,Gk.h)("a",{className:"uppy-Dashboard-Item-previewLink",href:e.file.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.file.meta.name},(0,Gk.h)("span",{hidden:!0},e.file.meta.name)),(0,Gk.h)(Jk,{file:e.file}),(0,Gk.h)(Xk,{file:e.file,i18n:e.i18n,toggleFileCard:e.toggleFileCard,metaFields:e.metaFields}))},xE=function(e){return e.file.progress.uploadStarted?e.isUploaded?(0,eE.h)("div",{className:"uppy-Dashboard-Item-progress"},(0,eE.h)("div",{className:"uppy-Dashboard-Item-progressIndicator"},(0,eE.h)(rE,null,(0,eE.h)("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),(0,eE.h)("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):e.recoveredState?void 0:e.error&&!e.hideRetryButton?(0,eE.h)(nE,e,(0,eE.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},(0,eE.h)("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),(0,eE.h)("path",{d:"M7.9 3H10v2H7.9z"}),(0,eE.h)("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),(0,eE.h)("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):e.resumableUploads&&!e.hidePauseResumeButton?(0,eE.h)(nE,e,(0,eE.h)(rE,null,(0,eE.h)(iE,{progress:e.file.progress.percentage}),e.file.isPaused?(0,eE.h)("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):(0,eE.h)("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},(0,eE.h)("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),(0,eE.h)("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?(0,eE.h)("div",{className:"uppy-Dashboard-Item-progress"},(0,eE.h)("div",{className:"uppy-Dashboard-Item-progressIndicator"},(0,eE.h)(rE,null,(0,eE.h)(iE,{progress:e.file.progress.percentage})))):(0,eE.h)(nE,e,(0,eE.h)(rE,null,(0,eE.h)(iE,{progress:e.file.progress.percentage}),(0,eE.h)("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):null},ME=function(e){const{file:t}=e;return(0,sE.h)("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source},(0,sE.h)("div",{className:"uppy-Dashboard-Item-fileName"},(e=>{const{author:t,name:n}=e.file.meta;return(0,sE.h)("div",{className:"uppy-Dashboard-Item-name",title:n},lE(n,e.containerWidth<=352?35:e.containerWidth<=576?60:t?20:30))})(e),(0,sE.h)(cE,{file:e.file,onClick:()=>alert(e.file.error)})),(0,sE.h)("div",{className:"uppy-Dashboard-Item-status"},(e=>{const{author:t}=e.file.meta,{providerName:n}=e.file.remote,r=`·`;return t?(0,sE.h)("div",{className:"uppy-Dashboard-Item-author"},(0,sE.h)("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},lE(t.name,13)),n?(0,sE.h)(sE.Fragment,null,` ${r} `,n,` ${r} `):null):null})(e),(e=>e.file.size&&(0,sE.h)("div",{className:"uppy-Dashboard-Item-statusSize"},aE(e.file.size)))(e),(e=>e.file.isGhost&&(0,sE.h)("span",null," • ",(0,sE.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:e.toggleAddFilesPanel},e.i18n("reSelect"))))(e)),(0,sE.h)(uE,{file:e.file,i18n:e.i18n,toggleFileCard:e.toggleFileCard,metaFields:e.metaFields}))},DE=gE;class kE extends yE.Component{componentDidMount(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!vE(this.props,e)}componentDidUpdate(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){const{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){const{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,n=e.progress.uploadComplete&&!t&&!e.error,r=e.progress.uploadStarted||t,i=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,{isGhost:s}=e;let a=(this.props.individualCancellation||!i)&&!n;n&&this.props.showRemoveButtonAfterComplete&&(a=!0);const l=bE({"uppy-Dashboard-Item":!0,"is-inprogress":i&&!this.props.recoveredState,"is-processing":t,"is-complete":n,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":s});return(0,yE.h)("div",{className:l,id:`uppy_${e.id}`,role:this.props.role},(0,yE.h)("div",{className:"uppy-Dashboard-Item-preview"},(0,yE.h)(wE,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),(0,yE.h)(xE,{uppy:this.props.uppy,file:e,error:o,isUploaded:n,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,showRemoveButtonAfterComplete:this.props.showRemoveButtonAfterComplete,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),(0,yE.h)("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},(0,yE.h)(ME,{file:e,id:this.props.id,acquirers:this.props.acquirers,containerWidth:this.props.containerWidth,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),(0,yE.h)(DE,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:a,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}}var EE=kE,CE=bM;function TE(){return TE=Object.assign||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},TE.apply(this,arguments)}const OE={position:"relative",width:"100%",minHeight:"100%"},SE={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class AE extends CE.Component{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){const{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:n,renderRow:r,overscanCount:i=10,...o}=e;const{offset:s,height:a}=this.state;let l=Math.floor(s/n),u=Math.floor(a/n);i&&(l=Math.max(0,l-l%i),u+=i);const c=l+u+4,d=t.slice(l,c),p={...OE,height:t.length*n},h={...SE,top:l*n};return(0,CE.h)("div",TE({onScroll:this.handleScroll},o),(0,CE.h)("div",{role:"presentation",style:p},(0,CE.h)("div",{role:"presentation",style:h},d.map(r))))}}var NE=bM;function _E(){return _E=Object.assign||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},_E.apply(this,arguments)}const jE=oc.exports,IE=EE,LE=AE;var zE=bM;let PE;PE=Symbol.for("uppy test: disable unused locale key warning");class FE extends zE.Component{constructor(){super(...arguments),this.triggerFileInputClick=()=>{this.fileInput.click()},this.triggerFolderInputClick=()=>{this.folderInput.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.target.value=null},this.renderHiddenInput=(e,t)=>(0,zE.h)("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:1!==this.props.maxNumberOfFiles,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes,ref:t}),this.renderMyDeviceAcquirer=()=>(0,zE.h)("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},(0,zE.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},(0,zE.h)("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},(0,zE.h)("g",{fill:"none",fillRule:"evenodd"},(0,zE.h)("rect",{className:"uppy-ProviderIconBg",width:"32",height:"32",rx:"16",fill:"#2275D7"}),(0,zE.h)("path",{d:"M21.973 21.152H9.863l-1.108-5.087h14.464l-1.246 5.087zM9.935 11.37h3.958l.886 1.444a.673.673 0 0 0 .585.316h6.506v1.37H9.935v-3.13zm14.898 3.44a.793.793 0 0 0-.616-.31h-.978v-2.126c0-.379-.275-.613-.653-.613H15.75l-.886-1.445a.673.673 0 0 0-.585-.316H9.232c-.378 0-.667.209-.667.587V14.5h-.782a.793.793 0 0 0-.61.303.795.795 0 0 0-.155.663l1.45 6.633c.078.36.396.618.764.618h13.354c.36 0 .674-.246.76-.595l1.631-6.636a.795.795 0 0 0-.144-.675z",fill:"#FFF"}))),(0,zE.h)("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderBrowseButton=(e,t)=>{const n=this.props.acquirers.length;return(0,zE.h)("button",{type:"button",className:"uppy-u-reset uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":0===n},e)},this.renderDropPasteBrowseTagline=()=>{const e=this.props.acquirers.length,t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),n=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),r=this.props.fileManagerSelectionType,i=r.charAt(0).toUpperCase()+r.slice(1);return(0,zE.h)("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${i}`,{browseFiles:t,browseFolders:n,browse:t}):this.props.i18nArray(`dropPaste${i}`,{browseFiles:t,browseFolders:n,browse:t}))},this.renderAcquirer=e=>(0,zE.h)("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},(0,zE.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":this.props.activePickerPanel.id===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},e.icon(),(0,zE.h)("div",{className:"uppy-DashboardTab-name"},e.name))),this.renderAcquirers=(e,t)=>{const n=[...e],r=n.splice(e.length-2,e.length);return(0,zE.h)("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},!t&&this.renderMyDeviceAcquirer(),n.map((e=>this.renderAcquirer(e))),(0,zE.h)("span",{role:"presentation",style:{"white-space":"nowrap"}},r.map((e=>this.renderAcquirer(e)))))}}[PE](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){const{i18nArray:e}=this.props,t=e("poweredBy",{uppy:(0,zE.h)("span",null,(0,zE.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},(0,zE.h)("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),(0,zE.h)("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy"))});return(0,zE.h)("a",{tabIndex:"-1",href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},t)}render(){return(0,zE.h)("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,(e=>{this.fileInput=e})),this.renderHiddenInput(!0,(e=>{this.folderInput=e})),this.renderDropPasteBrowseTagline(),this.props.acquirers.length>0&&this.renderAcquirers(this.props.acquirers,this.props.disableLocalFiles),(0,zE.h)("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&(0,zE.h)("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))}}var RE=FE,BE=bM;const UE=oc.exports,HE=RE;var $E=e=>(0,BE.h)("div",{className:UE("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":e.showAddFilesPanel},(0,BE.h)("div",{className:"uppy-DashboardContent-bar"},(0,BE.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("addingMoreFiles")),(0,BE.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>e.toggleAddFilesPanel(!1)},e.i18n("back"))),(0,BE.h)(HE,e));var VE=function(e){const{tagName:t}=e.target;"INPUT"!==t&&"TEXTAREA"!==t?(e.preventDefault(),e.stopPropagation()):e.stopPropagation()},WE=bM;const qE=oc.exports,YE=VE;var QE=function(e){let{activePickerPanel:t,className:n,hideAllPanels:r,i18n:i,state:o,uppy:s}=e;return(0,WE.h)("div",{className:qE("uppy-DashboardContent-panel",n),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${t.id}`,onDragOver:YE,onDragLeave:YE,onDrop:YE,onPaste:YE},(0,WE.h)("div",{className:"uppy-DashboardContent-bar"},(0,WE.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i("importFrom",{name:t.name})),(0,WE.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:r},i("cancel"))),(0,WE.h)("div",{className:"uppy-DashboardContent-panelBody"},s.getPlugin(t.id).render(o)))},KE=bM;const GE=oc.exports;var JE=function(e){const t=e.files[e.fileCardFor];return(0,KE.h)("div",{className:GE("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},(0,KE.h)("div",{className:"uppy-DashboardContent-bar"},(0,KE.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18nArray("editing",{file:(0,KE.h)("span",{className:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),(0,KE.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e.hideAllPanels},e.i18n("cancel")),(0,KE.h)("button",{className:"uppy-DashboardContent-save",type:"button",onClick:e.saveFileEditor},e.i18n("save"))),(0,KE.h)("div",{className:"uppy-DashboardContent-panelBody"},e.editors.map((t=>e.uppy.getPlugin(t.id).render(e.state)))))},XE=bM;const ZE="error",eC="waiting",tC="preprocessing",nC="uploading",rC="postprocessing",iC="complete",oC="paused";function sC(e){let{files:t,i18n:n,isAllComplete:r,isAllErrored:i,isAllPaused:o,inProgressNotPausedFiles:s,newFiles:a,processingFiles:l}=e;const u=function(e,t,n,r){if(void 0===r&&(r={}),e)return ZE;if(t)return iC;if(n)return oC;let i=eC;const o=Object.keys(r);for(let e=0;e<o.length;e++){const{progress:t}=r[o[e]];if(t.uploadStarted&&!t.uploadComplete)return nC;t.preprocess&&i!==nC&&(i=tC),t.postprocess&&i!==nC&&i!==tC&&(i=rC)}return i}(i,r,o,t);switch(u){case"uploading":return n("uploadingXFiles",{smart_count:s.length});case"preprocessing":case"postprocessing":return n("processingXFiles",{smart_count:l.length});case"paused":return n("uploadPaused");case"waiting":return n("xFilesSelected",{smart_count:a.length});case"complete":return n("uploadComplete")}}var aC=function(e){const{i18n:t,isAllComplete:n,hideCancelButton:r,maxNumberOfFiles:i,toggleAddFilesPanel:o,uppy:s}=e;let{allowNewUpload:a}=e;return a&&i&&(a=e.totalFileCount<e.maxNumberOfFiles),(0,XE.h)("div",{className:"uppy-DashboardContent-bar"},n||r?(0,XE.h)("div",null):(0,XE.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>s.cancelAll()},t("cancel")),(0,XE.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},(0,XE.h)(sC,e)),a?(0,XE.h)("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>o(!0)},(0,XE.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},(0,XE.h)("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),(0,XE.h)("span",{className:"uppy-DashboardContent-addMoreCaption"},t("addMore"))):(0,XE.h)("div",null))},lC=bM,uC=Wv;const cC=oc.exports,dC=Vk,pC=VE,hC=Yk;class fC extends lC.Component{constructor(e){super(e),this.form=document.createElement("form"),this.updateMeta=(e,t)=>{this.setState((n=>{let{formState:r}=n;return{formState:{...r,[t]:e}}}))},this.handleSave=e=>{e.preventDefault();const t=this.props.fileCardFor;this.props.saveFileCard(this.state.formState,t)},this.handleCancel=()=>{const{currentImage:e}=this.getPluginState(),t=this.props.uppy.getFile(e.id);this.props.uppy.emit("file-editor:cancel",t),this.props.toggleFileCard(!1)},this.saveOnEnter=e=>{if(13===e.keyCode){e.stopPropagation(),e.preventDefault();const t=this.props.files[this.props.fileCardFor];this.props.saveFileCard(this.state.formState,t.id)}},this.renderMetaFields=()=>{const e=this.getMetaFields()||[],t={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map((e=>{const n=`uppy-Dashboard-FileCard-input-${e.id}`,r=this.props.requiredMetaFields.includes(e.id);return(0,lC.h)("fieldset",{key:e.id,className:"uppy-Dashboard-FileCard-fieldset"},(0,lC.h)("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:n},e.name),void 0!==e.render?e.render({value:this.state.formState[e.id],onChange:t=>this.updateMeta(t,e.id),fieldCSSClasses:t,required:r,form:this.form.id},lC.h):(0,lC.h)("input",{className:t.text,id:n,form:this.form.id,type:e.type||"text",required:r,value:this.state.formState[e.id],placeholder:e.placeholder,onKeyUp:"form"in HTMLInputElement.prototype?void 0:this.saveOnEnter,onKeyDown:"form"in HTMLInputElement.prototype?void 0:this.saveOnEnter,onKeyPress:"form"in HTMLInputElement.prototype?void 0:this.saveOnEnter,onInput:t=>this.updateMeta(t.target.value,e.id),"data-uppy-super-focusable":!0}))}))};const t=this.props.files[this.props.fileCardFor],n=this.getMetaFields()||[],r={};n.forEach((e=>{r[e.id]=t.meta[e.id]||""})),this.state={formState:r},this.form.id=(0,uC.nanoid)()}componentWillMount(){this.form.addEventListener("submit",this.handleSave),document.body.appendChild(this.form)}componentWillUnmount(){this.form.removeEventListener("submit",this.handleSave),document.body.removeChild(this.form)}getMetaFields(){return"function"==typeof this.props.metaFields?this.props.metaFields(this.props.files[this.props.fileCardFor]):this.props.metaFields}render(){const e=this.props.files[this.props.fileCardFor],t=this.props.canEditFile(e);return(0,lC.h)("div",{className:cC("uppy-Dashboard-FileCard",this.props.className),"data-uppy-panelType":"FileCard",onDragOver:pC,onDragLeave:pC,onDrop:pC,onPaste:pC},(0,lC.h)("div",{className:"uppy-DashboardContent-bar"},(0,lC.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},this.props.i18nArray("editing",{file:(0,lC.h)("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),(0,lC.h)("button",{className:"uppy-DashboardContent-back",type:"button",form:this.form.id,title:this.props.i18n("finishEditingFile"),onClick:this.handleCancel},this.props.i18n("cancel"))),(0,lC.h)("div",{className:"uppy-Dashboard-FileCard-inner"},(0,lC.h)("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:dC(e.type).color}},(0,lC.h)(hC,{file:e}),t&&(0,lC.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:t=>{this.handleSave(t),this.props.openFileEditor(e)},form:this.form.id},this.props.i18n("editFile"))),(0,lC.h)("div",{className:"uppy-Dashboard-FileCard-info"},this.renderMetaFields()),(0,lC.h)("div",{className:"uppy-Dashboard-FileCard-actions"},(0,lC.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"form"in HTMLButtonElement.prototype?"submit":"button",onClick:"form"in HTMLButtonElement.prototype?void 0:this.handleSave,form:this.form.id},this.props.i18n("saveChanges")),(0,lC.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:this.handleCancel,form:this.form.id},this.props.i18n("cancel")))))}}var mC=fC,gC=bM;const yC=oc.exports,bC="uppy-transition-slideDownUp",vC=250;class wC extends gC.Component{constructor(e){super(e),this.state={cachedChildren:null,className:""}}componentWillUpdate(e){const{cachedChildren:t}=this.state,n=(0,gC.toChildArray)(e.children)[0];if(t===n)return null;const r={cachedChildren:n};n&&!t&&(r.className=`${bC}-enter`,cancelAnimationFrame(this.animationFrame),clearTimeout(this.leaveTimeout),this.leaveTimeout=void 0,this.animationFrame=requestAnimationFrame((()=>{this.setState({className:`${bC}-enter ${bC}-enter-active`}),this.enterTimeout=setTimeout((()=>{this.setState({className:""})}),vC)}))),t&&!n&&void 0===this.leaveTimeout&&(r.cachedChildren=t,r.className=`${bC}-leave`,cancelAnimationFrame(this.animationFrame),clearTimeout(this.enterTimeout),this.enterTimeout=void 0,this.animationFrame=requestAnimationFrame((()=>{this.setState({className:`${bC}-leave ${bC}-leave-active`}),this.leaveTimeout=setTimeout((()=>{this.setState({cachedChildren:null,className:""})}),vC)}))),this.setState(r)}render(){const{cachedChildren:e,className:t}=this.state;return e?(0,gC.cloneElement)(e,{className:yC(t,e.props.className)}):null}}var xC=bM;function MC(){return MC=Object.assign||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},MC.apply(this,arguments)}const DC=oc.exports,kC=Hk,EC=e=>{const t=0===e.totalFileCount,n=jE("uppy-Dashboard-files",{"uppy-Dashboard-files--noFiles":t}),r=1===e.itemsPerRow?71:200,i={id:e.id,error:e.error,i18n:e.i18n,uppy:e.uppy,acquirers:e.acquirers,resumableUploads:e.resumableUploads,individualCancellation:e.individualCancellation,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,showLinkToFileUploadResult:e.showLinkToFileUploadResult,showRemoveButtonAfterComplete:e.showRemoveButtonAfterComplete,isWide:e.isWide,metaFields:e.metaFields,recoveredState:e.recoveredState,toggleFileCard:e.toggleFileCard,handleRequestThumbnail:e.handleRequestThumbnail,handleCancelThumbnail:e.handleCancelThumbnail},o=Object.keys(e.files);e.recoveredState&&o.sort(((t,n)=>e.files[n].isGhost-e.files[t].isGhost));const s=function(e,t){const n=[];let r=[];return e.forEach((e=>{r.length<t?r.push(e):(n.push(r),r=[e])})),r.length&&n.push(r),n}(o,e.itemsPerRow);return(0,NE.h)(LE,{class:n,role:"list",data:s,renderRow:t=>(0,NE.h)("div",{role:"presentation",key:t[0]},t.map((t=>(0,NE.h)(IE,_E({key:t,uppy:e.uppy},i,{role:"listitem",openFileEditor:e.openFileEditor,canEditFile:e.canEditFile,toggleAddFilesPanel:e.toggleAddFilesPanel,file:e.files[t]}))))),rowHeight:r})},CC=RE,TC=$E,OC=QE,SC=JE,AC=aC,NC=mC,_C=wC,jC=900,IC=700,LC=576,zC=400;var PC=bM,FC=Pv.exports,RC=Wv,BC=PM;function UC(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var HC=0;function $C(e){return"__private_"+HC+++"_"+e}const VC=qM.exports,WC=jD.exports,qC=ik,YC=sk,QC=FM,KC=fk,GC=vk,JC=RM,XC=Uk,ZC=function(e){const t=0===e.totalFileCount,n=e.containerWidth>LC,r=DC({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":e.disabled,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>LC,"uppy-size--lg":e.containerWidth>IC,"uppy-size--xl":e.containerWidth>jC,"uppy-size--height-md":e.containerHeight>zC,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible});let i=1;e.containerWidth>jC?i=5:e.containerWidth>IC?i=4:e.containerWidth>LC&&(i=3);const o=e.showSelectedFiles&&!t,s=e.recoveredState?Object.keys(e.recoveredState.files).length:null,a=e.files?Object.keys(e.files).filter((t=>e.files[t].isGhost)).length:null;return(0,xC.h)("div",{className:r,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&kC(),"aria-hidden":e.inline?"false":e.isHidden,"aria-disabled":e.disabled,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onPaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop},(0,xC.h)("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),(0,xC.h)("div",{className:"uppy-Dashboard-inner","aria-modal":!e.inline&&"true",role:!e.inline&&"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""}},e.inline?null:(0,xC.h)("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal},(0,xC.h)("span",{"aria-hidden":"true"},"×")),(0,xC.h)("div",{className:"uppy-Dashboard-innerWrap"},(0,xC.h)("div",{className:"uppy-Dashboard-dropFilesHereHint"},e.i18n("dropHint")),o&&(0,xC.h)(AC,e),s&&(0,xC.h)("div",{className:"uppy-Dashboard-serviceMsg"},(0,xC.h)("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},(0,xC.h)("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},(0,xC.h)("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),(0,xC.h)("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),(0,xC.h)("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),(0,xC.h)("strong",{className:"uppy-Dashboard-serviceMsg-title"},e.i18n("sessionRestored")),(0,xC.h)("div",{className:"uppy-Dashboard-serviceMsg-text"},a>0?e.i18n("recoveredXFiles",{smart_count:a}):e.i18n("recoveredAllFiles"))),o?(0,xC.h)(EC,MC({},e,{itemsPerRow:i})):(0,xC.h)(CC,MC({},e,{isSizeMD:n})),(0,xC.h)(_C,null,e.showAddFilesPanel?(0,xC.h)(TC,MC({key:"AddFiles"},e,{isSizeMD:n})):null),(0,xC.h)(_C,null,e.fileCardFor?(0,xC.h)(NC,MC({key:"FileCard"},e)):null),(0,xC.h)(_C,null,e.activePickerPanel?(0,xC.h)(OC,MC({key:"Picker"},e)):null),(0,xC.h)(_C,null,e.showFileEditor?(0,xC.h)(SC,MC({key:"Editor"},e)):null),(0,xC.h)("div",{className:"uppy-Dashboard-progressindicators"},e.progressindicators.map((t=>e.uppy.getPlugin(t.id).render(e.state)))))))},eT={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editing:"Editing %{file}",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."}}},tT=GC.default||GC,nT=9,rT=27;function iT(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}function oT(){return(0,PC.h)("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},(0,PC.h)("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var sT=$C("openFileEditorWhenFilesAdded"),aT=$C("attachRenderFunctionToTarget"),lT=$C("isTargetSupported"),uT=$C("getAcquirers"),cT=$C("getProgressIndicators"),dT=$C("getEditors");class pT extends FC.UIPlugin{constructor(e,t){var n;super(e,t),n=this,this.removeTarget=e=>{const t=this.getPluginState().targets.filter((t=>t.id!==e.id));this.setPluginState({targets:t})},this.addTarget=e=>{const t=e.id||e.constructor.name,n=e.title||t,r=e.type;if("acquirer"!==r&&"progressindicator"!==r&&"editor"!==r){const e="Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor";return void this.uppy.log(e,"error")}const i={id:t,name:n,type:r},o=this.getPluginState().targets.slice();return o.push(i),this.setPluginState({targets:o}),this.el},this.hideAllPanels=()=>{const e=this.getPluginState(),t={activePickerPanel:!1,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};e.activePickerPanel===t.activePickerPanel&&e.showAddFilesPanel===t.showAddFilesPanel&&e.showFileEditor===t.showFileEditor&&e.activeOverlayType===t.activeOverlayType||this.setPluginState(t)},this.showPanel=e=>{const{targets:t}=this.getPluginState(),n=t.filter((t=>"acquirer"===t.type&&t.id===e))[0];this.setPluginState({activePickerPanel:n,activeOverlayType:"PickerPanel"})},this.canEditFile=e=>{const{targets:t}=this.getPluginState();return UC(this,dT)[dT](t).some((t=>this.uppy.getPlugin(t.id).canEditFile(e)))},this.openFileEditor=e=>{const{targets:t}=this.getPluginState(),n=UC(this,dT)[dT](t);this.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),n.forEach((t=>{this.uppy.getPlugin(t.id).selectFile(e)}))},this.saveFileEditor=()=>{const{targets:e}=this.getPluginState();UC(this,dT)[dT](e).forEach((e=>{this.uppy.getPlugin(e.id).save()})),this.hideAllPanels()},this.openModal=()=>{const{promise:e,resolve:t}=iT();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){const e=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",e,!1),t()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!1}),t();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),e},this.closeModal=function(e){void 0===e&&(e={});const{manualClose:t=!0}=e,{isHidden:r,isClosing:i}=n.getPluginState();if(r||i)return;const{promise:o,resolve:s}=iT();if(n.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),n.opts.animateOpenClose){n.setPluginState({isClosing:!0});const e=()=>{n.setPluginState({isHidden:!0,isClosing:!1}),n.superFocus.cancel(),n.savedActiveElement.focus(),n.el.removeEventListener("animationend",e,!1),s()};n.el.addEventListener("animationend",e,!1)}else n.setPluginState({isHidden:!0}),n.superFocus.cancel(),n.savedActiveElement.focus(),s();var a;(document.removeEventListener("keydown",n.handleKeyDownInModal),t)&&(n.opts.browserBackButtonClose&&null!=(a=history.state)&&a[n.modalName]&&history.back());return n.uppy.emit("dashboard:modal-closed"),o},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=e=>{const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,darkMode:e}})},this.handleSystemDarkModeChange=e=>{const t=e.matches;this.uppy.log(`[Dashboard] Dark mode is ${t?"on":"off"}`),this.setDarkModeCapability(t)},this.toggleFileCard=(e,t)=>{const n=this.uppy.getFile(t);e?this.uppy.emit("dashboard:file-edit-start",n):this.uppy.emit("dashboard:file-edit-complete",n),this.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})},this.toggleAddFilesPanel=e=>{this.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})},this.addFiles=e=>{const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||e.webkitRelativePath||null}})));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver((e=>{const t=e[0],{width:n,height:r}=t.contentRect;this.uppy.log(`[Dashboard] resized: ${n} / ${r}`,"debug"),this.setPluginState({containerWidth:n,containerHeight:r,areInsidesReadyToBeVisible:!0})})),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout((()=>{const e=this.getPluginState(),t=!this.opts.inline&&e.isHidden;e.areInsidesReadyToBeVisible||t||(this.uppy.log("[Dashboard] resize event didn't fire on time: defaulted to mobile layout","debug"),this.setPluginState({areInsidesReadyToBeVisible:!0}))}),1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=e=>{this.el.contains(e.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableAllFocusableElements=e=>{const t=QC(this.el.querySelectorAll(JC));e?t.forEach((e=>{const t=e.getAttribute("tabindex");t&&(e.dataset.inertTabindex=t),e.setAttribute("tabindex","-1")})):t.forEach((e=>{"inertTabindex"in e.dataset?e.setAttribute("tabindex",e.dataset.inertTabindex):e.removeAttribute("tabindex")})),this.dashboardIsDisabled=e},this.updateBrowserHistory=()=>{var e;null!=(e=history.state)&&e[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=e=>{var t;!this.isModalOpen()||e.state&&e.state[this.modalName]||this.closeModal({manualClose:!1}),!this.isModalOpen()&&null!=(t=e.state)&&t[this.modalName]&&history.back()},this.handleKeyDownInModal=e=>{e.keyCode===rT&&this.requestCloseModal(e),e.keyCode===nT&&BC.forModal(e,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=e=>{this.uppy.iteratePlugins((t=>{"acquirer"===t.type&&(null==t.handleRootPaste||t.handleRootPaste(e))}));const t=QC(e.clipboardData.files);t.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(t))},this.handleInputChange=e=>{e.preventDefault();const t=QC(e.target.files);t.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(t))},this.handleDragOver=e=>{var t,n;e.preventDefault(),e.stopPropagation();const r=(()=>{let t=!0;return this.uppy.iteratePlugins((n=>{null!=n.canHandleRootDrop&&n.canHandleRootDrop(e)&&(t=!0)})),t})(),i=(()=>{const{types:t}=e.dataTransfer;return t.some((e=>"Files"===e))})();if(!r&&!i||this.opts.disabled||this.opts.disableLocalFiles&&(i||!r)||!this.uppy.getState().allowNewUpload)return e.dataTransfer.dropEffect="none",void clearTimeout(this.removeDragOverClassTimeout);e.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),null==(t=(n=this.opts).onDragOver)||t.call(n,e)},this.handleDragLeave=e=>{var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout((()=>{this.setPluginState({isDraggingOver:!1})}),50),null==(t=(n=this.opts).onDragLeave)||t.call(n,e)},this.handleDrop=async e=>{var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins((t=>{"acquirer"===t.type&&(null==t.handleRootDrop||t.handleRootDrop(e))}));let r=!1;const i=await KC(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error"),r||(this.uppy.info(e.message,"error"),r=!0)}});i.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(i)),null==(t=(n=this.opts).onDrop)||t.call(n,e)},this.handleRequestThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",e)},this.handleCancelThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",e)},this.handleKeyDownInInline=e=>{e.keyCode===nT&&BC.forInline(e,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=e=>{this.el.contains(document.activeElement)&&this.handlePaste(e)},this.handleComplete=e=>{let{failed:t}=e;this.opts.closeAfterFinish&&0===t.length&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,sT,{writable:!0,value:e=>{const t=e[0];this.canEditFile(t)&&this.openFileEditor(t)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){const e=YC(this.opts.trigger);e?e.forEach((e=>e.addEventListener("click",this.openModal))):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("file-editor:complete",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpenFileEditor&&this.uppy.on("files-added",UC(this,sT)[sT])},this.removeEvents=()=>{const e=YC(this.opts.trigger);!this.opts.inline&&e&&e.forEach((e=>e.removeEventListener("click",this.openModal))),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("file-editor:complete",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpenFileEditor&&this.uppy.off("files-added",UC(this,sT)[sT])},this.superFocusOnEachUpdate=()=>{const e=this.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,n=0===this.uppy.getState().info.length,r=!this.opts.inline;n&&(r||e||t&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{!this.opts.disabled||this.dashboardIsDisabled?(!this.opts.disabled&&this.dashboardIsDisabled&&this.disableAllFocusableElements(!1),this.superFocusOnEachUpdate()):this.disableAllFocusableElements(!0)},this.saveFileCard=(e,t)=>{this.uppy.setFileMeta(t,e),this.toggleFileCard(!1,t)},Object.defineProperty(this,aT,{writable:!0,value:e=>{const t=this.uppy.getPlugin(e.id);return{...e,icon:t.icon||this.opts.defaultPickerIcon,render:t.render}}}),Object.defineProperty(this,lT,{writable:!0,value:e=>{const t=this.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()}}),Object.defineProperty(this,uT,{writable:!0,value:tT((e=>e.filter((e=>"acquirer"===e.type&&UC(this,lT)[lT](e))).map(UC(this,aT)[aT])))}),Object.defineProperty(this,cT,{writable:!0,value:tT((e=>e.filter((e=>"progressindicator"===e.type)).map(UC(this,aT)[aT])))}),Object.defineProperty(this,dT,{writable:!0,value:tT((e=>e.filter((e=>"editor"===e.type)).map(UC(this,aT)[aT])))}),this.render=e=>{const t=this.getPluginState(),{files:n,capabilities:r,allowNewUpload:i}=e,{newFiles:o,uploadStartedFiles:s,completeFiles:a,erroredFiles:l,inProgressFiles:u,inProgressNotPausedFiles:c,processingFiles:d,isUploadStarted:p,isAllComplete:h,isAllErrored:f,isAllPaused:m}=this.uppy.getObjectOfFilesPerState(),g=UC(this,uT)[uT](t.targets),y=UC(this,cT)[cT](t.targets),b=UC(this,dT)[dT](t.targets);let v;return v="auto"===this.opts.theme?r.darkMode?"dark":"light":this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),ZC({state:e,isHidden:t.isHidden,files:n,newFiles:o,uploadStartedFiles:s,completeFiles:a,erroredFiles:l,inProgressFiles:u,inProgressNotPausedFiles:c,processingFiles:d,isUploadStarted:p,isAllComplete:h,isAllErrored:f,isAllPaused:m,totalFileCount:Object.keys(n).length,totalProgress:e.totalProgress,allowNewUpload:i,acquirers:g,theme:v,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:t.activePickerPanel,showFileEditor:t.showFileEditor,saveFileEditor:this.saveFileEditor,disableAllFocusableElements:this.disableAllFocusableElements,animateOpenClose:this.opts.animateOpenClose,isClosing:t.isClosing,progressindicators:y,editors:b,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:e.recoveredState,metaFields:t.metaFields,resumableUploads:r.resumableUploads||!1,individualCancellation:r.individualCancellation,isMobileDevice:r.isMobileDevice,fileCardFor:t.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:t.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:t.containerWidth,containerHeight:t.containerHeight,areInsidesReadyToBeVisible:t.areInsidesReadyToBeVisible,isTargetDOMEl:this.isTargetDOMEl,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:t.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},this.discoverProviderPlugins=()=>{this.uppy.iteratePlugins((e=>{e&&!e.target&&e.opts&&e.opts.target===this.constructor&&this.addTarget(e)}))},this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:!1,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});const{inline:e,closeAfterFinish:t}=this.opts;if(e&&t)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");const{allowMultipleUploads:n,allowMultipleUploadBatches:r}=this.uppy.opts;(n||r)&&t&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");const{target:i}=this.opts;i&&this.mount(i,this);(this.opts.plugins||[]).forEach((e=>{const t=this.uppy.getPlugin(e);t&&t.mount(this,t)})),this.opts.disableStatusBar||this.uppy.use(VC,{id:`${this.id}:StatusBar`,target:this,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,showProgressDetails:this.opts.showProgressDetails,hideAfterFinish:this.opts.hideProgressAfterFinish,locale:this.opts.locale,doneButtonHandler:this.opts.doneButtonHandler}),this.opts.disableInformer||this.uppy.use(WC,{id:`${this.id}:Informer`,target:this}),this.opts.disableThumbnailGenerator||this.uppy.use(qC,{id:`${this.id}:ThumbnailGenerator`,thumbnailWidth:this.opts.thumbnailWidth,thumbnailHeight:this.opts.thumbnailHeight,thumbnailType:this.opts.thumbnailType,waitForThumbnailsBeforeUpload:this.opts.waitForThumbnailsBeforeUpload,lazy:!this.opts.waitForThumbnailsBeforeUpload}),this.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const o=!!this.darkModeMediaQuery&&this.darkModeMediaQuery.matches;this.uppy.log(`[Dashboard] Dark mode is ${o?"on":"off"}`),this.setDarkModeCapability(o),"auto"===this.opts.theme&&this.darkModeMediaQuery.addListener(this.handleSystemDarkModeChange),this.discoverProviderPlugins(),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){const e=this.uppy.getPlugin(`${this.id}:Informer`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableStatusBar){const e=this.uppy.getPlugin(`${this.id}:StatusBar`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableThumbnailGenerator){const e=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);e&&this.uppy.removePlugin(e)}(this.opts.plugins||[]).forEach((e=>{const t=this.uppy.getPlugin(e);t&&t.unmount()})),"auto"===this.opts.theme&&this.darkModeMediaQuery.removeListener(this.handleSystemDarkModeChange),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.modalName=`uppy-Dashboard-${(0,RC.nanoid)()}`,this.defaultLocale=eT;const r={target:"body",metaFields:[],trigger:null,inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:oT,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,doneButtonHandler:()=>{this.uppy.reset(),this.requestCloseModal()},note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,onRequestCloseModal:()=>this.closeModal(),showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,theme:"light",autoOpenFileEditor:!1,disabled:!1,disableLocalFiles:!1};this.opts={...r,...t},this.i18nInit(),this.superFocus=XC(),this.ifFocusedOnUppyRecently=!1,this.makeDashboardInsidesVisibleAnywayTimeout=null,this.removeDragOverClassTimeout=null}}pT.VERSION="2.4.0",zM.exports=pT;const hT=qf.exports,fT=Pv.exports.Uppy,mT=hT.instanceOf(fT).isRequired,gT=hT.arrayOf(hT.string),yT=hT.shape({strings:hT.object,pluralize:hT.func}),bT=hT.shape({id:hT.string.isRequired,name:hT.string.isRequired,placeholder:hT.string}),vT=hT.oneOfType([hT.arrayOf(bT),hT.func]),wT=hT.oneOfType([hT.string,hT.number]);var xT={uppy:mT,locale:yT,dashboard:{uppy:mT,inline:hT.bool,plugins:gT,width:wT,height:wT,showProgressDetails:hT.bool,hideUploadButton:hT.bool,hideProgressAfterFinish:hT.bool,note:hT.string,metaFields:vT,proudlyDisplayPoweredByUppy:hT.bool,disableStatusBar:hT.bool,disableInformer:hT.bool,disableThumbnailGenerator:hT.bool,thumbnailWidth:hT.number,locale:yT}};const MT=["defaultChecked","defaultValue","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML","accessKey","className","contentEditable","contextMenu","dir","draggable","hidden","id","lang","placeholder","slot","spellCheck","style","tabIndex","title","translate","radioGroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","autoSave","color","itemProp","itemScope","itemType","itemID","itemRef","results","security","unselectable","inputMode","is","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],DT=/^(aria-|data-)/;var kT=e=>Object.fromEntries(Object.entries(e).filter((e=>{let[t]=e;return DT.test(t)||MT.includes(t)})));var ET=function(e,t){return Object.keys(e.props).some((n=>!((e,t)=>Object.prototype.hasOwnProperty.call(e,t))(e.validProps,n)&&e.props[n]!==t[n]))};const CT=t,TT=zM.exports,OT=xT.dashboard,ST=kT,AT=ET,NT=CT.createElement;class _T extends CT.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(AT(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:Dashboard",...this.props,target:this.container};delete t.uppy,e.use(TT,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=ST(this.props),NT("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}_T.propTypes=OT,_T.defaultProps={inline:!0};const jT=t,IT=qf.exports,LT=zM.exports,zT=xT.dashboard,PT=kT,FT=ET,RT=jT.createElement;class BT extends jT.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(FT(this,e)){const e={...this.props,onRequestCloseModal:this.props.onRequestClose};delete e.uppy,this.plugin.setOptions(e)}e.open&&!this.props.open?this.plugin.closeModal():!e.open&&this.props.open&&this.plugin.openModal()}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:DashboardModal",...this.props,onRequestCloseModal:this.props.onRequestClose};t.target||(t.target=this.container),delete t.uppy,e.use(LT,t),this.plugin=e.getPlugin(t.id),this.props.open&&this.plugin.openModal()}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=PT(this.props),RT("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}BT.propTypes={target:"undefined"!=typeof window?IT.instanceOf(window.HTMLElement):IT.any,open:IT.bool,onRequestClose:IT.func,closeModalOnClickOutside:IT.bool,disablePageScrollWhenModalOpen:IT.bool,...zT};var UT={exports:{}},HT=Pv.exports,$T=bM;const VT=FM,WT=Hk,qT=fk,YT={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};class QT extends HT.UIPlugin{constructor(e,t){super(e,t),this.handleDrop=async e=>{var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1});const r=await qT(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error")}});r.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(r)),null==(t=(n=this.opts).onDrop)||t.call(n,e)},this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=YT;this.opts={target:null,inputName:"files[]",width:"100%",height:"100%",note:null,...t},this.i18nInit(),this.isDragDropSupported=WT(),this.removeDragOverClassTimeout=null,this.onInputChange=this.onInputChange.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragLeave=this.handleDragLeave.bind(this),this.handleDrop=this.handleDrop.bind(this),this.addFiles=this.addFiles.bind(this),this.render=this.render.bind(this)}addFiles(e){const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}})));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}}onInputChange(e){const t=VT(e.target.files);t.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(t)),e.target.value=null}handleDragOver(e){var t,n;e.preventDefault(),e.stopPropagation();const{types:r}=e.dataTransfer,i=r.some((e=>"Files"===e)),{allowNewUpload:o}=this.uppy.getState();if(!i||!o)return e.dataTransfer.dropEffect="none",void clearTimeout(this.removeDragOverClassTimeout);e.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),null==(t=(n=this.opts).onDragOver)||t.call(n,e)}handleDragLeave(e){var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout((()=>{this.setPluginState({isDraggingOver:!1})}),50),null==(t=(n=this.opts).onDragLeave)||t.call(n,e)}renderHiddenFileInput(){const{restrictions:e}=this.uppy.opts;return(0,$T.h)("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:e=>{this.fileInputRef=e},name:this.opts.inputName,multiple:1!==e.maxNumberOfFiles,accept:e.allowedFileTypes,onChange:this.onInputChange})}static renderArrowSvg(){return(0,$T.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},(0,$T.h)("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return(0,$T.h)("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:(0,$T.h)("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return(0,$T.h)("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){const e=`uppy-u-reset\n uppy-DragDrop-container\n ${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}\n ${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}\n `,t={width:this.opts.width,height:this.opts.height};return(0,$T.h)("button",{type:"button",className:e,style:t,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),(0,$T.h)("div",{className:"uppy-DragDrop-inner"},QT.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){const{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}}QT.VERSION="2.1.1";const KT=t,GT=UT.exports=QT,JT=xT,XT=kT,ZT=ET,eO=KT.createElement;class tO extends KT.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(ZT(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:DragDrop",...this.props,target:this.container};delete t.uppy,e.use(GT,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=XT(this.props),eO("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}tO.propTypes={uppy:JT.uppy,locale:JT.locale},tO.defaultProps={};var nO=tO,rO={exports:{}},iO=bM,oO=Pv.exports;class sO extends oO.UIPlugin{constructor(e,t){super(e,t),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator";this.opts={target:"body",fixed:!1,hideAfterFinish:!0,...t},this.render=this.render.bind(this)}render(e){const t=e.totalProgress||0,n=(0===t||100===t)&&this.opts.hideAfterFinish;return(0,iO.h)("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":n},(0,iO.h)("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),(0,iO.h)("div",{className:"uppy-ProgressBar-percentage"},t))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}sO.VERSION="2.1.1",rO.exports=sO;const aO=t,lO=qf.exports,uO=rO.exports,cO=xT.uppy,dO=kT,pO=ET,hO=aO.createElement;class fO extends aO.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(pO(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:ProgressBar",...this.props,target:this.container};delete t.uppy,e.use(uO,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=dO(this.props),hO("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}fO.propTypes={uppy:cO,fixed:lO.bool,hideAfterFinish:lO.bool},fO.defaultProps={};const mO=t,gO=qf.exports,yO=qM.exports,bO=xT.uppy,vO=kT,wO=ET,xO=mO.createElement;class MO extends mO.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(wO(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:StatusBar",...this.props,target:this.container};delete t.uppy,e.use(yO,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=vO(this.props),xO("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}MO.propTypes={uppy:bO,hideAfterFinish:gO.bool,showProgressDetails:gO.bool},MO.defaultProps={};var DO={exports:{}},kO=Pv.exports,EO=bM;const CO=FM,TO={strings:{chooseFiles:"Choose files"}};class OO extends kO.UIPlugin{constructor(e,t){super(e,t),this.id=this.opts.id||"FileInput",this.title="File Input",this.type="acquirer",this.defaultLocale=TO;this.opts={target:null,pretty:!0,inputName:"files[]",...t},this.i18nInit(),this.render=this.render.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleClick=this.handleClick.bind(this)}addFiles(e){const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e})));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}}handleInputChange(e){this.uppy.log("[FileInput] Something selected through input...");const t=CO(e.target.files);this.addFiles(t),e.target.value=null}handleClick(){this.input.click()}render(){const{restrictions:e}=this.uppy.opts,t=e.allowedFileTypes?e.allowedFileTypes.join(","):null;return(0,EO.h)("div",{className:"uppy-FileInput-container"},(0,EO.h)("input",{className:"uppy-FileInput-input",style:this.opts.pretty&&{width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},type:"file",name:this.opts.inputName,onChange:this.handleInputChange,multiple:1!==e.maxNumberOfFiles,accept:t,ref:e=>{this.input=e}}),this.opts.pretty&&(0,EO.h)("button",{className:"uppy-FileInput-btn",type:"button",onClick:this.handleClick},this.i18n("chooseFiles")))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}OO.VERSION="2.1.1",DO.exports=OO;const SO=qf.exports,AO=t,NO=DO.exports,_O=xT,jO=AO.createElement;class IO extends AO.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){e.uppy!==this.props.uppy&&(this.uninstallPlugin(e),this.installPlugin())}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:FileInput",...this.props,target:this.container};delete t.uppy,e.use(NO,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return jO("div",{className:"uppy-Container",ref:e=>{this.container=e}})}}IO.propTypes={uppy:_O.uppy,locale:_O.locale,pretty:SO.bool,inputName:SO.string},IO.defaultProps={};const{useEffect:LO,useRef:zO}=t,PO=Pv.exports.Uppy;var FO={};class RO extends Error{constructor(e,t){void 0===t&&(t=null),super(`This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.`),this.cause=e,this.isNetworkError=!0,this.request=t}}var BO=RO;const UO=BO;var HO=function(){return fetch(...arguments).catch((e=>{throw"AbortError"===e.name?e:new UO(e)}))};const $O=ew;class VO extends Error{constructor(e,t){void 0===t&&(t={}),super(e),this.cause=t.cause,this.cause&&$O(this.cause,"isNetworkError")&&(this.isNetworkError=this.cause.isNetworkError)}}var WO=VO;class qO extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}let YO;function QO(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var KO=0;function GO(e){return"__private_"+KO+++"_"+e}const JO=HO,XO=WO,ZO=qO;async function eS(e){if(401===e.status)throw new ZO;const t=e.json();if(e.status<200||e.status>300){let n=`Failed request with status: ${e.status}. ${e.statusText}`;try{const e=await t;n=e.message?`${n} message: ${e.message}`:n,n=e.requestId?`${n} request-Id: ${e.requestId}`:n}finally{throw new Error(n)}}return t}var tS=GO("companionHeaders"),nS=GO("getPostResponseFunc"),rS=GO("getUrl"),iS=GO("errorHandler");YO=Symbol.for("uppy test: getCompanionHeaders");class oS{constructor(e,t){Object.defineProperty(this,iS,{value:aS}),Object.defineProperty(this,rS,{value:sS}),Object.defineProperty(this,tS,{writable:!0,value:void 0}),Object.defineProperty(this,nS,{writable:!0,value:e=>t=>e?t:this.onReceiveResponse(t)}),this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=["accept","content-type","uppy-auth-token"],this.preflightDone=!1,QO(this,tS)[tS]=null==t?void 0:t.companionHeaders}setCompanionHeaders(e){QO(this,tS)[tS]=e}[YO](){return QO(this,tS)[tS]}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e&&e[t]?e[t]:t).replace(/\/$/,"")}headers(){return Promise.resolve({...oS.defaultHeaders,...QO(this,tS)[tS]})}onReceiveResponse(e){const t=this.uppy.getState().companion||{},n=this.opts.companionUrl,{headers:r}=e;return r.has("i-am")&&r.get("i-am")!==t[n]&&this.uppy.setState({companion:{...t,[n]:r.get("i-am")}}),e}preflight(e){return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(QO(this,rS)[rS](e),{method:"OPTIONS"}).then((e=>(e.headers.has("access-control-allow-headers")&&(this.allowedHeaders=e.headers.get("access-control-allow-headers").split(",").map((e=>e.trim().toLowerCase()))),this.preflightDone=!0,this.allowedHeaders.slice()))).catch((e=>(this.uppy.log(`[CompanionClient] unable to make preflight request ${e}`,"warning"),this.preflightDone=!0,this.allowedHeaders.slice())))}preflightAndHeaders(e){return Promise.all([this.preflight(e),this.headers()]).then((e=>{let[t,n]=e;return Object.keys(n).forEach((e=>{t.includes(e.toLowerCase())||(this.uppy.log(`[CompanionClient] excluding disallowed header ${e}`),delete n[e])})),n}))}get(e,t){const n="get";return this.preflightAndHeaders(e).then((t=>JO(QO(this,rS)[rS](e),{method:n,headers:t,credentials:this.opts.companionCookiesRule||"same-origin"}))).then(QO(this,nS)[nS](t)).then(eS).catch(QO(this,iS)[iS](n,e))}post(e,t,n){const r="post";return this.preflightAndHeaders(e).then((n=>JO(QO(this,rS)[rS](e),{method:r,headers:n,credentials:this.opts.companionCookiesRule||"same-origin",body:JSON.stringify(t)}))).then(QO(this,nS)[nS](n)).then(eS).catch(QO(this,iS)[iS](r,e))}delete(e,t,n){const r="delete";return this.preflightAndHeaders(e).then((n=>JO(`${this.hostname}/${e}`,{method:r,headers:n,credentials:this.opts.companionCookiesRule||"same-origin",body:t?JSON.stringify(t):null}))).then(QO(this,nS)[nS](n)).then(eS).catch(QO(this,iS)[iS](r,e))}}function sS(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}function aS(e,t){return n=>{var r;return null!=(r=n)&&r.isAuthError||(n=new XO(`Could not ${e} ${QO(this,rS)[rS](t)}`,{cause:n})),Promise.reject(n)}}oS.VERSION="2.2.1",oS.defaultHeaders={Accept:"application/json","Content-Type":"application/json","Uppy-Versions":`@uppy/companion-client=${oS.VERSION}`};var lS=oS,uS={};Object.defineProperty(uS,"__esModule",{value:!0}),uS.getItem=function(e){return Promise.resolve(localStorage.getItem(e))},uS.removeItem=function(e){return new Promise((t=>{localStorage.removeItem(e),t()}))},uS.setItem=function(e,t){return new Promise((n=>{localStorage.setItem(e,t),n()}))};var cS=uS;const dS=lS;var pS=class extends dS{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||(e=>e.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "))(this.id),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null}headers(){return Promise.all([super.headers(),this.getAuthToken()]).then((e=>{let[t,n]=e;const r={};return n&&(r["uppy-auth-token"]=n),this.companionKeysParams&&(r["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),{...t,...r}}))}onReceiveResponse(e){e=super.onReceiveResponse(e);const t=this.uppy.getPlugin(this.pluginId),n=t.getPluginState().authenticated?401!==e.status:e.status<400;return t.setPluginState({authenticated:n}),e}setAuthToken(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)}getAuthToken(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)}async ensurePreAuth(){if(this.companionKeysParams&&!this.preAuthToken&&(await this.fetchPreAuthToken(),!this.preAuthToken))throw new Error("Could not load authentication data required for third-party login. Please try again later.")}authUrl(e){void 0===e&&(e={});const t=new URLSearchParams(e);return this.preAuthToken&&t.set("uppyPreAuthToken",this.preAuthToken),`${this.hostname}/${this.id}/connect?${t}`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}async fetchPreAuthToken(){if(this.companionKeysParams)try{const e=await this.post(`${this.id}/preauth/`,{params:this.companionKeysParams});this.preAuthToken=e.token}catch(e){this.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${e}`,"warning")}}list(e){return this.get(`${this.id}/list/${e||""}`)}logout(){return this.get(`${this.id}/logout`).then((e=>Promise.all([e,this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)]))).then((e=>{let[t]=e;return t}))}static initPlugin(e,t,n){if(e.type="acquirer",e.files=[],n&&(e.opts={...n,...t}),t.serverUrl||t.serverPattern)throw new Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(t.companionAllowedHosts){const n=t.companionAllowedHosts;if(!("string"==typeof n||Array.isArray(n)||n instanceof RegExp))throw new TypeError(`${e.id}: the option "companionAllowedHosts" must be one of string, Array, RegExp`);e.opts.companionAllowedHosts=n}else/^(?!https?:\/\/).*$/i.test(t.companionUrl)?e.opts.companionAllowedHosts=`https://${t.companionUrl.replace(/^\/\//,"")}`:e.opts.companionAllowedHosts=new URL(t.companionUrl).origin;e.storage=e.opts.storage||cS}};const hS=lS;var fS=class extends hS{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||(e=>e.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "))(this.id),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t?`&${t}`:""}`)}};let mS,gS;function yS(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var bS=0;function vS(e){return"__private_"+bS+++"_"+e}const wS=cw;var xS=vS("queued"),MS=vS("emitter"),DS=vS("isOpen"),kS=vS("socket"),ES=vS("handleMessage");mS=Symbol.for("uppy test: getSocket"),gS=Symbol.for("uppy test: getQueued");var CS=class{constructor(e){Object.defineProperty(this,xS,{writable:!0,value:[]}),Object.defineProperty(this,MS,{writable:!0,value:wS()}),Object.defineProperty(this,DS,{writable:!0,value:!1}),Object.defineProperty(this,kS,{writable:!0,value:void 0}),Object.defineProperty(this,ES,{writable:!0,value:e=>{try{const t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(e){console.log(e)}}}),this.opts=e,e&&!1===e.autoOpen||this.open()}get isOpen(){return yS(this,DS)[DS]}[mS](){return yS(this,kS)[kS]}[gS](){return yS(this,xS)[xS]}open(){yS(this,kS)[kS]=new WebSocket(this.opts.target),yS(this,kS)[kS].onopen=()=>{for(yS(this,DS)[DS]=!0;yS(this,xS)[xS].length>0&&yS(this,DS)[DS];){const e=yS(this,xS)[xS].shift();this.send(e.action,e.payload)}},yS(this,kS)[kS].onclose=()=>{yS(this,DS)[DS]=!1},yS(this,kS)[kS].onmessage=yS(this,ES)[ES]}close(){var e;null==(e=yS(this,kS)[kS])||e.close()}send(e,t){yS(this,DS)[DS]?yS(this,kS)[kS].send(JSON.stringify({action:e,payload:t})):yS(this,xS)[xS].push({action:e,payload:t})}on(e,t){yS(this,MS)[MS].on(e,t)}emit(e,t){yS(this,MS)[MS].emit(e,t)}once(e,t){yS(this,MS)[MS].once(e,t)}};Object.defineProperty(FO,"__esModule",{value:!0}),FO.Socket=FO.SearchProvider=FO.RequestClient=FO.Provider=void 0;const TS=lS;FO.RequestClient=TS;const OS=pS;FO.Provider=OS;const SS=fS;FO.SearchProvider=SS;const AS=CS;FO.Socket=AS;var NS={};function _S(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Object.defineProperty(NS,"__esModule",{value:!0}),NS.internalRateLimitedQueue=NS.RateLimitedQueue=void 0;var jS=0;function IS(e){return"__private_"+jS+++"_"+e}function LS(){return new Error("Cancelled")}var zS=IS("activeRequests"),PS=IS("queuedHandlers"),FS=IS("paused"),RS=IS("pauseTimer"),BS=IS("downLimit"),US=IS("upperLimit"),HS=IS("rateLimitingTimer"),$S=IS("call"),VS=IS("queueNext"),WS=IS("next"),qS=IS("queue"),YS=IS("dequeue"),QS=IS("resume"),KS=IS("increaseLimit");function GS(e){_S(this,zS)[zS]+=1;let t,n=!1;try{t=e()}catch(e){throw _S(this,zS)[zS]-=1,e}return{abort:()=>{n||(n=!0,_S(this,zS)[zS]-=1,t(),_S(this,VS)[VS]())},done:()=>{n||(n=!0,_S(this,zS)[zS]-=1,_S(this,VS)[VS]())}}}function JS(){queueMicrotask((()=>_S(this,WS)[WS]()))}function XS(){if(_S(this,FS)[FS]||_S(this,zS)[zS]>=this.limit)return;if(0===_S(this,PS)[PS].length)return;const e=_S(this,PS)[PS].shift(),t=_S(this,$S)[$S](e.fn);e.abort=t.abort,e.done=t.done}function ZS(e,t){void 0===t&&(t={});const n={fn:e,priority:t.priority||0,abort:()=>{_S(this,YS)[YS](n)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=_S(this,PS)[PS].findIndex((e=>n.priority>e.priority));return-1===r?_S(this,PS)[PS].push(n):_S(this,PS)[PS].splice(r,0,n),n}function eA(e){const t=_S(this,PS)[PS].indexOf(e);-1!==t&&_S(this,PS)[PS].splice(t,1)}NS.RateLimitedQueue=class{constructor(e){Object.defineProperty(this,YS,{value:eA}),Object.defineProperty(this,qS,{value:ZS}),Object.defineProperty(this,WS,{value:XS}),Object.defineProperty(this,VS,{value:JS}),Object.defineProperty(this,$S,{value:GS}),Object.defineProperty(this,zS,{writable:!0,value:0}),Object.defineProperty(this,PS,{writable:!0,value:[]}),Object.defineProperty(this,FS,{writable:!0,value:!1}),Object.defineProperty(this,RS,{writable:!0,value:void 0}),Object.defineProperty(this,BS,{writable:!0,value:1}),Object.defineProperty(this,US,{writable:!0,value:void 0}),Object.defineProperty(this,HS,{writable:!0,value:void 0}),Object.defineProperty(this,QS,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,KS,{writable:!0,value:()=>{if(_S(this,FS)[FS])_S(this,HS)[HS]=setTimeout(_S(this,KS)[KS],0);else{_S(this,BS)[BS]=this.limit,this.limit=Math.ceil((_S(this,US)[US]+_S(this,BS)[BS])/2);for(let e=_S(this,BS)[BS];e<=this.limit;e++)_S(this,VS)[VS]();_S(this,US)[US]-_S(this,BS)[BS]>3?_S(this,HS)[HS]=setTimeout(_S(this,KS)[KS],2e3):_S(this,BS)[BS]=Math.floor(_S(this,BS)[BS]/2)}}}),this.limit="number"!=typeof e||0===e?1/0:e}run(e,t){return!_S(this,FS)[FS]&&_S(this,zS)[zS]<this.limit?_S(this,$S)[$S](e):_S(this,qS)[qS](e,t)}wrapPromiseFunction(e,t){var n=this;return function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];let s;const a=new Promise(((r,o)=>{s=n.run((()=>{let t,n;try{n=Promise.resolve(e(...i))}catch(e){n=Promise.reject(e)}return n.then((e=>{t?o(t):(s.done(),r(e))}),(e=>{t?o(t):(s.done(),o(e))})),()=>{t=LS()}}),t)}));return a.abort=()=>{s.abort()},a}}resume(){_S(this,FS)[FS]=!1,clearTimeout(_S(this,RS)[RS]);for(let e=0;e<this.limit;e++)_S(this,VS)[VS]()}pause(e){void 0===e&&(e=null),_S(this,FS)[FS]=!0,clearTimeout(_S(this,RS)[RS]),null!=e&&(_S(this,RS)[RS]=setTimeout(_S(this,QS)[QS],e))}rateLimit(e){clearTimeout(_S(this,HS)[HS]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(_S(this,US)[US]=this.limit-1,this.limit=_S(this,BS)[BS],_S(this,HS)[HS]=setTimeout(_S(this,KS)[KS],e))}get isPaused(){return _S(this,FS)[FS]}};const tA=Symbol("__queue");NS.internalRateLimitedQueue=tA;var nA=Sw((function(e,t,n){const{progress:r,bytesUploaded:i,bytesTotal:o}=t;r&&(e.uppy.log(`Upload progress: ${r}`),e.uppy.emit("upload-progress",n,{uploader:e,bytesUploaded:i,bytesTotal:o}))}),300,{leading:!0,trailing:!0});var rA=function(e){const t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(e)[1];return`${/^http:\/\//i.test(e)?"ws":"wss"}://${t}`};var iA=function(e){const t=[],n=[];function r(e){t.push(e)}function i(e){n.push(e)}return Promise.all(e.map((e=>e.then(r,i)))).then((()=>({successful:t,failed:n})))};function oA(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var sA=0;function aA(e){return"__private_"+sA+++"_"+e}var lA=aA("emitter"),uA=aA("events");var cA=class{constructor(e){Object.defineProperty(this,lA,{writable:!0,value:void 0}),Object.defineProperty(this,uA,{writable:!0,value:[]}),oA(this,lA)[lA]=e}on(e,t){return oA(this,uA)[uA].push([e,t]),oA(this,lA)[lA].on(e,t)}remove(){for(const[e,t]of oA(this,uA)[uA].splice(0))oA(this,lA)[lA].off(e,t)}};function dA(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var pA=0;function hA(e){return"__private_"+pA+++"_"+e}var fA=hA("aliveTimer"),mA=hA("isDone"),gA=hA("onTimedOut"),yA=hA("timeout");var bA=function(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)},vA=Wv,wA=FO,xA=NS;const MA=kM,DA=nA,kA=rA,EA=iA,CA=cA,TA=class{constructor(e,t){Object.defineProperty(this,fA,{writable:!0,value:void 0}),Object.defineProperty(this,mA,{writable:!0,value:!1}),Object.defineProperty(this,gA,{writable:!0,value:void 0}),Object.defineProperty(this,yA,{writable:!0,value:void 0}),dA(this,yA)[yA]=e,dA(this,gA)[gA]=t}progress(){dA(this,mA)[mA]||dA(this,yA)[yA]>0&&(clearTimeout(dA(this,fA)[fA]),dA(this,fA)[fA]=setTimeout(dA(this,gA)[gA],dA(this,yA)[yA]))}done(){dA(this,mA)[mA]||(clearTimeout(dA(this,fA)[fA]),dA(this,fA)[fA]=null,dA(this,mA)[mA]=!0)}},OA=BO,SA=bA,AA={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}};function NA(e,t){let n=t;return n||(n=new Error("Upload error")),"string"==typeof n&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),SA(e)?(n=new OA(n,e),n):(n.request=e,n)}function _A(e){return e.data.slice(0,e.data.size,e.meta.type)}class jA extends MA{constructor(e,t){super(e,t),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.title="XHRUpload",this.defaultLocale=AA;const n={formData:!0,fieldName:t.bundle?"files[]":"file",method:"post",metaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:"",getResponseData(t){let n={};try{n=JSON.parse(t)}catch(t){e.log(t)}return n},getResponseError(e,t){let n=new Error("Upload error");return SA(t)&&(n=new OA(n,t)),n},validateStatus:e=>e>=200&&e<300};if(this.opts={...n,...t},this.i18nInit(),this.handleUpload=this.handleUpload.bind(this),xA.internalRateLimitedQueue in this.opts?this.requests=this.opts[xA.internalRateLimitedQueue]:this.requests=new xA.RateLimitedQueue(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");this.uploaderEvents=Object.create(null)}getOptions(e){const t=this.uppy.getState().xhrUpload,{headers:n}=this.opts,r={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return"function"==typeof n?r.headers=n(e):Object.assign(r.headers,this.opts.headers),t&&Object.assign(r.headers,t.headers),e.xhrUpload&&Object.assign(r.headers,e.xhrUpload.headers),r}addMetadata(e,t,n){(Array.isArray(n.metaFields)?n.metaFields:Object.keys(t)).forEach((n=>{e.append(n,t[n])}))}createFormDataUpload(e,t){const n=new FormData;this.addMetadata(n,e.meta,t);const r=_A(e);return e.name?n.append(t.fieldName,r,e.meta.name):n.append(t.fieldName,r),n}createBundledUpload(e,t){const n=new FormData,{meta:r}=this.uppy.getState();return this.addMetadata(n,r,t),e.forEach((e=>{const t=this.getOptions(e),r=_A(e);e.name?n.append(t.fieldName,r,e.name):n.append(t.fieldName,r)})),n}upload(e,t,n){const r=this.getOptions(e);return this.uppy.log(`uploading ${t} of ${n}`),new Promise(((t,n)=>{this.uppy.emit("upload-started",e);const i=r.formData?this.createFormDataUpload(e,r):e.data,o=new XMLHttpRequest;let s;this.uploaderEvents[e.id]=new CA(this.uppy);const a=new TA(r.timeout,(()=>{o.abort(),s.done();const t=new Error(this.i18n("timedOut",{seconds:Math.ceil(r.timeout/1e3)}));this.uppy.emit("upload-error",e,t),n(t)})),l=(0,vA.nanoid)();o.upload.addEventListener("loadstart",(()=>{this.uppy.log(`[XHRUpload] ${l} started`)})),o.upload.addEventListener("progress",(t=>{this.uppy.log(`[XHRUpload] ${l} progress: ${t.loaded} / ${t.total}`),a.progress(),t.lengthComputable&&this.uppy.emit("upload-progress",e,{uploader:this,bytesUploaded:t.loaded,bytesTotal:t.total})})),o.addEventListener("load",(()=>{if(this.uppy.log(`[XHRUpload] ${l} finished`),a.done(),s.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),r.validateStatus(o.status,o.responseText,o)){const n=r.getResponseData(o.responseText,o),i=n[r.responseUrlFieldName],s={status:o.status,body:n,uploadURL:i};return this.uppy.emit("upload-success",e,s),i&&this.uppy.log(`Download ${e.name} from ${i}`),t(e)}const i=r.getResponseData(o.responseText,o),u=NA(o,r.getResponseError(o.responseText,o)),c={status:o.status,body:i};return this.uppy.emit("upload-error",e,u,c),n(u)})),o.addEventListener("error",(()=>{this.uppy.log(`[XHRUpload] ${l} errored`),a.done(),s.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null);const t=NA(o,r.getResponseError(o.responseText,o));return this.uppy.emit("upload-error",e,t),n(t)})),o.open(r.method.toUpperCase(),r.endpoint,!0),o.withCredentials=r.withCredentials,""!==r.responseType&&(o.responseType=r.responseType),s=this.requests.run((()=>{this.uppy.emit("upload-started",e);const t=this.getOptions(e);return Object.keys(t.headers).forEach((e=>{o.setRequestHeader(e,t.headers[e])})),o.send(i),()=>{a.done(),o.abort()}})),this.onFileRemove(e.id,(()=>{s.abort(),n(new Error("File removed"))})),this.onCancelAll(e.id,(e=>{let{reason:t}=e;"user"===t&&s.abort(),n(new Error("Upload cancelled"))}))}))}uploadRemote(e){const t=this.getOptions(e);return new Promise(((n,r)=>{this.uppy.emit("upload-started",e);const i={};(Array.isArray(t.metaFields)?t.metaFields:Object.keys(e.meta)).forEach((t=>{i[t]=e.meta[t]}));new(e.remote.providerOptions.provider?wA.Provider:wA.RequestClient)(this.uppy,e.remote.providerOptions).post(e.remote.url,{...e.remote.body,endpoint:t.endpoint,size:e.data.size,fieldname:t.fieldName,metadata:i,httpMethod:t.method,useFormData:t.formData,headers:t.headers}).then((i=>{const{token:o}=i,s=kA(e.remote.companionUrl),a=new wA.Socket({target:`${s}/api/${o}`,autoOpen:!1});let l;this.uploaderEvents[e.id]=new CA(this.uppy),this.onFileRemove(e.id,(()=>{a.send("cancel",{}),l.abort(),n(`upload ${e.id} was removed`)})),this.onCancelAll(e.id,(function(t){let{reason:r}=void 0===t?{}:t;"user"===r&&(a.send("cancel",{}),l.abort()),n(`upload ${e.id} was canceled`)})),this.onRetry(e.id,(()=>{a.send("pause",{}),a.send("resume",{})})),this.onRetryAll(e.id,(()=>{a.send("pause",{}),a.send("resume",{})})),a.on("progress",(t=>DA(this,t,e))),a.on("success",(r=>{const i=t.getResponseData(r.response.responseText,r.response),o=i[t.responseUrlFieldName],s={status:r.response.status,body:i,uploadURL:o};return this.uppy.emit("upload-success",e,s),l.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),n()})),a.on("error",(n=>{const i=n.response,o=i?t.getResponseError(i.responseText,i):Object.assign(new Error(n.error.message),{cause:n.error});this.uppy.emit("upload-error",e,o),l.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),r(o)})),l=this.requests.run((()=>(a.open(),e.isPaused&&a.send("pause",{}),()=>a.close())))})).catch((t=>{this.uppy.emit("upload-error",e,t),r(t)}))}))}uploadBundle(e){return new Promise(((t,n)=>{const{endpoint:r}=this.opts,{method:i}=this.opts,o=this.uppy.getState().xhrUpload,s=this.createBundledUpload(e,{...this.opts,...o||{}}),a=new XMLHttpRequest,l=t=>{e.forEach((e=>{this.uppy.emit("upload-error",e,t)}))},u=new TA(this.opts.timeout,(()=>{a.abort();const e=new Error(this.i18n("timedOut",{seconds:Math.ceil(this.opts.timeout/1e3)}));l(e),n(e)}));a.upload.addEventListener("loadstart",(()=>{this.uppy.log("[XHRUpload] started uploading bundle"),u.progress()})),a.upload.addEventListener("progress",(t=>{u.progress(),t.lengthComputable&&e.forEach((e=>{this.uppy.emit("upload-progress",e,{uploader:this,bytesUploaded:t.loaded/t.total*e.size,bytesTotal:e.size})}))})),a.addEventListener("load",(r=>{if(u.done(),this.opts.validateStatus(r.target.status,a.responseText,a)){const n=this.opts.getResponseData(a.responseText,a),i={status:r.target.status,body:n};return e.forEach((e=>{this.uppy.emit("upload-success",e,i)})),t()}const i=this.opts.getResponseError(a.responseText,a)||new Error("Upload error");return i.request=a,l(i),n(i)})),a.addEventListener("error",(()=>{u.done();const e=this.opts.getResponseError(a.responseText,a)||new Error("Upload error");return l(e),n(e)})),this.uppy.on("cancel-all",(function(e){let{reason:t}=void 0===e?{}:e;"user"===t&&(u.done(),a.abort())})),a.open(i.toUpperCase(),r,!0),a.withCredentials=this.opts.withCredentials,""!==this.opts.responseType&&(a.responseType=this.opts.responseType),Object.keys(this.opts.headers).forEach((e=>{a.setRequestHeader(e,this.opts.headers[e])})),a.send(s),e.forEach((e=>{this.uppy.emit("upload-started",e)}))}))}uploadFiles(e){const t=e.map(((t,n)=>{const r=parseInt(n,10)+1,i=e.length;return t.error?Promise.reject(new Error(t.error)):t.isRemote?this.uploadRemote(t,r,i):this.upload(t,r,i)}));return EA(t)}onFileRemove(e,t){this.uploaderEvents[e].on("file-removed",(n=>{e===n.id&&t(n.id)}))}onRetry(e,t){this.uploaderEvents[e].on("upload-retry",(n=>{e===n&&t()}))}onRetryAll(e,t){this.uploaderEvents[e].on("retry-all",(()=>{this.uppy.getFile(e)&&t()}))}onCancelAll(e,t){var n=this;this.uploaderEvents[e].on("cancel-all",(function(){n.uppy.getFile(e)&&t(...arguments)}))}handleUpload(e){if(0===e.length)return this.uppy.log("[XHRUpload] No files to upload!"),Promise.resolve();0!==this.opts.limit||this.opts[xA.internalRateLimitedQueue]||this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const t=e.map((e=>this.uppy.getFile(e)));if(this.opts.bundle){if(t.some((e=>e.isRemote)))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if("function"==typeof this.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");return this.uploadBundle(t)}return this.uploadFiles(t).then((()=>null))}install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(this.handleUpload)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(this.handleUpload)}}jA.VERSION="2.1.2";var IA=jA;const LA=e=>{var n;let{uppy:r}=e;const[s,a]=i(0);o((()=>{r.on("progress",a)}),[r]);const l="".concat(s,"%");return t.createElement("div",{className:"neeto-editor-image-uploader__progress"},t.createElement("p",{className:"neeto-editor-image-uploader__progress-title"},"Uploading..."),t.createElement("p",{className:"neeto-editor-image-uploader__progress-file"},null===(n=r.getFiles()[0])||void 0===n?void 0:n.name),t.createElement("div",{className:"neeto-editor-progress-bar__wrapper","data-cy":"neeto-editor-image-upload-progress-bar"},t.createElement("div",{className:"neeto-editor-progress-bar__percent"},t.createElement("p",null,l),t.createElement(Ld,{icon:th,onClick:()=>r.cancelAll(),size:"small",style:"text"})),t.createElement("div",{className:"neeto-editor-progress-bar__indicator"},t.createElement("div",{style:{width:l},className:"neeto-editor-progress-bar__indicator-inner"}))))},zA=e=>{const t=["B","KB","MB","GB"];let n=0;for(;e>=1024&&n<t.length;)e/=1024,++n;return"".concat(e.toFixed(1)," ").concat(t[n])},PA=e=>{let{endpoint:n=Lv,onSuccess:r,uploadConfig:o}=e;const[s,a]=i(!1),[l,u]=i(""),c={...jv,...o},d=function(e){if("function"!=typeof e)throw new TypeError("useUppy: expected a function that returns a new Uppy instance");const t=zO(void 0);if(void 0===t.current&&(t.current=e(),!(t.current instanceof PO)))throw new TypeError(`useUppy: factory function must return an Uppy instance, got ${typeof t.current}`);return LO((()=>()=>{t.current.close({reason:"unmount"}),t.current=void 0}),[t]),t.current}((()=>new LM({...c,onBeforeFileAdded:e=>{const{maxFileSize:t,allowedFileTypes:n}=c.restrictions;return e.size>t?(u("File size is too large. Max size is ".concat(zA(c.restrictions.maxFileSize),".")),!1):!!n.includes(".".concat(e.extension))||(u("File type is not permitted. Allowed file types are: ".concat(n.join(", "),".")),!1)}}).use(IA,{endpoint:n,...Iv}).on("upload",(()=>a(!0))).on("upload-success",((e,t)=>r(t.body.imageURL))).on("cancel-all",(()=>a(!1))).on("complete",(()=>a(!1)))));return s?t.createElement(LA,{uppy:d}):t.createElement("div",{className:"neeto-editor-image-uploader__dnd-wrapper"},t.createElement(nO,{className:"neeto-editor-image-uploader__dnd",note:"Max. File Size: ".concat(zA(c.restrictions.maxFileSize)),locale:{strings:{dropHereOr:"Drop your file(s) here or %{browse}",browse:"Browse"}},uppy:d,"data-cy":"neeto-editor-image-local-uploader"}),l&&t.createElement("p",{className:"neeto-editor-image-uploader__dnd--error"},l))},FA=()=>t.createElement("div",{className:"neeto-editor-loader"},t.createElement("span",{className:"neeto-editor-loader__spinner-icon"}));var RA={},BA=Object.assign||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},UA=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.create(null);function n(e,n){return t[e]=t[e]||[],t[e].push(n),this}function r(e,t){return t._once=!0,n(e,t),this}function i(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n?t[e].splice(t[e].indexOf(n),1):delete t[e],this}function o(e){for(var n=this,r=arguments.length,o=Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];var a=t[e]&&t[e].slice();return a&&a.forEach((function(t){t._once&&i(e,t),t.apply(n,o)})),this}return BA({},e,{on:n,once:r,off:i,emit:o})},HA=Object.freeze({__proto__:null,default:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=void 0,n=void 0,r=void 0,i=void 0,o=void 0,s=void 0,a=void 0,l=void 0,u=void 0,c=void 0,d=void 0,p=void 0,h=void 0,f=0===e.packed.indexOf("data-")?e.packed:"data-"+e.packed,m=e.sizes.slice().reverse(),g=!1!==e.position,y=e.container.nodeType?e.container:document.querySelector(e.container),b={all:function(){return D(y.children)},new:function(){return D(y.children).filter((function(e){return!e.hasAttribute(""+f)}))}},v=[C,T,O],w=[S,A,N,_],x=UA({pack:L,update:z,resize:P});return x;function M(e){e.forEach((function(e){return e()}))}function D(e){return Array.prototype.slice.call(e)}function k(e){return Array.apply(null,Array(e)).map((function(){return 0}))}function E(){return m.map((function(e){return e.mq&&window.matchMedia("(min-width: "+e.mq+")").matches})).indexOf(!0)}function C(){r=E()}function T(){i=-1===r?m[m.length-1]:m[r]}function O(){s=k(i.columns)}function S(){d=b[t?"new":"all"]()}function A(){0!==d.length&&(p=d.map((function(e){return e.clientWidth})),h=d.map((function(e){return e.clientHeight})))}function N(){d.forEach((function(e,t){o=s.indexOf(Math.min.apply(Math,s)),e.style.position="absolute",a=s[o]+"px",l=o*p[t]+o*i.gutter+"px",g?(e.style.top=a,e.style.left=l):e.style.transform="translate3d("+l+", "+a+", 0)",e.setAttribute(f,""),u=p[t],c=h[t],u&&c&&(s[o]+=c+i.gutter)}))}function _(){y.style.position="relative",y.style.width=i.columns*u+(i.columns-1)*i.gutter+"px",y.style.height=Math.max.apply(Math,s)-i.gutter+"px"}function j(){n||(window.requestAnimationFrame(I),n=!0)}function I(){r!==E()&&(L(),x.emit("resize",i)),n=!1}function L(){return t=!1,M(v.concat(w)),x.emit("pack")}function z(){return t=!0,M(w),x.emit("update")}function P(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=e?"addEventListener":"removeEventListener";return window[t]("resize",j),x}}}),$A=rc(HA),VA={exports:{}},WA={exports:{}};!function(e,n){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=t,o=a(i),s=a(qf.exports);function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.scrollListener=n.scrollListener.bind(n),n.eventListenerOptions=n.eventListenerOptions.bind(n),n.mousewheelListener=n.mousewheelListener.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var e=!1,t={get passive(){e=!0}};try{document.addEventListener("test",null,t),document.removeEventListener("test",null,t)}catch(e){}return e}},{key:"eventListenerOptions",value:function(){this.props.useCapture;return this.isPassiveSupported()?{useCapture:this.props.useCapture,passive:!0}:{passive:!1}}},{key:"setDefaultLoader",value:function(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(e){var t=this.props.getScrollParent&&this.props.getScrollParent();return null!=t?t:e&&e.parentNode}},{key:"filterProps",value:function(e){return e}},{key:"attachScrollListener",value:function(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var t=window;!1===this.props.useWindow&&(t=e),t.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),t.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function(){var e=this.scrollComponent,t=window,n=this.getParentElement(e),r=void 0;if(this.props.useWindow){var i=document.documentElement||document.body.parentNode||document.body,o=void 0!==t.pageYOffset?t.pageYOffset:i.scrollTop;r=this.props.isReverse?o:this.calculateOffset(e,o)}else r=this.props.isReverse?n.scrollTop:e.scrollHeight-n.scrollTop-n.clientHeight;r<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=n.scrollHeight,this.beforeScrollTop=n.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(e,t){return e?this.calculateTopPosition(e)+(e.offsetHeight-t-window.innerHeight):0}},{key:"calculateTopPosition",value:function(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function(){var e=this,t=this.filterProps(this.props),n=t.children,r=t.element,i=t.hasMore;t.initialLoad;var s=t.isReverse,a=t.loader;t.loadMore,t.pageStart;var l=t.ref;t.threshold,t.useCapture,t.useWindow,t.getScrollParent;var u=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);u.ref=function(t){e.scrollComponent=t,l&&l(t)};var c=[n];return i&&(a?s?c.unshift(a):c.push(a):this.defaultLoader&&(s?c.unshift(this.defaultLoader):c.push(this.defaultLoader))),o.default.createElement(r,u,c)}}]),t}(i.Component);l.propTypes={children:s.default.node.isRequired,element:s.default.node,hasMore:s.default.bool,initialLoad:s.default.bool,isReverse:s.default.bool,loader:s.default.node,loadMore:s.default.func.isRequired,pageStart:s.default.number,ref:s.default.func,getScrollParent:s.default.func,threshold:s.default.number,useCapture:s.default.bool,useWindow:s.default.bool},l.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},n.default=l,e.exports=n["default"]}(WA,WA.exports),VA.exports=WA.exports,Object.defineProperty(RA,"__esModule",{value:!0});var qA,YA,QA=RA.default=void 0,KA=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),GA=t,JA=tN(GA),XA=tN(qf.exports),ZA=tN($A),eN=tN(VA.exports);function tN(e){return e&&e.__esModule?e:{default:e}}function nN(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rN(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var iN=(YA=qA=function(e){function t(){var e,n,r;nN(this,t);for(var i=arguments.length,o=Array(i),s=0;s<i;s++)o[s]=arguments[s];return n=r=rN(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.setContainerRef=function(e){r.masonryContainer=e},r.forcePack=function(){r.masonryContainer&&r.state.instance.pack()},r.forceUpdate=function(){r.masonryContainer&&r.state.instance.update()},r.createNewInstance=function(){var e=r.props,t=e.packed,n=e.sizes,i=e.children,o=e.position,s=(0,ZA.default)({container:r.masonryContainer,packed:t,sizes:n,position:o});s.resize(!0),i.length>0&&s.pack(),r.setState((function(){return{instance:s}}))},rN(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,GA.Component),KA(t,[{key:"componentDidMount",value:function(){this.createNewInstance()}},{key:"componentDidUpdate",value:function(e){var t=this.props.children,n=this.state.instance;if(0!==e.children.length||0!==t.length)return 0===e.children.length&&t.length>0?n.pack():e.children.length!==t.length?this.props.pack?n.pack():n.update():void 0}},{key:"componentWillUnmount",value:function(){this.state&&this.state.instance.resize(!1)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.style;e.pack,e.packed,e.position,e.sizes;var i=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["children","className","style","pack","packed","position","sizes"]);return JA.default.createElement(eN.default,i,JA.default.createElement("div",{ref:this.setContainerRef,className:n,style:r},t))}}]),t}(),qA.propTypes={children:XA.default.arrayOf(XA.default.element).isRequired,className:XA.default.string,initialLoad:XA.default.bool,pack:XA.default.bool,packed:XA.default.string,position:XA.default.bool,sizes:XA.default.array,style:XA.default.object},qA.defaultProps={className:"",initialLoad:!0,pack:!1,packed:"data-packed",position:!0,sizes:[{columns:1,gutter:20},{mq:"768px",columns:2,gutter:20},{mq:"1024px",columns:3,gutter:20}],style:{}},YA);QA=RA.default=iN;const oN=e=>{let{onSubmit:n,unsplashApiKey:r}=e;const s=u(null),[a,l]=i(""),[c,d]=i(!1),[p,h]=i([]),[f,m]=i(1),[g,y]=i(!0),[b,v]=i(!1),w=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800;const[n,r]=i(e);return o((()=>{const n=setTimeout((()=>{r(e)}),t);return()=>{clearTimeout(n)}}),[e]),n}(a||"latest");o((()=>{x(1)}),[w]);const x=async e=>{try{v(!0),d(!1);const t=await(e=>{let{pageNo:t,query:n,apiKey:r}=e;return by.get(fd,{headers:{Authorization:"Client-ID ".concat(r)},params:{page:t,per_page:30,order_by:"popular",query:n}})})({page:e,query:w,apiKey:r}),{data:{results:n,total_pages:i}}=t;h(1===e?n:[...p,...n]),m(e+1),y(e<i)}catch(e){d(!0)}finally{v(!1)}};return t.createElement("div",{className:"neeto-editor-unsplash-wrapper"},t.createElement(jf,{autoFocus:!0,name:"text",value:a,placeholder:"Search Unsplash",onChange:e=>{let{target:{value:t}}=e;l(t)},"data-cy":"neeto-editor-unsplash-image-picker-search-input"}),c&&t.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-error"},"Something went wrong! Please try again later."),!c&&!b&&ld(p)&&t.createElement("p",{className:"neeto-editor-unsplash-gallery__text","data-cy":"neeto-editor-unsplash-image-picker-no-results-error"},"No results"),!c&&t.createElement("div",{className:"neeto-editor-unsplash-container"},t.createElement(QA,{ref:s,pack:!0,style:{width:"100%"},sizes:[{columns:3,gutter:0},{mq:"768px",columns:3,gutter:0},{mq:"1024px",columns:3,gutter:0}],hasMore:g,loadMore:()=>{!b&&g&&f>1&&x(f)},position:!0,useWindow:!1,className:"neeto-editor-unsplash-gallery",loader:t.createElement(FA,{key:0})},p&&p.map(((e,r)=>t.createElement("div",{key:r,className:"neeto-editor-unsplash-gallery__item","data-cy":"neeto-editor-unsplash-image-picker-result-".concat(r)},t.createElement("div",{className:"neeto-editor-unsplash-gallery__item-placeholder",style:{paddingBottom:"".concat(e.height/e.width*100,"%")}},t.createElement("div",{className:"neeto-editor-unsplash-gallery__item-inner",id:"unsplashImage".concat(r)},t.createElement("img",{src:e.urls.regular,onClick:()=>n(e.urls.small)}),t.createElement("a",{href:"https://unsplash.com/@".concat(e.user.username),target:"_blank",rel:"noreferrer"},e.user.name," "))))))),!g&&t.createElement("p",{className:"neeto-editor-unsplash-gallery__text"},"End of results")))},sN=e=>{let{buttonLabel:n="Submit",placeholder:r,onSubmit:o,className:s}=e;const[a,l]=i(""),[u,c]=i("");return t.createElement("div",{className:sc("neeto-editor-url-form__wrapper",{[s]:s})},t.createElement(jf,{autoFocus:!0,name:"url",value:a,placeholder:r,onFocus:()=>c(""),error:u,onChange:e=>{let{target:{value:t}}=e;return l(t)},"data-cy":"neeto-editor-image-upload-url-input"}),t.createElement(Ld,{size:"large",label:n,onClick:e=>{e.preventDefault(),Rf.test(a)?o(a):c("Please enter a valid url")},disabled:!a,"data-cy":"neeto-editor-image-upload-url-submit"}))},aN=e=>{let{editor:n,imageUploadUrl:r,uploadConfig:o,isVisible:s,setIsVisible:a,unsplashApiKey:l,isUnsplashImageUploadActive:u}=e;const[c,d]=(e=>{var t;const[n,r]=i(null===(t=e[0])||void 0===t?void 0:t.key);return[n,e=>r(e.key)]})(zv),[p,h]=i(""),f=e=>{h(e)},m={local:()=>t.createElement(PA,{endpoint:r,onSuccess:f,uploadConfig:o}),link:()=>t.createElement(sN,{onSubmit:f,buttonLabel:"Upload Image",placeholder:"Paste the image link"}),unsplash:()=>t.createElement(oN,{unsplashApiKey:l,onSubmit:f})}[c];return t.createElement(Nf,{isOpen:s,onClose:()=>{a(!1),d(zv[0])},closeButton:!1},t.createElement("div",{className:"neeto-editor-image-uploader"},t.createElement(_v,null,zv.filter((e=>"unsplash"!==e.key||u)).map((e=>t.createElement(_v.Item,{key:e.key,active:c===e.key,onClick:()=>d(e)},e.title)))),t.createElement("div",{className:"neeto-editor-image-uploader__content"},p?t.createElement(If,{url:p,editor:n,onClose:()=>{h(null),a(!1)}}):t.createElement(m,null))))},lN=js.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize"}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){return t.textBetween(0,t.content.size,void 0," ").length}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;return t.textBetween(0,t.content.size," "," ").split(" ").filter((e=>""!==e)).length}},addProseMirrorPlugins(){return[new kn({key:new Tn("characterCount"),filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n)return!0;if(r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r)return!1;if(!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,s=o-(i-n),a=o;e.deleteRange(s,a);return!(this.storage.characters({node:e.doc})>n)}})]}}),uN=Ca.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=ea(e,this.type);return!!Object.entries(n).some((([,e])=>!!e))||t.unsetMark(this.name)}}}}),cN=js.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return null===(t=e.style.color)||void 0===t?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})});function dN(e={}){return new kn({view:t=>new pN(t,e)})}class pN{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?t.bottom:t.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:t.left,right:t.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos);e={left:t.left-this.width/2,right:t.left+this.width/2,top:t.top,bottom:t.bottom}}let n,r,i=this.editorView.dom.offsetParent;if(this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!i||i==document.body&&"static"==getComputedStyle(i).position)n=-pageXOffset,r=-pageYOffset;else{let e=i.getBoundingClientRect();n=e.left-i.scrollLeft,r=e.top-i.scrollTop}this.element.style.left=e.left-n+"px",this.element.style.top=e.top-r+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&(e=Bt(this.editorView.state.doc,e,this.editorView.dragging.slice),null==e))return this.setCursor(null);this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const hN=js.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[dN(this.options)]}}),fN=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,mN=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,gN=Ca.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}`}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[xa({find:fN,type:this.type})]},addPasteRules(){return[Oa({find:mN,type:this.type})]}});function yN(e){this.j={},this.jr=[],this.jd=null,this.t=e}yN.prototype={accepts:function(){return!!this.t},tt:function(e,t){if(t&&t.j)return this.j[e]=t,t;var n=t,r=this.j[e];if(r)return n&&(r.t=n),r;r=bN();var i=MN(this,e);return i?(Object.assign(r.j,i.j),r.jr.append(i.jr),r.jr=i.jd,r.t=n||i.t):r.t=n,this.j[e]=r,r}};var bN=function(){return new yN},vN=function(e){return new yN(e)},wN=function(e,t,n){e.j[t]||(e.j[t]=n)},xN=function(e,t,n){e.jr.push([t,n])},MN=function(e,t){var n=e.j[t];if(n)return n;for(var r=0;r<e.jr.length;r++){var i=e.jr[r][0],o=e.jr[r][1];if(i.test(t))return o}return e.jd},DN=function(e,t,n){for(var r=0;r<t.length;r++)wN(e,t[r],n)},kN=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0],i=t[n][1];wN(e,r,i)}},EN=function(e,t,n,r){for(var i,o=0,s=t.length;o<s&&(i=e.j[t[o]]);)e=i,o++;if(o>=s)return[];for(;o<s-1;)i=r(),wN(e,t[o],i),e=i,o++;wN(e,t[s-1],n)},CN="DOMAIN",TN="LOCALHOST",ON="TLD",SN="NUM",AN="PROTOCOL",NN="MAILTO",_N="WS",jN="NL",IN="OPENBRACE",LN="OPENBRACKET",zN="OPENANGLEBRACKET",PN="OPENPAREN",FN="CLOSEBRACE",RN="CLOSEBRACKET",BN="CLOSEANGLEBRACKET",UN="CLOSEPAREN",HN="AMPERSAND",$N="APOSTROPHE",VN="ASTERISK",WN="AT",qN="BACKSLASH",YN="BACKTICK",QN="CARET",KN="COLON",GN="COMMA",JN="DOLLAR",XN="DOT",ZN="EQUALS",e_="EXCLAMATION",t_="HYPHEN",n_="PERCENT",r_="PIPE",i_="PLUS",o_="POUND",s_="QUERY",a_="QUOTE",l_="SEMI",u_="SLASH",c_="TILDE",d_="UNDERSCORE",p_="SYM",h_=Object.freeze({__proto__:null,DOMAIN:CN,LOCALHOST:TN,TLD:ON,NUM:SN,PROTOCOL:AN,MAILTO:NN,WS:_N,NL:jN,OPENBRACE:IN,OPENBRACKET:LN,OPENANGLEBRACKET:zN,OPENPAREN:PN,CLOSEBRACE:FN,CLOSEBRACKET:RN,CLOSEANGLEBRACKET:BN,CLOSEPAREN:UN,AMPERSAND:HN,APOSTROPHE:$N,ASTERISK:VN,AT:WN,BACKSLASH:qN,BACKTICK:YN,CARET:QN,COLON:KN,COMMA:GN,DOLLAR:JN,DOT:XN,EQUALS:ZN,EXCLAMATION:e_,HYPHEN:t_,PERCENT:n_,PIPE:r_,PLUS:i_,POUND:o_,QUERY:s_,QUOTE:a_,SEMI:l_,SLASH:u_,TILDE:c_,UNDERSCORE:d_,SYM:p_}),f_="aaa aarp abarth abb abbott abbvie abc able abogado abudhabi ac academy accenture accountant accountants aco actor ad adac ads adult ae aeg aero aetna af afamilycompany afl africa ag agakhan agency ai aig airbus airforce airtel akdn al alfaromeo alibaba alipay allfinanz allstate ally alsace alstom am amazon americanexpress americanfamily amex amfam amica amsterdam analytics android anquan anz ao aol apartments app apple aq aquarelle ar arab aramco archi army arpa art arte as asda asia associates at athleta attorney au auction audi audible audio auspost author auto autos avianca aw aws ax axa az azure ba baby baidu banamex bananarepublic band bank bar barcelona barclaycard barclays barefoot bargains baseball basketball bauhaus bayern bb bbc bbt bbva bcg bcn bd be beats beauty beer bentley berlin best bestbuy bet bf bg bh bharti bi bible bid bike bing bingo bio biz bj black blackfriday blockbuster blog bloomberg blue bm bms bmw bn bnpparibas bo boats boehringer bofa bom bond boo book booking bosch bostik boston bot boutique box br bradesco bridgestone broadway broker brother brussels bs bt budapest bugatti build builders business buy buzz bv bw by bz bzh ca cab cafe cal call calvinklein cam camera camp cancerresearch canon capetown capital capitalone car caravan cards care career careers cars casa case cash casino cat catering catholic cba cbn cbre cbs cc cd center ceo cern cf cfa cfd cg ch chanel channel charity chase chat cheap chintai christmas chrome church ci cipriani circle cisco citadel citi citic city cityeats ck cl claims cleaning click clinic clinique clothing cloud club clubmed cm cn co coach codes coffee college cologne com comcast commbank community company compare computer comsec condos construction consulting contact contractors cooking cookingchannel cool coop corsica country coupon coupons courses cpa cr credit creditcard creditunion cricket crown crs cruise cruises csc cu cuisinella cv cw cx cy cymru cyou cz dabur dad dance data date dating datsun day dclk dds de deal dealer deals degree delivery dell deloitte delta democrat dental dentist desi design dev dhl diamonds diet digital direct directory discount discover dish diy dj dk dm dnp do docs doctor dog domains dot download drive dtv dubai duck dunlop dupont durban dvag dvr dz earth eat ec eco edeka edu education ee eg email emerck energy engineer engineering enterprises epson equipment er ericsson erni es esq estate et etisalat eu eurovision eus events exchange expert exposed express extraspace fage fail fairwinds faith family fan fans farm farmers fashion fast fedex feedback ferrari ferrero fi fiat fidelity fido film final finance financial fire firestone firmdale fish fishing fit fitness fj fk flickr flights flir florist flowers fly fm fo foo food foodnetwork football ford forex forsale forum foundation fox fr free fresenius frl frogans frontdoor frontier ftr fujitsu fujixerox fun fund furniture futbol fyi ga gal gallery gallo gallup game games gap garden gay gb gbiz gd gdn ge gea gent genting george gf gg ggee gh gi gift gifts gives giving gl glade glass gle global globo gm gmail gmbh gmo gmx gn godaddy gold goldpoint golf goo goodyear goog google gop got gov gp gq gr grainger graphics gratis green gripe grocery group gs gt gu guardian gucci guge guide guitars guru gw gy hair hamburg hangout haus hbo hdfc hdfcbank health healthcare help helsinki here hermes hgtv hiphop hisamitsu hitachi hiv hk hkt hm hn hockey holdings holiday homedepot homegoods homes homesense honda horse hospital host hosting hot hoteles hotels hotmail house how hr hsbc ht hu hughes hyatt hyundai ibm icbc ice icu id ie ieee ifm ikano il im imamat imdb immo immobilien in inc industries infiniti info ing ink institute insurance insure int international intuit investments io ipiranga iq ir irish is ismaili ist istanbul it itau itv iveco jaguar java jcb je jeep jetzt jewelry jio jll jm jmp jnj jo jobs joburg jot joy jp jpmorgan jprs juegos juniper kaufen kddi ke kerryhotels kerrylogistics kerryproperties kfh kg kh ki kia kim kinder kindle kitchen kiwi km kn koeln komatsu kosher kp kpmg kpn kr krd kred kuokgroup kw ky kyoto kz la lacaixa lamborghini lamer lancaster lancia land landrover lanxess lasalle lat latino latrobe law lawyer lb lc lds lease leclerc lefrak legal lego lexus lgbt li lidl life lifeinsurance lifestyle lighting like lilly limited limo lincoln linde link lipsy live living lixil lk llc llp loan loans locker locus loft lol london lotte lotto love lpl lplfinancial lr ls lt ltd ltda lu lundbeck luxe luxury lv ly ma macys madrid maif maison makeup man management mango map market marketing markets marriott marshalls maserati mattel mba mc mckinsey md me med media meet melbourne meme memorial men menu merckmsd mg mh miami microsoft mil mini mint mit mitsubishi mk ml mlb mls mm mma mn mo mobi mobile moda moe moi mom monash money monster mormon mortgage moscow moto motorcycles mov movie mp mq mr ms msd mt mtn mtr mu museum mutual mv mw mx my mz na nab nagoya name nationwide natura navy nba nc ne nec net netbank netflix network neustar new news next nextdirect nexus nf nfl ng ngo nhk ni nico nike nikon ninja nissan nissay nl no nokia northwesternmutual norton now nowruz nowtv np nr nra nrw ntt nu nyc nz obi observer off office okinawa olayan olayangroup oldnavy ollo om omega one ong onl online onyourside ooo open oracle orange org organic origins osaka otsuka ott ovh pa page panasonic paris pars partners parts party passagens pay pccw pe pet pf pfizer pg ph pharmacy phd philips phone photo photography photos physio pics pictet pictures pid pin ping pink pioneer pizza pk pl place play playstation plumbing plus pm pn pnc pohl poker politie porn post pr pramerica praxi press prime pro prod productions prof progressive promo properties property protection pru prudential ps pt pub pw pwc py qa qpon quebec quest qvc racing radio raid re read realestate realtor realty recipes red redstone redumbrella rehab reise reisen reit reliance ren rent rentals repair report republican rest restaurant review reviews rexroth rich richardli ricoh ril rio rip rmit ro rocher rocks rodeo rogers room rs rsvp ru rugby ruhr run rw rwe ryukyu sa saarland safe safety sakura sale salon samsclub samsung sandvik sandvikcoromant sanofi sap sarl sas save saxo sb sbi sbs sc sca scb schaeffler schmidt scholarships school schule schwarz science scjohnson scot sd se search seat secure security seek select sener services ses seven sew sex sexy sfr sg sh shangrila sharp shaw shell shia shiksha shoes shop shopping shouji show showtime si silk sina singles site sj sk ski skin sky skype sl sling sm smart smile sn sncf so soccer social softbank software sohu solar solutions song sony soy spa space sport spot spreadbetting sr srl ss st stada staples star statebank statefarm stc stcgroup stockholm storage store stream studio study style su sucks supplies supply support surf surgery suzuki sv swatch swiftcover swiss sx sy sydney systems sz tab taipei talk taobao target tatamotors tatar tattoo tax taxi tc tci td tdk team tech technology tel temasek tennis teva tf tg th thd theater theatre tiaa tickets tienda tiffany tips tires tirol tj tjmaxx tjx tk tkmaxx tl tm tmall tn to today tokyo tools top toray toshiba total tours town toyota toys tr trade trading training travel travelchannel travelers travelersinsurance trust trv tt tube tui tunes tushu tv tvs tw tz ua ubank ubs ug uk unicom university uno uol ups us uy uz va vacations vana vanguard vc ve vegas ventures verisign versicherung vet vg vi viajes video vig viking villas vin vip virgin visa vision viva vivo vlaanderen vn vodka volkswagen volvo vote voting voto voyage vu vuelos wales walmart walter wang wanggou watch watches weather weatherchannel webcam weber website wed wedding weibo weir wf whoswho wien wiki williamhill win windows wine winners wme wolterskluwer woodside work works world wow ws wtc wtf xbox xerox xfinity xihuan xin xxx xyz yachts yahoo yamaxun yandex ye yodobashi yoga yokohama you youtube yt yun za zappos zara zero zip zm zone zuerich zw vermögensberater-ctb vermögensberatung-pwb ελ ευ бг бел дети ею католик ком қаз мкд мон москва онлайн орг рус рф сайт срб укр გე հայ ישראל קום ابوظبي اتصالات ارامكو الاردن البحرين الجزائر السعودية العليان المغرب امارات ایران بارت بازار بھارت بيتك پاکستان ڀارت تونس سودان سورية شبكة عراق عرب عمان فلسطين قطر كاثوليك كوم مصر مليسيا موريتانيا موقع همراه कॉम नेट भारत भारतम् भारोत संगठन বাংলা ভারত ভাৰত ਭਾਰਤ ભારત ଭାରତ இந்தியா இலங்கை சிங்கப்பூர் భారత్ ಭಾರತ ഭാരതം ලංකා คอม ไทย ລາວ 닷넷 닷컴 삼성 한국 アマゾン グーグル クラウド コム ストア セール ファッション ポイント みんな 世界 中信 中国 中國 中文网 亚马逊 企业 佛山 信息 健康 八卦 公司 公益 台湾 台灣 商城 商店 商标 嘉里 嘉里大酒店 在线 大众汽车 大拿 天主教 娱乐 家電 广东 微博 慈善 我爱你 手机 招聘 政务 政府 新加坡 新闻 时尚 書籍 机构 淡马锡 游戏 澳門 点看 移动 组织机构 网址 网店 网站 网络 联通 诺基亚 谷歌 购物 通販 集团 電訊盈科 飞利浦 食品 餐厅 香格里拉 香港".split(" "),m_=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/,g_=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEDD-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC5\uDED0-\uDED9\uDEE0-\uDEE7\uDEF0-\uDEF6])/,y_=/\uFE0F/,b_=/\d/,v_=/\s/;function w_(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=bN(),n=vN(SN),r=vN(CN),i=bN(),o=vN(_N),s=[[b_,r],[m_,r],[g_,r],[y_,r]],a=function(){var e=vN(CN);return e.j={"-":i},e.jr=[].concat(s),e},l=function(e){var t=a();return t.t=e,t};kN(t,[["'",vN($N)],["{",vN(IN)],["[",vN(LN)],["<",vN(zN)],["(",vN(PN)],["}",vN(FN)],["]",vN(RN)],[">",vN(BN)],[")",vN(UN)],["&",vN(HN)],["*",vN(VN)],["@",vN(WN)],["`",vN(YN)],["^",vN(QN)],[":",vN(KN)],[",",vN(GN)],["$",vN(JN)],[".",vN(XN)],["=",vN(ZN)],["!",vN(e_)],["-",vN(t_)],["%",vN(n_)],["|",vN(r_)],["+",vN(i_)],["#",vN(o_)],["?",vN(s_)],['"',vN(a_)],["/",vN(u_)],[";",vN(l_)],["~",vN(c_)],["_",vN(d_)],["\\",vN(qN)]]),wN(t,"\n",vN(jN)),xN(t,v_,o),wN(o,"\n",bN()),xN(o,v_,o);for(var u=0;u<f_.length;u++)EN(t,f_[u],l(ON),a);var c=a(),d=a(),p=a(),h=a();EN(t,"file",c,a),EN(t,"ftp",d,a),EN(t,"http",p,a),EN(t,"mailto",h,a);var f=a(),m=vN(AN),g=vN(NN);wN(d,"s",f),wN(d,":",m),wN(p,"s",f),wN(p,":",m),wN(c,":",m),wN(f,":",m),wN(h,":",g);for(var y=a(),b=0;b<e.length;b++)EN(t,e[b],y,a);return wN(y,":",m),EN(t,"localhost",l(TN),a),xN(t,b_,n),xN(t,m_,r),xN(t,g_,r),xN(t,y_,r),xN(n,b_,n),xN(n,m_,r),xN(n,g_,r),xN(n,y_,r),wN(n,"-",i),wN(r,"-",i),wN(i,"-",i),xN(r,b_,r),xN(r,m_,r),xN(r,g_,r),xN(r,y_,r),xN(i,b_,r),xN(i,m_,r),xN(i,g_,r),xN(i,y_,r),t.jd=vN(p_),t}var x_={defaultProtocol:"http",events:null,format:M_,formatHref:M_,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function M_(e){return e}function D_(){}function k_(e,t){function n(t,n){this.t=e,this.v=t,this.tk=n}return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object.create(e.prototype);for(var i in n)r[i]=n[i];r.constructor=t,t.prototype=r}(D_,n,t),n}D_.prototype={t:"token",isLink:!1,toString:function(){return this.v},toHref:function(){return this.toString()},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x_.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}}};var E_=k_("email",{isLink:!0}),C_=k_("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),T_=k_("text"),O_=k_("nl"),S_=k_("url",{isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x_.defaultProtocol,t=this.tk,n=!1,r=!1,i=[],o=0;t[o].t===AN;)n=!0,i.push(t[o].v),o++;for(;t[o].t===u_;)r=!0,i.push(t[o].v),o++;for(;o<t.length;o++)i.push(t[o].v);return i=i.join(""),n||r||(i="".concat(e,"://").concat(i)),i},hasProtocol:function(){return this.tk[0].t===AN}}),A_=Object.freeze({__proto__:null,MultiToken:D_,Base:D_,createTokenClass:k_,MailtoEmail:E_,Email:C_,Text:T_,Nl:O_,Url:S_});function N_(){var e=bN(),t=bN(),n=bN(),r=bN(),i=bN(),o=bN(),s=bN(),a=vN(S_),l=bN(),u=vN(S_),c=vN(S_),d=bN(),p=bN(),h=bN(),f=bN(),m=bN(),g=vN(S_),y=vN(S_),b=vN(S_),v=vN(S_),w=bN(),x=bN(),M=bN(),D=bN(),k=bN(),E=bN(),C=vN(C_),T=bN(),O=vN(C_),S=vN(E_),A=bN(),N=bN(),_=bN(),j=bN(),I=vN(O_);wN(e,jN,I),wN(e,AN,t),wN(e,NN,n),wN(t,u_,r),wN(r,u_,i),wN(e,ON,o),wN(e,CN,o),wN(e,TN,a),wN(e,SN,o),wN(i,ON,c),wN(i,CN,c),wN(i,SN,c),wN(i,TN,c),wN(o,XN,s),wN(k,XN,E),wN(s,ON,a),wN(s,CN,o),wN(s,SN,o),wN(s,TN,o),wN(E,ON,C),wN(E,CN,k),wN(E,SN,k),wN(E,TN,k),wN(a,XN,s),wN(C,XN,E),wN(a,KN,l),wN(a,u_,c),wN(l,SN,u),wN(u,u_,c),wN(C,KN,T),wN(T,SN,O);var L=[HN,VN,WN,qN,YN,QN,JN,CN,ZN,t_,TN,SN,n_,r_,i_,o_,AN,u_,p_,c_,ON,d_],z=[$N,BN,FN,RN,UN,KN,GN,XN,e_,zN,IN,LN,PN,s_,a_,l_];wN(c,IN,p),wN(c,LN,h),wN(c,zN,f),wN(c,PN,m),wN(d,IN,p),wN(d,LN,h),wN(d,zN,f),wN(d,PN,m),wN(p,FN,c),wN(h,RN,c),wN(f,BN,c),wN(m,UN,c),wN(g,FN,c),wN(y,RN,c),wN(b,BN,c),wN(v,UN,c),wN(w,FN,c),wN(x,RN,c),wN(M,BN,c),wN(D,UN,c),DN(p,L,g),DN(h,L,y),DN(f,L,b),DN(m,L,v),DN(p,z,w),DN(h,z,x),DN(f,z,M),DN(m,z,D),DN(g,L,g),DN(y,L,y),DN(b,L,b),DN(v,L,v),DN(g,z,g),DN(y,z,y),DN(b,z,b),DN(v,z,v),DN(w,L,g),DN(x,L,y),DN(M,L,b),DN(D,L,v),DN(w,z,w),DN(x,z,x),DN(M,z,M),DN(D,z,D),DN(c,L,c),DN(d,L,c),DN(c,z,d),DN(d,z,d),wN(n,ON,S),wN(n,CN,S),wN(n,SN,S),wN(n,TN,S),DN(S,L,S),DN(S,z,A),DN(A,L,S),DN(A,z,A);var P=[HN,$N,VN,qN,YN,QN,FN,JN,CN,ZN,t_,SN,IN,n_,r_,i_,o_,s_,u_,p_,c_,ON,d_];return DN(o,P,N),wN(o,WN,_),DN(a,P,N),wN(a,WN,_),DN(s,P,N),DN(N,P,N),wN(N,WN,_),wN(N,XN,j),DN(j,P,N),wN(_,ON,k),wN(_,CN,k),wN(_,SN,k),wN(_,TN,C),e}function __(e,t,n){var r=n[0].s,i=n[n.length-1].e;return new e(t.substr(r,i-r),n)}var j_="undefined"!=typeof console&&console&&console.warn||function(){},I_={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function L_(e){if(I_.initialized&&j_('linkifyjs: already initialized - will not register custom protocol "'.concat(e,'" until you manually call linkify.init(). To avoid this warning, please register all custom protocols before invoking linkify the first time.')),!/^[a-z-]+$/.test(e))throw Error("linkifyjs: protocols containing characters other than a-z or - (hyphen) are not supported");I_.customProtocols.push(e)}function z_(e){return I_.initialized||function(){I_.scanner={start:w_(I_.customProtocols),tokens:h_},I_.parser={start:N_(),tokens:A_};for(var e={createTokenClass:k_},t=0;t<I_.pluginQueue.length;t++)I_.pluginQueue[t][1]({scanner:I_.scanner,parser:I_.parser,utils:e});I_.initialized=!0}(),function(e,t,n){for(var r=n.length,i=0,o=[],s=[];i<r;){for(var a=e,l=null,u=null,c=0,d=null,p=-1;i<r&&!(l=MN(a,n[i].t));)s.push(n[i++]);for(;i<r&&(u=l||MN(a,n[i].t));)l=null,(a=u).accepts()?(p=0,d=a):p>=0&&p++,i++,c++;if(p<0)for(var h=i-c;h<i;h++)s.push(n[h]);else{s.length>0&&(o.push(__(T_,t,s)),s=[]),i-=p,c-=p;var f=d.t,m=n.slice(i-c,i);o.push(__(f,t,m))}}return s.length>0&&o.push(__(T_,t,s)),o}(I_.parser.start,e,function(e,t){for(var n=function(e){for(var t=[],n=e.length,r=0;r<n;){var i=e.charCodeAt(r),o=void 0,s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,(function(e){return e.toLowerCase()}))),r=n.length,i=[],o=0,s=0;s<r;){for(var a=e,l=null,u=0,c=null,d=-1,p=-1;s<r&&(l=MN(a,n[s]));)(a=l).accepts()?(d=0,p=0,c=a):d>=0&&(d+=n[s].length,p++),u+=n[s].length,o+=n[s].length,s++;o-=d,s-=p,u-=d,i.push({t:c.t,v:t.substr(o-u,u),s:o-u,e:o})}return i}(I_.scanner.start,e))}function P_(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=z_(e),r=[],i=0;i<n.length;i++){var o=n[i];!o.isLink||t&&o.t!==t||r.push(o.toObject())}return r}function F_(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=z_(e);return 1===n.length&&n[0].isLink&&(!t||n[0].t===t)}function R_(e){return new kn({key:new Tn("autolink"),appendTransaction:(t,n,r)=>{const i=t.some((e=>e.docChanged))&&!n.doc.eq(r.doc),o=t.some((e=>e.getMeta("preventAutolink")));if(!i||o)return;const{tr:s}=r,a=function(e,t){const n=new Zt(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}(n.doc,[...t]),{mapping:l}=a,u=function(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,i)=>{const o=[];if(e.ranges.length)e.forEach(((e,t)=>{o.push({from:e,to:t})}));else{const{from:e,to:t}=n[i];if(void 0===e||void 0===t)return;o.push({from:e,to:t})}o.forEach((({from:e,to:n})=>{const o=t.slice(i).map(e,-1),s=t.slice(i).map(n),a=t.invert().map(o,-1),l=t.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:o,to:s}})}))})),ba(r)}(a);return u.forEach((({oldRange:t,newRange:i})=>{va(t.from,t.to,n.doc).filter((t=>t.mark.type===e.type)).forEach((t=>{const i=va(l.map(t.from),l.map(t.to),r.doc).filter((t=>t.mark.type===e.type));if(!i.length)return;const o=i[0],a=n.doc.textBetween(t.from,t.to,void 0," "),u=r.doc.textBetween(o.from,o.to,void 0," "),c=F_(a),d=F_(u);c&&!d&&s.removeMark(o.from,o.to,e.type)})),function(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,((e,t)=>{n(e)&&r.push({node:e,pos:t})})),r}(r.doc,i,(e=>e.isTextblock)).forEach((t=>{P_(r.doc.textBetween(t.pos,t.pos+t.node.nodeSize,void 0," ")).filter((e=>e.isLink)).filter((t=>!e.validate||e.validate(t.value))).map((e=>({...e,from:t.pos+e.start+1,to:t.pos+e.end+1}))).filter((e=>{const t=i.from>=e.from&&i.from<=e.to,n=i.to>=e.from&&i.to<=e.to;return t||n})).forEach((t=>{s.addMark(t.from,t.to,e.type.create({href:t.href}))}))}))})),s.steps.length?s:void 0}})}const B_=Ca.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(L_)},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:e}){return["a",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setLink:e=>({chain:t})=>t().setMark(this.name,e).setMeta("preventAutolink",!0).run(),toggleLink:e=>({chain:t})=>t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Oa({find:e=>P_(e).filter((e=>!this.options.validate||this.options.validate(e.value))).filter((e=>e.isLink)).map((e=>({text:e.value,index:e.start,data:e}))),type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[];var t;return this.options.autolink&&e.push(R_({type:this.type,validate:this.options.validate})),this.options.openOnClick&&e.push((t={type:this.type},new kn({key:new Tn("handleClickLink"),props:{handleClick:(e,n,r)=>{var i;const o=ma(e.state,t.type.name);return!(!(null===(i=r.target)||void 0===i?void 0:i.closest("a"))||!o.href||(window.open(o.href,o.target),0))}}}))),this.options.linkOnPaste&&e.push(function(e){return new kn({key:new Tn("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:i}=t,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach((e=>{a+=e.textContent}));const l=P_(a).find((e=>e.isLink&&e.value===a));return!(!a||!l||(e.editor.commands.setMark(e.type,{href:l.href}),0))}}})}({editor:this.editor,type:this.type})),e}}),U_=Ca.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),H_=/^\s*>\s$/,$_=Ta.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Ea({find:H_,type:this.type})]}}),V_=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,W_=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,q_=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Y_=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Q_=Ca.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[xa({find:V_,type:this.type}),xa({find:q_,type:this.type})]},addPasteRules(){return[Oa({find:W_,type:this.type}),Oa({find:Y_,type:this.type})]}}),K_=/^\s*([-+*])\s$/,G_=Ta.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[Ea({find:K_,type:this.type})]}}),J_=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,X_=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Z_=Ca.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[xa({find:J_,type:this.type})]},addPasteRules(){return[Oa({find:X_,type:this.type})]}}),ej=/^```([a-z]+)?[\s\n]$/,tj=/^~~~([a-z]+)?[\s\n]$/,nj=Ta.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,r=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter((e=>e.startsWith(n))).map((e=>e.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",ms(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!o||!s)&&e.chain().command((({tr:e})=>(e.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type)return!1;if(!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();if(void 0===s)return!1;return!r.nodeAt(s)&&e.commands.exitCode()}}},addInputRules(){return[Da({find:ej,type:this.type,getAttributes:e=>({language:e[1]})}),Da({find:tj,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new kn({key:new Tn("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;const{tr:s}=e.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(sn.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,"\n")),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),rj=Ta.create({name:"doc",topNode:!0,content:"block+"}),ij="undefined"!=typeof navigator?navigator:null,oj="undefined"!=typeof document?document:null,sj=ij&&ij.userAgent||"",aj=/Edge\/(\d+)/.exec(sj),lj=/MSIE \d/.exec(sj),uj=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(sj),cj=!!(lj||uj||aj),dj=lj?document.documentMode:uj?+uj[1]:aj?+aj[1]:0,pj=!cj&&/gecko\/(\d+)/i.test(sj);pj&&(/Firefox\/(\d+)/.exec(sj)||[0,0])[1];const hj=!cj&&/Chrome\/(\d+)/.exec(sj),fj=!!hj,mj=hj?+hj[1]:0,gj=!cj&&!!ij&&/Apple Computer/.test(ij.vendor),yj=gj&&(/Mobile\/\w+/.test(sj)||!!ij&&ij.maxTouchPoints>2),bj=yj||!!ij&&/Mac/.test(ij.platform),vj=/Android \d/.test(sj),wj=!!oj&&"webkitFontSmoothing"in oj.documentElement.style,xj=wj?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Mj=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Dj=/^(img|br|input|textarea|hr)$/i;function kj(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Ej(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Cj(e)||Dj.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Mj(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?Ej(e):0}}}function Ej(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Cj(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 Tj=function(e){let t=e.isCollapsed;return t&&fj&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function Oj(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function Sj(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,u=r.resolve(s);if(Tj(n)){for(a=u;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&ln.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==Ej(e);r||i;){if(e==n)return!0;let t=Mj(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==Ej(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new ln(s==e?u:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=Pj(e,a,u,"pointer"==t||e.state.selection.head<u.pos&&!o?1:-1)}return l}function Aj(e){return e.editable?e.hasFocus():function(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}}(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Nj(e,t=!1){let n=e.state.selection;if(function(e,t){if(t instanceof ln){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(zj(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else zj(e)}(e,n),Aj(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&fj){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&(r=t.anchorNode,i=t.anchorOffset,o=n.anchorNode,s=n.anchorOffset,o&&(kj(r,i,o,s,-1)||kj(r,i,o,s,1))))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}var r,i,o,s;if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,Mj(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&cj&&dj<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,i,{anchor:o,head:s}=n;!_j||n instanceof sn||(n.$from.parent.inlineContent||(r=jj(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=jj(e,n.to))),e.docView.setSelection(o,s,e.root,t),_j&&(r&&Lj(r),i&&Lj(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{Aj(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const _j=gj||fj&&mj<63;function jj(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(gj&&i&&"false"==i.contentEditable)return Ij(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return Ij(i);if(o)return Ij(o)}}function Ij(e){return e.contentEditable="true",gj&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Lj(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function zj(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Pj(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||sn.between(t,n,r)}function Fj(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&tn.findFrom(o,t)}function Rj(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Bj(e,t,n){let r=e.state.selection;if(!(r instanceof sn)){if(r instanceof ln&&r.node.isInline)return Rj(e,new sn(t>0?r.$to:r.$from));{let n=Fj(e.state,t);return!!n&&Rj(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=Fj(e.state,t);return!!(n&&n instanceof ln)&&Rj(e,n)}if(!(bj&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(ln.isSelectable(o)?Rj(e,new ln(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!wj&&Rj(e,new sn(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function Uj(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Hj(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function $j(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(pj&&1==n.nodeType&&r<Uj(n)&&Hj(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(Hj(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Wj(n))break;{let t=n.previousSibling;for(;t&&Hj(t);)i=n.parentNode,o=Mj(t),t=t.previousSibling;if(t)n=t,r=Uj(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?qj(e,t,n,r):i&&qj(e,t,i,o)}function Vj(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=Uj(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!Hj(n.childNodes[r]))break;i=n,o=++r}else{if(Wj(n))break;{let t=n.nextSibling;for(;t&&Hj(t);)i=t.parentNode,o=Mj(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=Uj(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&qj(e,t,i,o)}function Wj(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function qj(e,t,n,r){if(Tj(t)){let e=document.createRange();e.setEnd(n,r),e.setStart(n,r),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&Nj(e)}),50)}function Yj(e,t,n){let r=e.state.selection;if(r instanceof sn&&!r.empty||n.indexOf("s")>-1)return!1;if(bj&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Fj(e.state,t);if(n&&n instanceof ln)return Rj(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof cn?tn.near(n,t):tn.findFrom(n,t);return!!s&&Rj(e,s)}return!1}function Qj(e,t){if(!(e.state.selection instanceof sn))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function Kj(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Gj(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||bj&&72==n&&"c"==r?Qj(e,-1)||$j(e):46==n||bj&&68==n&&"c"==r?Qj(e,1)||Vj(e):13==n||27==n||(37==n||bj&&66==n&&"c"==r?Bj(e,-1,r)||$j(e):39==n||bj&&70==n&&"c"==r?Bj(e,1,r)||Vj(e):38==n||bj&&80==n&&"c"==r?Yj(e,-1,r)||$j(e):40==n||bj&&78==n&&"c"==r?function(e){if(!gj||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;Kj(e,n,"true"),setTimeout((()=>Kj(e,n,"false")),20)}return!1}(e)||Yj(e,1,r)||Vj(e):r==(bj?"m":"c")&&(66==n||73==n||89==n||90==n))}function Jj(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||dt.fromSchema(e.state.schema),a=aI(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&1==c.nodeType&&(u=oI[c.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=a.createElement(u[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}c=l.firstChild}c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n");return{dom:l,text:p}}function Xj(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new fe(le.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):fe.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=dt.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=aI().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&oI[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=e,n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),wj&&function(e){let t=e.querySelectorAll(fj?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let e=+c[3];e>0&&o.firstChild;e--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Xe.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!c),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Zj.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(c)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;i=le.from(t.create(n[e+1],i)),o++,s++}return new fe(i,o,s)}(iI(s,+c[1],+c[2]),c[4]);else if(s=fe.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&tI(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=nI(o[o.length-1],r.length));let t=eI(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return le.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=iI(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const Zj=/^(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 eI(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,le.from(e));return e}function tI(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=tI(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(le.from(eI(n,e,i+1))))}}function nI(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,nI(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(le.empty,!0);return e.copy(n.append(r))}function rI(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return i<r-1&&(a=rI(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(le.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function iI(e,t,n){return t<e.openStart&&(e=new fe(rI(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new fe(rI(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const oI={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 sI=null;function aI(){return sI||(sI=document.implementation.createHTMLDocument("title"))}const lI={};let uI={};function cI(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function dI(e){return{left:e.clientX,top:e.clientY}}function pI(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,(t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1))))return!0;return!1}function hI(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function fI(e,t,n,r,i){return pI(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof ln&&(n=i.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(ln.isSelectable(t)){r=n&&i.$from.depth>0&&e>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(e);break}}return null!=r&&(hI(e,ln.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&ln.isSelectable(r))&&(hI(e,new ln(n),"pointer"),!0)}(e,n))}function mI(e,t,n,r){return pI(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function gI(e,t,n,r){return pI(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&&(hI(e,sn.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)hI(e,sn.create(r,o+1,o+1+n.content.size),"pointer");else{if(!ln.isSelectable(n))continue;hI(e,ln.create(r,o),"pointer")}return!0}}(e,n,r)}function yI(e){return kI(e)}uI.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!wI(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!vj||!fj||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!yj||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||Gj(e,n)?n.preventDefault():cI(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,Oj(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},uI.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},uI.keypress=(e,t)=>{let n=t;if(wI(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||bj&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof sn&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const bI=bj?"metaKey":"ctrlKey";lI.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=yI(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[bI]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(dI(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new vI(e,s,n,!!r)):("doubleClick"==o?mI:gI)(e,s.pos,s.inside,n)?n.preventDefault():cI(e,"pointer"))};class vI{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[bI],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof ln&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!pj||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)),cI(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((()=>Nj(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(dI(e))),this.allowDefault||!t?cI(this.view,"pointer"):fI(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||gj&&this.mightDrag&&!this.mightDrag.node.isAtom||fj&&!(this.view.state.selection instanceof sn)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(hI(this.view,tn.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):cI(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),cI(this.view,"pointer"),0==e.buttons&&this.done()}}function wI(e,t){return!!e.composing||!!(gj&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}lI.touchdown=e=>{yI(e),cI(e,"pointer")},lI.contextmenu=e=>yI(e);const xI=vj?5e3:-1;function MI(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>kI(e)),t))}function DI(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 kI(e,t=!1){if(!(vj&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),DI(e),t||e.docView&&e.docView.dirty){let t=Sj(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}uI.compositionstart=uI.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(),kI(e,!0),e.markCursor=null;else if(kI(e),pj&&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}MI(e,xI)},uI.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,MI(e,20))};const EI=cj&&dj<15||yj&&xj<604;function CI(e,t,n,r){let i=Xj(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||fe.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}lI.copy=uI.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=EI?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Jj(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},uI.paste=(e,t)=>{let n=t;if(e.composing&&!vj)return;let r=EI?null:n.clipboardData;r&&CI(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?CI(e,r.value,null,t):CI(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class TI{constructor(e,t){this.slice=e,this.move=t}}const OI=bj?"altKey":"ctrlKey";lI.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(dI(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof ln?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(ln.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(ln.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=Jj(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(EI?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",EI||n.dataTransfer.setData("text/plain",l),e.dragging=new TI(s,!n[OI])},lI.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},uI.dragover=uI.dragenter=(e,t)=>t.preventDefault(),uI.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(dI(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Xj(e,n.dataTransfer.getData(EI?"Text":"text/plain"),EI?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[OI]);if(e.someProp("handleDrop",(t=>t(e,n,s||fe.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?Bt(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let u=e.state.tr;a&&u.deleteSelection();let c=u.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(p))return;let h=u.doc.resolve(c);if(d&&ln.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new ln(h));else{let t=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),u.setSelection(Pj(e,h,u.doc.resolve(t)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))},lI.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())&&Nj(e)}),20))},lI.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)},lI.beforeinput=(e,t)=>{if(fj&&vj&&"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,Oj(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 uI)lI[e]=uI[e];function SI(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 AI{constructor(e,t){this.toDOM=e,this.spec=t||LI,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new jI(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof AI&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&SI(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class NI{constructor(e,t){this.attrs=e,this.spec=t||LI}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new jI(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof NI&&SI(this.attrs,e.attrs)&&SI(this.spec,e.spec)}static is(e){return e.type instanceof NI}destroy(){}}class _I{constructor(e,t){this.attrs=e,this.spec=t||LI}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new jI(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof _I&&SI(this.attrs,e.attrs)&&SI(this.spec,e.spec)}destroy(){}}class jI{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new jI(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 jI(e,e,new AI(t,n))}static inline(e,t,n,r){return new jI(e,t,new NI(n,r))}static node(e,t,n,r){return new jI(e,t,new _I(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof NI}}const II=[],LI={};class zI{constructor(e,t){this.local=e.length?e:II,this.children=t.length?t:II}static create(e,t){return t.length?HI(t,e,0,LI):PI}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==PI||0==e.maps.length?this:this.mapInner(e,t,0,0,n||LI)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice(),l=(e,t,n,r)=>{for(let s=0;s<a.length;s+=3){let l,u=a[s+1];if(u<0||e>u+o)continue;let c=a[s]+o;t>=c?a[s+1]=e<=c?-2:-1:n>=i&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l)}};for(let e=0;e<n.maps.length;e++)n.maps[e].forEach(l);let u=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){u=!0,a[t+1]=-1;continue}let l=n.map(e[t]+o),c=l-i;if(c<0||c>=r.content.size){u=!0;continue}let d=n.map(e[t+1]+o,-1)-i,{index:p,offset:h}=r.content.findIndex(c),f=r.maybeChild(p);if(f&&h==c&&h+f.nodeSize==d){let r=a[t+2].mapInner(n,f,l+1,e[t]+o+1,s);r!=PI?(a[t]=c,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,u=!0)}else u=!0}if(u){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(r,i,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+o+1);return n}(a,e,t,n,i,o,s),u=HI(l,r,0,s);t=u.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<u.children.length;e+=3){let n=u.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,u.children[e],u.children[e+1],u.children[e+2])}}return new zI(t.sort($I),a)}(this.children,o||[],e,t,n,r,i):o?new zI(o.sort($I),II):PI}add(e,t){return t.length?this==PI?zI.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,a=o+n;if(s=BI(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,a+1):r.splice(i,0,o,o+e.nodeSize,HI(s,e,a+1,LI)),i+=3}}));let o=RI(i?UI(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new zI(o.length?this.local.concat(o).sort($I):this.local,r||this.children)}remove(e){return 0==e.length||this==PI?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(i||(i=[])).push(t));if(!i)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(i,o+1);a!=PI?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,i=0;i<e.length;i++)if(n=e[i])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new zI(r,n):PI}forChild(e,t){if(this==PI)return this;if(t.isLeaf)return zI.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof NI){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new zI(r.sort($I),II);return n?new FI([e,n]):e}return n||PI}eq(e){if(this==e)return!0;if(!(e instanceof zI)||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 VI(this.localsInner(e))}localsInner(e){if(this==PI)return II;if(e.inlineContent||!this.local.some(NI.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof NI||t.push(this.local[e]);return t}}zI.empty=new zI([],[]),zI.removeOverlap=VI;const PI=zI.empty;class FI{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,LI)));return FI.from(n)}forChild(e,t){if(t.isLeaf)return zI.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=PI&&(i instanceof FI?n=n.concat(i.members):n.push(i))}return FI.from(n)}eq(e){if(!(e instanceof FI)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?VI(n?t:t.sort($I)):II}static from(e){switch(e.length){case 0:return PI;case 1:return e[0];default:return new FI(e)}}}function RI(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new jI(i.from+t,i.to+t,i.type))}return n}function BI(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t,o=0;o<e.length;o++)(t=e[o])&&t.from>n&&t.to<r&&((i||(i=[])).push(t),e[o]=null);return i}function UI(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function HI(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=BI(e,t,s+n);if(a){o=!0;let e=HI(a,t,n+s+1,r);e!=PI&&i.push(s,s+t.nodeSize,e)}}));let s=RI(o?UI(e):e,-n).sort($I);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new zI(s,i):PI}function $I(e,t){return e.from-t.from||e.to-t.to}function VI(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),WI(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),WI(t,i+1,o.copy(r.to,o.to)))}}return t}function WI(e,t,n){for(;t<e.length&&$I(n,e[t])>0;)t++;e.splice(t,0,n)}class qI extends tn{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return qI.valid(n)?new qI(n):tn.near(n)}content(){return fe.empty}eq(e){return e instanceof qI&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new qI(e.resolve(t.pos))}getBookmark(){return new YI(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&qI.valid(e))return e;let r=e.pos,i=null;for(let n=e.depth;;n--){let o=e.node(n);if(t>0?e.indexAfter(n)<o.childCount:e.index(n)>0){i=o.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(qI.valid(s))return s}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!ln.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*t),n=!1;continue e}break}i=o,r+=t;let s=e.doc.resolve(r);if(qI.valid(s))return s}return null}}}qI.prototype.visible=!1,qI.findFrom=qI.findGapCursorFrom,tn.jsonID("gapcursor",qI);class YI{constructor(e){this.pos=e}map(e){return new YI(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return qI.valid(t)?new qI(t):tn.near(t)}}const QI=Go({ArrowLeft:KI("horiz",-1),ArrowRight:KI("horiz",1),ArrowUp:KI("vert",-1),ArrowDown:KI("vert",1)});function KI(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){let o=e.selection,s=t>0?o.$to:o.$from,a=o.empty;if(o instanceof sn){if(!i.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=qI.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new qI(l))),!0)}}function GI(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!qI.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&ln.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new qI(r))),!0)}function JI(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof qI))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=le.empty;for(let e=r.length-1;e>=0;e--)i=le.from(r[e].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new fe(i,0,0));return o.setSelection(sn.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function XI(e){if(!(e.selection instanceof qI))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",zI.create(e.doc,[jI.widget(e.selection.head,t,{key:"gapcursor"})])}const ZI=js.create({name:"gapCursor",addProseMirrorPlugins:()=>[new kn({props:{decorations:XI,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&qI.valid(n)?new qI(n):null,handleClick:GI,handleKeyDown:QI,handleDOMEvents:{beforeinput:JI}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!==(t=bs(ds(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),eL=Ta.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",ms(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,a=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&o){const t=a.filter((e=>s.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),tL=Ta.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,ms(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>Da({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}});var nL=200,rL=function(){};rL.prototype.append=function(e){return e.length?(e=rL.from(e),!this.length&&e||e.length<nL&&this.leafAppend(e)||this.length<nL&&e.leafPrepend(this)||this.appendInner(e)):this},rL.prototype.prepend=function(e){return e.length?rL.from(e).append(this):this},rL.prototype.appendInner=function(e){return new oL(this,e)},rL.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?rL.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},rL.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},rL.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},rL.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},rL.from=function(e){return e instanceof rL?e:e&&e.length?new iL(e):rL.empty};var iL=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=nL)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=nL)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(rL);rL.empty=new iL([]);var oL=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(rL),sL=rL;const aL=500;class lL{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,a=e.tr,l=[],u=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void u.push(e);if(n){u.push(new uL(e.map));let t,i=e.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new uL(t,void 0,void 0,l.length+u.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new lL(this.items.slice(0,i).append(u.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,u=e.steps[n].invert(e.docs[n]),c=new uL(e.mapping.maps[n],u,t);(l=a&&a.merge(c))&&(c=l,n?i.pop():s=s.slice(0,s.length-1)),i.push(c),t&&(o++,t=void 0),r||(a=c)}let l=o-n.depth;return l>dL&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),o-=l),new lL(s.append(i),o)}remapping(e,t){let n=new kt;return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new lL(this.items.append(e.map((e=>new uL(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),u=t.selection&&t.selection.map(i.slice(a+1,r));u&&s++,n.push(new uL(l,o,u))}else n.push(new uL(l))}),r);let l=[];for(let e=t;e<o;e++)l.push(new uL(i.maps[e]));let u=this.items.slice(0,r).append(l).append(n),c=new lL(u,s);return c.emptyItemCount()>aL&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l,u=new uL(s.invert(),e,a),c=r.length-1;(l=r.length&&r[c].merge(u))?r[c]=l:r.push(u)}}else o.map&&n--}),this.items.length,0),new lL(sL.from(r.reverse()),i)}}lL.empty=new lL(sL.empty,0);class uL{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new uL(t.getMap().invert(),t,this.selection)}}}class cL{constructor(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r}}const dL=20;function pL(e){let t=[];return e.forEach(((e,n,r,i)=>t.push(r,i))),t}function hL(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function fL(e,t,n,r){let i=yL(t),o=bL.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,i);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),o,i),u=new cL(r?l:s.remaining,r?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(bL,{redo:r,historyState:u}).scrollIntoView())}let mL=!1,gL=null;function yL(e){let t=e.plugins;if(gL!=t){mL=!1,gL=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){mL=!0;break}}return mL}const bL=new Tn("history"),vL=new Tn("closeHistory");function wL(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new kn({key:bL,state:{init:()=>new cL(lL.empty,lL.empty,null,0),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(bL);if(o)return o.historyState;n.getMeta(vL)&&(e=new cL(e.done,e.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(bL))return s.getMeta(bL).redo?new cL(e.done.addTransform(n,void 0,r,yL(t)),e.undone,pL(n.mapping.maps[n.steps.length-1]),e.prevTime):new cL(e.done,e.undone.addTransform(n,void 0,r,yL(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new cL(e.done.rebased(n,i),e.undone.rebased(n,i),hL(e.prevRanges,n.mapping),e.prevTime):new cL(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),hL(e.prevRanges,n.mapping),e.prevTime);{let i=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)})),n}(n,e.prevRanges)),o=s?hL(e.prevRanges,n.mapping):pL(n.mapping.maps[n.steps.length-1]);return new cL(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,yL(t)),lL.empty,o,n.time)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?xL:"historyRedo"==n?ML:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const xL=(e,t)=>{let n=bL.getState(e);return!(!n||0==n.done.eventCount)&&(t&&fL(n,e,t,!1),!0)},ML=(e,t)=>{let n=bL.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&fL(n,e,t,!0),!0)},DL=js.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>xL(e,t),redo:()=>({state:e,dispatch:t})=>ML(e,t)}),addProseMirrorPlugins(){return[wL(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),kL=Ta.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",ms(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{var n;if(t){const{$to:t}=e.selection,r=t.end();if(t.nodeAfter)e.setSelection(sn.create(e.doc,t.pos));else{const i=null===(n=t.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();i&&(e.insert(r,i),e.setSelection(sn.create(e.doc,r)))}e.scrollIntoView()}return!0})).run()}},addInputRules(){return[Ma({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),EL=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,CL=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,TL=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,OL=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,SL=Ca.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[xa({find:EL,type:this.type}),xa({find:TL,type:this.type})]},addPasteRules(){return[Oa({find:CL,type:this.type}),Oa({find:OL,type:this.type})]}}),AL=Ta.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",ms(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),NL=/^(\d+)\.\s$/,_L=Ta.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",ms(this.options.HTMLAttributes,n),0]:["ol",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[Ea({find:NL,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}),jL=Ta.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),IL=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,LL=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,zL=Ca.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",ms(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[xa({find:IL,type:this.type})]},addPasteRules(){return[Oa({find:LL,type:this.type})]}}),PL=Ta.create({name:"text",group:"inline"}),FL=js.create({name:"starterKit",addExtensions(){var e,t,n,r,i,o,s,a,l,u,c,d,p,h,f,m,g,y;const b=[];return!1!==this.options.blockquote&&b.push($_.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&b.push(Q_.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&b.push(G_.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&b.push(Z_.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&b.push(nj.configure(null===(i=this.options)||void 0===i?void 0:i.codeBlock)),!1!==this.options.document&&b.push(rj.configure(null===(o=this.options)||void 0===o?void 0:o.document)),!1!==this.options.dropcursor&&b.push(hN.configure(null===(s=this.options)||void 0===s?void 0:s.dropcursor)),!1!==this.options.gapcursor&&b.push(ZI.configure(null===(a=this.options)||void 0===a?void 0:a.gapcursor)),!1!==this.options.hardBreak&&b.push(eL.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&b.push(tL.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&b.push(DL.configure(null===(c=this.options)||void 0===c?void 0:c.history)),!1!==this.options.horizontalRule&&b.push(kL.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&b.push(SL.configure(null===(p=this.options)||void 0===p?void 0:p.italic)),!1!==this.options.listItem&&b.push(AL.configure(null===(h=this.options)||void 0===h?void 0:h.listItem)),!1!==this.options.orderedList&&b.push(_L.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&b.push(jL.configure(null===(m=this.options)||void 0===m?void 0:m.paragraph)),!1!==this.options.strike&&b.push(zL.configure(null===(g=this.options)||void 0===g?void 0:g.strike)),!1!==this.options.text&&b.push(PL.configure(null===(y=this.options)||void 0===y?void 0:y.text)),b}});function RL(e,t=[]){return e.map((e=>{const n=[...t,...e.properties?e.properties.className:[]];return e.children?RL(e.children,n):{text:e.value,classes:n}})).flat()}function BL(e){return e.value||e.children||[]}function UL({doc:e,name:t,lowlight:n,defaultLanguage:r}){const i=[];return ya(e,(e=>e.type.name===t)).forEach((e=>{let t=e.pos+1;const o=e.node.attrs.language||r,s=n.listLanguages();RL(o&&s.includes(o)?BL(n.highlight(o,e.node.textContent)):BL(n.highlightAuto(e.node.textContent))).forEach((e=>{const n=t+e.text.length;if(e.classes.length){const r=ao.inline(t,n,{class:e.classes.join(" ")});i.push(r)}t=n}))})),co.create(e,i)}function HL({name:e,lowlight:t,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every((e=>"function"==typeof t[e])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new kn({key:new Tn("lowlight"),state:{init:(r,{doc:i})=>UL({doc:i,name:e,lowlight:t,defaultLanguage:n}),apply:(r,i,o,s)=>{const a=o.selection.$head.parent.type.name,l=s.selection.$head.parent.type.name,u=ya(o.doc,(t=>t.type.name===e)),c=ya(s.doc,(t=>t.type.name===e));return r.docChanged&&([a,l].includes(e)||c.length!==u.length||r.steps.some((e=>void 0!==e.from&&void 0!==e.to&&u.some((t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))))?UL({doc:r.doc,name:e,lowlight:t,defaultLanguage:n}):i.map(r.mapping,r.doc)}},props:{decorations:e=>r.getState(e)}});return r}const $L=nj.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:{},defaultLanguage:null}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],HL({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});var VL={exports:{}};!function(e){!function(){var t;function n(e){for(var t,n,r,i,o=1,s=[].slice.call(arguments),a=0,l=e.length,u="",c=!1,d=!1,p=function(){return s[o++]},h=function(){for(var n="";/\d/.test(e[a]);)n+=e[a++],t=e[a];return n.length>0?parseInt(n):null};a<l;++a)if(t=e[a],c)switch(c=!1,"."==t?(d=!1,t=e[++a]):"0"==t&&"."==e[a+1]?(d=!0,t=e[a+=2]):d=!0,i=h(),t){case"b":u+=parseInt(p(),10).toString(2);break;case"c":u+="string"==typeof(n=p())||n instanceof String?n:String.fromCharCode(parseInt(n,10));break;case"d":u+=parseInt(p(),10);break;case"f":r=String(parseFloat(p()).toFixed(i||6)),u+=d?r:r.replace(/^0/,"");break;case"j":u+=JSON.stringify(p());break;case"o":u+="0"+parseInt(p(),10).toString(8);break;case"s":u+=p();break;case"x":u+="0x"+parseInt(p(),10).toString(16);break;case"X":u+="0x"+parseInt(p(),10).toString(16).toUpperCase();break;default:u+=t}else"%"===t?c=!0:u+=t;return u}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()}(VL);var WL=VL.exports;const qL=Object.assign(YL(Error),{eval:YL(EvalError),range:YL(RangeError),reference:YL(ReferenceError),syntax:YL(SyntaxError),type:YL(TypeError),uri:YL(URIError)});function YL(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){const r=t?WL(t,...n):t;return new e(r)}}const QL={}.hasOwnProperty,KL="hljs-";function GL(e,t,n={}){let r=n.prefix;if("string"!=typeof e)throw qL("Expected `string` for name, got `%s`",e);if(!Z.getLanguage(e))throw qL("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw qL("Expected `string` for value, got `%s`",t);null==r&&(r=KL),Z.configure({__emitter:JL,classPrefix:r});const i=Z.highlight(t,{language:e,ignoreIllegals:!0});if(Z.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}class JL{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(""===e)return;const t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}addKeyword(e,t){this.openNode(t),this.addText(e),this.closeNode()}addSublanguage(e,t){const n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){const t=e.split(".").map(((e,t)=>t?e+"_".repeat(t):this.options.classPrefix+e)),n={type:"element",tagName:"span",properties:{className:t},children:[]};this.stack[this.stack.length-1].children.push(n),this.stack.push(n)}closeNode(){this.stack.pop()}closeAllNodes(){}finalize(){}toHTML(){return""}}const XL={highlight:GL,highlightAuto:function(e,t={}){const n=t.subset||Z.listLanguages();t.prefix;let r=-1,i={type:"root",data:{language:null,relevance:0},children:[]};if("string"!=typeof e)throw qL("Expected `string` for value, got `%s`",e);for(;++r<n.length;){const o=n[r];if(!Z.getLanguage(o))continue;const s=GL(o,e,t);s.data.relevance>i.data.relevance&&(i=s)}return i},registerLanguage:function(e,t){Z.registerLanguage(e,t)},registered:function(e){return Boolean(Z.getLanguage(e))},listLanguages:function(){return Z.listLanguages()},registerAlias:function(e,t){if("string"==typeof e)Z.registerAliases(t,{languageName:e});else{let t;for(t in e)QL.call(e,t)&&Z.registerAliases(e[t],{languageName:t})}}};XL.registerLanguage("arduino",g),XL.registerLanguage("bash",y),XL.registerLanguage("c",b),XL.registerLanguage("cpp",v),XL.registerLanguage("csharp",w),XL.registerLanguage("css",x),XL.registerLanguage("diff",M),XL.registerLanguage("go",D),XL.registerLanguage("graphql",k),XL.registerLanguage("ini",E),XL.registerLanguage("java",C),XL.registerLanguage("javascript",T),XL.registerLanguage("json",O),XL.registerLanguage("kotlin",S),XL.registerLanguage("less",A),XL.registerLanguage("lua",N),XL.registerLanguage("makefile",_),XL.registerLanguage("markdown",j),XL.registerLanguage("objectivec",I),XL.registerLanguage("perl",L),XL.registerLanguage("php",z),XL.registerLanguage("php-template",P),XL.registerLanguage("plaintext",F),XL.registerLanguage("python",R),XL.registerLanguage("python-repl",B),XL.registerLanguage("r",U),XL.registerLanguage("ruby",H),XL.registerLanguage("rust",$),XL.registerLanguage("scss",V),XL.registerLanguage("shell",W),XL.registerLanguage("sql",q),XL.registerLanguage("swift",Y),XL.registerLanguage("typescript",Q),XL.registerLanguage("vbnet",K),XL.registerLanguage("wasm",G),XL.registerLanguage("xml",J),XL.registerLanguage("yaml",X);const ZL=()=>t.createElement(Gu,{"data-cy":"neeto-editor-code-block"},t.createElement("pre",null,t.createElement(Ku,{as:"code"})));var ez=$L.extend({addNodeView:()=>new Zu(ZL)}).configure({lowlight:XL}),tz=js.create({name:"paste-unformatted",addCommands:()=>({pasteUnformatted:()=>async e=>{let{editor:t}=e;const n=await navigator.clipboard.readText();t.commands.insertContent(n)}})}),nz=rj.extend({content:"root",addProseMirrorPlugins(){const{editor:e}=this;return[new kn({key:new Tn("eventHandler"),props:{handleClick(t,n){const{state:r}=t,i=r.doc.lastChild,o=r.doc.resolve(n).nodeBefore;if(i&&o){const t=i.eq(o),r=i.isInline,s=["paragraph","text"].includes(i.type.name);!t||r||s||e.commands.insertContentAt(n,{type:"paragraph",content:""})}}}})]}}),rz=Ta.create({name:"external-video",addOptions:()=>({inline:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},title:{default:null},frameborder:{default:"0"},allow:{default:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"},allowfullscreen:{default:"allowfullscreen"}}),parseHTML:()=>[{tag:"iframe[src]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["iframe",ms(this.options.HTMLAttributes,{...t,class:"video-wrapper"})]},addCommands(){return{setExternalVideo:e=>t=>{let{commands:n}=t;return n.insertContent({type:this.name,attrs:e})}}}});const iz=new Tn("suggestion");function oz({pluginKey:e=iz,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:a="suggestion",command:l=(()=>null),items:u=(()=>[]),render:c=(()=>({})),allow:d=(()=>!0)}){let p;const h=null==c?void 0:c(),f=new kn({key:e,view(){return{update:async(e,n)=>{var r,i,o,s,a,c,d;const f=null===(r=this.key)||void 0===r?void 0:r.getState(n),m=null===(i=this.key)||void 0===i?void 0:i.getState(e.state),g=f.active&&m.active&&f.range.from!==m.range.from,y=!f.active&&m.active,b=f.active&&!m.active,v=y||g,w=!y&&!b&&f.query!==m.query&&!g,x=b||g;if(!v&&!w&&!x)return;const M=x&&!v?f:m,D=document.querySelector(`[data-decoration-id="${M.decorationId}"]`);p={editor:t,range:M.range,query:M.query,text:M.text,items:[],command:e=>{l({editor:t,range:M.range,props:e})},decorationNode:D,clientRect:D?()=>{var e;const{decorationId:n}=null===(e=this.key)||void 0===e?void 0:e.getState(t.state),r=document.querySelector(`[data-decoration-id="${n}"]`);return(null==r?void 0:r.getBoundingClientRect())||null}:null},v&&(null===(o=null==h?void 0:h.onBeforeStart)||void 0===o||o.call(h,p)),w&&(null===(s=null==h?void 0:h.onBeforeUpdate)||void 0===s||s.call(h,p)),(w||v)&&(p.items=await u({editor:t,query:M.query})),x&&(null===(a=null==h?void 0:h.onExit)||void 0===a||a.call(h,p)),w&&(null===(c=null==h?void 0:h.onUpdate)||void 0===c||c.call(h,p)),v&&(null===(d=null==h?void 0:h.onStart)||void 0===d||d.call(h,p))},destroy:()=>{var e;p&&(null===(e=null==h?void 0:h.onExit)||void 0===e||e.call(h,p))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(e,s,a,l){const{isEditable:u}=t,{composing:c}=t.view,{selection:p}=e,{empty:h,from:f}=p,m={...s};if(m.composing=c,u&&(h||t.view.composing)){!(f<s.range.from||f>s.range.to)||c||s.composing||(m.active=!1);const e=function(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=e,a=n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),l=new RegExp(`\\s${a}$`),u=o?"^":"",c=r?new RegExp(`${u}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${u}(?:^)?${a}[^\\s${a}]*`,"gm"),d=(null===(t=s.nodeBefore)||void 0===t?void 0:t.isText)&&s.nodeBefore.text;if(!d)return null;const p=s.pos-d.length,h=Array.from(d.matchAll(c)).pop();if(!h||void 0===h.input||void 0===h.index)return null;const f=h.input.slice(Math.max(0,h.index-1),h.index),m=new RegExp(`^[${null==i?void 0:i.join("")}\0]?$`).test(f);if(null!==i&&!m)return null;const g=p+h.index;let y=g+h[0].length;return r&&l.test(d.slice(y-1,y+1))&&(h[0]+=" ",y+=1),g<s.pos&&y>=s.pos?{range:{from:g,to:y},query:h[0].slice(n.length),text:h[0]}:null}({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:p.$from}),a=`id_${Math.floor(4294967295*Math.random())}`;e&&d({editor:t,state:l,range:e.range})?(m.active=!0,m.decorationId=s.decorationId?s.decorationId:a,m.range=e.range,m.query=e.query,m.text=e.text):m.active=!1}else m.active=!1;return m.active||(m.decorationId=null,m.range={from:0,to:0},m.query=null,m.text=null),m}},props:{handleKeyDown(e,t){var n;const{active:r,range:i}=f.getState(e.state);return r&&(null===(n=null==h?void 0:h.onKeyDown)||void 0===n?void 0:n.call(h,{view:e,event:t,range:i}))||!1},decorations(e){const{active:t,range:n,decorationId:r}=f.getState(e);return t?co.create(e.doc,[ao.inline(n.from,n.to,{nodeName:s,class:a,"data-decoration-id":r})]):null}}});return f}const sz=new Tn("emoji-picker"),az=Ta.create({name:"emojiPicker",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:()=>({suggestion:{char:"::",startOfLine:!1,pluginKey:sz,items:()=>[],render:()=>{let e,t;return{onStart(n){e=new Ju(mv,{props:n,editor:n.editor}),t=Iu("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onKeyDown(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit(){t[0].destroy(),e.destroy()}}}}}),addProseMirrorPlugins(){return[oz({editor:this.editor,...this.options.suggestion})]}});class lz extends t.Component{constructor(){super(...arguments),pm(this,"state",{isLoading:!1,selectedIndex:0,emojiSuggestions:[]}),pm(this,"fetchEmojiData",(async()=>{this.setState({isLoading:!0});try{const{data:e}=await by.get("https://cdn.jsdelivr.net/npm/@emoji-mart/data");return this.setState({isLoading:!1}),e}catch(e){return this.setState({isLoading:!1}),{}}})),pm(this,"searchEmoji",(async()=>(await fb.search(this.props.query||"smile")).slice(0,5))),pm(this,"searchEmojiAndSetState",(async()=>{const e=await this.searchEmoji();this.setState({emojiSuggestions:e})})),pm(this,"setEditorState",(async()=>{const e=await this.searchEmoji();this.props.editor.chain().focus().deleteRange(this.props.range).setEmoji(e[0]).run()})),pm(this,"onKeyDown",(e=>{let{event:t}=e;return"ArrowLeft"===t.key||"ArrowDown"===t.key?(this.setState((e=>{let{selectedIndex:t,emojiSuggestions:n}=e;return{selectedIndex:(t+n.length-1)%n.length}})),!0):"ArrowRight"===t.key||"ArrowUp"===t.key?(this.setState((e=>{let{selectedIndex:t,emojiSuggestions:n}=e;return{selectedIndex:(t+1)%n.length}})),!0):"Enter"===t.key?(this.selectItem(this.state.selectedIndex),!0):" "===t.key?(ld(this.props.query)?this.props.editor.chain().focus().insertContent(" ").run():this.setEditorState(),!0):"Escape"===t.key&&(this.props.editor.chain().focus().insertContent(" ").run(),!0)})),pm(this,"selectItem",(e=>{this.props.editor.chain().focus().deleteRange(this.props.range).setEmoji(this.state.emojiSuggestions[e]).run()}))}componentDidMount(){xb({data:this.fetchEmojiData,theme:"light",previewPosition:"none"}),this.searchEmojiAndSetState()}componentDidUpdate(e){this.props.query!==e.query&&this.searchEmojiAndSetState()}render(){return t.createElement("div",{className:"neeto-editor-emoji-suggestion"},this.state.isLoading&&t.createElement(FA,null),!this.state.isLoading&&(this.state.emojiSuggestions.length>0?this.state.emojiSuggestions.map(((e,n)=>t.createElement("div",{key:e.id,onClick:()=>this.selectItem(n),className:sc("neeto-editor-emoji-suggestion__item",{"neeto-editor-emoji-suggestion__item--selected":n===this.state.selectedIndex}),"data-cy":"neeto-editor-emoji-suggestion-".concat(e.id)},e.skins[0].native))):t.createElement("p",null,"No results")))}}const uz={char:":",startOfLine:!1,pluginKey:new Tn("emoji-suggestion"),command:e=>{let{editor:t,range:n,props:r}=e;t.chain().focus().deleteRange(n).setEmoji(r).run()},items:()=>[],render:()=>{let e,t;return{onStart(n){e=new Ju(lz,{props:n,editor:n.editor}),t=Iu("body",{theme:"light",getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit(){t[0].destroy(),e.destroy()}}}};var cz=Ta.create({name:"emojiSuggestion",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions:()=>({HTMLAttributes:{class:"neeto-editor-emoji"},renderEmoji(e){let{node:t}=e;return t.attrs.label},suggestion:{}}),addAttributes:()=>({label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-emoji]"}],renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["span",ms({"data-emoji":""},this.options.HTMLAttributes,n),this.options.renderEmoji({node:t})]},renderText(e){let{node:t}=e;return this.options.renderEmoji({node:t})},addCommands(){return{setEmoji:e=>t=>{var n;let{chain:r}=t;r().focus().insertContent([{type:this.name,attrs:{label:(null==e?void 0:e.native)||(null==e||null===(n=e.skins[0])||void 0===n?void 0:n.native)||""}},{type:"text",text:" "}]).run()}}},addProseMirrorPlugins(){return[oz({editor:this.editor,...this.options.suggestion})]}}).configure({suggestion:uz});const dz=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,pz=Ta.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",ms(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Ma({find:dz,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}});var hz,fz=void 0&&(void 0).__extends||(hz=function(e,t){return hz=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},hz(e,t)},function(e,t){function n(){this.constructor=e}hz(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),mz=void 0&&(void 0).__assign||function(){return mz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mz.apply(this,arguments)},gz={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},yz={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},bz={width:"20px",height:"20px",position:"absolute"},vz={top:mz(mz({},gz),{top:"-5px"}),right:mz(mz({},yz),{left:void 0,right:"-5px"}),bottom:mz(mz({},gz),{top:void 0,bottom:"-5px"}),left:mz(mz({},yz),{left:"-5px"}),topRight:mz(mz({},bz),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:mz(mz({},bz),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:mz(mz({},bz),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:mz(mz({},bz),{left:"-10px",top:"-10px",cursor:"nw-resize"})},wz=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.onMouseDown=function(t){e.props.onResizeStart(t,e.props.direction)},e.onTouchStart=function(t){e.props.onResizeStart(t,e.props.direction)},e}return fz(n,t),n.prototype.render=function(){return e.createElement("div",{className:this.props.className||"",style:mz(mz({position:"absolute",userSelect:"none"},vz[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},n}(e.PureComponent),xz=void 0&&(void 0).__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mz=void 0&&(void 0).__assign||function(){return Mz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Mz.apply(this,arguments)},Dz={width:"auto",height:"auto"},kz=function(e,t,n){return Math.max(Math.min(e,n),t)},Ez=function(e,t){return Math.round(e/t)*t},Cz=function(e,t){return new RegExp(e,"i").test(t)},Tz=function(e){return Boolean(e.touches&&e.touches.length)},Oz=function(e,t,n){void 0===n&&(n=0);var r=t.reduce((function(n,r,i){return Math.abs(r-e)<Math.abs(t[n]-e)?i:n}),0),i=Math.abs(t[r]-e);return 0===n||i<n?t[r]:e},Sz=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},Az=function(e,t,n,r){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return n*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return r*(Number(e.replace("vh",""))/100)}return e},Nz=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],_z="__resizable_base__",jz=function(t){function n(e){var n=t.call(this,e)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableRight=0,n.resizableTop=0,n.resizableBottom=0,n.targetLeft=0,n.targetTop=0,n.appendBase=function(){if(!n.resizable||!n.window)return null;var e=n.parentNode;if(!e)return null;var t=n.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(_z):t.className+=_z,e.appendChild(t),t},n.removeBase=function(e){var t=n.parentNode;t&&t.removeChild(e)},n.ref=function(e){e&&(n.resizable=e)},n.state={isResizing:!1,width:void 0===(n.propsSize&&n.propsSize.width)?"auto":n.propsSize&&n.propsSize.width,height:void 0===(n.propsSize&&n.propsSize.height)?"auto":n.propsSize&&n.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return xz(n,t),Object.defineProperty(n.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||Dz},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,i=this.resizable.style.position;"relative"!==i&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:n,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:r,this.resizable.style.position=i}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,n=function(t){if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&e.propsSize[t].toString().endsWith("%")){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var n=e.getParentSize();return Number(e.state[t].toString().replace("px",""))/n[t]*100+"%"}return Sz(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?Sz(t.width):n("width"),height:t&&void 0!==t.height&&!this.state.isResizing?Sz(t.height):n("height")}},enumerable:!1,configurable:!0}),n.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;"wrap"!==n&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),r},n.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},n.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},n.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},n.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},n.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==n&&"auto"!==n?e:"auto"},n.prototype.calculateNewMaxFromBoundary=function(e,t){var n,r,i=this.props.boundsByDirection,o=this.state.direction,s=i&&Cz("left",o),a=i&&Cz("top",o);if("parent"===this.props.bounds){var l=this.parentNode;l&&(n=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),r=a?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(n=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,r=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(n=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),r=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return n&&Number.isFinite(n)&&(e=e&&e<n?e:n),r&&Number.isFinite(r)&&(t=t&&t<r?t:r),{maxWidth:e,maxHeight:t}},n.prototype.calculateNewSizeFromDirection=function(e,t){var n=this.props.scale||1,r=this.props.resizeRatio||1,i=this.state,o=i.direction,s=i.original,a=this.props,l=a.lockAspectRatio,u=a.lockAspectRatioExtraHeight,c=a.lockAspectRatioExtraWidth,d=s.width,p=s.height,h=u||0,f=c||0;return Cz("right",o)&&(d=s.width+(e-s.x)*r/n,l&&(p=(d-f)/this.ratio+h)),Cz("left",o)&&(d=s.width-(e-s.x)*r/n,l&&(p=(d-f)/this.ratio+h)),Cz("bottom",o)&&(p=s.height+(t-s.y)*r/n,l&&(d=(p-h)*this.ratio+f)),Cz("top",o)&&(p=s.height-(t-s.y)*r/n,l&&(d=(p-h)*this.ratio+f)),{newWidth:d,newHeight:p}},n.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var i=this.props,o=i.lockAspectRatio,s=i.lockAspectRatioExtraHeight,a=i.lockAspectRatioExtraWidth,l=void 0===r.width?10:r.width,u=void 0===n.width||n.width<0?e:n.width,c=void 0===r.height?10:r.height,d=void 0===n.height||n.height<0?t:n.height,p=s||0,h=a||0;if(o){var f=(c-p)*this.ratio+h,m=(d-p)*this.ratio+h,g=(l-h)/this.ratio+p,y=(u-h)/this.ratio+p,b=Math.max(l,f),v=Math.min(u,m),w=Math.max(c,g),x=Math.min(d,y);e=kz(e,b,v),t=kz(t,w,x)}else e=kz(e,l,u),t=kz(t,c,d);return{newWidth:e,newHeight:t}},n.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var e=this.parentNode;if(e){var t=e.getBoundingClientRect();this.parentLeft=t.left,this.parentTop=t.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var n=this.props.bounds.getBoundingClientRect();this.targetLeft=n.left,this.targetTop=n.top}if(this.resizable){var r=this.resizable.getBoundingClientRect(),i=r.left,o=r.top,s=r.right,a=r.bottom;this.resizableLeft=i,this.resizableRight=s,this.resizableTop=o,this.resizableBottom=a}},n.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var n,r=0,i=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(r=e.nativeEvent.clientX,i=e.nativeEvent.clientY):e.nativeEvent&&Tz(e.nativeEvent)&&(r=e.nativeEvent.touches[0].clientX,i=e.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var o=this.window.getComputedStyle(this.resizable);if("auto"!==o.flexBasis){var s=this.parentNode;if(s){var a=this.window.getComputedStyle(s).flexDirection;this.flexDir=a.startsWith("row")?"row":"column",n=o.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:r,y:i,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Mz(Mz({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:n};this.setState(l)}},n.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&Tz(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var n=this.props,r=n.maxWidth,i=n.maxHeight,o=n.minWidth,s=n.minHeight,a=Tz(e)?e.touches[0].clientX:e.clientX,l=Tz(e)?e.touches[0].clientY:e.clientY,u=this.state,c=u.direction,d=u.original,p=u.width,h=u.height,f=this.getParentSize(),g=function(e,t,n,r,i,o,s){return r=Az(r,e.width,t,n),i=Az(i,e.height,t,n),o=Az(o,e.width,t,n),s=Az(s,e.height,t,n),{maxWidth:void 0===r?void 0:Number(r),maxHeight:void 0===i?void 0:Number(i),minWidth:void 0===o?void 0:Number(o),minHeight:void 0===s?void 0:Number(s)}}(f,this.window.innerWidth,this.window.innerHeight,r,i,o,s);r=g.maxWidth,i=g.maxHeight,o=g.minWidth,s=g.minHeight;var y=this.calculateNewSizeFromDirection(a,l),b=y.newHeight,v=y.newWidth,w=this.calculateNewMaxFromBoundary(r,i);this.props.snap&&this.props.snap.x&&(v=Oz(v,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(b=Oz(b,this.props.snap.y,this.props.snapGap));var x=this.calculateNewSizeFromAspectRatio(v,b,{width:w.maxWidth,height:w.maxHeight},{width:o,height:s});if(v=x.newWidth,b=x.newHeight,this.props.grid){var M=Ez(v,this.props.grid[0]),D=Ez(b,this.props.grid[1]),k=this.props.snapGap||0;v=0===k||Math.abs(M-v)<=k?M:v,b=0===k||Math.abs(D-b)<=k?D:b}var E={width:v-d.width,height:b-d.height};if(p&&"string"==typeof p)if(p.endsWith("%"))v=v/f.width*100+"%";else if(p.endsWith("vw")){v=v/this.window.innerWidth*100+"vw"}else if(p.endsWith("vh")){v=v/this.window.innerHeight*100+"vh"}if(h&&"string"==typeof h)if(h.endsWith("%"))b=b/f.height*100+"%";else if(h.endsWith("vw")){b=b/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){b=b/this.window.innerHeight*100+"vh"}var C={width:this.createSizeForCssProperty(v,"width"),height:this.createSizeForCssProperty(b,"height")};"row"===this.flexDir?C.flexBasis=C.width:"column"===this.flexDir&&(C.flexBasis=C.height),m((function(){t.setState(C)})),this.props.onResize&&this.props.onResize(e,c,this.resizable,E)}},n.prototype.onMouseUp=function(e){var t=this.state,n=t.isResizing,r=t.direction,i=t.original;if(n&&this.resizable){var o={width:this.size.width-i.width,height:this.size.height-i.height};this.props.onResizeStop&&this.props.onResizeStop(e,r,this.resizable,o),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Mz(Mz({},this.state.backgroundStyle),{cursor:"auto"})})}},n.prototype.updateSize=function(e){this.setState({width:e.width,height:e.height})},n.prototype.renderResizer=function(){var t=this,n=this.props,r=n.enable,i=n.handleStyles,o=n.handleClasses,s=n.handleWrapperStyle,a=n.handleWrapperClass,l=n.handleComponent;if(!r)return null;var u=Object.keys(r).map((function(n){return!1!==r[n]?e.createElement(wz,{key:n,direction:n,onResizeStart:t.onResizeStart,replaceStyles:i&&i[n],className:o&&o[n]},l&&l[n]?l[n]:null):null}));return e.createElement("div",{className:a,style:s},u)},n.prototype.render=function(){var t=this,n=Object.keys(this.props).reduce((function(e,n){return-1!==Nz.indexOf(n)||(e[n]=t.props[n]),e}),{}),r=Mz(Mz(Mz({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(r.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return e.createElement(i,Mz({ref:this.ref,style:r,className:this.props.className},n),this.state.isResizing&&e.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},n.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},n}(e.PureComponent);const Iz=e=>{let{node:n,editor:r,getPos:i}=e;const{alt:o,src:s,float:a,align:l,height:u,width:c}=n.attrs,d=o||"",{view:p}=r;return t.createElement(Gu,null,t.createElement(jz,{lockAspectRatio:!0,className:"neeto-editor__image neeto-editor__image--".concat(a," neeto-editor__image--").concat(l," neeto-editor__image-defaults"),size:{height:u,width:c},onResizeStop:(e,t,o)=>{p.dispatch(p.state.tr.setNodeMarkup(i(),void 0,{...n.attrs,height:o.offsetHeight,width:o.offsetWidth})),r.commands.focus()}},t.createElement("figure",null,t.createElement("img",ie({alt:d,src:s},n.attrs)),t.createElement("figcaption",null,d))))};var Lz=pz.extend({name:"image",addAttributes:()=>({...pz.config.addAttributes(),height:{default:"auto",rendered:!1},width:{default:"fit-content",rendered:!1},float:{default:"none",rendered:!1},align:{default:"center",rendered:!1}}),addCommands(){return{setImage:e=>t=>{var n,r,i;let{tr:o,commands:s}=t;return"image"===(null===(n=o.selection)||void 0===n||null===(r=n.node)||void 0===r||null===(i=r.type)||void 0===i?void 0:i.name)?s.updateAttributes("image",e):s.insertContent({type:this.name,attrs:e})},setImageAttributes:e=>t=>{let{tr:n}=t;const{selection:r}=n,i={...r.node.attrs,...e},o=this.type.create(i);n.replaceRangeWith(r.from,r.to,o)}}},parseHTML:()=>[{tag:"img"}],renderHTML(e){let{node:t}=e;const{alt:n,src:r,float:i,align:o,height:s,width:a}=t.attrs,l=n||"",u=isNaN(s)?s:"".concat(s,"px"),c=isNaN(a)?a:"".concat(a,"px"),d="height:".concat(u,";width:").concat(c,";");return["a",{class:"neeto-editor__image neeto-editor__image--".concat(i," neeto-editor__image--").concat(o," neeto-editor__image-defaults"),style:d,href:r,target:"_blank",rel:"noopener noreferrer"},["figure",{},["img",ms(t.attrs,{src:r,caption:l})],["figcaption",l]]]},addNodeView:()=>Zu(Iz)}),zz=Ta.create({name:"figcaption",selectable:!1,draggable:!1,parseHTML:()=>[{tag:"figcaption"}]});const Pz=e=>{let{handleSubmit:t,shortcuts:n}=e;return js.create({addKeyboardShortcuts(){return{"Mod-Enter":()=>(null==t||t(this.editor.getHTML()),this.editor.commands.blur(),!0),...n}}})};var Fz=e=>{let{handleSubmit:t,shortcuts:n}=e;return Pz({handleSubmit:t,shortcuts:n})};const Rz=new Tn("mention"),Bz=Ta.create({name:"mention",addOptions(){return{HTMLAttributes:{},renderLabel({options:e,node:t}){var n;return`${e.suggestion.char}${null!==(n=t.attrs.label)&&void 0!==n?n:t.attrs.id}`},suggestion:{char:"@",pluginKey:Rz,command:({editor:e,range:t,props:n})=>{var r,i;const o=e.view.state.selection.$to.nodeAfter;(null===(r=null==o?void 0:o.text)||void 0===r?void 0:r.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),null===(i=window.getSelection())||void 0===i||i.collapseToEnd()},allow:({state:e,range:t})=>{const n=e.doc.resolve(t.from),r=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){return["span",ms({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command((({tr:e,state:t})=>{let n=!1;const{selection:r}=t,{empty:i,anchor:o}=r;return!!i&&(t.doc.nodesBetween(o-1,o,((t,r)=>{if(t.type.name===this.name)return n=!0,e.insertText(this.options.suggestion.char||"",r,r+t.nodeSize),!1})),n)}))}},addProseMirrorPlugins(){return[oz({editor:this.editor,...this.options.suggestion})]}}),Uz=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],{showImage:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.map(((e,n)=>({showImage:t,key:"".concat(sd(e.name),"-").concat(n),...e}))).sort(((e,t)=>e.name.localeCompare(t.name)));return e=>{let{query:t}=e;return n.filter((e=>{let{name:n}=e;return n.toLowerCase().includes(t.toLowerCase())}))}},Hz=e=>{let{wrapperRef:t,index:n}=e;if(!t.current||n>=t.current.children.length)return;const r=8,i=t.current,o=i.children[n],s=o.clientHeight+r;let a=i.scrollTop;o.offsetTop+s>a+i.clientHeight?a=o.offsetTop-i.clientHeight+s:a>o.offsetTop&&(a=o.offsetTop-r),t.current.scrollTop=a};class $z extends t.Component{constructor(e){super(e),pm(this,"selectItem",(e=>{const{items:t,command:n}=this.props,r=t[e];r&&n({label:r.name,id:r.key})})),pm(this,"upHandler",(()=>{const{items:e}=this.props;this.setState((t=>{const{selectedIndex:n}=t;return{selectedIndex:(n+e.length-1)%e.length}}))})),pm(this,"downHandler",(()=>{const{items:e}=this.props;this.setState((t=>{const{selectedIndex:n}=t;return{selectedIndex:(n+1)%e.length}}))})),pm(this,"enterHandler",(()=>{const{selectedIndex:e}=this.state;this.selectItem(e)})),pm(this,"onKeyDown",(e=>{let{event:t}=e;const n={ArrowUp:this.upHandler,ArrowDown:this.downHandler,Enter:this.enterHandler};return!!Object.prototype.hasOwnProperty.call(n,t.key)&&(n[t.key](),!0)})),this.state={selectedIndex:0},this.mentionRef=t.createRef()}componentDidUpdate(e){const{items:t}=this.props;t!==e.items&&this.setState({selectedIndex:0}),Hz({wrapperRef:this.mentionRef,index:this.state.selectedIndex})}render(){const{selectedIndex:e}=this.state,{items:n}=this.props;return 0===n.length?t.createElement("div",{className:"neeto-editor-mentions__wrapper"},t.createElement("p",{className:"neeto-editor-mentions__item"},"No Results")):t.createElement("div",{ref:this.mentionRef,className:"neeto-editor-mentions__wrapper","data-cy":"neeto-editor-mention-list"},n.map(((n,r)=>{let{key:i,name:o,imageUrl:s,showImage:a}=n;return t.createElement("button",{className:sc("neeto-editor-mentions__item",{active:r===e}),key:i,onClick:()=>this.selectItem(r),type:"button","data-cy":"neeto-editor-mention-list-".concat(o)},a&&t.createElement(kv,{user:{name:o,imageUrl:s}}),t.createElement("p",null,o))})))}}const Vz={render:()=>{let e,t;return{onStart:n=>{e=new Ju($z,{props:n,editor:n.editor}),t=Iu("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var r;return"Escape"===n.event.key?(t[0].hide(),!0):null===(r=e.ref)||void 0===r?void 0:r.onKeyDown(n)},onExit(){t[0].destroy(),e.destroy()}}}},Wz=Bz.extend({addCommands(){return{setMention:e=>t=>{let{chain:n}=t;n().focus().insertContent([{type:this.name,attrs:{id:e,label:e}},{type:"text",text:" "}]).run()}}}});var qz=e=>{let{suggestion:t={},...n}=e;return Wz.configure({...n,suggestion:{...Vz,...t}})},Yz="[object Object]";var Qz,Kz,Gz=Function.prototype,Jz=Object.prototype,Xz=Gz.toString,Zz=Jz.hasOwnProperty,eP=Xz.call(Object),tP=Jz.toString,nP=(Qz=Object.getPrototypeOf,Kz=Object,function(e){return Qz(Kz(e))});var rP=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||tP.call(e)!=Yz||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=nP(e);if(null===t)return!0;var n=Zz.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Xz.call(n)==eP};const iP=e=>{const t=typeof e;return"string"===t||"funtion"===t?e:rP(e)?t=>{let{node:n}=t;const{name:r}=n.type;return e[r]}:""};var oP=js.create({name:"placeholder",addOptions:()=>({excludeNodeTypes:["variable","codeBlock"],emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!1}),addProseMirrorPlugins(){return[new kn({props:{decorations:e=>{let{doc:t,selection:n}=e;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];return r?(t.descendants(((e,t)=>{const n=i>=t&&i<=t+e.nodeSize,r=!e.isLeaf&&!e.childCount,s=this.options.excludeNodeTypes.includes(e.type.name);if((n||!this.options.showOnlyCurrent)&&!s&&r){const n=[this.options.emptyNodeClass];this.editor.isEmpty&&n.push(this.options.emptyEditorClass);const r=ao.node(t,t+e.nodeSize,{class:n.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t}):this.options.placeholder});o.push(r)}return this.options.includeChildren})),co.create(t,o)):null}}})]}});class sP extends t.Component{constructor(e){super(e),pm(this,"keydownHandler",(e=>{const t={Enter:this.enterHandler,ArrowUp:this.upHandler,ArrowDown:this.downHandler,ArrowLeft:this.leftArrowHandler,ArrowRight:this.rightArrowHandler};e.key in t&&t[e.key](e)})),pm(this,"selectItem",(e=>{const{items:t,editor:n,range:r}=this.props,i=t[e],o=i&&i.command,s=ld(i.items);o&&s&&i.command({editor:n,range:r})})),pm(this,"upHandler",(()=>{const{items:e}=this.props,{selectedIndex:t}=this.state;this.setState({selectedIndex:(t+e.length-1)%e.length})})),pm(this,"downHandler",(()=>{const{items:e}=this.props,{selectedIndex:t}=this.state;this.setState({selectedIndex:(t+1)%e.length})})),pm(this,"enterHandler",(()=>{const{selectedIndex:e}=this.state;this.selectItem(e)})),pm(this,"leftArrowHandler",(()=>{const{menuIndex:e,setActiveMenuIndex:t}=this.props;e>0&&t(e-1)})),pm(this,"rightArrowHandler",(()=>{const{menuIndex:e,setActiveMenuIndex:t,items:n}=this.props,{selectedIndex:r}=this.state,i=n[r];i&&!ld(i.items)&&t(e+1)})),this.state={selectedIndex:0},this.menuRef=t.createRef()}componentDidMount(){const{menuIndex:e,activeMenuIndex:t}=this.props;e===t&&document.addEventListener("keydown",this.keydownHandler)}componentWillUnmount(){document.removeEventListener("keydown",this.keydownHandler)}componentDidUpdate(e){const{items:t,menuIndex:n,activeMenuIndex:r}=this.props,i=n===r;t!==e.items&&this.setState({selectedIndex:0}),Hz({wrapperRef:this.menuRef,index:this.state.selectedIndex}),i?document.addEventListener("keydown",this.keydownHandler):document.removeEventListener("keydown",this.keydownHandler)}render(){const{items:e,menuIndex:n,activeMenuIndex:r}=this.props,{selectedIndex:i}=this.state,o=n===r;return t.createElement("div",{ref:this.menuRef,className:"neeto-editor-slash-commands__wrapper"},e.map(((e,r)=>{const s=ld(e.items),a=t.createElement(aP,{key:e.title,item:e,index:r,selectedIndex:o?i:-1,selectItem:()=>s&&this.selectItem(r),onHover:()=>this.setState({selectedIndex:r})});return s?a:t.createElement(Sd,{key:e.title,interactive:!0,placement:"right",content:t.createElement(sP,ie({},this.props,{items:e.items,menuIndex:n+1})),onCreate:e=>{let{popper:t}=e;return t.style.width="max-content"},visible:i===r,onShow:()=>{this.isSubmenuOpened=!0},onHide:()=>{this.isSubmenuOpened=!1}},a)})))}}const aP=s(((e,n)=>{let{item:r,selectedIndex:i,index:o,selectItem:s,onHover:a}=e;const{Icon:l}=r;return t.createElement("div",{className:sc("neeto-editor-slash-commands__item",{active:o===i}),onClick:s,ref:n,"data-cy":"neeto-editor-command-list-item-".concat(o),onMouseEnter:a},l&&t.createElement(l,{size:20}),t.createElement("div",{className:"neeto-editor-slash-commands__item-content"},t.createElement("h5",null,r.title),t.createElement("p",null,r.description)))}));class lP extends t.Component{constructor(){super(...arguments),pm(this,"state",{activeMenuIndex:0}),pm(this,"onKeyDown",(e=>{let{event:t}=e;return["Enter","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)})),pm(this,"setActiveMenuIndex",(e=>this.setState({activeMenuIndex:e})))}render(){return t.createElement(sP,ie({},this.props,{menuIndex:0,activeMenuIndex:this.state.activeMenuIndex,setActiveMenuIndex:this.setActiveMenuIndex}))}}const uP={PARAGRAPH:{optionName:md.PARAGRAPH,title:"Paragraph",description:"Add a plain text block.",Icon:Sh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("paragraph").run()}},H1:{optionName:md.H1,title:"H1",description:"Add a big heading.",Icon:Uh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:1}).run()}},H2:{optionName:md.H2,title:"H2",description:"Add a sub-heading.",Icon:$h,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:2}).run()}},H3:{optionName:md.H3,title:"H3",description:"Add a sub-heading of level 3.",Icon:Yh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:3}).run()}},H4:{optionName:md.H4,title:"H4",description:"Add a sub-heading of level 4.",Icon:Yh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:4}).run()}},H5:{optionName:md.H5,title:"H5",description:"Add a sub-heading of level 5.",Icon:Yh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:5}).run()}},H6:{optionName:md.H6,title:"H6",description:"Add a sub-heading of level 6.",Icon:Yh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setNode("heading",{level:6}).run()}},LIST_ORDERED:{optionName:md.LIST_ORDERED,title:"Numbered list",description:"Add a list with numbering.",Icon:Dh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).toggleOrderedList().run()}},LIST_BULLETS:{optionName:md.LIST_BULLETS,title:"Bulleted list",description:"Add a list with bullets.",Icon:xh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).toggleBulletList().run()}},BLOCKQUOTE:{optionName:md.BLOCKQUOTE,title:"Blockquote",description:"Add a quote.",Icon:Jp,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).toggleBlockquote().run()}},IMAGE:{optionName:md.IMAGE_UPLOAD,title:"Image",description:"Add an image.",Icon:hh,command:e=>{let{editor:t,range:n}=e;return t.chain().focus().deleteRange(n).run()}},CODE:{optionName:md.CODE_BLOCK,title:"Code block",description:"Add a code block with syntax highlighting.",Icon:rh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).toggleCodeBlock().run()}},EMOJI:{optionName:md.EMOJI,title:"Emoji",description:"Add an emoji.",Icon:Lh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).insertContent("::").run()}},DIVIDER:{optionName:md.DIVIDER,title:"Divider",description:"Add an horizontal line to separate sections.",Icon:Eh,command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).setHorizontalRule().run()}},VIDEO:{optionName:md.VIDEO_EMBED,title:"Embed Youtube/Vimeo",description:"Embed a video from major services.",Icon:Zh,command:e=>{let{editor:t,range:n}=e;const r=prompt("Please enter Youtube/Vimeo embed URL."),i=(e=>{const t=e.match(Bf);return t&&"https://www.youtube.com/embed/".concat(t[5])})(r)||(e=>{const t=e.match(Uf);return t&&"https://player.vimeo.com/video/".concat(t[4],"?h=").concat(t[5])})(r);i?t.chain().focus().deleteRange(n).setExternalVideo({src:i}).run():t.chain().focus().deleteRange(n).insertContent("#invalid").run()}},PASTE_UNFORMATTED:{optionName:md.PASTE_UNFORMATTED,title:"Paste Unformatted",description:"Paste by removing all styles.",Icon:Th,command:e=>{let{editor:t,range:n}=e;return t.chain().focus().deleteRange(n).pasteUnformatted().run()}},NO_RESULT:{title:"No results",command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).run()}}},cP=new Tn("commands");var dP=e=>{let{setImageUploadVisible:t,addonCommands:n,options:r}=e,i=[uP.PARAGRAPH,uP.H1,uP.H2,uP.H3,uP.H4,uP.H5,uP.H6,uP.LIST_ORDERED,uP.LIST_BULLETS,uP.BLOCKQUOTE,{...uP.IMAGE,command:function(){t(!0),uP.IMAGE.command(...arguments)}},uP.CODE,uP.EMOJI,uP.DIVIDER,uP.VIDEO,uP.PASTE_UNFORMATTED];return ld(r)||(i=i.filter((e=>{let{optionName:t}=e;return r.includes(t)}))),ld(n)||(i=i.concat(n)),js.create({addOptions:()=>({HTMLAttributes:{class:"commands"},suggestion:{char:"/",startOfLine:!1,pluginKey:cP,command:e=>{let{editor:t,range:n,props:r}=e;r.command({editor:t,range:n})},items:e=>{let{query:t}=e;const n=i.filter((e=>{let{title:n}=e;return n.toLowerCase().includes(t.toLowerCase())}));return ld(n)?[uP.NO_RESULT]:n},render:()=>{let e,t;return{onStart:n=>{e=new Ju(lP,{props:n,editor:n.editor}),t=Iu("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",arrow:!1,zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(t){var n;return null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit(){t&&t[0].destroy(),e&&e.destroy()}}}}}),addProseMirrorPlugins(){return[oz({editor:this.editor,...this.options.suggestion})]}})},pP=tL.extend({name:"title",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML:()=>[{tag:"h1"}],renderHTML(e){let{_node:t,HTMLAttributes:n}=e;return["h1",ms(this.options.HTMLAttributes,n),0]}});const hP=ka({find:/--$/,replace:"—"}),fP=ka({find:/\.\.\.$/,replace:"…"}),mP=ka({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:"“"}),gP=ka({find:/"$/,replace:"”"}),yP=ka({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:"‘"}),bP=ka({find:/'$/,replace:"’"}),vP=ka({find:/<-$/,replace:"←"}),wP=ka({find:/->$/,replace:"→"}),xP=ka({find:/\(c\)$/,replace:"©"}),MP=ka({find:/\(tm\)$/,replace:"™"}),DP=ka({find:/\(r\)$/,replace:"®"}),kP=ka({find:/1\/2$/,replace:"½"}),EP=ka({find:/\+\/-$/,replace:"±"}),CP=ka({find:/!=$/,replace:"≠"}),TP=ka({find:/<<$/,replace:"«"}),OP=ka({find:/>>$/,replace:"»"}),SP=ka({find:/\d+\s?([*x])\s?\d+$/,replace:"×"}),AP=ka({find:/\^2$/,replace:"²"}),NP=ka({find:/\^3$/,replace:"³"}),_P=ka({find:/1\/4$/,replace:"¼"}),jP=ka({find:/3\/4$/,replace:"¾"});var IP=js.create({name:"typography",addInputRules(){const e=[];return!1!==this.options.emDash&&e.push(hP),!1!==this.options.ellipsis&&e.push(fP),!1!==this.options.openDoubleQuote&&e.push(mP),!1!==this.options.closeDoubleQuote&&e.push(gP),!1!==this.options.openSingleQuote&&e.push(yP),!1!==this.options.closeSingleQuote&&e.push(bP),!1!==this.options.leftArrow&&e.push(vP),!1!==this.options.rightArrow&&e.push(wP),!1!==this.options.copyright&&e.push(xP),!1!==this.options.trademark&&e.push(MP),!1!==this.options.registeredTrademark&&e.push(DP),!1!==this.options.oneHalf&&e.push(kP),!1!==this.options.plusMinus&&e.push(EP),!1!==this.options.notEqual&&e.push(CP),!1!==this.options.laquo&&e.push(TP),!1!==this.options.raquo&&e.push(OP),!1!==this.options.multiplication&&e.push(SP),!1!==this.options.superscriptTwo&&e.push(AP),!1!==this.options.superscriptThree&&e.push(NP),!1!==this.options.oneQuarter&&e.push(_P),!1!==this.options.threeQuarters&&e.push(jP),e}}).configure({emDash:!1,openDoubleQuote:!1,closeDoubleQuote:!1,openSingleQuote:!1,closeSingleQuote:!1});const LP=e=>{let{items:n,command:r}=e;return t.createElement("div",{className:"neeto-editor-variables-suggestion"},t.createElement(Cv,{variables:n,onClickVariable:e=>{const{category_key:t,key:n}=e,i=t?"".concat(t,".").concat(n):n;r({label:i,id:i})}}))},zP=new Tn("variables"),PP=Ta.create({name:"variable",addOptions:()=>({HTMLAttributes:{class:"neeto-editor-variable"},charOpen:"{{",charClose:"}}",renderLabel(e){let{options:t,node:n}=e;return"".concat(t.charOpen).concat(n.attrs.label||n.attrs.id).concat(t.charClose)},suggestion:{}}),group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}),parseHTML:()=>[{tag:"span[data-variable]"}],renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["span",ms({"data-variable":""},this.options.HTMLAttributes,n),this.options.renderLabel({options:this.options,node:t})]},renderText(e){let{node:t}=e;return this.options.renderLabel({options:this.options,node:t})},addCommands(){return{setVariable:e=>t=>{let{chain:n}=t;n().focus().insertContent([{type:this.name,attrs:e},{type:"text",text:" "}]).run()}}},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command((e=>{let{tr:t,state:n}=e,r=!1;const{selection:i}=n,{empty:o,anchor:s}=i;return!!o&&(n.doc.nodesBetween(s-1,s,((e,n)=>{if(e.type.name===this.name)return r=!0,t.insertText("",n,n+e.nodeSize),!1})),r)}))}},addProseMirrorPlugins(){return[oz({editor:this.editor,...this.options.suggestion})]}}),FP={char:"{{",startOfLine:!1,pluginKey:zP,command:e=>{let{editor:t,range:n,props:r}=e;t.chain().focus().deleteRange(n).setVariable(r).run()},items:()=>[],render:()=>{let e,t;return{onStart:n=>{e=new Ju(LP,{props:n,editor:n.editor}),t=Iu("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:99999})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onExit(){t[0].destroy(),e.destroy()}}}};var RP=e=>{let{suggestion:t={}}=e;return PP.configure({suggestion:{...FP,...t}})};const BP=(e,t)=>{const n=[];e.split(/\n/).forEach((e=>{const r={type:"paragraph"};e.length>0&&(r.content=[{type:"text",text:e}]);const i=_e.fromJSON(t.doc.type.schema,r);n.push(i)}));const r=le.fromArray(n);return fe.maxOpen(r)},UP=(e,n)=>{let{forceTitle:r=!1,titleError:s=!1,hideSlashCommands:a=!1,defaults:l=gd,addons:u=[],addonCommands:c,className:d,uploadEndpoint:p,uploadConfig:h={},initialValue:f="",onChange:m=(()=>{}),onFocus:g=(()=>{}),onBlur:y=(()=>{}),menuType:b="fixed",variables:v,mentions:w,showImageInMention:x=!1,placeholder:M=(r?{title:"Untitled"}:null),extensions:D,contentClassName:k,characterLimit:E,editorSecrets:C,rows:T=6,autoFocus:O=!1,onSubmit:S,heightStrategy:A="fixed",characterCountStrategy:N="hidden",keyboardShortcuts:_=[],error:j=null,...I}=e;const[L,z]=i(!1),P="fixed"===b,F="bubble"===b,R=!a,B=(e=>{if(e){if("string"==typeof e&&e.length)return!0;if("object"==typeof e&&Object.keys(e).length)return!0;if("function"==typeof e)return!0}return!1})(M),U=!B&&R,H=u.includes("image-upload-unsplash"),$="hidden"!==N,V=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],{includeImageUpload:n}=arguments.length>2?arguments[2]:void 0;const r=t.map((e=>e.toLowerCase()));return n&&r.push(md.IMAGE_UPLOAD),[].concat(e,r)}(l,u,{includeImageUpload:H}),W=(e=>{let{forceTitle:t,placeholder:n,extensions:r,mentions:i,variables:o,isSlashCommandsActive:s,showImageInMention:a,setImageUploadVisible:l,options:u,addonCommands:c,characterLimit:d,onSubmit:p,keyboardShortcuts:h}=e,f=[pP,nz.extend({content:t?"title block*":"block+"}),FL.configure({document:!1,codeBlock:!1}),U_,IP,uN,gN,ez,Lz,zz,hN,rz,B_,cN,oP.configure({placeholder:iP(n)}),cz,az,tz,lN.configure({limit:d}),Fz({handleSubmit:p,shortcuts:h})];return s&&f.push(dP({setImageUploadVisible:l,options:u,addonCommands:c})),ld(i)||f.push(qz({suggestion:{items:Uz(i,{showImage:a})}})),ld(o)||f.push(RP({suggestion:{items:()=>o}})),ld(r)||(f=f.concat(r)),f})({contentClassName:k,forceTitle:r,placeholder:M,extensions:D,mentions:w,variables:v,isSlashCommandsActive:R,showImageInMention:x,setImageUploadVisible:z,options:V,addonCommands:c,characterLimit:E,keyboardShortcuts:_,onSubmit:S}),q=sc("neeto-editor",{"slash-active":U,"fixed-menu-active border":P,"bubble-menu-active":F,"force-title":r,"force-title--error":s,"placeholder-active":B,[d]:d}),Y=(e=>{let{heightStrategy:t,rows:n}=e;const r={},i=n*hd+2*(dd+pd);return"flexible"===t?r["min-height"]="".concat(i,"px"):r.height="".concat(i,"px"),r})({heightStrategy:A,rows:T}),Q=ec({extensions:W,content:f,injectCSS:!1,autofocus:O&&"end",editorProps:{attributes:{class:q,style:ad(Y)},clipboardTextParser:BP},parseOptions:{preserveWhitespace:!0},onUpdate:e=>{let{editor:t}=e;return m(t.getHTML())},onFocus:g,onBlur:y});return t.useImperativeHandle(n,(()=>({editor:Q}))),o((()=>{![process.env.RAILS_ENV,"production"].includes("production")&&ld(f)&&console.warn('[neeto-editor]: Empty value of "initialValue" in needtoEditor is expected to be "<p></p>" instead of "'.concat(f,'".'))}),[f]),t.createElement(ud,{error:j,isFixedMenuActive:P},P&&t.createElement(Sv,{editor:Q,variables:v,setImageUploadVisible:z,options:V,mentions:w,showImageInMention:x}),F&&t.createElement(Vf,{editor:Q,options:V}),t.createElement(aN,{isVisible:L,setIsVisible:z,editor:Q,imageUploadUrl:p,uploadConfig:h,isUnsplashImageUploadActive:H,unsplashApiKey:null==C?void 0:C.unsplash}),t.createElement(qu,ie({editor:Q},I)),$&&t.createElement(Wf,{count:null==Q?void 0:Q.storage.characterCount.characters(),limit:E,strategy:N}))};var HP=t.forwardRef(UP),$P={exports:{}},VP=$P.exports=function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function r(e,i,o){return r=n()?Reflect.construct:function(e,n,r){var i=[null];i.push.apply(i,n);var o=new(Function.bind.apply(e,i));return r&&t(o,r.prototype),o},r.apply(null,arguments)}function i(e){return o(e)||s(e)||a(e)||u()}function o(e){if(Array.isArray(e))return l(e)}function s(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c=Object.hasOwnProperty,d=Object.setPrototypeOf,p=Object.isFrozen,h=Object.getPrototypeOf,f=Object.getOwnPropertyDescriptor,m=Object.freeze,g=Object.seal,y=Object.create,b="undefined"!=typeof Reflect&&Reflect,v=b.apply,w=b.construct;v||(v=function(e,t,n){return e.apply(t,n)}),m||(m=function(e){return e}),g||(g=function(e){return e}),w||(w=function(e,t){return r(e,i(t))});var x=N(Array.prototype.forEach),M=N(Array.prototype.pop),D=N(Array.prototype.push),k=N(String.prototype.toLowerCase),E=N(String.prototype.match),C=N(String.prototype.replace),T=N(String.prototype.indexOf),O=N(String.prototype.trim),S=N(RegExp.prototype.test),A=_(TypeError);function N(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return v(e,t,r)}}function _(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return w(e,n)}}function j(e,t,n){n=n||k,d&&d(e,null);for(var r=t.length;r--;){var i=t[r];if("string"==typeof i){var o=n(i);o!==i&&(p(t)||(t[r]=o),i=o)}e[i]=!0}return e}function I(e){var t,n=y(null);for(t in e)v(c,e,[t])&&(n[t]=e[t]);return n}function L(e,t){for(;null!==e;){var n=f(e,t);if(n){if(n.get)return N(n.get);if("function"==typeof n.value)return N(n.value)}e=h(e)}function r(e){return console.warn("fallback value for",e),null}return r}var z=m(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),P=m(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),F=m(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),R=m(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),B=m(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),U=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),H=m(["#text"]),$=m(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),V=m(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),W=m(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),q=m(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Y=g(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Q=g(/<%[\w\W]*|[\w\W]*%>/gm),K=g(/^data-[\-\w.\u00B7-\uFFFF]/),G=g(/^aria-[\-\w]+$/),J=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),X=g(/^(?:\w+script|data):/i),Z=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ee=g(/^html$/i),te=function(){return"undefined"==typeof window?null:window},ne=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,i="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(i)&&(r=n.currentScript.getAttribute(i));var o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function re(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te(),n=function(e){return re(e)};if(n.version="2.3.10",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,s=t.DocumentFragment,a=t.HTMLTemplateElement,l=t.Node,u=t.Element,c=t.NodeFilter,d=t.NamedNodeMap,p=void 0===d?t.NamedNodeMap||t.MozNamedAttrMap:d,h=t.HTMLFormElement,f=t.DOMParser,g=t.trustedTypes,y=u.prototype,b=L(y,"cloneNode"),v=L(y,"nextSibling"),w=L(y,"childNodes"),N=L(y,"parentNode");if("function"==typeof a){var _=o.createElement("template");_.content&&_.content.ownerDocument&&(o=_.content.ownerDocument)}var ie=ne(g,r),oe=ie?ie.createHTML(""):"",se=o,ae=se.implementation,le=se.createNodeIterator,ue=se.createDocumentFragment,ce=se.getElementsByTagName,de=r.importNode,pe={};try{pe=I(o).documentMode?o.documentMode:{}}catch(e){}var he={};n.isSupported="function"==typeof N&&ae&&void 0!==ae.createHTMLDocument&&9!==pe;var fe,me,ge=Y,ye=Q,be=K,ve=G,we=X,xe=Z,Me=J,De=null,ke=j({},[].concat(i(z),i(P),i(F),i(B),i(H))),Ee=null,Ce=j({},[].concat(i($),i(V),i(W),i(q))),Te=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Oe=null,Se=null,Ae=!0,Ne=!0,_e=!1,je=!1,Ie=!1,Le=!1,ze=!1,Pe=!1,Fe=!1,Re=!1,Be=!0,Ue=!0,He=!1,$e={},Ve=null,We=j({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),qe=null,Ye=j({},["audio","video","img","source","image","track"]),Qe=null,Ke=j({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ge="http://www.w3.org/1998/Math/MathML",Je="http://www.w3.org/2000/svg",Xe="http://www.w3.org/1999/xhtml",Ze=Xe,et=!1,tt=["application/xhtml+xml","text/html"],nt="text/html",rt=null,it=o.createElement("form"),ot=function(e){return e instanceof RegExp||e instanceof Function},st=function(t){rt&&rt===t||(t&&"object"===e(t)||(t={}),t=I(t),fe=fe=-1===tt.indexOf(t.PARSER_MEDIA_TYPE)?nt:t.PARSER_MEDIA_TYPE,me="application/xhtml+xml"===fe?function(e){return e}:k,De="ALLOWED_TAGS"in t?j({},t.ALLOWED_TAGS,me):ke,Ee="ALLOWED_ATTR"in t?j({},t.ALLOWED_ATTR,me):Ce,Qe="ADD_URI_SAFE_ATTR"in t?j(I(Ke),t.ADD_URI_SAFE_ATTR,me):Ke,qe="ADD_DATA_URI_TAGS"in t?j(I(Ye),t.ADD_DATA_URI_TAGS,me):Ye,Ve="FORBID_CONTENTS"in t?j({},t.FORBID_CONTENTS,me):We,Oe="FORBID_TAGS"in t?j({},t.FORBID_TAGS,me):{},Se="FORBID_ATTR"in t?j({},t.FORBID_ATTR,me):{},$e="USE_PROFILES"in t&&t.USE_PROFILES,Ae=!1!==t.ALLOW_ARIA_ATTR,Ne=!1!==t.ALLOW_DATA_ATTR,_e=t.ALLOW_UNKNOWN_PROTOCOLS||!1,je=t.SAFE_FOR_TEMPLATES||!1,Ie=t.WHOLE_DOCUMENT||!1,Pe=t.RETURN_DOM||!1,Fe=t.RETURN_DOM_FRAGMENT||!1,Re=t.RETURN_TRUSTED_TYPE||!1,ze=t.FORCE_BODY||!1,Be=!1!==t.SANITIZE_DOM,Ue=!1!==t.KEEP_CONTENT,He=t.IN_PLACE||!1,Me=t.ALLOWED_URI_REGEXP||Me,Ze=t.NAMESPACE||Xe,t.CUSTOM_ELEMENT_HANDLING&&ot(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Te.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ot(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Te.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Te.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),je&&(Ne=!1),Fe&&(Pe=!0),$e&&(De=j({},i(H)),Ee=[],!0===$e.html&&(j(De,z),j(Ee,$)),!0===$e.svg&&(j(De,P),j(Ee,V),j(Ee,q)),!0===$e.svgFilters&&(j(De,F),j(Ee,V),j(Ee,q)),!0===$e.mathMl&&(j(De,B),j(Ee,W),j(Ee,q))),t.ADD_TAGS&&(De===ke&&(De=I(De)),j(De,t.ADD_TAGS,me)),t.ADD_ATTR&&(Ee===Ce&&(Ee=I(Ee)),j(Ee,t.ADD_ATTR,me)),t.ADD_URI_SAFE_ATTR&&j(Qe,t.ADD_URI_SAFE_ATTR,me),t.FORBID_CONTENTS&&(Ve===We&&(Ve=I(Ve)),j(Ve,t.FORBID_CONTENTS,me)),Ue&&(De["#text"]=!0),Ie&&j(De,["html","head","body"]),De.table&&(j(De,["tbody"]),delete Oe.tbody),m&&m(t),rt=t)},at=j({},["mi","mo","mn","ms","mtext"]),lt=j({},["foreignobject","desc","title","annotation-xml"]),ut=j({},["title","style","font","a","script"]),ct=j({},P);j(ct,F),j(ct,R);var dt=j({},B);j(dt,U);var pt=function(e){var t=N(e);t&&t.tagName||(t={namespaceURI:Xe,tagName:"template"});var n=k(e.tagName),r=k(t.tagName);return e.namespaceURI===Je?t.namespaceURI===Xe?"svg"===n:t.namespaceURI===Ge?"svg"===n&&("annotation-xml"===r||at[r]):Boolean(ct[n]):e.namespaceURI===Ge?t.namespaceURI===Xe?"math"===n:t.namespaceURI===Je?"math"===n&&lt[r]:Boolean(dt[n]):e.namespaceURI===Xe&&!(t.namespaceURI===Je&&!lt[r])&&!(t.namespaceURI===Ge&&!at[r])&&!dt[n]&&(ut[n]||!ct[n])},ht=function(e){D(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=oe}catch(t){e.remove()}}},ft=function(e,t){try{D(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){D(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ee[e])if(Pe||Fe)try{ht(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},mt=function(e){var t,n;if(ze)e="<remove></remove>"+e;else{var r=E(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===fe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=ie?ie.createHTML(e):e;if(Ze===Xe)try{t=(new f).parseFromString(i,fe)}catch(e){}if(!t||!t.documentElement){t=ae.createDocument(Ze,"template",null);try{t.documentElement.innerHTML=et?"":i}catch(e){}}var s=t.body||t.documentElement;return e&&n&&s.insertBefore(o.createTextNode(n),s.childNodes[0]||null),Ze===Xe?ce.call(t,Ie?"html":"body")[0]:Ie?t.documentElement:s},gt=function(e){return le.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},yt=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof p)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},bt=function(t){return"object"===e(l)?t instanceof l:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},vt=function(e,t,r){he[e]&&x(he[e],(function(e){e.call(n,t,r,rt)}))},wt=function(e){var t;if(vt("beforeSanitizeElements",e,null),yt(e))return ht(e),!0;if(S(/[\u0080-\uFFFF]/,e.nodeName))return ht(e),!0;var r=me(e.nodeName);if(vt("uponSanitizeElement",e,{tagName:r,allowedTags:De}),e.hasChildNodes()&&!bt(e.firstElementChild)&&(!bt(e.content)||!bt(e.content.firstElementChild))&&S(/<[/\w]/g,e.innerHTML)&&S(/<[/\w]/g,e.textContent))return ht(e),!0;if("select"===r&&S(/<template/i,e.innerHTML))return ht(e),!0;if(!De[r]||Oe[r]){if(!Oe[r]&&Mt(r)){if(Te.tagNameCheck instanceof RegExp&&S(Te.tagNameCheck,r))return!1;if(Te.tagNameCheck instanceof Function&&Te.tagNameCheck(r))return!1}if(Ue&&!Ve[r]){var i=N(e)||e.parentNode,o=w(e)||e.childNodes;if(o&&i)for(var s=o.length-1;s>=0;--s)i.insertBefore(b(o[s],!0),v(e))}return ht(e),!0}return e instanceof u&&!pt(e)?(ht(e),!0):"noscript"!==r&&"noembed"!==r||!S(/<\/no(script|embed)/i,e.innerHTML)?(je&&3===e.nodeType&&(t=e.textContent,t=C(t,ge," "),t=C(t,ye," "),e.textContent!==t&&(D(n.removed,{element:e.cloneNode()}),e.textContent=t)),vt("afterSanitizeElements",e,null),!1):(ht(e),!0)},xt=function(e,t,n){if(Be&&("id"===t||"name"===t)&&(n in o||n in it))return!1;if(Ne&&!Se[t]&&S(be,t));else if(Ae&&S(ve,t));else if(!Ee[t]||Se[t]){if(!(Mt(e)&&(Te.tagNameCheck instanceof RegExp&&S(Te.tagNameCheck,e)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(e))&&(Te.attributeNameCheck instanceof RegExp&&S(Te.attributeNameCheck,t)||Te.attributeNameCheck instanceof Function&&Te.attributeNameCheck(t))||"is"===t&&Te.allowCustomizedBuiltInElements&&(Te.tagNameCheck instanceof RegExp&&S(Te.tagNameCheck,n)||Te.tagNameCheck instanceof Function&&Te.tagNameCheck(n))))return!1}else if(Qe[t]);else if(S(Me,C(n,xe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==T(n,"data:")||!qe[e])if(_e&&!S(we,C(n,xe,"")));else if(n)return!1;return!0},Mt=function(e){return e.indexOf("-")>0},Dt=function(t){var r,i,o,s;vt("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ee};for(s=a.length;s--;){var u=r=a[s],c=u.name,d=u.namespaceURI;if(i="value"===c?r.value:O(r.value),o=me(c),l.attrName=o,l.attrValue=i,l.keepAttr=!0,l.forceKeepAttr=void 0,vt("uponSanitizeAttribute",t,l),i=l.attrValue,!l.forceKeepAttr&&(ft(c,t),l.keepAttr))if(S(/\/>/i,i))ft(c,t);else{je&&(i=C(i,ge," "),i=C(i,ye," "));var p=me(t.nodeName);if(xt(p,o,i)){if(ie&&"object"===e(g)&&"function"==typeof g.getAttributeType)if(d);else switch(g.getAttributeType(p,o)){case"TrustedHTML":i=ie.createHTML(i);break;case"TrustedScriptURL":i=ie.createScriptURL(i)}try{d?t.setAttributeNS(d,c,i):t.setAttribute(c,i),M(n.removed)}catch(e){}}}}vt("afterSanitizeAttributes",t,null)}},kt=function e(t){var n,r=gt(t);for(vt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)vt("uponSanitizeShadowNode",n,null),wt(n)||(n.content instanceof s&&e(n.content),Dt(n));vt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(i,o){var a,u,c,d,p;if((et=!i)&&(i="\x3c!--\x3e"),"string"!=typeof i&&!bt(i)){if("function"!=typeof i.toString)throw A("toString is not a function");if("string"!=typeof(i=i.toString()))throw A("dirty is not a string, aborting")}if(!n.isSupported){if("object"===e(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof i)return t.toStaticHTML(i);if(bt(i))return t.toStaticHTML(i.outerHTML)}return i}if(Le||st(o),n.removed=[],"string"==typeof i&&(He=!1),He){if(i.nodeName){var h=me(i.nodeName);if(!De[h]||Oe[h])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof l)1===(u=(a=mt("\x3c!----\x3e")).ownerDocument.importNode(i,!0)).nodeType&&"BODY"===u.nodeName||"HTML"===u.nodeName?a=u:a.appendChild(u);else{if(!Pe&&!je&&!Ie&&-1===i.indexOf("<"))return ie&&Re?ie.createHTML(i):i;if(!(a=mt(i)))return Pe?null:Re?oe:""}a&&ze&&ht(a.firstChild);for(var f=gt(He?i:a);c=f.nextNode();)3===c.nodeType&&c===d||wt(c)||(c.content instanceof s&&kt(c.content),Dt(c),d=c);if(d=null,He)return i;if(Pe){if(Fe)for(p=ue.call(a.ownerDocument);a.firstChild;)p.appendChild(a.firstChild);else p=a;return Ee.shadowroot&&(p=de.call(r,p,!0)),p}var m=Ie?a.outerHTML:a.innerHTML;return Ie&&De["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&S(ee,a.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+a.ownerDocument.doctype.name+">\n"+m),je&&(m=C(m,ge," "),m=C(m,ye," ")),ie&&Re?ie.createHTML(m):m},n.setConfig=function(e){st(e),Le=!0},n.clearConfig=function(){rt=null,Le=!1},n.isValidAttribute=function(e,t,n){rt||st({});var r=me(e),i=me(t);return xt(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(he[e]=he[e]||[],D(he[e],t))},n.removeHook=function(e){if(he[e])return M(he[e])},n.removeHooks=function(e){he[e]&&(he[e]=[])},n.removeAllHooks=function(){he={}},n}return re()}();const WP=e=>{let{content:n="",className:r,...i}=e;o((()=>{document.querySelectorAll("div.".concat(cd," pre code")).forEach((e=>{ee.highlightElement(e)}))}),[n]);const s=VP.sanitize;return t.createElement("div",ie({className:sc(cd,{[r]:r}),dangerouslySetInnerHTML:{__html:s(n,{ADD_ATTR:["target"]})},"data-cy":"neeto-editor-content"},i))};export{md as EDITOR_OPTIONS,HP as Editor,WP as EditorContent};