@mirus/tiptap-editor 2.0.0

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.
@@ -0,0 +1,115 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();/*!
2
+ * Vue.js v2.7.14
3
+ * (c) 2014-2022 Evan You
4
+ * Released under the MIT License.
5
+ */var Me=Object.freeze({}),B=Array.isArray;function L(t){return t==null}function b(t){return t!=null}function Q(t){return t===!0}function Fd(t){return t===!1}function Pr(t){return typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="boolean"}function Y(t){return typeof t=="function"}function me(t){return t!==null&&typeof t=="object"}var qs=Object.prototype.toString;function Te(t){return qs.call(t)==="[object Object]"}function Bd(t){return qs.call(t)==="[object RegExp]"}function xf(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function Go(t){return b(t)&&typeof t.then=="function"&&typeof t.catch=="function"}function zd(t){return t==null?"":Array.isArray(t)||Te(t)&&t.toString===qs?JSON.stringify(t,null,2):String(t)}function wr(t){var e=parseFloat(t);return isNaN(e)?t:e}function Ye(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return e?function(o){return n[o.toLowerCase()]}:function(o){return n[o]}}Ye("slot,component",!0);var Hd=Ye("key,ref,slot,slot-scope,is");function Ht(t,e){var n=t.length;if(n){if(e===t[n-1]){t.length=n-1;return}var r=t.indexOf(e);if(r>-1)return t.splice(r,1)}}var jd=Object.prototype.hasOwnProperty;function be(t,e){return jd.call(t,e)}function bn(t){var e=Object.create(null);return function(r){var i=e[r];return i||(e[r]=t(r))}}var Wd=/-(\w)/g,cn=bn(function(t){return t.replace(Wd,function(e,n){return n?n.toUpperCase():""})}),Vd=bn(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),Ud=/\B([A-Z])/g,Rr=bn(function(t){return t.replace(Ud,"-$1").toLowerCase()});function qd(t,e){function n(r){var i=arguments.length;return i?i>1?t.apply(e,arguments):t.call(e,r):t.call(e)}return n._length=t.length,n}function Kd(t,e){return t.bind(e)}var wf=Function.prototype.bind?Kd:qd;function Yo(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function G(t,e){for(var n in e)t[n]=e[n];return t}function Sf(t){for(var e={},n=0;n<t.length;n++)t[n]&&G(e,t[n]);return e}function oe(t,e,n){}var Jr=function(t,e,n){return!1},kf=function(t){return t};function fn(t,e){if(t===e)return!0;var n=me(t),r=me(e);if(n&&r)try{var i=Array.isArray(t),o=Array.isArray(e);if(i&&o)return t.length===e.length&&t.every(function(l,c){return fn(l,e[c])});if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(!i&&!o){var s=Object.keys(t),a=Object.keys(e);return s.length===a.length&&s.every(function(l){return fn(t[l],e[l])})}else return!1}catch{return!1}else return!n&&!r?String(t)===String(e):!1}function Cf(t,e){for(var n=0;n<t.length;n++)if(fn(t[n],e))return n;return-1}function gi(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}function Jd(t,e){return t===e?t===0&&1/t!==1/e:t===t||e===e}var Ya="data-server-rendered",Ki=["component","directive","filter"],Of=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch","renderTracked","renderTriggered"],Le={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:Jr,isReservedAttr:Jr,isUnknownElement:Jr,getTagNamespace:oe,parsePlatformTagName:kf,mustUseProp:Jr,async:!0,_lifecycleHooks:Of},Gd=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function Mf(t){var e=(t+"").charCodeAt(0);return e===36||e===95}function Nt(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var Yd=new RegExp("[^".concat(Gd.source,".$_\\d]"));function Xd(t){if(!Yd.test(t)){var e=t.split(".");return function(n){for(var r=0;r<e.length;r++){if(!n)return;n=n[e[r]]}return n}}}var Zd="__proto__"in{},Ae=typeof window<"u",Fe=Ae&&window.navigator.userAgent.toLowerCase(),Jn=Fe&&/msie|trident/.test(Fe),Gn=Fe&&Fe.indexOf("msie 9.0")>0,Ef=Fe&&Fe.indexOf("edge/")>0;Fe&&Fe.indexOf("android")>0;var Qd=Fe&&/iphone|ipad|ipod|ios/.test(Fe),Xa=Fe&&Fe.match(/firefox\/(\d+)/),Xo={}.watch,Tf=!1;if(Ae)try{var Za={};Object.defineProperty(Za,"passive",{get:function(){Tf=!0}}),window.addEventListener("test-passive",null,Za)}catch{}var Gr,Lr=function(){return Gr===void 0&&(!Ae&&typeof global<"u"?Gr=global.process&&global.process.env.VUE_ENV==="server":Gr=!1),Gr},yi=Ae&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function Pn(t){return typeof t=="function"&&/native code/.test(t.toString())}var $r=typeof Symbol<"u"&&Pn(Symbol)&&typeof Reflect<"u"&&Pn(Reflect.ownKeys),Sr;typeof Set<"u"&&Pn(Set)?Sr=Set:Sr=function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(e){return this.set[e]===!0},t.prototype.add=function(e){this.set[e]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var hr=null;function Pt(t){t===void 0&&(t=null),t||hr&&hr._scope.off(),hr=t,t&&t._scope.on()}var Ne=function(){function t(e,n,r,i,o,s,a,l){this.tag=e,this.data=n,this.children=r,this.text=i,this.elm=o,this.ns=void 0,this.context=s,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=n&&n.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=l,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),en=function(t){t===void 0&&(t="");var e=new Ne;return e.text=t,e.isComment=!0,e};function Nn(t){return new Ne(void 0,void 0,void 0,String(t))}function Zo(t){var e=new Ne(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var eh=0,ci=[],th=function(){for(var t=0;t<ci.length;t++){var e=ci[t];e.subs=e.subs.filter(function(n){return n}),e._pending=!1}ci.length=0},Rt=function(){function t(){this._pending=!1,this.id=eh++,this.subs=[]}return t.prototype.addSub=function(e){this.subs.push(e)},t.prototype.removeSub=function(e){this.subs[this.subs.indexOf(e)]=null,this._pending||(this._pending=!0,ci.push(this))},t.prototype.depend=function(e){t.target&&t.target.addDep(this)},t.prototype.notify=function(e){for(var n=this.subs.filter(function(s){return s}),r=0,i=n.length;r<i;r++){var o=n[r];o.update()}},t}();Rt.target=null;var fi=[];function Yn(t){fi.push(t),Rt.target=t}function Xn(){fi.pop(),Rt.target=fi[fi.length-1]}var Nf=Array.prototype,vi=Object.create(Nf),nh=["push","pop","shift","unshift","splice","sort","reverse"];nh.forEach(function(t){var e=Nf[t];Nt(vi,t,function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e.apply(this,r),s=this.__ob__,a;switch(t){case"push":case"unshift":a=r;break;case"splice":a=r.slice(2);break}return a&&s.observeArray(a),s.dep.notify(),o})});var Qa=Object.getOwnPropertyNames(vi),Af={},Ks=!0;function Lt(t){Ks=t}var rh={notify:oe,depend:oe,addSub:oe,removeSub:oe},el=function(){function t(e,n,r){if(n===void 0&&(n=!1),r===void 0&&(r=!1),this.value=e,this.shallow=n,this.mock=r,this.dep=r?rh:new Rt,this.vmCount=0,Nt(e,"__ob__",this),B(e)){if(!r)if(Zd)e.__proto__=vi;else for(var i=0,o=Qa.length;i<o;i++){var s=Qa[i];Nt(e,s,vi[s])}n||this.observeArray(e)}else for(var a=Object.keys(e),i=0;i<a.length;i++){var s=a[i];un(e,s,Af,void 0,n,r)}}return t.prototype.observeArray=function(e){for(var n=0,r=e.length;n<r;n++)mt(e[n],!1,this.mock)},t}();function mt(t,e,n){if(t&&be(t,"__ob__")&&t.__ob__ instanceof el)return t.__ob__;if(Ks&&(n||!Lr())&&(B(t)||Te(t))&&Object.isExtensible(t)&&!t.__v_skip&&!ot(t)&&!(t instanceof Ne))return new el(t,e,n)}function un(t,e,n,r,i,o){var s=new Rt,a=Object.getOwnPropertyDescriptor(t,e);if(!(a&&a.configurable===!1)){var l=a&&a.get,c=a&&a.set;(!l||c)&&(n===Af||arguments.length===2)&&(n=t[e]);var f=!i&&mt(n,!1,o);return Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var p=l?l.call(t):n;return Rt.target&&(s.depend(),f&&(f.dep.depend(),B(p)&&Df(p))),ot(p)&&!i?p.value:p},set:function(p){var d=l?l.call(t):n;if(Jd(d,p)){if(c)c.call(t,p);else{if(l)return;if(!i&&ot(d)&&!ot(p)){d.value=p;return}else n=p}f=!i&&mt(p,!1,o),s.notify()}}}),s}}function Js(t,e,n){if(!Gs(t)){var r=t.__ob__;return B(t)&&xf(e)?(t.length=Math.max(t.length,e),t.splice(e,1,n),r&&!r.shallow&&r.mock&&mt(n,!1,!0),n):e in t&&!(e in Object.prototype)?(t[e]=n,n):t._isVue||r&&r.vmCount?n:r?(un(r.value,e,n,void 0,r.shallow,r.mock),r.dep.notify(),n):(t[e]=n,n)}}function If(t,e){if(B(t)&&xf(e)){t.splice(e,1);return}var n=t.__ob__;t._isVue||n&&n.vmCount||Gs(t)||be(t,e)&&(delete t[e],n&&n.dep.notify())}function Df(t){for(var e=void 0,n=0,r=t.length;n<r;n++)e=t[n],e&&e.__ob__&&e.__ob__.dep.depend(),B(e)&&Df(e)}function _f(t){return ih(t,!0),Nt(t,"__v_isShallow",!0),t}function ih(t,e){Gs(t)||mt(t,e,Lr())}function Gs(t){return!!(t&&t.__v_isReadonly)}function ot(t){return!!(t&&t.__v_isRef===!0)}function Qo(t,e,n){Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:function(){var r=e[n];if(ot(r))return r.value;var i=r&&r.__ob__;return i&&i.dep.depend(),r},set:function(r){var i=e[n];ot(i)&&!ot(r)?i.value=r:e[n]=r}})}var Oe,oh=function(){function t(e){e===void 0&&(e=!1),this.detached=e,this.active=!0,this.effects=[],this.cleanups=[],this.parent=Oe,!e&&Oe&&(this.index=(Oe.scopes||(Oe.scopes=[])).push(this)-1)}return t.prototype.run=function(e){if(this.active){var n=Oe;try{return Oe=this,e()}finally{Oe=n}}},t.prototype.on=function(){Oe=this},t.prototype.off=function(){Oe=this.parent},t.prototype.stop=function(e){if(this.active){var n=void 0,r=void 0;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].teardown();for(n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.scopes)for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);if(!this.detached&&this.parent&&!e){var i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0,this.active=!1}},t}();function sh(t,e){e===void 0&&(e=Oe),e&&e.active&&e.effects.push(t)}function ah(t){var e=t._provided,n=t.$parent&&t.$parent._provided;return n===e?t._provided=Object.create(n):e}var tl=bn(function(t){var e=t.charAt(0)==="&";t=e?t.slice(1):t;var n=t.charAt(0)==="~";t=n?t.slice(1):t;var r=t.charAt(0)==="!";return t=r?t.slice(1):t,{name:t,once:n,capture:r,passive:e}});function es(t,e){function n(){var r=n.fns;if(B(r))for(var i=r.slice(),o=0;o<i.length;o++)$t(i[o],null,arguments,e,"v-on handler");else return $t(r,null,arguments,e,"v-on handler")}return n.fns=t,n}function Pf(t,e,n,r,i,o){var s,a,l,c;for(s in t)a=t[s],l=e[s],c=tl(s),L(a)||(L(l)?(L(a.fns)&&(a=t[s]=es(a,o)),Q(c.once)&&(a=t[s]=i(c.name,a,c.capture)),n(c.name,a,c.capture,c.passive,c.params)):a!==l&&(l.fns=a,t[s]=l));for(s in e)L(t[s])&&(c=tl(s),r(c.name,e[s],c.capture))}function kt(t,e,n){t instanceof Ne&&(t=t.data.hook||(t.data.hook={}));var r,i=t[e];function o(){n.apply(this,arguments),Ht(r.fns,o)}L(i)?r=es([o]):b(i.fns)&&Q(i.merged)?(r=i,r.fns.push(o)):r=es([i,o]),r.merged=!0,t[e]=r}function lh(t,e,n){var r=e.options.props;if(!L(r)){var i={},o=t.attrs,s=t.props;if(b(o)||b(s))for(var a in r){var l=Rr(a);nl(i,s,a,l,!0)||nl(i,o,a,l,!1)}return i}}function nl(t,e,n,r,i){if(b(e)){if(be(e,n))return t[n]=e[n],i||delete e[n],!0;if(be(e,r))return t[n]=e[r],i||delete e[r],!0}return!1}function ch(t){for(var e=0;e<t.length;e++)if(B(t[e]))return Array.prototype.concat.apply([],t);return t}function Ys(t){return Pr(t)?[Nn(t)]:B(t)?Rf(t):void 0}function rr(t){return b(t)&&b(t.text)&&Fd(t.isComment)}function Rf(t,e){var n=[],r,i,o,s;for(r=0;r<t.length;r++)i=t[r],!(L(i)||typeof i=="boolean")&&(o=n.length-1,s=n[o],B(i)?i.length>0&&(i=Rf(i,"".concat(e||"","_").concat(r)),rr(i[0])&&rr(s)&&(n[o]=Nn(s.text+i[0].text),i.shift()),n.push.apply(n,i)):Pr(i)?rr(s)?n[o]=Nn(s.text+i):i!==""&&n.push(Nn(i)):rr(i)&&rr(s)?n[o]=Nn(s.text+i.text):(Q(t._isVList)&&b(i.tag)&&L(i.key)&&b(e)&&(i.key="__vlist".concat(e,"_").concat(r,"__")),n.push(i)));return n}function fh(t,e){var n=null,r,i,o,s;if(B(t)||typeof t=="string")for(n=new Array(t.length),r=0,i=t.length;r<i;r++)n[r]=e(t[r],r);else if(typeof t=="number")for(n=new Array(t),r=0;r<t;r++)n[r]=e(r+1,r);else if(me(t))if($r&&t[Symbol.iterator]){n=[];for(var a=t[Symbol.iterator](),l=a.next();!l.done;)n.push(e(l.value,n.length)),l=a.next()}else for(o=Object.keys(t),n=new Array(o.length),r=0,i=o.length;r<i;r++)s=o[r],n[r]=e(t[s],s,r);return b(n)||(n=[]),n._isVList=!0,n}function uh(t,e,n,r){var i=this.$scopedSlots[t],o;i?(n=n||{},r&&(n=G(G({},r),n)),o=i(n)||(Y(e)?e():e)):o=this.$slots[t]||(Y(e)?e():e);var s=n&&n.slot;return s?this.$createElement("template",{slot:s},o):o}function ph(t){return Ci(this.$options,"filters",t)||kf}function rl(t,e){return B(t)?t.indexOf(e)===-1:t!==e}function dh(t,e,n,r,i){var o=Le.keyCodes[e]||n;return i&&r&&!Le.keyCodes[e]?rl(i,r):o?rl(o,t):r?Rr(r)!==e:t===void 0}function hh(t,e,n,r,i){if(n&&me(n)){B(n)&&(n=Sf(n));var o=void 0,s=function(l){if(l==="class"||l==="style"||Hd(l))o=t;else{var c=t.attrs&&t.attrs.type;o=r||Le.mustUseProp(e,c,l)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}var f=cn(l),u=Rr(l);if(!(f in o)&&!(u in o)&&(o[l]=n[l],i)){var p=t.on||(t.on={});p["update:".concat(l)]=function(d){n[l]=d}}};for(var a in n)s(a)}return t}function mh(t,e){var n=this._staticTrees||(this._staticTrees=[]),r=n[t];return r&&!e||(r=n[t]=this.$options.staticRenderFns[t].call(this._renderProxy,this._c,this),Lf(r,"__static__".concat(t),!1)),r}function gh(t,e,n){return Lf(t,"__once__".concat(e).concat(n?"_".concat(n):""),!0),t}function Lf(t,e,n){if(B(t))for(var r=0;r<t.length;r++)t[r]&&typeof t[r]!="string"&&il(t[r],"".concat(e,"_").concat(r),n);else il(t,e,n)}function il(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}function yh(t,e){if(e&&Te(e)){var n=t.on=t.on?G({},t.on):{};for(var r in e){var i=n[r],o=e[r];n[r]=i?[].concat(i,o):o}}return t}function $f(t,e,n,r){e=e||{$stable:!n};for(var i=0;i<t.length;i++){var o=t[i];B(o)?$f(o,e,n):o&&(o.proxy&&(o.fn.proxy=!0),e[o.key]=o.fn)}return r&&(e.$key=r),e}function vh(t,e){for(var n=0;n<e.length;n+=2){var r=e[n];typeof r=="string"&&r&&(t[e[n]]=e[n+1])}return t}function bh(t,e){return typeof t=="string"?e+t:t}function Ff(t){t._o=gh,t._n=wr,t._s=zd,t._l=fh,t._t=uh,t._q=fn,t._i=Cf,t._m=mh,t._f=ph,t._k=dh,t._b=hh,t._v=Nn,t._e=en,t._u=$f,t._g=yh,t._d=vh,t._p=bh}function Xs(t,e){if(!t||!t.length)return{};for(var n={},r=0,i=t.length;r<i;r++){var o=t[r],s=o.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,(o.context===e||o.fnContext===e)&&s&&s.slot!=null){var a=s.slot,l=n[a]||(n[a]=[]);o.tag==="template"?l.push.apply(l,o.children||[]):l.push(o)}else(n.default||(n.default=[])).push(o)}for(var c in n)n[c].every(xh)&&delete n[c];return n}function xh(t){return t.isComment&&!t.asyncFactory||t.text===" "}function kr(t){return t.isComment&&t.asyncFactory}function mr(t,e,n,r){var i,o=Object.keys(n).length>0,s=e?!!e.$stable:!o,a=e&&e.$key;if(!e)i={};else{if(e._normalized)return e._normalized;if(s&&r&&r!==Me&&a===r.$key&&!o&&!r.$hasNormal)return r;i={};for(var l in e)e[l]&&l[0]!=="$"&&(i[l]=wh(t,n,l,e[l]))}for(var c in n)c in i||(i[c]=Sh(n,c));return e&&Object.isExtensible(e)&&(e._normalized=i),Nt(i,"$stable",s),Nt(i,"$key",a),Nt(i,"$hasNormal",o),i}function wh(t,e,n,r){var i=function(){var o=hr;Pt(t);var s=arguments.length?r.apply(null,arguments):r({});s=s&&typeof s=="object"&&!B(s)?[s]:Ys(s);var a=s&&s[0];return Pt(o),s&&(!a||s.length===1&&a.isComment&&!kr(a))?void 0:s};return r.proxy&&Object.defineProperty(e,n,{get:i,enumerable:!0,configurable:!0}),i}function Sh(t,e){return function(){return t[e]}}function kh(t){var e=t.$options,n=e.setup;if(n){var r=t._setupContext=Ch(t);Pt(t),Yn();var i=$t(n,null,[t._props||_f({}),r],t,"setup");if(Xn(),Pt(),Y(i))e.render=i;else if(me(i))if(t._setupState=i,i.__sfc){var s=t._setupProxy={};for(var o in i)o!=="__sfc"&&Qo(s,i,o)}else for(var o in i)Mf(o)||Qo(t,i,o)}}function Ch(t){return{get attrs(){if(!t._attrsProxy){var e=t._attrsProxy={};Nt(e,"_v_attr_proxy",!0),bi(e,t.$attrs,Me,t,"$attrs")}return t._attrsProxy},get listeners(){if(!t._listenersProxy){var e=t._listenersProxy={};bi(e,t.$listeners,Me,t,"$listeners")}return t._listenersProxy},get slots(){return Mh(t)},emit:wf(t.$emit,t),expose:function(e){e&&Object.keys(e).forEach(function(n){return Qo(t,e,n)})}}}function bi(t,e,n,r,i){var o=!1;for(var s in e)s in t?e[s]!==n[s]&&(o=!0):(o=!0,Oh(t,s,r,i));for(var s in t)s in e||(o=!0,delete t[s]);return o}function Oh(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[r][e]}})}function Mh(t){return t._slotsProxy||Bf(t._slotsProxy={},t.$scopedSlots),t._slotsProxy}function Bf(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}function Eh(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,r=n&&n.context;t.$slots=Xs(e._renderChildren,r),t.$scopedSlots=n?mr(t.$parent,n.data.scopedSlots,t.$slots):Me,t._c=function(o,s,a,l){return xi(t,o,s,a,l,!1)},t.$createElement=function(o,s,a,l){return xi(t,o,s,a,l,!0)};var i=n&&n.data;un(t,"$attrs",i&&i.attrs||Me,null,!0),un(t,"$listeners",e._parentListeners||Me,null,!0)}var ts=null;function Th(t){Ff(t.prototype),t.prototype.$nextTick=function(e){return Zs(e,this)},t.prototype._render=function(){var e=this,n=e.$options,r=n.render,i=n._parentVnode;i&&e._isMounted&&(e.$scopedSlots=mr(e.$parent,i.data.scopedSlots,e.$slots,e.$scopedSlots),e._slotsProxy&&Bf(e._slotsProxy,e.$scopedSlots)),e.$vnode=i;var o;try{Pt(e),ts=e,o=r.call(e._renderProxy,e.$createElement)}catch(s){pn(s,e,"render"),o=e._vnode}finally{ts=null,Pt()}return B(o)&&o.length===1&&(o=o[0]),o instanceof Ne||(o=en()),o.parent=i,o}}function co(t,e){return(t.__esModule||$r&&t[Symbol.toStringTag]==="Module")&&(t=t.default),me(t)?e.extend(t):t}function Nh(t,e,n,r,i){var o=en();return o.asyncFactory=t,o.asyncMeta={data:e,context:n,children:r,tag:i},o}function Ah(t,e){if(Q(t.error)&&b(t.errorComp))return t.errorComp;if(b(t.resolved))return t.resolved;var n=ts;if(n&&b(t.owners)&&t.owners.indexOf(n)===-1&&t.owners.push(n),Q(t.loading)&&b(t.loadingComp))return t.loadingComp;if(n&&!b(t.owners)){var r=t.owners=[n],i=!0,o=null,s=null;n.$on("hook:destroyed",function(){return Ht(r,n)});var a=function(u){for(var p=0,d=r.length;p<d;p++)r[p].$forceUpdate();u&&(r.length=0,o!==null&&(clearTimeout(o),o=null),s!==null&&(clearTimeout(s),s=null))},l=gi(function(u){t.resolved=co(u,e),i?r.length=0:a(!0)}),c=gi(function(u){b(t.errorComp)&&(t.error=!0,a(!0))}),f=t(l,c);return me(f)&&(Go(f)?L(t.resolved)&&f.then(l,c):Go(f.component)&&(f.component.then(l,c),b(f.error)&&(t.errorComp=co(f.error,e)),b(f.loading)&&(t.loadingComp=co(f.loading,e),f.delay===0?t.loading=!0:o=setTimeout(function(){o=null,L(t.resolved)&&L(t.error)&&(t.loading=!0,a(!1))},f.delay||200)),b(f.timeout)&&(s=setTimeout(function(){s=null,L(t.resolved)&&c(null)},f.timeout)))),i=!1,t.loading?t.loadingComp:t.resolved}}function zf(t){if(B(t))for(var e=0;e<t.length;e++){var n=t[e];if(b(n)&&(b(n.componentOptions)||kr(n)))return n}}var Ih=1,Hf=2;function xi(t,e,n,r,i,o){return(B(n)||Pr(n))&&(i=r,r=n,n=void 0),Q(o)&&(i=Hf),Dh(t,e,n,r,i)}function Dh(t,e,n,r,i){if(b(n)&&b(n.__ob__)||(b(n)&&b(n.is)&&(e=n.is),!e))return en();B(r)&&Y(r[0])&&(n=n||{},n.scopedSlots={default:r[0]},r.length=0),i===Hf?r=Ys(r):i===Ih&&(r=ch(r));var o,s;if(typeof e=="string"){var a=void 0;s=t.$vnode&&t.$vnode.ns||Le.getTagNamespace(e),Le.isReservedTag(e)?o=new Ne(Le.parsePlatformTagName(e),n,r,void 0,void 0,t):(!n||!n.pre)&&b(a=Ci(t.$options,"components",e))?o=pl(a,n,t,r,e):o=new Ne(e,n,r,void 0,void 0,t)}else o=pl(e,n,t,r);return B(o)?o:b(o)?(b(s)&&jf(o,s),b(n)&&_h(n),o):en()}function jf(t,e,n){if(t.ns=e,t.tag==="foreignObject"&&(e=void 0,n=!0),b(t.children))for(var r=0,i=t.children.length;r<i;r++){var o=t.children[r];b(o.tag)&&(L(o.ns)||Q(n)&&o.tag!=="svg")&&jf(o,e,n)}}function _h(t){me(t.style)&&wi(t.style),me(t.class)&&wi(t.class)}function pn(t,e,n){Yn();try{if(e)for(var r=e;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{var s=i[o].call(r,t,e,n)===!1;if(s)return}catch(a){ol(a,r,"errorCaptured hook")}}ol(t,e,n)}finally{Xn()}}function $t(t,e,n,r,i){var o;try{o=n?t.apply(e,n):t.call(e),o&&!o._isVue&&Go(o)&&!o._handled&&(o.catch(function(s){return pn(s,r,i+" (Promise/async)")}),o._handled=!0)}catch(s){pn(s,r,i)}return o}function ol(t,e,n){if(Le.errorHandler)try{return Le.errorHandler.call(null,t,e,n)}catch(r){r!==t&&sl(r)}sl(t)}function sl(t,e,n){if(Ae&&typeof console<"u")console.error(t);else throw t}var ns=!1,rs=[],is=!1;function Yr(){is=!1;var t=rs.slice(0);rs.length=0;for(var e=0;e<t.length;e++)t[e]()}var fr;if(typeof Promise<"u"&&Pn(Promise)){var Ph=Promise.resolve();fr=function(){Ph.then(Yr),Qd&&setTimeout(oe)},ns=!0}else if(!Jn&&typeof MutationObserver<"u"&&(Pn(MutationObserver)||MutationObserver.toString()==="[object MutationObserverConstructor]")){var Xr=1,Rh=new MutationObserver(Yr),al=document.createTextNode(String(Xr));Rh.observe(al,{characterData:!0}),fr=function(){Xr=(Xr+1)%2,al.data=String(Xr)},ns=!0}else typeof setImmediate<"u"&&Pn(setImmediate)?fr=function(){setImmediate(Yr)}:fr=function(){setTimeout(Yr,0)};function Zs(t,e){var n;if(rs.push(function(){if(t)try{t.call(e)}catch(r){pn(r,e,"nextTick")}else n&&n(e)}),is||(is=!0,fr()),!t&&typeof Promise<"u")return new Promise(function(r){n=r})}var Lh="2.7.14",ll=new Sr;function wi(t){return ui(t,ll),ll.clear(),t}function ui(t,e){var n,r,i=B(t);if(!(!i&&!me(t)||t.__v_skip||Object.isFrozen(t)||t instanceof Ne)){if(t.__ob__){var o=t.__ob__.dep.id;if(e.has(o))return;e.add(o)}if(i)for(n=t.length;n--;)ui(t[n],e);else if(ot(t))ui(t.value,e);else for(r=Object.keys(t),n=r.length;n--;)ui(t[r[n]],e)}}var $h=0,Qs=function(){function t(e,n,r,i,o){sh(this,Oe&&!Oe._vm?Oe:e?e._scope:void 0),(this.vm=e)&&o&&(e._watcher=this),i?(this.deep=!!i.deep,this.user=!!i.user,this.lazy=!!i.lazy,this.sync=!!i.sync,this.before=i.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=r,this.id=++$h,this.active=!0,this.post=!1,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new Sr,this.newDepIds=new Sr,this.expression="",Y(n)?this.getter=n:(this.getter=Xd(n),this.getter||(this.getter=oe)),this.value=this.lazy?void 0:this.get()}return t.prototype.get=function(){Yn(this);var e,n=this.vm;try{e=this.getter.call(n,n)}catch(r){if(this.user)pn(r,n,'getter for watcher "'.concat(this.expression,'"'));else throw r}finally{this.deep&&wi(e),Xn(),this.cleanupDeps()}return e},t.prototype.addDep=function(e){var n=e.id;this.newDepIds.has(n)||(this.newDepIds.add(n),this.newDeps.push(e),this.depIds.has(n)||e.addSub(this))},t.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var n=this.deps[e];this.newDepIds.has(n.id)||n.removeSub(this)}var r=this.depIds;this.depIds=this.newDepIds,this.newDepIds=r,this.newDepIds.clear(),r=this.deps,this.deps=this.newDeps,this.newDeps=r,this.newDeps.length=0},t.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():Qh(this)},t.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||me(e)||this.deep){var n=this.value;if(this.value=e,this.user){var r='callback for watcher "'.concat(this.expression,'"');$t(this.cb,this.vm,[e,n],this.vm,r)}else this.cb.call(this.vm,e,n)}}},t.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},t.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},t.prototype.teardown=function(){if(this.vm&&!this.vm._isBeingDestroyed&&Ht(this.vm._scope.effects,this),this.active){for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1,this.onStop&&this.onStop()}},t}();function Fh(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Wf(t,e)}var Cr;function Bh(t,e){Cr.$on(t,e)}function zh(t,e){Cr.$off(t,e)}function Hh(t,e){var n=Cr;return function r(){var i=e.apply(null,arguments);i!==null&&n.$off(t,r)}}function Wf(t,e,n){Cr=t,Pf(e,n||{},Bh,zh,Hh,t),Cr=void 0}function jh(t){var e=/^hook:/;t.prototype.$on=function(n,r){var i=this;if(B(n))for(var o=0,s=n.length;o<s;o++)i.$on(n[o],r);else(i._events[n]||(i._events[n]=[])).push(r),e.test(n)&&(i._hasHookEvent=!0);return i},t.prototype.$once=function(n,r){var i=this;function o(){i.$off(n,o),r.apply(i,arguments)}return o.fn=r,i.$on(n,o),i},t.prototype.$off=function(n,r){var i=this;if(!arguments.length)return i._events=Object.create(null),i;if(B(n)){for(var o=0,s=n.length;o<s;o++)i.$off(n[o],r);return i}var a=i._events[n];if(!a)return i;if(!r)return i._events[n]=null,i;for(var l,c=a.length;c--;)if(l=a[c],l===r||l.fn===r){a.splice(c,1);break}return i},t.prototype.$emit=function(n){var r=this,i=r._events[n];if(i){i=i.length>1?Yo(i):i;for(var o=Yo(arguments,1),s='event handler for "'.concat(n,'"'),a=0,l=i.length;a<l;a++)$t(i[a],r,o,r,s)}return r}}var tn=null;function Vf(t){var e=tn;return tn=t,function(){tn=e}}function Wh(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}function Vh(t){t.prototype._update=function(e,n){var r=this,i=r.$el,o=r._vnode,s=Vf(r);r._vnode=e,o?r.$el=r.__patch__(o,e):r.$el=r.__patch__(r.$el,e,n,!1),s(),i&&(i.__vue__=null),r.$el&&(r.$el.__vue__=r);for(var a=r;a&&a.$vnode&&a.$parent&&a.$vnode===a.$parent._vnode;)a.$parent.$el=a.$el,a=a.$parent},t.prototype.$forceUpdate=function(){var e=this;e._watcher&&e._watcher.update()},t.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){Ke(e,"beforeDestroy"),e._isBeingDestroyed=!0;var n=e.$parent;n&&!n._isBeingDestroyed&&!e.$options.abstract&&Ht(n.$children,e),e._scope.stop(),e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),Ke(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}function Uh(t,e,n){t.$el=e,t.$options.render||(t.$options.render=en),Ke(t,"beforeMount");var r;r=function(){t._update(t._render(),n)};var i={before:function(){t._isMounted&&!t._isDestroyed&&Ke(t,"beforeUpdate")}};new Qs(t,r,oe,i,!0),n=!1;var o=t._preWatchers;if(o)for(var s=0;s<o.length;s++)o[s].run();return t.$vnode==null&&(t._isMounted=!0,Ke(t,"mounted")),t}function qh(t,e,n,r,i){var o=r.data.scopedSlots,s=t.$scopedSlots,a=!!(o&&!o.$stable||s!==Me&&!s.$stable||o&&t.$scopedSlots.$key!==o.$key||!o&&t.$scopedSlots.$key),l=!!(i||t.$options._renderChildren||a),c=t.$vnode;t.$options._parentVnode=r,t.$vnode=r,t._vnode&&(t._vnode.parent=r),t.$options._renderChildren=i;var f=r.data.attrs||Me;t._attrsProxy&&bi(t._attrsProxy,f,c.data&&c.data.attrs||Me,t,"$attrs")&&(l=!0),t.$attrs=f,n=n||Me;var u=t.$options._parentListeners;if(t._listenersProxy&&bi(t._listenersProxy,n,u||Me,t,"$listeners"),t.$listeners=t.$options._parentListeners=n,Wf(t,n,u),e&&t.$options.props){Lt(!1);for(var p=t._props,d=t.$options._propKeys||[],h=0;h<d.length;h++){var m=d[h],x=t.$options.props;p[m]=oa(m,x,e,t)}Lt(!0),t.$options.propsData=e}l&&(t.$slots=Xs(i,r.context),t.$forceUpdate())}function Uf(t){for(;t&&(t=t.$parent);)if(t._inactive)return!0;return!1}function ea(t,e){if(e){if(t._directInactive=!1,Uf(t))return}else if(t._directInactive)return;if(t._inactive||t._inactive===null){t._inactive=!1;for(var n=0;n<t.$children.length;n++)ea(t.$children[n]);Ke(t,"activated")}}function qf(t,e){if(!(e&&(t._directInactive=!0,Uf(t)))&&!t._inactive){t._inactive=!0;for(var n=0;n<t.$children.length;n++)qf(t.$children[n]);Ke(t,"deactivated")}}function Ke(t,e,n,r){r===void 0&&(r=!0),Yn();var i=hr;r&&Pt(t);var o=t.$options[e],s="".concat(e," hook");if(o)for(var a=0,l=o.length;a<l;a++)$t(o[a],t,n||null,t,s);t._hasHookEvent&&t.$emit("hook:"+e),r&&Pt(i),Xn()}var pt=[],ta=[],Si={},ss=!1,na=!1,An=0;function Kh(){An=pt.length=ta.length=0,Si={},ss=na=!1}var Kf=0,as=Date.now;if(Ae&&!Jn){var fo=window.performance;fo&&typeof fo.now=="function"&&as()>document.createEvent("Event").timeStamp&&(as=function(){return fo.now()})}var Jh=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function Gh(){Kf=as(),na=!0;var t,e;for(pt.sort(Jh),An=0;An<pt.length;An++)t=pt[An],t.before&&t.before(),e=t.id,Si[e]=null,t.run();var n=ta.slice(),r=pt.slice();Kh(),Zh(n),Yh(r),th(),yi&&Le.devtools&&yi.emit("flush")}function Yh(t){for(var e=t.length;e--;){var n=t[e],r=n.vm;r&&r._watcher===n&&r._isMounted&&!r._isDestroyed&&Ke(r,"updated")}}function Xh(t){t._inactive=!1,ta.push(t)}function Zh(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,ea(t[e],!0)}function Qh(t){var e=t.id;if(Si[e]==null&&!(t===Rt.target&&t.noRecurse)){if(Si[e]=!0,!na)pt.push(t);else{for(var n=pt.length-1;n>An&&pt[n].id>t.id;)n--;pt.splice(n+1,0,t)}ss||(ss=!0,Zs(Gh))}}function em(t){var e=t.$options.provide;if(e){var n=Y(e)?e.call(t):e;if(!me(n))return;for(var r=ah(t),i=$r?Reflect.ownKeys(n):Object.keys(n),o=0;o<i.length;o++){var s=i[o];Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(n,s))}}}function tm(t){var e=Jf(t.$options.inject,t);e&&(Lt(!1),Object.keys(e).forEach(function(n){un(t,n,e[n])}),Lt(!0))}function Jf(t,e){if(t){for(var n=Object.create(null),r=$r?Reflect.ownKeys(t):Object.keys(t),i=0;i<r.length;i++){var o=r[i];if(o!=="__ob__"){var s=t[o].from;if(s in e._provided)n[o]=e._provided[s];else if("default"in t[o]){var a=t[o].default;n[o]=Y(a)?a.call(e):a}}}return n}}function ra(t,e,n,r,i){var o=this,s=i.options,a;be(r,"_uid")?(a=Object.create(r),a._original=r):(a=r,r=r._original);var l=Q(s._compiled),c=!l;this.data=t,this.props=e,this.children=n,this.parent=r,this.listeners=t.on||Me,this.injections=Jf(s.inject,r),this.slots=function(){return o.$slots||mr(r,t.scopedSlots,o.$slots=Xs(n,r)),o.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return mr(r,t.scopedSlots,this.slots())}}),l&&(this.$options=s,this.$slots=this.slots(),this.$scopedSlots=mr(r,t.scopedSlots,this.$slots)),s._scopeId?this._c=function(f,u,p,d){var h=xi(a,f,u,p,d,c);return h&&!B(h)&&(h.fnScopeId=s._scopeId,h.fnContext=r),h}:this._c=function(f,u,p,d){return xi(a,f,u,p,d,c)}}Ff(ra.prototype);function nm(t,e,n,r,i){var o=t.options,s={},a=o.props;if(b(a))for(var l in a)s[l]=oa(l,a,e||Me);else b(n.attrs)&&fl(s,n.attrs),b(n.props)&&fl(s,n.props);var c=new ra(n,s,i,r,t),f=o.render.call(null,c._c,c);if(f instanceof Ne)return cl(f,n,c.parent,o);if(B(f)){for(var u=Ys(f)||[],p=new Array(u.length),d=0;d<u.length;d++)p[d]=cl(u[d],n,c.parent,o);return p}}function cl(t,e,n,r,i){var o=Zo(t);return o.fnContext=n,o.fnOptions=r,e.slot&&((o.data||(o.data={})).slot=e.slot),o}function fl(t,e){for(var n in e)t[cn(n)]=e[n]}function ki(t){return t.name||t.__name||t._componentTag}var ia={init:function(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){var n=t;ia.prepatch(n,n)}else{var r=t.componentInstance=rm(t,tn);r.$mount(e?t.elm:void 0,e)}},prepatch:function(t,e){var n=e.componentOptions,r=e.componentInstance=t.componentInstance;qh(r,n.propsData,n.listeners,e,n.children)},insert:function(t){var e=t.context,n=t.componentInstance;n._isMounted||(n._isMounted=!0,Ke(n,"mounted")),t.data.keepAlive&&(e._isMounted?Xh(n):ea(n,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?qf(e,!0):e.$destroy())}},ul=Object.keys(ia);function pl(t,e,n,r,i){if(!L(t)){var o=n.$options._base;if(me(t)&&(t=o.extend(t)),typeof t=="function"){var s;if(L(t.cid)&&(s=t,t=Ah(s,o),t===void 0))return Nh(s,e,n,r,i);e=e||{},aa(t),b(e.model)&&sm(t.options,e);var a=lh(e,t);if(Q(t.options.functional))return nm(t,a,e,n,r);var l=e.on;if(e.on=e.nativeOn,Q(t.options.abstract)){var c=e.slot;e={},c&&(e.slot=c)}im(e);var f=ki(t.options)||i,u=new Ne("vue-component-".concat(t.cid).concat(f?"-".concat(f):""),e,void 0,void 0,void 0,n,{Ctor:t,propsData:a,listeners:l,tag:i,children:r},s);return u}}}function rm(t,e){var n={_isComponent:!0,_parentVnode:t,parent:e},r=t.data.inlineTemplate;return b(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns),new t.componentOptions.Ctor(n)}function im(t){for(var e=t.hook||(t.hook={}),n=0;n<ul.length;n++){var r=ul[n],i=e[r],o=ia[r];i!==o&&!(i&&i._merged)&&(e[r]=i?om(o,i):o)}}function om(t,e){var n=function(r,i){t(r,i),e(r,i)};return n._merged=!0,n}function sm(t,e){var n=t.model&&t.model.prop||"value",r=t.model&&t.model.event||"input";(e.attrs||(e.attrs={}))[n]=e.model.value;var i=e.on||(e.on={}),o=i[r],s=e.model.callback;b(o)?(B(o)?o.indexOf(s)===-1:o!==s)&&(i[r]=[s].concat(o)):i[r]=s}var am=oe,nt=Le.optionMergeStrategies;function Or(t,e,n){if(n===void 0&&(n=!0),!e)return t;for(var r,i,o,s=$r?Reflect.ownKeys(e):Object.keys(e),a=0;a<s.length;a++)r=s[a],r!=="__ob__"&&(i=t[r],o=e[r],!n||!be(t,r)?Js(t,r,o):i!==o&&Te(i)&&Te(o)&&Or(i,o));return t}function dl(t,e,n){return n?function(){var i=Y(e)?e.call(n,n):e,o=Y(t)?t.call(n,n):t;return i?Or(i,o):o}:e?t?function(){return Or(Y(e)?e.call(this,this):e,Y(t)?t.call(this,this):t)}:e:t}nt.data=function(t,e,n){return n?dl(t,e,n):e&&typeof e!="function"?t:dl(t,e)};function lm(t,e){var n=e?t?t.concat(e):B(e)?e:[e]:t;return n&&cm(n)}function cm(t){for(var e=[],n=0;n<t.length;n++)e.indexOf(t[n])===-1&&e.push(t[n]);return e}Of.forEach(function(t){nt[t]=lm});function fm(t,e,n,r){var i=Object.create(t||null);return e?G(i,e):i}Ki.forEach(function(t){nt[t+"s"]=fm});nt.watch=function(t,e,n,r){if(t===Xo&&(t=void 0),e===Xo&&(e=void 0),!e)return Object.create(t||null);if(!t)return e;var i={};G(i,t);for(var o in e){var s=i[o],a=e[o];s&&!B(s)&&(s=[s]),i[o]=s?s.concat(a):B(a)?a:[a]}return i};nt.props=nt.methods=nt.inject=nt.computed=function(t,e,n,r){if(!t)return e;var i=Object.create(null);return G(i,t),e&&G(i,e),i};nt.provide=function(t,e){return t?function(){var n=Object.create(null);return Or(n,Y(t)?t.call(this):t),e&&Or(n,Y(e)?e.call(this):e,!1),n}:e};var um=function(t,e){return e===void 0?t:e};function pm(t,e){var n=t.props;if(n){var r={},i,o,s;if(B(n))for(i=n.length;i--;)o=n[i],typeof o=="string"&&(s=cn(o),r[s]={type:null});else if(Te(n))for(var a in n)o=n[a],s=cn(a),r[s]=Te(o)?o:{type:o};t.props=r}}function dm(t,e){var n=t.inject;if(n){var r=t.inject={};if(B(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(Te(n))for(var o in n){var s=n[o];r[o]=Te(s)?G({from:o},s):{from:s}}}}function hm(t){var e=t.directives;if(e)for(var n in e){var r=e[n];Y(r)&&(e[n]={bind:r,update:r})}}function dn(t,e,n){if(Y(e)&&(e=e.options),pm(e),dm(e),hm(e),!e._base&&(e.extends&&(t=dn(t,e.extends,n)),e.mixins))for(var r=0,i=e.mixins.length;r<i;r++)t=dn(t,e.mixins[r],n);var o={},s;for(s in t)a(s);for(s in e)be(t,s)||a(s);function a(l){var c=nt[l]||um;o[l]=c(t[l],e[l],n,l)}return o}function Ci(t,e,n,r){if(typeof n=="string"){var i=t[e];if(be(i,n))return i[n];var o=cn(n);if(be(i,o))return i[o];var s=Vd(o);if(be(i,s))return i[s];var a=i[n]||i[o]||i[s];return a}}function oa(t,e,n,r){var i=e[t],o=!be(n,t),s=n[t],a=ml(Boolean,i.type);if(a>-1){if(o&&!be(i,"default"))s=!1;else if(s===""||s===Rr(t)){var l=ml(String,i.type);(l<0||a<l)&&(s=!0)}}if(s===void 0){s=mm(r,i,t);var c=Ks;Lt(!0),mt(s),Lt(c)}return s}function mm(t,e,n){if(be(e,"default")){var r=e.default;return t&&t.$options.propsData&&t.$options.propsData[n]===void 0&&t._props[n]!==void 0?t._props[n]:Y(r)&&ls(e.type)!=="Function"?r.call(t):r}}var gm=/^\s*function (\w+)/;function ls(t){var e=t&&t.toString().match(gm);return e?e[1]:""}function hl(t,e){return ls(t)===ls(e)}function ml(t,e){if(!B(e))return hl(e,t)?0:-1;for(var n=0,r=e.length;n<r;n++)if(hl(e[n],t))return n;return-1}var xt={enumerable:!0,configurable:!0,get:oe,set:oe};function sa(t,e,n){xt.get=function(){return this[e][n]},xt.set=function(i){this[e][n]=i},Object.defineProperty(t,n,xt)}function ym(t){var e=t.$options;if(e.props&&vm(t,e.props),kh(t),e.methods&&km(t,e.methods),e.data)bm(t);else{var n=mt(t._data={});n&&n.vmCount++}e.computed&&Sm(t,e.computed),e.watch&&e.watch!==Xo&&Cm(t,e.watch)}function vm(t,e){var n=t.$options.propsData||{},r=t._props=_f({}),i=t.$options._propKeys=[],o=!t.$parent;o||Lt(!1);var s=function(l){i.push(l);var c=oa(l,e,n,t);un(r,l,c),l in t||sa(t,"_props",l)};for(var a in e)s(a);Lt(!0)}function bm(t){var e=t.$options.data;e=t._data=Y(e)?xm(e,t):e||{},Te(e)||(e={});var n=Object.keys(e),r=t.$options.props;t.$options.methods;for(var i=n.length;i--;){var o=n[i];r&&be(r,o)||Mf(o)||sa(t,"_data",o)}var s=mt(e);s&&s.vmCount++}function xm(t,e){Yn();try{return t.call(e,e)}catch(n){return pn(n,e,"data()"),{}}finally{Xn()}}var wm={lazy:!0};function Sm(t,e){var n=t._computedWatchers=Object.create(null),r=Lr();for(var i in e){var o=e[i],s=Y(o)?o:o.get;r||(n[i]=new Qs(t,s||oe,oe,wm)),i in t||Gf(t,i,o)}}function Gf(t,e,n){var r=!Lr();Y(n)?(xt.get=r?gl(e):yl(n),xt.set=oe):(xt.get=n.get?r&&n.cache!==!1?gl(e):yl(n.get):oe,xt.set=n.set||oe),Object.defineProperty(t,e,xt)}function gl(t){return function(){var n=this._computedWatchers&&this._computedWatchers[t];if(n)return n.dirty&&n.evaluate(),Rt.target&&n.depend(),n.value}}function yl(t){return function(){return t.call(this,this)}}function km(t,e){t.$options.props;for(var n in e)t[n]=typeof e[n]!="function"?oe:wf(e[n],t)}function Cm(t,e){for(var n in e){var r=e[n];if(B(r))for(var i=0;i<r.length;i++)cs(t,n,r[i]);else cs(t,n,r)}}function cs(t,e,n,r){return Te(n)&&(r=n,n=n.handler),typeof n=="string"&&(n=t[n]),t.$watch(e,n,r)}function Om(t){var e={};e.get=function(){return this._data};var n={};n.get=function(){return this._props},Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=Js,t.prototype.$delete=If,t.prototype.$watch=function(r,i,o){var s=this;if(Te(i))return cs(s,r,i,o);o=o||{},o.user=!0;var a=new Qs(s,r,i,o);if(o.immediate){var l='callback for immediate watcher "'.concat(a.expression,'"');Yn(),$t(i,s,[a.value],s,l),Xn()}return function(){a.teardown()}}}var Mm=0;function Em(t){t.prototype._init=function(e){var n=this;n._uid=Mm++,n._isVue=!0,n.__v_skip=!0,n._scope=new oh(!0),n._scope._vm=!0,e&&e._isComponent?Tm(n,e):n.$options=dn(aa(n.constructor),e||{},n),n._renderProxy=n,n._self=n,Wh(n),Fh(n),Eh(n),Ke(n,"beforeCreate",void 0,!1),tm(n),ym(n),em(n),Ke(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}function Tm(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}function aa(t){var e=t.options;if(t.super){var n=aa(t.super),r=t.superOptions;if(n!==r){t.superOptions=n;var i=Nm(t);i&&G(t.extendOptions,i),e=t.options=dn(n,t.extendOptions),e.name&&(e.components[e.name]=t)}}return e}function Nm(t){var e,n=t.options,r=t.sealedOptions;for(var i in n)n[i]!==r[i]&&(e||(e={}),e[i]=n[i]);return e}function ee(t){this._init(t)}Em(ee);Om(ee);jh(ee);Vh(ee);Th(ee);function Am(t){t.use=function(e){var n=this._installedPlugins||(this._installedPlugins=[]);if(n.indexOf(e)>-1)return this;var r=Yo(arguments,1);return r.unshift(this),Y(e.install)?e.install.apply(e,r):Y(e)&&e.apply(null,r),n.push(e),this}}function Im(t){t.mixin=function(e){return this.options=dn(this.options,e),this}}function Dm(t){t.cid=0;var e=1;t.extend=function(n){n=n||{};var r=this,i=r.cid,o=n._Ctor||(n._Ctor={});if(o[i])return o[i];var s=ki(n)||ki(r.options),a=function(c){this._init(c)};return a.prototype=Object.create(r.prototype),a.prototype.constructor=a,a.cid=e++,a.options=dn(r.options,n),a.super=r,a.options.props&&_m(a),a.options.computed&&Pm(a),a.extend=r.extend,a.mixin=r.mixin,a.use=r.use,Ki.forEach(function(l){a[l]=r[l]}),s&&(a.options.components[s]=a),a.superOptions=r.options,a.extendOptions=n,a.sealedOptions=G({},a.options),o[i]=a,a}}function _m(t){var e=t.options.props;for(var n in e)sa(t.prototype,"_props",n)}function Pm(t){var e=t.options.computed;for(var n in e)Gf(t.prototype,n,e[n])}function Rm(t){Ki.forEach(function(e){t[e]=function(n,r){return r?(e==="component"&&Te(r)&&(r.name=r.name||n,r=this.options._base.extend(r)),e==="directive"&&Y(r)&&(r={bind:r,update:r}),this.options[e+"s"][n]=r,r):this.options[e+"s"][n]}})}function vl(t){return t&&(ki(t.Ctor.options)||t.tag)}function Zr(t,e){return B(t)?t.indexOf(e)>-1:typeof t=="string"?t.split(",").indexOf(e)>-1:Bd(t)?t.test(e):!1}function bl(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var s=n[o];if(s){var a=s.name;a&&!e(a)&&fs(n,o,r,i)}}}function fs(t,e,n,r){var i=t[e];i&&(!r||i.tag!==r.tag)&&i.componentInstance.$destroy(),t[e]=null,Ht(n,e)}var xl=[String,RegExp,Array],Lm={name:"keep-alive",abstract:!0,props:{include:xl,exclude:xl,max:[String,Number]},methods:{cacheVNode:function(){var t=this,e=t.cache,n=t.keys,r=t.vnodeToCache,i=t.keyToCache;if(r){var o=r.tag,s=r.componentInstance,a=r.componentOptions;e[i]={name:vl(a),tag:o,componentInstance:s},n.push(i),this.max&&n.length>parseInt(this.max)&&fs(e,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)fs(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",function(e){bl(t,function(n){return Zr(e,n)})}),this.$watch("exclude",function(e){bl(t,function(n){return!Zr(e,n)})})},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=zf(t),n=e&&e.componentOptions;if(n){var r=vl(n),i=this,o=i.include,s=i.exclude;if(o&&(!r||!Zr(o,r))||s&&r&&Zr(s,r))return e;var a=this,l=a.cache,c=a.keys,f=e.key==null?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;l[f]?(e.componentInstance=l[f].componentInstance,Ht(c,f),c.push(f)):(this.vnodeToCache=e,this.keyToCache=f),e.data.keepAlive=!0}return e||t&&t[0]}},$m={KeepAlive:Lm};function Fm(t){var e={};e.get=function(){return Le},Object.defineProperty(t,"config",e),t.util={warn:am,extend:G,mergeOptions:dn,defineReactive:un},t.set=Js,t.delete=If,t.nextTick=Zs,t.observable=function(n){return mt(n),n},t.options=Object.create(null),Ki.forEach(function(n){t.options[n+"s"]=Object.create(null)}),t.options._base=t,G(t.options.components,$m),Am(t),Im(t),Dm(t),Rm(t)}Fm(ee);Object.defineProperty(ee.prototype,"$isServer",{get:Lr});Object.defineProperty(ee.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}});Object.defineProperty(ee,"FunctionalRenderContext",{value:ra});ee.version=Lh;var Bm=Ye("style,class"),zm=Ye("input,textarea,option,select,progress"),Hm=function(t,e,n){return n==="value"&&zm(t)&&e!=="button"||n==="selected"&&t==="option"||n==="checked"&&t==="input"||n==="muted"&&t==="video"},Yf=Ye("contenteditable,draggable,spellcheck"),jm=Ye("events,caret,typing,plaintext-only"),Wm=function(t,e){return Oi(e)||e==="false"?"false":t==="contenteditable"&&jm(e)?e:"true"},Vm=Ye("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),us="http://www.w3.org/1999/xlink",la=function(t){return t.charAt(5)===":"&&t.slice(0,5)==="xlink"},Xf=function(t){return la(t)?t.slice(6,t.length):""},Oi=function(t){return t==null||t===!1};function Um(t){for(var e=t.data,n=t,r=t;b(r.componentInstance);)r=r.componentInstance._vnode,r&&r.data&&(e=wl(r.data,e));for(;b(n=n.parent);)n&&n.data&&(e=wl(e,n.data));return qm(e.staticClass,e.class)}function wl(t,e){return{staticClass:ca(t.staticClass,e.staticClass),class:b(t.class)?[t.class,e.class]:e.class}}function qm(t,e){return b(t)||b(e)?ca(t,fa(e)):""}function ca(t,e){return t?e?t+" "+e:t:e||""}function fa(t){return Array.isArray(t)?Km(t):me(t)?Jm(t):typeof t=="string"?t:""}function Km(t){for(var e="",n,r=0,i=t.length;r<i;r++)b(n=fa(t[r]))&&n!==""&&(e&&(e+=" "),e+=n);return e}function Jm(t){var e="";for(var n in t)t[n]&&(e&&(e+=" "),e+=n);return e}var Gm={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Ym=Ye("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),ua=Ye("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Zf=function(t){return Ym(t)||ua(t)};function Xm(t){if(ua(t))return"svg";if(t==="math")return"math"}var Qr=Object.create(null);function Zm(t){if(!Ae)return!0;if(Zf(t))return!1;if(t=t.toLowerCase(),Qr[t]!=null)return Qr[t];var e=document.createElement(t);return t.indexOf("-")>-1?Qr[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Qr[t]=/HTMLUnknownElement/.test(e.toString())}var ps=Ye("text,number,password,search,email,tel,url");function Qm(t){if(typeof t=="string"){var e=document.querySelector(t);return e||document.createElement("div")}else return t}function eg(t,e){var n=document.createElement(t);return t!=="select"||e.data&&e.data.attrs&&e.data.attrs.multiple!==void 0&&n.setAttribute("multiple","multiple"),n}function tg(t,e){return document.createElementNS(Gm[t],e)}function ng(t){return document.createTextNode(t)}function rg(t){return document.createComment(t)}function ig(t,e,n){t.insertBefore(e,n)}function og(t,e){t.removeChild(e)}function sg(t,e){t.appendChild(e)}function ag(t){return t.parentNode}function lg(t){return t.nextSibling}function cg(t){return t.tagName}function fg(t,e){t.textContent=e}function ug(t,e){t.setAttribute(e,"")}var pg=Object.freeze({__proto__:null,createElement:eg,createElementNS:tg,createTextNode:ng,createComment:rg,insertBefore:ig,removeChild:og,appendChild:sg,parentNode:ag,nextSibling:lg,tagName:cg,setTextContent:fg,setStyleScope:ug}),dg={create:function(t,e){In(e)},update:function(t,e){t.data.ref!==e.data.ref&&(In(t,!0),In(e))},destroy:function(t){In(t,!0)}};function In(t,e){var n=t.data.ref;if(b(n)){var r=t.context,i=t.componentInstance||t.elm,o=e?null:i,s=e?void 0:i;if(Y(n)){$t(n,r,[o],r,"template ref function");return}var a=t.data.refInFor,l=typeof n=="string"||typeof n=="number",c=ot(n),f=r.$refs;if(l||c){if(a){var u=l?f[n]:n.value;e?B(u)&&Ht(u,i):B(u)?u.includes(i)||u.push(i):l?(f[n]=[i],Sl(r,n,f[n])):n.value=[i]}else if(l){if(e&&f[n]!==i)return;f[n]=s,Sl(r,n,o)}else if(c){if(e&&n.value!==i)return;n.value=o}}}}function Sl(t,e,n){var r=t._setupState;r&&be(r,e)&&(ot(r[e])?r[e].value=n:r[e]=n)}var Ct=new Ne("",{},[]),ir=["create","activate","update","remove","destroy"];function Jt(t,e){return t.key===e.key&&t.asyncFactory===e.asyncFactory&&(t.tag===e.tag&&t.isComment===e.isComment&&b(t.data)===b(e.data)&&hg(t,e)||Q(t.isAsyncPlaceholder)&&L(e.asyncFactory.error))}function hg(t,e){if(t.tag!=="input")return!0;var n,r=b(n=t.data)&&b(n=n.attrs)&&n.type,i=b(n=e.data)&&b(n=n.attrs)&&n.type;return r===i||ps(r)&&ps(i)}function mg(t,e,n){var r,i,o={};for(r=e;r<=n;++r)i=t[r].key,b(i)&&(o[i]=r);return o}function gg(t){var e,n,r={},i=t.modules,o=t.nodeOps;for(e=0;e<ir.length;++e)for(r[ir[e]]=[],n=0;n<i.length;++n)b(i[n][ir[e]])&&r[ir[e]].push(i[n][ir[e]]);function s(v){return new Ne(o.tagName(v).toLowerCase(),{},[],void 0,v)}function a(v,y){function k(){--k.listeners===0&&l(v)}return k.listeners=y,k}function l(v){var y=o.parentNode(v);b(y)&&o.removeChild(y,v)}function c(v,y,k,T,_,z,P){if(b(v.elm)&&b(z)&&(v=z[P]=Zo(v)),v.isRootInsert=!_,!f(v,y,k,T)){var I=v.data,H=v.children,q=v.tag;b(q)?(v.elm=v.ns?o.createElementNS(v.ns,q):o.createElement(q,v),w(v),h(v,H,y),b(I)&&x(v,y),d(k,v.elm,T)):Q(v.isComment)?(v.elm=o.createComment(v.text),d(k,v.elm,T)):(v.elm=o.createTextNode(v.text),d(k,v.elm,T))}}function f(v,y,k,T){var _=v.data;if(b(_)){var z=b(v.componentInstance)&&_.keepAlive;if(b(_=_.hook)&&b(_=_.init)&&_(v,!1),b(v.componentInstance))return u(v,y),d(k,v.elm,T),Q(z)&&p(v,y,k,T),!0}}function u(v,y){b(v.data.pendingInsert)&&(y.push.apply(y,v.data.pendingInsert),v.data.pendingInsert=null),v.elm=v.componentInstance.$el,m(v)?(x(v,y),w(v)):(In(v),y.push(v))}function p(v,y,k,T){for(var _,z=v;z.componentInstance;)if(z=z.componentInstance._vnode,b(_=z.data)&&b(_=_.transition)){for(_=0;_<r.activate.length;++_)r.activate[_](Ct,z);y.push(z);break}d(k,v.elm,T)}function d(v,y,k){b(v)&&(b(k)?o.parentNode(k)===v&&o.insertBefore(v,y,k):o.appendChild(v,y))}function h(v,y,k){if(B(y))for(var T=0;T<y.length;++T)c(y[T],k,v.elm,null,!0,y,T);else Pr(v.text)&&o.appendChild(v.elm,o.createTextNode(String(v.text)))}function m(v){for(;v.componentInstance;)v=v.componentInstance._vnode;return b(v.tag)}function x(v,y){for(var k=0;k<r.create.length;++k)r.create[k](Ct,v);e=v.data.hook,b(e)&&(b(e.create)&&e.create(Ct,v),b(e.insert)&&y.push(v))}function w(v){var y;if(b(y=v.fnScopeId))o.setStyleScope(v.elm,y);else for(var k=v;k;)b(y=k.context)&&b(y=y.$options._scopeId)&&o.setStyleScope(v.elm,y),k=k.parent;b(y=tn)&&y!==v.context&&y!==v.fnContext&&b(y=y.$options._scopeId)&&o.setStyleScope(v.elm,y)}function M(v,y,k,T,_,z){for(;T<=_;++T)c(k[T],z,v,y,!1,k,T)}function O(v){var y,k,T=v.data;if(b(T))for(b(y=T.hook)&&b(y=y.destroy)&&y(v),y=0;y<r.destroy.length;++y)r.destroy[y](v);if(b(y=v.children))for(k=0;k<v.children.length;++k)O(v.children[k])}function K(v,y,k){for(;y<=k;++y){var T=v[y];b(T)&&(b(T.tag)?(F(T),O(T)):l(T.elm))}}function F(v,y){if(b(y)||b(v.data)){var k,T=r.remove.length+1;for(b(y)?y.listeners+=T:y=a(v.elm,T),b(k=v.componentInstance)&&b(k=k._vnode)&&b(k.data)&&F(k,y),k=0;k<r.remove.length;++k)r.remove[k](v,y);b(k=v.data.hook)&&b(k=k.remove)?k(v,y):y()}else l(v.elm)}function X(v,y,k,T,_){for(var z=0,P=0,I=y.length-1,H=y[0],q=y[I],V=k.length-1,ne=k[0],ge=k[V],Xe,je,Ze,kn,Cn=!_;z<=I&&P<=V;)L(H)?H=y[++z]:L(q)?q=y[--I]:Jt(H,ne)?(A(H,ne,T,k,P),H=y[++z],ne=k[++P]):Jt(q,ge)?(A(q,ge,T,k,V),q=y[--I],ge=k[--V]):Jt(H,ge)?(A(H,ge,T,k,V),Cn&&o.insertBefore(v,H.elm,o.nextSibling(q.elm)),H=y[++z],ge=k[--V]):Jt(q,ne)?(A(q,ne,T,k,P),Cn&&o.insertBefore(v,q.elm,H.elm),q=y[--I],ne=k[++P]):(L(Xe)&&(Xe=mg(y,z,I)),je=b(ne.key)?Xe[ne.key]:g(ne,y,z,I),L(je)?c(ne,T,v,H.elm,!1,k,P):(Ze=y[je],Jt(Ze,ne)?(A(Ze,ne,T,k,P),y[je]=void 0,Cn&&o.insertBefore(v,Ze.elm,H.elm)):c(ne,T,v,H.elm,!1,k,P)),ne=k[++P]);z>I?(kn=L(k[V+1])?null:k[V+1].elm,M(v,kn,k,P,V,T)):P>V&&K(y,z,I)}function g(v,y,k,T){for(var _=k;_<T;_++){var z=y[_];if(b(z)&&Jt(v,z))return _}}function A(v,y,k,T,_,z){if(v!==y){b(y.elm)&&b(T)&&(y=T[_]=Zo(y));var P=y.elm=v.elm;if(Q(v.isAsyncPlaceholder)){b(y.asyncFactory.resolved)?He(v.elm,y,k):y.isAsyncPlaceholder=!0;return}if(Q(y.isStatic)&&Q(v.isStatic)&&y.key===v.key&&(Q(y.isCloned)||Q(y.isOnce))){y.componentInstance=v.componentInstance;return}var I,H=y.data;b(H)&&b(I=H.hook)&&b(I=I.prepatch)&&I(v,y);var q=v.children,V=y.children;if(b(H)&&m(y)){for(I=0;I<r.update.length;++I)r.update[I](v,y);b(I=H.hook)&&b(I=I.update)&&I(v,y)}L(y.text)?b(q)&&b(V)?q!==V&&X(P,q,V,k,z):b(V)?(b(v.text)&&o.setTextContent(P,""),M(P,null,V,0,V.length-1,k)):b(q)?K(q,0,q.length-1):b(v.text)&&o.setTextContent(P,""):v.text!==y.text&&o.setTextContent(P,y.text),b(H)&&b(I=H.hook)&&b(I=I.postpatch)&&I(v,y)}}function ce(v,y,k){if(Q(k)&&b(v.parent))v.parent.data.pendingInsert=y;else for(var T=0;T<y.length;++T)y[T].data.hook.insert(y[T])}var te=Ye("attrs,class,staticClass,staticStyle,key");function He(v,y,k,T){var _,z=y.tag,P=y.data,I=y.children;if(T=T||P&&P.pre,y.elm=v,Q(y.isComment)&&b(y.asyncFactory))return y.isAsyncPlaceholder=!0,!0;if(b(P)&&(b(_=P.hook)&&b(_=_.init)&&_(y,!0),b(_=y.componentInstance)))return u(y,k),!0;if(b(z)){if(b(I))if(!v.hasChildNodes())h(y,I,k);else if(b(_=P)&&b(_=_.domProps)&&b(_=_.innerHTML)){if(_!==v.innerHTML)return!1}else{for(var H=!0,q=v.firstChild,V=0;V<I.length;V++){if(!q||!He(q,I[V],k,T)){H=!1;break}q=q.nextSibling}if(!H||q)return!1}if(b(P)){var ne=!1;for(var ge in P)if(!te(ge)){ne=!0,x(y,k);break}!ne&&P.class&&wi(P.class)}}else v.data!==y.text&&(v.data=y.text);return!0}return function(y,k,T,_){if(L(k)){b(y)&&O(y);return}var z=!1,P=[];if(L(y))z=!0,c(k,P);else{var I=b(y.nodeType);if(!I&&Jt(y,k))A(y,k,P,null,null,_);else{if(I){if(y.nodeType===1&&y.hasAttribute(Ya)&&(y.removeAttribute(Ya),T=!0),Q(T)&&He(y,k,P))return ce(k,P,!0),y;y=s(y)}var H=y.elm,q=o.parentNode(H);if(c(k,P,H._leaveCb?null:q,o.nextSibling(H)),b(k.parent))for(var V=k.parent,ne=m(k);V;){for(var ge=0;ge<r.destroy.length;++ge)r.destroy[ge](V);if(V.elm=k.elm,ne){for(var Xe=0;Xe<r.create.length;++Xe)r.create[Xe](Ct,V);var je=V.data.hook.insert;if(je.merged)for(var Ze=1;Ze<je.fns.length;Ze++)je.fns[Ze]()}else In(V);V=V.parent}b(q)?K([y],0,0):b(y.tag)&&O(y)}}return ce(k,P,z),k.elm}}var yg={create:uo,update:uo,destroy:function(e){uo(e,Ct)}};function uo(t,e){(t.data.directives||e.data.directives)&&vg(t,e)}function vg(t,e){var n=t===Ct,r=e===Ct,i=kl(t.data.directives,t.context),o=kl(e.data.directives,e.context),s=[],a=[],l,c,f;for(l in o)c=i[l],f=o[l],c?(f.oldValue=c.value,f.oldArg=c.arg,or(f,"update",e,t),f.def&&f.def.componentUpdated&&a.push(f)):(or(f,"bind",e,t),f.def&&f.def.inserted&&s.push(f));if(s.length){var u=function(){for(var p=0;p<s.length;p++)or(s[p],"inserted",e,t)};n?kt(e,"insert",u):u()}if(a.length&&kt(e,"postpatch",function(){for(var p=0;p<a.length;p++)or(a[p],"componentUpdated",e,t)}),!n)for(l in i)o[l]||or(i[l],"unbind",t,t,r)}var bg=Object.create(null);function kl(t,e){var n=Object.create(null);if(!t)return n;var r,i;for(r=0;r<t.length;r++){if(i=t[r],i.modifiers||(i.modifiers=bg),n[xg(i)]=i,e._setupState&&e._setupState.__sfc){var o=i.def||Ci(e,"_setupState","v-"+i.name);typeof o=="function"?i.def={bind:o,update:o}:i.def=o}i.def=i.def||Ci(e.$options,"directives",i.name)}return n}function xg(t){return t.rawName||"".concat(t.name,".").concat(Object.keys(t.modifiers||{}).join("."))}function or(t,e,n,r,i){var o=t.def&&t.def[e];if(o)try{o(n.elm,t,n,r,i)}catch(s){pn(s,n.context,"directive ".concat(t.name," ").concat(e," hook"))}}var wg=[dg,yg];function Cl(t,e){var n=e.componentOptions;if(!(b(n)&&n.Ctor.options.inheritAttrs===!1)&&!(L(t.data.attrs)&&L(e.data.attrs))){var r,i,o,s=e.elm,a=t.data.attrs||{},l=e.data.attrs||{};(b(l.__ob__)||Q(l._v_attr_proxy))&&(l=e.data.attrs=G({},l));for(r in l)i=l[r],o=a[r],o!==i&&Ol(s,r,i,e.data.pre);(Jn||Ef)&&l.value!==a.value&&Ol(s,"value",l.value);for(r in a)L(l[r])&&(la(r)?s.removeAttributeNS(us,Xf(r)):Yf(r)||s.removeAttribute(r))}}function Ol(t,e,n,r){r||t.tagName.indexOf("-")>-1?Ml(t,e,n):Vm(e)?Oi(n)?t.removeAttribute(e):(n=e==="allowfullscreen"&&t.tagName==="EMBED"?"true":e,t.setAttribute(e,n)):Yf(e)?t.setAttribute(e,Wm(e,n)):la(e)?Oi(n)?t.removeAttributeNS(us,Xf(e)):t.setAttributeNS(us,e,n):Ml(t,e,n)}function Ml(t,e,n){if(Oi(n))t.removeAttribute(e);else{if(Jn&&!Gn&&t.tagName==="TEXTAREA"&&e==="placeholder"&&n!==""&&!t.__ieph){var r=function(i){i.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Sg={create:Cl,update:Cl};function El(t,e){var n=e.elm,r=e.data,i=t.data;if(!(L(r.staticClass)&&L(r.class)&&(L(i)||L(i.staticClass)&&L(i.class)))){var o=Um(e),s=n._transitionClasses;b(s)&&(o=ca(o,fa(s))),o!==n._prevClass&&(n.setAttribute("class",o),n._prevClass=o)}}var kg={create:El,update:El},po="__r",ho="__c";function Cg(t){if(b(t[po])){var e=Jn?"change":"input";t[e]=[].concat(t[po],t[e]||[]),delete t[po]}b(t[ho])&&(t.change=[].concat(t[ho],t.change||[]),delete t[ho])}var Mr;function Og(t,e,n){var r=Mr;return function i(){var o=e.apply(null,arguments);o!==null&&Qf(t,i,n,r)}}var Mg=ns&&!(Xa&&Number(Xa[1])<=53);function Eg(t,e,n,r){if(Mg){var i=Kf,o=e;e=o._wrapper=function(s){if(s.target===s.currentTarget||s.timeStamp>=i||s.timeStamp<=0||s.target.ownerDocument!==document)return o.apply(this,arguments)}}Mr.addEventListener(t,e,Tf?{capture:n,passive:r}:n)}function Qf(t,e,n,r){(r||Mr).removeEventListener(t,e._wrapper||e,n)}function mo(t,e){if(!(L(t.data.on)&&L(e.data.on))){var n=e.data.on||{},r=t.data.on||{};Mr=e.elm||t.elm,Cg(n),Pf(n,r,Eg,Qf,Og,e.context),Mr=void 0}}var Tg={create:mo,update:mo,destroy:function(t){return mo(t,Ct)}},ei;function Tl(t,e){if(!(L(t.data.domProps)&&L(e.data.domProps))){var n,r,i=e.elm,o=t.data.domProps||{},s=e.data.domProps||{};(b(s.__ob__)||Q(s._v_attr_proxy))&&(s=e.data.domProps=G({},s));for(n in o)n in s||(i[n]="");for(n in s){if(r=s[n],n==="textContent"||n==="innerHTML"){if(e.children&&(e.children.length=0),r===o[n])continue;i.childNodes.length===1&&i.removeChild(i.childNodes[0])}if(n==="value"&&i.tagName!=="PROGRESS"){i._value=r;var a=L(r)?"":String(r);Ng(i,a)&&(i.value=a)}else if(n==="innerHTML"&&ua(i.tagName)&&L(i.innerHTML)){ei=ei||document.createElement("div"),ei.innerHTML="<svg>".concat(r,"</svg>");for(var l=ei.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;l.firstChild;)i.appendChild(l.firstChild)}else if(r!==o[n])try{i[n]=r}catch{}}}}function Ng(t,e){return!t.composing&&(t.tagName==="OPTION"||Ag(t,e)||Ig(t,e))}function Ag(t,e){var n=!0;try{n=document.activeElement!==t}catch{}return n&&t.value!==e}function Ig(t,e){var n=t.value,r=t._vModifiers;if(b(r)){if(r.number)return wr(n)!==wr(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}var Dg={create:Tl,update:Tl},_g=bn(function(t){var e={},n=/;(?![^(]*\))/g,r=/:(.+)/;return t.split(n).forEach(function(i){if(i){var o=i.split(r);o.length>1&&(e[o[0].trim()]=o[1].trim())}}),e});function go(t){var e=eu(t.style);return t.staticStyle?G(t.staticStyle,e):e}function eu(t){return Array.isArray(t)?Sf(t):typeof t=="string"?_g(t):t}function Pg(t,e){var n={},r;if(e)for(var i=t;i.componentInstance;)i=i.componentInstance._vnode,i&&i.data&&(r=go(i.data))&&G(n,r);(r=go(t.data))&&G(n,r);for(var o=t;o=o.parent;)o.data&&(r=go(o.data))&&G(n,r);return n}var Rg=/^--/,Nl=/\s*!important$/,Al=function(t,e,n){if(Rg.test(e))t.style.setProperty(e,n);else if(Nl.test(n))t.style.setProperty(Rr(e),n.replace(Nl,""),"important");else{var r=Lg(e);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)t.style[r]=n[i];else t.style[r]=n}},Il=["Webkit","Moz","ms"],ti,Lg=bn(function(t){if(ti=ti||document.createElement("div").style,t=cn(t),t!=="filter"&&t in ti)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<Il.length;n++){var r=Il[n]+e;if(r in ti)return r}});function Dl(t,e){var n=e.data,r=t.data;if(!(L(n.staticStyle)&&L(n.style)&&L(r.staticStyle)&&L(r.style))){var i,o,s=e.elm,a=r.staticStyle,l=r.normalizedStyle||r.style||{},c=a||l,f=eu(e.data.style)||{};e.data.normalizedStyle=b(f.__ob__)?G({},f):f;var u=Pg(e,!0);for(o in c)L(u[o])&&Al(s,o,"");for(o in u)i=u[o],i!==c[o]&&Al(s,o,i??"")}}var $g={create:Dl,update:Dl},tu=/\s+/;function nu(t,e){if(!(!e||!(e=e.trim())))if(t.classList)e.indexOf(" ")>-1?e.split(tu).forEach(function(r){return t.classList.add(r)}):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function ru(t,e){if(!(!e||!(e=e.trim())))if(t.classList)e.indexOf(" ")>-1?e.split(tu).forEach(function(i){return t.classList.remove(i)}):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function iu(t){if(t){if(typeof t=="object"){var e={};return t.css!==!1&&G(e,_l(t.name||"v")),G(e,t),e}else if(typeof t=="string")return _l(t)}}var _l=bn(function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}}),ou=Ae&&!Gn,Mn="transition",yo="animation",pi="transition",Mi="transitionend",ds="animation",su="animationend";ou&&(window.ontransitionend===void 0&&window.onwebkittransitionend!==void 0&&(pi="WebkitTransition",Mi="webkitTransitionEnd"),window.onanimationend===void 0&&window.onwebkitanimationend!==void 0&&(ds="WebkitAnimation",su="webkitAnimationEnd"));var Pl=Ae?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function au(t){Pl(function(){Pl(t)})}function nn(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),nu(t,e))}function dt(t,e){t._transitionClasses&&Ht(t._transitionClasses,e),ru(t,e)}function lu(t,e,n){var r=cu(t,e),i=r.type,o=r.timeout,s=r.propCount;if(!i)return n();var a=i===Mn?Mi:su,l=0,c=function(){t.removeEventListener(a,f),n()},f=function(u){u.target===t&&++l>=s&&c()};setTimeout(function(){l<s&&c()},o+1),t.addEventListener(a,f)}var Fg=/\b(transform|all)(,|$)/;function cu(t,e){var n=window.getComputedStyle(t),r=(n[pi+"Delay"]||"").split(", "),i=(n[pi+"Duration"]||"").split(", "),o=Rl(r,i),s=(n[ds+"Delay"]||"").split(", "),a=(n[ds+"Duration"]||"").split(", "),l=Rl(s,a),c,f=0,u=0;e===Mn?o>0&&(c=Mn,f=o,u=i.length):e===yo?l>0&&(c=yo,f=l,u=a.length):(f=Math.max(o,l),c=f>0?o>l?Mn:yo:null,u=c?c===Mn?i.length:a.length:0);var p=c===Mn&&Fg.test(n[pi+"Property"]);return{type:c,timeout:f,propCount:u,hasTransform:p}}function Rl(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max.apply(null,e.map(function(n,r){return Ll(n)+Ll(t[r])}))}function Ll(t){return Number(t.slice(0,-1).replace(",","."))*1e3}function hs(t,e){var n=t.elm;b(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var r=iu(t.data.transition);if(!L(r)&&!(b(n._enterCb)||n.nodeType!==1)){for(var i=r.css,o=r.type,s=r.enterClass,a=r.enterToClass,l=r.enterActiveClass,c=r.appearClass,f=r.appearToClass,u=r.appearActiveClass,p=r.beforeEnter,d=r.enter,h=r.afterEnter,m=r.enterCancelled,x=r.beforeAppear,w=r.appear,M=r.afterAppear,O=r.appearCancelled,K=r.duration,F=tn,X=tn.$vnode;X&&X.parent;)F=X.context,X=X.parent;var g=!F._isMounted||!t.isRootInsert;if(!(g&&!w&&w!=="")){var A=g&&c?c:s,ce=g&&u?u:l,te=g&&f?f:a,He=g&&x||p,v=g&&Y(w)?w:d,y=g&&M||h,k=g&&O||m,T=wr(me(K)?K.enter:K),_=i!==!1&&!Gn,z=pa(v),P=n._enterCb=gi(function(){_&&(dt(n,te),dt(n,ce)),P.cancelled?(_&&dt(n,A),k&&k(n)):y&&y(n),n._enterCb=null});t.data.show||kt(t,"insert",function(){var I=n.parentNode,H=I&&I._pending&&I._pending[t.key];H&&H.tag===t.tag&&H.elm._leaveCb&&H.elm._leaveCb(),v&&v(n,P)}),He&&He(n),_&&(nn(n,A),nn(n,ce),au(function(){dt(n,A),P.cancelled||(nn(n,te),z||(uu(T)?setTimeout(P,T):lu(n,o,P)))})),t.data.show&&(e&&e(),v&&v(n,P)),!_&&!z&&P()}}}function fu(t,e){var n=t.elm;b(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var r=iu(t.data.transition);if(L(r)||n.nodeType!==1)return e();if(b(n._leaveCb))return;var i=r.css,o=r.type,s=r.leaveClass,a=r.leaveToClass,l=r.leaveActiveClass,c=r.beforeLeave,f=r.leave,u=r.afterLeave,p=r.leaveCancelled,d=r.delayLeave,h=r.duration,m=i!==!1&&!Gn,x=pa(f),w=wr(me(h)?h.leave:h),M=n._leaveCb=gi(function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[t.key]=null),m&&(dt(n,a),dt(n,l)),M.cancelled?(m&&dt(n,s),p&&p(n)):(e(),u&&u(n)),n._leaveCb=null});d?d(O):O();function O(){M.cancelled||(!t.data.show&&n.parentNode&&((n.parentNode._pending||(n.parentNode._pending={}))[t.key]=t),c&&c(n),m&&(nn(n,s),nn(n,l),au(function(){dt(n,s),M.cancelled||(nn(n,a),x||(uu(w)?setTimeout(M,w):lu(n,o,M)))})),f&&f(n,M),!m&&!x&&M())}}function uu(t){return typeof t=="number"&&!isNaN(t)}function pa(t){if(L(t))return!1;var e=t.fns;return b(e)?pa(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function $l(t,e){e.data.show!==!0&&hs(e)}var Bg=Ae?{create:$l,activate:$l,remove:function(t,e){t.data.show!==!0?fu(t,e):e()}}:{},zg=[Sg,kg,Tg,Dg,$g,Bg],Hg=zg.concat(wg),jg=gg({nodeOps:pg,modules:Hg});Gn&&document.addEventListener("selectionchange",function(){var t=document.activeElement;t&&t.vmodel&&da(t,"input")});var pu={inserted:function(t,e,n,r){n.tag==="select"?(r.elm&&!r.elm._vOptions?kt(n,"postpatch",function(){pu.componentUpdated(t,e,n)}):Fl(t,e,n.context),t._vOptions=[].map.call(t.options,Ei)):(n.tag==="textarea"||ps(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",Wg),t.addEventListener("compositionend",Hl),t.addEventListener("change",Hl),Gn&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if(n.tag==="select"){Fl(t,e,n.context);var r=t._vOptions,i=t._vOptions=[].map.call(t.options,Ei);if(i.some(function(s,a){return!fn(s,r[a])})){var o=t.multiple?e.value.some(function(s){return zl(s,i)}):e.value!==e.oldValue&&zl(e.value,i);o&&da(t,"change")}}}};function Fl(t,e,n){Bl(t,e),(Jn||Ef)&&setTimeout(function(){Bl(t,e)},0)}function Bl(t,e,n){var r=e.value,i=t.multiple;if(!(i&&!Array.isArray(r))){for(var o,s,a=0,l=t.options.length;a<l;a++)if(s=t.options[a],i)o=Cf(r,Ei(s))>-1,s.selected!==o&&(s.selected=o);else if(fn(Ei(s),r)){t.selectedIndex!==a&&(t.selectedIndex=a);return}i||(t.selectedIndex=-1)}}function zl(t,e){return e.every(function(n){return!fn(n,t)})}function Ei(t){return"_value"in t?t._value:t.value}function Wg(t){t.target.composing=!0}function Hl(t){t.target.composing&&(t.target.composing=!1,da(t.target,"input"))}function da(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function ms(t){return t.componentInstance&&(!t.data||!t.data.transition)?ms(t.componentInstance._vnode):t}var Vg={bind:function(t,e,n){var r=e.value;n=ms(n);var i=n.data&&n.data.transition,o=t.__vOriginalDisplay=t.style.display==="none"?"":t.style.display;r&&i?(n.data.show=!0,hs(n,function(){t.style.display=o})):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value,i=e.oldValue;if(!r!=!i){n=ms(n);var o=n.data&&n.data.transition;o?(n.data.show=!0,r?hs(n,function(){t.style.display=t.__vOriginalDisplay}):fu(n,function(){t.style.display="none"})):t.style.display=r?t.__vOriginalDisplay:"none"}},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}},Ug={model:pu,show:Vg},du={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function gs(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?gs(zf(e.children)):t}function hu(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var r in i)e[cn(r)]=i[r];return e}function jl(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function qg(t){for(;t=t.parent;)if(t.data.transition)return!0}function Kg(t,e){return e.key===t.key&&e.tag===t.tag}var Jg=function(t){return t.tag||kr(t)},Gg=function(t){return t.name==="show"},Yg={name:"transition",props:du,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Jg),!!n.length)){var r=this.mode,i=n[0];if(qg(this.$vnode))return i;var o=gs(i);if(!o)return i;if(this._leaving)return jl(t,i);var s="__transition-".concat(this._uid,"-");o.key=o.key==null?o.isComment?s+"comment":s+o.tag:Pr(o.key)?String(o.key).indexOf(s)===0?o.key:s+o.key:o.key;var a=(o.data||(o.data={})).transition=hu(this),l=this._vnode,c=gs(l);if(o.data.directives&&o.data.directives.some(Gg)&&(o.data.show=!0),c&&c.data&&!Kg(o,c)&&!kr(c)&&!(c.componentInstance&&c.componentInstance._vnode.isComment)){var f=c.data.transition=G({},a);if(r==="out-in")return this._leaving=!0,kt(f,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()}),jl(t,i);if(r==="in-out"){if(kr(o))return l;var u,p=function(){u()};kt(a,"afterEnter",p),kt(a,"enterCancelled",p),kt(f,"delayLeave",function(d){u=d})}}return i}}},mu=G({tag:String,moveClass:String},du);delete mu.mode;var Xg={props:mu,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var i=Vf(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],s=hu(this),a=0;a<i.length;a++){var l=i[a];l.tag&&l.key!=null&&String(l.key).indexOf("__vlist")!==0&&(o.push(l),n[l.key]=l,(l.data||(l.data={})).transition=s)}if(r){for(var c=[],f=[],a=0;a<r.length;a++){var l=r[a];l.data.transition=s,l.data.pos=l.elm.getBoundingClientRect(),n[l.key]?c.push(l):f.push(l)}this.kept=t(e,null,c),this.removed=f}return t(e,null,o)},updated:function(){var t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";!t.length||!this.hasMove(t[0].elm,e)||(t.forEach(Zg),t.forEach(Qg),t.forEach(ey),this._reflow=document.body.offsetHeight,t.forEach(function(n){if(n.data.moved){var r=n.elm,i=r.style;nn(r,e),i.transform=i.WebkitTransform=i.transitionDuration="",r.addEventListener(Mi,r._moveCb=function o(s){s&&s.target!==r||(!s||/transform$/.test(s.propertyName))&&(r.removeEventListener(Mi,o),r._moveCb=null,dt(r,e))})}}))},methods:{hasMove:function(t,e){if(!ou)return!1;if(this._hasMove)return this._hasMove;var n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach(function(i){ru(n,i)}),nu(n,e),n.style.display="none",this.$el.appendChild(n);var r=cu(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function Zg(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Qg(t){t.data.newPos=t.elm.getBoundingClientRect()}function ey(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate(".concat(r,"px,").concat(i,"px)"),o.transitionDuration="0s"}}var ty={Transition:Yg,TransitionGroup:Xg};ee.config.mustUseProp=Hm;ee.config.isReservedTag=Zf;ee.config.isReservedAttr=Bm;ee.config.getTagNamespace=Xm;ee.config.isUnknownElement=Zm;G(ee.options.directives,Ug);G(ee.options.components,ty);ee.prototype.__patch__=Ae?jg:oe;ee.prototype.$mount=function(t,e){return t=t&&Ae?Qm(t):void 0,Uh(this,t,e)};Ae&&setTimeout(function(){Le.devtools&&yi&&yi.emit("init",ee)},0);(function(t){var e="currentScript",n=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(o){var r,i=(/.*at [^\(]*\((.*):.+:.+\)$/ig.exec(o.stack)||[!1])[1];for(r in n)if(n[r].src==i||n[r].readyState=="interactive")return n[r];return null}}})})(document);function fe(t){this.content=t}fe.prototype={constructor:fe,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new fe(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new fe(n)},addToStart:function(t,e){return new fe([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new fe(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new fe(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=fe.from(t),t.size?new fe(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=fe.from(t),t.size?new fe(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=fe.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};fe.from=function(t){if(t instanceof fe)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new fe(e)};function gu(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=gu(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function yu(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,f=Math.min(s.text.length,a.text.length);for(;c<f&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=yu(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class C{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let f=a+1;l.nodesBetween(Math.max(0,e-f),Math.min(l.content.size,n-f),r,i+f)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{a.isText?(o+=a.text.slice(Math.max(e,l)-l,n-l),s=!r):a.isLeaf?(i?o+=typeof i=="function"?i(a):i:a.type.spec.leafText&&(o+=a.type.spec.leafText(a)),s=!r):!s&&a.isBlock&&(o+=r,s=!0)},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new C(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new C(r,i)}cutByIndex(e,n){return e==n?C.empty:e==0&&n==this.content.length?this:new C(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new C(i,o)}addToStart(e){return new C([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new C(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))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 n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return gu(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return yu(this,e,n,r)}findIndex(e,n=-1){if(e==0)return ni(0,e);if(e==this.size)return ni(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?ni(r+1,s):ni(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return C.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new C(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return C.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new C(n||e,r)}static from(e){if(!e)return C.empty;if(e instanceof C)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new C([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}C.empty=new C([],0);const vo={index:0,offset:0};function ni(t,e){return vo.index=t,vo.offset=e,vo}function Ti(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Ti(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ti(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let J=class ys{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ti(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ys.none;if(e instanceof ys)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};J.none=[];class Ni extends Error{}class E{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=bu(this.content,e+this.openStart,n);return r&&new E(r,this.openStart,this.openEnd)}removeBetween(e,n){return new E(vu(this.content,e+this.openStart,n+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,n){if(!n)return E.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new E(C.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new E(e,r,i)}}E.empty=new E(C.empty,0,0);function vu(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(vu(o.content,e-i-1,n-i-1)))}function bu(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=bu(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function ny(t,e,n){if(n.openStart>t.depth)throw new Ni("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Ni("Inconsistent open depths");return xu(t,e,n,0)}function xu(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=xu(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return on(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=ry(n,t);return on(o,Su(t,s,a,e,r))}else return on(o,Ai(t,e,r))}function wu(t,e){if(!e.type.compatibleContent(t.type))throw new Ni("Cannot join "+e.type.name+" onto "+t.type.name)}function vs(t,e,n){let r=t.node(n);return wu(r,e.node(n)),r}function rn(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function gr(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(rn(t.nodeAfter,r),o++));for(let a=o;a<s;a++)rn(i.child(a),r);e&&e.depth==n&&e.textOffset&&rn(e.nodeBefore,r)}function on(t,e){return t.type.checkContent(e),t.copy(e)}function Su(t,e,n,r,i){let o=t.depth>i&&vs(t,e,i+1),s=r.depth>i&&vs(n,r,i+1),a=[];return gr(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(wu(o,s),rn(on(o,Su(t,e,n,r,i+1)),a)):(o&&rn(on(o,Ai(t,e,i+1)),a),gr(e,n,i,a),s&&rn(on(s,Ai(n,r,i+1)),a)),gr(r,null,i,a),new C(a)}function Ai(t,e,n){let r=[];if(gr(null,t,n,r),t.depth>n){let i=vs(t,e,n+1);rn(on(i,Ai(t,e,n+1)),r)}return gr(e,null,n,r),new C(r)}function ry(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(C.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Er{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?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[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return J.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ii(this,e,r);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 n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new Er(n,r,o)}static resolveCached(e,n){for(let i=0;i<bo.length;i++){let o=bo[i];if(o.pos==n&&o.doc==e)return o}let r=bo[xo]=Er.resolve(e,n);return xo=(xo+1)%iy,r}}let bo=[],xo=0,iy=12;class Ii{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}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 oy=Object.create(null);let sn=class bs{constructor(e,n,r,i=J.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||C.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,n,r,i=0){this.content.nodesBetween(e,n,r,i,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,n,r,i){return this.content.textBetween(e,n,r,i)}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,n,r){return this.type==e&&Ti(this.attrs,n||e.defaultAttrs||oy)&&J.sameSet(this.marks,r||J.none)}copy(e=null){return e==this.content?this:new bs(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new bs(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return E.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s),c=i.node(s).content.cut(i.pos-a,o.pos-a);return new E(c,i.depth-s,o.depth-s)}replace(e,n,r){return ny(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Er.resolveCached(this,e)}resolveNoCache(e){return Er.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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()+")"),ku(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=C.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=J.none;for(let n=0;n<this.marks.length;n++)e=this.marks[n].addToSet(e);if(!J.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=C.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};sn.prototype.text=void 0;class Di extends sn{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ku(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Di(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Di(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function ku(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class hn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new sy(e,n);if(r.next==null)return hn.empty;let i=Cu(r);r.next&&r.err("Unexpected trailing text");let o=dy(py(i));return hy(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return C.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:f,next:u}=s.next[c];if(!(f.isText||f.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let p=o(u,a.concat(f));if(p)return p}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.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=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
6
+ `)}}hn.empty=new hn(!0);class sy{constructor(e,n){this.string=e,this.nodeTypes=n,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 Cu(t){let e=[];do e.push(ay(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function ay(t){let e=[];do e.push(ly(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function ly(t){let e=uy(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=cy(t,e);else break;return e}function Wl(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function cy(t,e){let n=Wl(t),r=n;return t.eat(",")&&(t.next!="}"?r=Wl(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function fy(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function uy(t){if(t.eat("(")){let e=Cu(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=fy(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function py(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let f=n();i(o(s.expr,l),f),l=f}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let f=n();r(l,f),i(o(s.expr,l),f),l=f}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Ou(t,e){return e-t}function Vl(t,e){let n=[];return r(e),n.sort(Ou);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&n.indexOf(l)==-1&&r(l)}}}function dy(t){let e=Object.create(null);return n(Vl(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let f=0;f<i.length;f++)i[f][0]==a&&(c=i[f][1]);Vl(t,l).forEach(f=>{c||i.push([a,c=[]]),c.indexOf(f)==-1&&c.push(f)})})});let o=e[r.join(",")]=new hn(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(Ou);o.next.push({type:i[s][0],next:e[a.join(",")]||n(a)})}return o}}function hy(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Mu(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Eu(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Tu(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new my(t[n]);return e}let Ul=class Nu{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Tu(r.attrs),this.defaultAttrs=Mu(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==hn.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:Eu(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new sn(this,this.computeAttrs(e),C.from(n),J.setFrom(r))}createChecked(e=null,n,r){return n=C.from(n),this.checkContent(n),new sn(this,this.computeAttrs(e),n,J.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=C.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(C.empty,!0);return o?new sn(this,e,n.append(o),J.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:J.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Nu(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class my{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Ji{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Tu(i.attrs),this.excluded=null;let o=Mu(this.attrs);this.instance=o?new J(this,o):null}create(e=null){return!e&&this.instance?this.instance:new J(this,Eu(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new Ji(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}excludes(e){return this.excluded.indexOf(e)>-1}}class gy{constructor(e){this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=fe.from(e.nodes),n.marks=fe.from(e.marks||{}),this.nodes=Ul.compile(this.spec.nodes,this),this.marks=Ji.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;o.contentMatch=r[s]||(r[s]=hn.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=a=="_"?null:a?ql(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:ql(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Ul){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Di(r,r.defaultAttrs,e,J.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return sn.fromJSON(this,e)}markFromJSON(e){return J.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function ql(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class Bn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new Jl(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Jl(this,n,!0);return r.addAll(e,n.from,n.to),E.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(by(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Gl(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Gl(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Bn(e,Bn.schemaRules(e)))}}const Au={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},yy={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Iu={ol:!0,ul:!0},_i=1,Pi=2,yr=4;function Kl(t,e,n){return e!=null?(e?_i:0)|(e==="full"?Pi:0):t&&t.whitespace=="pre"?_i|Pi:n&~yr}class ri{constructor(e,n,r,i,o,s,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=J.none,this.stashMarks=[],this.match=s||(a&yr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(C.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&_i)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=C.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(C.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):wy(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Au.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Jl{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,s=Kl(null,n.preserveWhitespace,0)|(r?yr:0);i?o=new ri(i.type,i.attrs,J.none,J.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new ri(null,null,J.none,J.none,!0,null,s):o=new ri(e.schema.topNodeType,null,J.none,J.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(e.nodeType==3)this.addTextNode(e);else if(e.nodeType==1){let n=e.getAttribute("style");if(!n)this.addElement(e);else{let r=this.readStyles(xy(n));if(!r)return;let[i,o]=r,s=this.top;for(let a=0;a<o.length;a++)this.removePendingMark(o[a],s);for(let a=0;a<i.length;a++)this.addPendingMark(i[a]);this.addElement(e);for(let a=0;a<i.length;a++)this.removePendingMark(i[a],s);for(let a=0;a<o.length;a++)this.addPendingMark(o[a])}}}addTextNode(e){let n=e.nodeValue,r=this.top;if(r.options&Pi||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&_i)r.options&Pi?n=n.replace(/\r\n?/g,`
7
+ `):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(e)}else this.findInside(e)}addElement(e,n){let r=e.nodeName.toLowerCase(),i;Iu.hasOwnProperty(r)&&this.parser.normalizeLists&&vy(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,n));if(o?o.ignore:yy.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let s,a=this.top,l=this.needsBlock;if(Au.hasOwnProperty(r))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}this.addAll(e),s&&this.sync(a),this.needsBlock=l}else this.addElementByRule(e,o,o.consuming===!1?i:void 0)}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
8
+ `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=J.none,r=J.none;for(let i=0;i<e.length;i+=2)for(let o=void 0;;){let s=this.parser.matchStyle(e[i],e[i+1],this,o);if(!s)break;if(s.ignore)return null;if(s.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(a=>{s.clearMark(a)&&(r=a.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)o=s;else break}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;i<n.length;i++)this.enterInner(n[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(e)){this.closeExtra();let n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));let r=n.activeMarks;for(let i=0;i<e.marks.length;i++)(!n.type||n.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}enter(e,n,r){let i=this.findPlace(e.create(n));return i&&this.enterInner(e,n,!0,r),i}enterInner(e,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let s=Kl(e,i,o.options);o.options&yr&&o.content.length==0&&(s|=yr),this.nodes.push(new ri(e,n,o.activeMarks,o.pendingMarks,r,null,s)),this.open++}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let f=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!f||f.name!=c&&f.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=Sy(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}}function vy(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Iu.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function by(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function xy(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function Gl(t){let e={};for(let n in t)e[n]=t[n];return e}function wy(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:f}=a.edge(l);if(c==e||o.indexOf(f)<0&&s(f))return!0}};if(s(i.contentMatch))return!0}}function Sy(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}class rt{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=wo(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],f=this.serializeMark(c,s.isInline,n);f&&(o.push([c,i]),i.appendChild(f.dom),i=f.contentDOM||f.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=rt.renderSpec(wo(n),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&rt.renderSpec(wo(r),i(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,a=r?e.createElementNS(r,i):e.createElement(i),l=n[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let f in l)if(l[f]!=null){let u=f.indexOf(" ");u>0?a.setAttributeNS(f.slice(0,u),f.slice(u+1),l[f]):a.setAttribute(f,l[f])}}for(let f=c;f<n.length;f++){let u=n[f];if(u===0){if(f<n.length-1||f>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:p,contentDOM:d}=rt.renderSpec(e,u,r);if(a.appendChild(p),d){if(s)throw new RangeError("Multiple content holes");s=d}}}return{dom:a,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new rt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Yl(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Yl(e.marks)}}function Yl(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function wo(t){return t.document||window.document}const Du=65535,_u=Math.pow(2,16);function ky(t,e){return t+e*_u}function Xl(t){return t&Du}function Cy(t){return(t-(t&Du))/_u}const Pu=1,Ru=2,di=4,Lu=8;class xs{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Lu)>0}get deletedBefore(){return(this.delInfo&(Pu|di))>0}get deletedAfter(){return(this.delInfo&(Ru|di))>0}get deletedAcross(){return(this.delInfo&di)>0}}class _e{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&_e.empty)return _e.empty}recover(e){let n=0,r=Xl(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Cy(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+o],f=this.ranges[a+s],u=l+c;if(e<=u){let p=c?e==l?-1:e==u?1:n:n,d=l+i+(p<0?0:f);if(r)return d;let h=e==(n<0?l:u)?null:ky(a/3,e-l),m=e==l?Ru:e==u?Pu:di;return(n<0?e!=l:e!=u)&&(m|=Lu),new xs(d,m,h)}i+=f-c}return r?e+i:new xs(e+i,0,null)}touches(e,n){let r=0,i=Xl(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+o],f=l+c;if(e<=f&&a==i*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),c=this.ranges[i+n],f=this.ranges[i+r];e(a,a+c,l,l+f),o+=f-c}}invert(){return new _e(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?_e.empty:new _e(e<0?[0,-e,0]:[0,0,e])}}_e.empty=new _e([]);class Rn{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new Rn(this.maps,this.mirror,e,n)}copy(){return new Rn(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Rn;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this.maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new xs(e,i,null)}}const So=Object.create(null);class Ce{getMap(){return _e.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=So[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in So)throw new RangeError("Duplicate use of step JSON ID "+e);return So[e]=n,n.prototype.jsonID=e,n}}class ie{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new ie(e,null)}static fail(e){return new ie(null,e)}static fromReplace(e,n,r,i){try{return ie.ok(e.replace(n,r,i))}catch(o){if(o instanceof Ni)return ie.fail(o.message);throw o}}}function ha(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(ha(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return C.fromArray(r)}class Ot extends Ce{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new E(ha(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return ie.fromReplace(e,this.from,this.to,o)}invert(){return new it(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ot(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ot&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ot(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ot(n.from,n.to,e.markFromJSON(n.mark))}}Ce.jsonID("addMark",Ot);class it extends Ce{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new E(ha(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return ie.fromReplace(e,this.from,this.to,r)}invert(){return new Ot(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new it(n.pos,r.pos,this.mark)}merge(e){return e instanceof it&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new it(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new it(n.from,n.to,e.markFromJSON(n.mark))}}Ce.jsonID("removeMark",it);class Mt extends Ce{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ie.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ie.fromReplace(e,this.pos,this.pos+1,new E(C.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Mt(this.pos,n.marks[i]);return new Mt(this.pos,this.mark)}}return new zn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Mt(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Mt(n.pos,e.markFromJSON(n.mark))}}Ce.jsonID("addNodeMark",Mt);class zn extends Ce{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ie.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return ie.fromReplace(e,this.pos,this.pos+1,new E(C.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Mt(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new zn(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new zn(n.pos,e.markFromJSON(n.mark))}}Ce.jsonID("removeNodeMark",zn);class de extends Ce{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&ws(e,this.from,this.to)?ie.fail("Structure replace would overwrite content"):ie.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new _e([this.from,this.to-this.from,this.slice.size])}invert(e){return new de(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new de(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof de)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?E.empty:new E(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new de(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?E.empty:new E(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new de(e.from,this.to,n,this.structure)}else return null}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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new de(n.from,n.to,E.fromJSON(e,n.slice),!!n.structure)}}Ce.jsonID("replace",de);class se extends Ce{constructor(e,n,r,i,o,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(ws(e,this.from,this.gapFrom)||ws(e,this.gapTo,this.to)))return ie.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return ie.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?ie.fromReplace(e,this.from,this.to,r):ie.fail("Content does not fit in gap")}getMap(){return new _e([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new se(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new se(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new se(n.from,n.to,n.gapFrom,n.gapTo,E.fromJSON(e,n.slice),n.insert,!!n.structure)}}Ce.jsonID("replaceAround",se);function ws(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function Oy(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,c,f)=>{if(!l.isInline)return;let u=l.marks;if(!r.isInSet(u)&&f.type.allowsMarkType(r.type)){let p=Math.max(c,e),d=Math.min(c+l.nodeSize,n),h=r.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(h)||(s&&s.to==p&&s.mark.eq(u[m])?s.to=d:i.push(s=new it(p,d,u[m])));a&&a.to==p?a.to=d:o.push(a=new Ot(p,d,r))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function My(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof Ji){let c=s.marks,f;for(;f=r.isInSet(c);)(l||(l=[])).push(f),c=f.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let f=0;f<l.length;f++){let u=l[f],p;for(let d=0;d<i.length;d++){let h=i[d];h.step==o-1&&u.eq(i[d].style)&&(p=h)}p?(p.to=c,p.step=o):i.push({style:u,from:Math.max(a,e),to:c,step:o})}}}),i.forEach(s=>t.step(new it(s.from,s.to,s.style)))}function Ey(t,e,n,r=n.contentMatch){let i=t.doc.nodeAt(e),o=[],s=e+1;for(let a=0;a<i.childCount;a++){let l=i.child(a),c=s+l.nodeSize,f=r.matchType(l.type);if(!f)o.push(new de(s,c,E.empty));else{r=f;for(let u=0;u<l.marks.length;u++)n.allowsMarkType(l.marks[u].type)||t.step(new it(s,c,l.marks[u]))}s=c}if(!r.validEnd){let a=r.fillBefore(C.empty,!0);t.replace(s,s,new E(a,0,0))}for(let a=o.length-1;a>=0;a--)t.step(o[a])}function Ty(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Zn(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!Ty(i,o,s))break}return null}function Ny(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),l=s,c=a,f=C.empty,u=0;for(let h=o,m=!1;h>n;h--)m||r.index(h)>0?(m=!0,f=C.from(r.node(h).copy(f)),u++):l--;let p=C.empty,d=0;for(let h=o,m=!1;h>n;h--)m||i.after(h+1)<i.end(h)?(m=!0,p=C.from(i.node(h).copy(p)),d++):c++;t.step(new se(l,c,s,a,new E(f.append(p),u,d),f.size-u,!0))}function ma(t,e,n=null,r=t){let i=Ay(t,e),o=i&&Iy(r,e);return o?i.map(Zl).concat({type:e,attrs:n}).concat(o.map(Zl)):null}function Zl(t){return{type:t,attrs:null}}function Ay(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function Iy(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function Dy(t,e,n){let r=C.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=C.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new se(i,o,i,o,new E(r,0,0),n.length,!0))}function _y(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&Py(t.doc,t.mapping.slice(o).map(a),r)){t.clearIncompatible(t.mapping.slice(o).map(a,1),r);let l=t.mapping.slice(o),c=l.map(a,1),f=l.map(a+s.nodeSize,1);return t.step(new se(c,f,c+1,f-1,new E(C.from(r.create(i,null,s.marks)),0,0),1,!0)),!1}})}function Py(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Ry(t,e,n,r,i){let o=t.doc.nodeAt(e);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 t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new se(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new E(C.from(s),0,0),1,!0))}function Ln(t,e,n=1,r){let i=t.resolve(e),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 c=i.depth-1,f=n-2;c>o;c--,f--){let u=i.node(c),p=i.index(c);if(u.type.spec.isolating)return!1;let d=u.content.cutByIndex(p,u.childCount),h=r&&r[f+1];h&&(d=d.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[f]||u;if(!u.canReplace(p+1,u.childCount)||!m.type.validContent(d))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 Ly(t,e,n=1,r){let i=t.doc.resolve(e),o=C.empty,s=C.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=C.from(i.node(a).copy(o));let f=r&&r[c];s=C.from(f?f.type.create(f.attrs,s):i.node(a).copy(s))}t.step(new de(e,e,new E(o.append(s),n,n),!0))}function jt(t,e){let n=t.resolve(e),r=n.index();return $u(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function $u(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Fu(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&$u(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function $y(t,e,n){let r=new de(e-n,e+n,E.empty,!0);t.step(r)}function Fy(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function By(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),f=!1;if(o==1)f=c.canReplace(l,l,i);else{let u=c.contentMatchAt(l).findWrapping(i.firstChild.type);f=u&&c.canReplaceWith(l,l,u[0])}if(f)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function ga(t,e,n=e,r=E.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Bu(i,o,r)?new de(e,n,r):new zy(i,o,r).fit()}function Bu(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class zy{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=C.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=C.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new E(o,s,a);return e>-1?new se(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new de(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=ko(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],f,u=null;if(n==1&&(s?c.matchType(s.type)||(u=c.fillBefore(C.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:u};if(n==2&&s&&(f=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:f};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ko(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new E(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ko(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new E(ur(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new E(ur(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m<o.length;m++)this.openFrontierNode(o[m]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,c=0,f=[],{match:u,type:p}=this.frontier[n];if(i){for(let m=0;m<i.childCount;m++)f.push(i.child(m));u=u.matchFragment(i)}let d=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let m=a.child(c),x=u.matchType(m.type);if(!x)break;c++,(c>1||l==0||m.content.size)&&(u=x,f.push(zu(m.mark(p.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?d:-1)))}let h=c==a.childCount;h||(d=-1),this.placed=pr(this.placed,n,C.from(f)),this.frontier[n].match=u,h&&d<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,x=a;m<d;m++){let w=x.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),x=w.content}this.unplaced=h?e==0?E.empty:new E(ur(s.content,e-1,1),e-1,d<0?s.openEnd:e-1):new E(ur(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Co(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Co(e,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],f=Co(e,a,c,l,!0);if(!f||f.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=pr(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=pr(this.placed,this.depth,C.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(C.empty,!0);n.childCount&&(this.placed=pr(this.placed,this.frontier.length,n))}}function ur(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ur(t.firstChild.content,e-1,n)))}function pr(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(pr(t.lastChild.content,e-1,n)))}function ko(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function zu(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,zu(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(C.empty,!0)))),t.copy(r)}function Co(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!Hy(n,o.content,s)?a:null}function Hy(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function jy(t){return t.spec.defining||t.spec.definingForContent}function Wy(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Bu(i,o,r))return t.step(new de(e,n,r));let s=ju(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let p=i.depth,d=i.pos-1;p>0;p--,d--){let h=i.node(p).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(p)>-1?a=p:i.before(p)==d&&s.splice(1,0,-p)}let l=s.indexOf(a),c=[],f=r.openStart;for(let p=r.content,d=0;;d++){let h=p.firstChild;if(c.push(h),d==r.openStart)break;p=h.content}for(let p=f-1;p>=0;p--){let d=c[p].type,h=jy(d);if(h&&i.node(l).type!=d)f=p;else if(h||!d.isTextblock)break}for(let p=r.openStart;p>=0;p--){let d=(p+f+1)%(r.openStart+1),h=c[d];if(h)for(let m=0;m<s.length;m++){let x=s[(m+l)%s.length],w=!0;x<0&&(w=!1,x=-x);let M=i.node(x-1),O=i.index(x-1);if(M.canReplaceWith(O,O,h.type,h.marks))return t.replace(i.before(x),w?o.after(x):n,new E(Hu(r.content,0,r.openStart,d),d,r.openEnd))}}let u=t.steps.length;for(let p=s.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>u));p--){let d=s[p];d<0||(e=i.before(d),n=o.after(d))}}function Hu(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Hu(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(C.empty,!0))}return t}function Vy(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=Fy(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new E(C.from(r),0,0))}function Uy(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=ju(r,i);for(let s=0;s<o.length;s++){let a=o[s],l=s==o.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function ju(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class $n extends Ce{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return ie.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return ie.fromReplace(e,this.pos,this.pos+1,new E(C.from(i),0,n.isLeaf?0:1))}getMap(){return _e.empty}invert(e){return new $n(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new $n(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new $n(n.pos,n.attr,n.value)}}Ce.jsonID("attr",$n);let Hn=class extends Error{};Hn=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Hn.prototype=Object.create(Error.prototype);Hn.prototype.constructor=Hn;Hn.prototype.name="TransformError";class qy{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Rn}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Hn(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=E.empty){let i=ga(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new E(C.from(r),0,0))}delete(e,n){return this.replace(e,n,E.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Wy(this,e,n,r),this}replaceRangeWith(e,n,r){return Vy(this,e,n,r),this}deleteRange(e,n){return Uy(this,e,n),this}lift(e,n){return Ny(this,e,n),this}join(e,n=1){return $y(this,e,n),this}wrap(e,n){return Dy(this,e,n),this}setBlockType(e,n=e,r,i=null){return _y(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return Ry(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new $n(e,n,r)),this}addNodeMark(e,n){return this.step(new Mt(e,n)),this}removeNodeMark(e,n){if(!(n instanceof J)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new zn(e,n)),this}split(e,n=1,r){return Ly(this,e,n,r),this}addMark(e,n,r){return Oy(this,e,n,r),this}removeMark(e,n,r){return My(this,e,n,r),this}clearIncompatible(e,n,r){return Ey(this,e,n,r),this}}const Oo=Object.create(null);class W{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Ky(e.min(n),e.max(n))]}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 n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=E.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],f=e.mapping.slice(o);e.replaceRange(f.map(l.pos),f.map(c.pos),a?E.empty:n),a==0&&tc(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=e.mapping.slice(r),c=l.map(s.pos),f=l.map(a.pos);o?e.deleteRange(c,f):(e.replaceRangeWith(c,f,n),tc(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new U(e):En(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?En(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):En(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Je(e.node(0))}static atStart(e){return En(e,e,0,0,1)||new Je(e)}static atEnd(e){return En(e,e,e.content.size,e.childCount,-1)||new Je(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Oo[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Oo)throw new RangeError("Duplicate use of selection JSON ID "+e);return Oo[e]=n,n.prototype.jsonID=e,n}getBookmark(){return U.between(this.$anchor,this.$head).getBookmark()}}W.prototype.visible=!0;class Ky{constructor(e,n){this.$from=e,this.$to=n}}let Ql=!1;function ec(t){!Ql&&!t.parent.inlineContent&&(Ql=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class U extends W{constructor(e,n=e){ec(e),ec(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return W.near(r);let i=e.resolve(n.map(this.anchor));return new U(i.parent.inlineContent?i:r,r)}replace(e,n=E.empty){if(super.replace(e,n),n==E.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof U&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Gi(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new U(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=W.findFrom(n,r,!0)||W.findFrom(n,-r,!0);if(o)n=o.$head;else return W.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(W.findFrom(e,-r,!0)||W.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new U(e,n)}}W.jsonID("text",U);class Gi{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Gi(e.map(this.anchor),e.map(this.head))}resolve(e){return U.between(e.resolve(this.anchor),e.resolve(this.head))}}class R extends W{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?W.near(o):new R(o)}content(){return new E(C.from(this.node),0,0)}eq(e){return e instanceof R&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ya(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new R(e.resolve(n.anchor))}static create(e,n){return new R(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}R.prototype.visible=!1;W.jsonID("node",R);class ya{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Gi(r,r):new ya(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&R.isSelectable(r)?new R(n):W.near(n)}}class Je extends W{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=E.empty){if(n==E.empty){e.delete(0,e.doc.content.size);let r=W.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Je(e)}map(e){return new Je(e)}eq(e){return e instanceof Je}getBookmark(){return Jy}}W.jsonID("all",Je);const Jy={map(){return this},resolve(t){return new Je(t)}};function En(t,e,n,r,i,o=!1){if(e.inlineContent)return U.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&R.isSelectable(a))return R.create(t,n-(i<0?a.nodeSize:0))}else{let l=En(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function tc(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof de||i instanceof se))return;let o=t.mapping.maps[r],s;o.forEach((a,l,c,f)=>{s==null&&(s=f)}),t.setSelection(W.near(t.doc.resolve(s),n))}const nc=1,ii=2,rc=4;class Gy extends qy{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|nc)&~ii,this.storedMarks=null,this}get selectionSet(){return(this.updated&nc)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ii,this}ensureMarks(e){return J.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&ii)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~ii,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||J.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(W.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=rc,this}get scrolledIntoView(){return(this.updated&rc)>0}}function ic(t,e){return!e||!t?t:t.bind(e)}class dr{constructor(e,n,r){this.name=e,this.init=ic(n.init,r),this.apply=ic(n.apply,r)}}const Yy=[new dr("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new dr("selection",{init(t,e){return t.selection||W.atStart(e.doc)},apply(t){return t.selection}}),new dr("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new dr("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Mo{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Yy.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new dr(r.key,r.spec.state,r))})}}class Dn{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,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,c=i?i[s].state:this,f=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(f&&r.filterTransaction(f,s)){if(f.setMeta("appendedTransaction",e),!i){i=[];for(let u=0;u<this.config.plugins.length;u++)i.push(u<s?{state:r,n:n.length}:{state:this,n:0})}n.push(f),r=r.applyInner(f),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Dn(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new Gy(this)}static create(e){let n=new Mo(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Dn(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Mo(this.schema,e.plugins),r=n.fields,i=new Dn(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Mo(e.schema,e.plugins),o=new Dn(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=sn.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=W.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=c.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function Wu(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Wu(i,e,{})),n[r]=i}return n}class ze{constructor(e){this.spec=e,this.props={},e.props&&Wu(e.props,this,this.props),this.key=e.key?e.key.key:Vu("plugin")}getState(e){return e[this.key]}}const Eo=Object.create(null);function Vu(t){return t in Eo?t+"$"+ ++Eo[t]:(Eo[t]=0,t+"$")}class lt{constructor(e="key"){this.key=Vu(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Pe=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Tr=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let oc=null;const ut=function(t,e,n){let r=oc||(oc=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},mn=function(t,e,n,r){return n&&(sc(t,e,n,r,-1)||sc(t,e,n,r,1))},Xy=/^(img|br|input|textarea|hr)$/i;function sc(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:et(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Qy(t)||Xy.test(t.nodeName)||t.contentEditable=="false")return!1;e=Pe(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?et(t):0}else return!1}}function et(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Zy(t,e,n){for(let r=e==0,i=e==et(t);r||i;){if(t==n)return!0;let o=Pe(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==et(t)}}function Qy(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Yi=function(t){return t.focusNode&&mn(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Gt(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function ev(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function tv(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const st=typeof navigator<"u"?navigator:null,ac=typeof document<"u"?document:null,Wt=st&&st.userAgent||"",Ss=/Edge\/(\d+)/.exec(Wt),Uu=/MSIE \d/.exec(Wt),ks=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Wt),ke=!!(Uu||ks||Ss),At=Uu?document.documentMode:ks?+ks[1]:Ss?+Ss[1]:0,Ge=!ke&&/gecko\/(\d+)/i.test(Wt);Ge&&+(/Firefox\/(\d+)/.exec(Wt)||[0,0])[1];const Cs=!ke&&/Chrome\/(\d+)/.exec(Wt),he=!!Cs,nv=Cs?+Cs[1]:0,xe=!ke&&!!st&&/Apple Computer/.test(st.vendor),jn=xe&&(/Mobile\/\w+/.test(Wt)||!!st&&st.maxTouchPoints>2),De=jn||(st?/Mac/.test(st.platform):!1),rv=st?/Win/.test(st.platform):!1,Ue=/Android \d/.test(Wt),Xi=!!ac&&"webkitFontSmoothing"in ac.documentElement.style,iv=Xi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function ov(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function yt(t,e){return typeof t=="number"?t:t[e]}function sv(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function lc(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Tr(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,c=l?ov(o):sv(a),f=0,u=0;if(e.top<c.top+yt(r,"top")?u=-(c.top-e.top+yt(i,"top")):e.bottom>c.bottom-yt(r,"bottom")&&(u=e.bottom-c.bottom+yt(i,"bottom")),e.left<c.left+yt(r,"left")?f=-(c.left-e.left+yt(i,"left")):e.right>c.right-yt(r,"right")&&(f=e.right-c.right+yt(i,"right")),f||u)if(l)o.defaultView.scrollBy(f,u);else{let p=a.scrollLeft,d=a.scrollTop;u&&(a.scrollTop+=u),f&&(a.scrollLeft+=f);let h=a.scrollLeft-p,m=a.scrollTop-d;e={left:e.left-h,top:e.top-m,right:e.right-h,bottom:e.bottom-m}}if(l)break}}function av(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:qu(t.dom)}}function qu(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Tr(r));return e}function lv({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Ku(n,r==0?0:r-e)}function Ku(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let On=null;function cv(t){if(t.setActive)return t.setActive();if(On)return t.focus(On);let e=qu(t);t.focus(On==null?{get preventScroll(){return On={preventScroll:!0},!0}}:void 0),On||(On=!1,Ku(e,0))}function Ju(t,e){let n,r=2e8,i,o=0,s=e.top,a=e.top,l,c;for(let f=t.firstChild,u=0;f;f=f.nextSibling,u++){let p;if(f.nodeType==1)p=f.getClientRects();else if(f.nodeType==3)p=ut(f).getClientRects();else continue;for(let d=0;d<p.length;d++){let h=p[d];if(h.top<=s&&h.bottom>=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(m<r){n=f,r=m,i=m&&n.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,f.nodeType==1&&m&&(o=u+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!l&&h.left<=e.left&&h.right>=e.left&&(l=f,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(o=u+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?fv(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:Ju(n,i)}function fv(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=vt(r,1);if(o.top!=o.bottom&&va(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function va(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function uv(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function pv(t,e,n){let{node:r,offset:i}=Ju(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function dv(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,l.left>r.left||l.top>r.top?i=a.posBefore:(l.right<r.left||l.bottom<r.top)&&(i=a.posAfter)),!a.contentDOM&&i<0)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function Gu(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(va(e,c))return Gu(s,e,c)}}if((o=(o+1)%r)==i)break}return t}function hv(t,e){let n=t.dom.ownerDocument,r,i=0,o=tv(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!va(e,c)||(s=Gu(t.dom,e,c),!s))return null}if(xe)for(let c=s;r&&c;c=Tr(c))c.draggable&&(r=void 0);if(s=uv(s,e),r){if(Ge&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let c=r.childNodes[i],f;c.nodeName=="IMG"&&(f=c.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=dv(t,r,i,e))}a==null&&(a=pv(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function cc(t){return t.top<t.bottom||t.left<t.right}function vt(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(cc(r))return r}return Array.prototype.find.call(n,cc)||t.getBoundingClientRect()}const mv=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Yu(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=Xi||Ge;if(r.nodeType==3)if(s&&(mv.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=vt(ut(r,i,i),n);if(Ge&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=vt(ut(r,i-1,i-1),-1);if(c.top==l.top){let f=vt(ut(r,i,i+1),-1);if(f.top!=l.top)return sr(f,f.left<c.left)}}return l}else{let l=i,c=i,f=n<0?1:-1;return n<0&&!i?(c++,f=-1):n>=0&&i==r.nodeValue.length?(l--,f=1):n<0?l--:c++,sr(vt(ut(r,l,c),f),f<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==et(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return To(l.getBoundingClientRect(),!1)}if(o==null&&i<et(r)){let l=r.childNodes[i];if(l.nodeType==1)return To(l.getBoundingClientRect(),!0)}return To(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==et(r))){let l=r.childNodes[i-1],c=l.nodeType==3?ut(l,et(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return sr(vt(c,1),!1)}if(o==null&&i<et(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?ut(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return sr(vt(c,-1),!0)}return sr(vt(r.nodeType==3?ut(r):r,-n),n>=0)}function sr(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function To(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Xu(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function gv(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return Xu(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=Yu(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=ut(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let f=l[c];if(f.bottom>f.top+1&&(n=="up"?s.top-f.top>(f.bottom-s.top)*2:f.bottom-s.bottom>(s.bottom-f.top)*2))return!1}}return!0})}const yv=/[\u0590-\u08ac]/;function vv(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return!yv.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:Xu(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:f,anchorOffset:u}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",n,"character");let d=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:m}=t.domSelectionRange(),x=h&&!d.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(f,u),l&&(l!=f||c!=u)&&a.extend&&a.extend(l,c)}catch{}return p!=null&&(a.caretBidiLevel=p),x})}let fc=null,uc=null,pc=!1;function bv(t,e,n){return fc==e&&uc==n?pc:(fc=e,uc=n,pc=n=="up"||n=="down"?gv(t,e,n):vv(t,e,n))}const $e=0,dc=1,Xt=2,at=3;class Fr{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=$e,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].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 n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.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,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>Pe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>e||s instanceof Qu){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Zu&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Pe(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?Pe(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(i==-1&&e<=c){let f=s+l.border;if(e>=f&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,f);e=s;for(let u=a;u>0;u--){let p=this.children[u-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){i=Pe(p.dom)+1;break}e-=p.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let f=a+1;f<this.children.length;f++){let u=this.children[f];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(-1)){o=Pe(u.dom);break}n+=u.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let p=0,d=0;p<this.children.length;p++){let h=this.children[p],m=d+h.size;if(o>d&&s<m)return h.setSelection(e-d-h.border,n-d-h.border,r,i);d=m}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.getSelection(),f=!1;if((Ge||xe)&&e==n){let{node:p,offset:d}=a;if(p.nodeType==3)f=!!(d&&p.nodeValue[d-1]==`
9
+ `);else{let h=p.childNodes[d-1];f=h&&(h.nodeName=="BR"||h.contentEditable=="false")}}if(Ge&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let p=c.focusNode.childNodes[c.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||f&&xe)&&mn(a.node,a.offset,c.anchorNode,c.anchorOffset)&&mn(l.node,l.offset,c.focusNode,c.focusOffset))return;let u=!1;if((c.extend||e==n)&&!f){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),u=!0}catch{}}if(!u){if(e>n){let d=a;a=l,l=d}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?Xt:dc,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=at:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Xt:at}r=s}this.dirty=Xt}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Xt:dc;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Zu extends Fr{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==$e&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class xv extends Fr{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class gn extends Fr{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=rt.renderSpec(document,n.type.spec.toDOM(n,r))),new gn(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&at||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!=at&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=$e){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=$e}}slice(e,n,r){let i=gn.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Es(o,n,s,r)),e>0&&(o=Es(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}}class It extends Fr{constructor(e,n,r,i,o,s,a,l,c){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,o,s){let a=o.nodeViews[n.type.name],l,c=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),f=c&&c.dom,u=c&&c.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:u}=rt.renderSpec(document,n.type.spec.toDOM(n)));!u&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let p=f;return f=np(f,r,n),c?l=new wv(e,n,r,i,f,u||null,p,c,o,s+1):n.isText?new Zi(e,n,r,i,f,p,o):new It(e,n,r,i,f,u||null,p,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>C.empty)}return e}matchesNode(e,n,r){return this.dirty==$e&&e.eq(this.node)&&Ms(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new kv(this,s&&s.node,e);Mv(this.node,this.innerDeco,(c,f,u)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!u&&l.syncToMarks(f==this.node.childCount?J.none:this.node.child(f).marks,r,e),l.placeWidget(c,e,i)},(c,f,u,p)=>{l.syncToMarks(c.marks,r,e);let d;l.findNodeMatch(c,f,u,p)||a&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(d=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(c,f,u,d,e)||l.updateNextNode(c,f,u,e,p,i)||l.addNode(c,f,u,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Xt)&&(s&&this.protectLocalComposition(e,s),ep(this.contentDOM,this.children,e),jn&&Ev(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof U)||r<n||i>n+this.node.content.size)return null;let o=e.domSelectionRange(),s=Tv(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=Nv(this.node.content,a,r-n,i-n);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new xv(this,o,n,i);e.input.compositionNodes.push(s),this.children=Es(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==at||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=$e}updateOuterDeco(e){if(Ms(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=tp(this.dom,this.nodeDOM,Os(this.outerDeco,this.node,n),Os(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function hc(t,e,n,r,i){np(r,e,t);let o=new It(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Zi extends It{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==at||this.dirty!=$e&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=$e||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=$e,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new Zi(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=at)}get domAtom(){return!1}}class Qu extends Fr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==$e&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class wv extends It{constructor(e,n,r,i,o,s,a,l,c,f){super(e,n,r,i,o,s,a,c,f),this.spec=l}update(e,n,r,i){if(this.dirty==at)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function ep(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=mc(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(s instanceof gn){let l=r?r.previousSibling:t.lastChild;ep(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=mc(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const vr=function(t){t&&(this.nodeName=t)};vr.prototype=Object.create(null);const Zt=[new vr];function Os(t,e,n){if(t.length==0)return Zt;let r=n?Zt[0]:new vr,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new vr(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&i.length==1&&i.push(r=new vr(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function tp(t,e,n,r){if(n==Zt&&r==Zt)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Zt[0]),i=l}Sv(i,a||Zt[0],s)}return i}function Sv(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function np(t,e,n){return tp(t,t,Zt,Os(e,n,t.nodeType!=1))}function Ms(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function mc(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class kv{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Cv(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=$e,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[o])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=gn.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==at&&s.dom==s.contentDOM&&(s.dirty=Xt),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof It){let c=this.preMatch.matched.get(l);if(c!=null&&c!=o)return!1;let f=l.dom,u,p=this.isLocked(f)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=at&&Ms(n,l.outerDeco));if(!p&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=f&&(this.changed=!0),this.index++,!0;if(!p&&(u=this.recreateWrapper(l,e,n,r,i,s)))return this.top.children[this.index]=u,u.dirty=Xt,u.updateChildren(i,s+1),u.dirty=$e,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let a=It.create(this.top,n,r,i,o,s);if(!a.contentDOM)return null;a.children=e.children,e.children=[],e.destroy();for(let l of a.children)l.parent=a;return a}addNode(e,n,r,i,o){let s=It.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new Zu(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof gn;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Zi)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((xe||he)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new Qu(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Cv(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof gn)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function Ov(t,e){return t.type.side-e.type.side}function Mv(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let f=t.child(c);r(f,i,e.forChild(o,f),c),o+=f.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){if(s<i.length&&i[s].to==o){let h=i[s++],m;for(;s<i.length&&i[s].to==o;)(m||(m=[h])).push(i[s++]);if(m){m.sort(Ov);for(let x=0;x<m.length;x++)n(m[x],c,!!l)}else n(h,c,!!l)}let f,u;if(l)u=-1,f=l,l=null;else if(c<t.childCount)u=c,f=t.child(c++);else break;for(let h=0;h<a.length;h++)a[h].to<=o&&a.splice(h--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let p=o+f.nodeSize;if(f.isText){let h=p;s<i.length&&i[s].from<h&&(h=i[s].from);for(let m=0;m<a.length;m++)a[m].to<h&&(h=a[m].to);h<p&&(l=f.cut(h-o),f=f.cut(0,h-o),p=h,u=-1)}let d=f.isInline&&!f.isLeaf?a.filter(h=>!h.inline):a.slice();r(f,d,e.forChild(o,f),u),o=p}}function Ev(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function Tv(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=et(t)}else if(t.nodeType==1&&e<t.childNodes.length)t=t.childNodes[e],e=0;else return null}}function Nv(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<t.childCount;){let c=t.child(i++);if(o+=c.nodeSize,!c.isText)break;l+=c.text}if(o>=n){let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Es(t,e,n,r,i){let o=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,f=a+=l.size;c>=n||f<=e?o.push(l):(c<e&&o.push(l.slice(0,e-c,r)),i&&(o.push(i),i=void 0),f>n&&o.push(l.slice(n-c,l.size,r)))}return o}function ba(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Yi(n)){for(l=a;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&R.isSelectable(f)&&i.parent&&!(f.isInline&&Zy(n.focusNode,n.focusOffset,i.dom))){let u=i.posBefore;c=new R(s==u?a:r.resolve(u))}}else{let f=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(f<0)return null;l=r.resolve(f)}if(!c){let f=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;c=xa(t,l,a,f)}return c}function rp(t){return t.editable?t.hasFocus():op(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function ht(t,e=!1){let n=t.state.selection;if(ip(t,n),!!rp(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&he){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&mn(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)Iv(t);else{let{anchor:r,head:i}=n,o,s;gc&&!(n instanceof U)&&(n.$from.parent.inlineContent||(o=yc(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=yc(t,n.to))),t.docView.setSelection(r,i,t.root,e),gc&&(o&&vc(o),s&&vc(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Av(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const gc=xe||he&&nv<63;function yc(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(xe&&i&&i.contentEditable=="false")return No(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return No(i);if(o)return No(o)}}function No(t){return t.contentEditable="true",xe&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function vc(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Av(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!rp(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Iv(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,Pe(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&ke&&At<=11&&(r.disabled=!0,r.disabled=!1)}function ip(t,e){if(e instanceof R){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(bc(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else bc(t)}function bc(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function xa(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||U.between(e,n,r)}function xc(t){return t.editable&&!t.hasFocus()?!1:op(t)}function op(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Dv(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return mn(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Ts(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&W.findFrom(o,e)}function Yt(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function wc(t,e,n){let r=t.state.selection;if(r instanceof U){if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let i=Ts(t.state,e);return i&&i instanceof R?Yt(t,i):!1}else if(!(De&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?R.isSelectable(o)?Yt(t,new R(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Xi?Yt(t,new U(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else{if(r instanceof R&&r.node.isInline)return Yt(t,new U(e>0?r.$to:r.$from));{let i=Ts(t.state,e);return i?Yt(t,i):!1}}}function Ri(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function br(t){let e=t.pmViewDesc;return e&&e.size==0&&(t.nextSibling||t.nodeName!="BR")}function ar(t,e){return e<0?_v(t):sp(t)}function _v(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(Ge&&n.nodeType==1&&r<Ri(n)&&br(n.childNodes[r])&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(br(a))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(ap(n))break;{let a=n.previousSibling;for(;a&&br(a);)i=n.parentNode,o=Pe(a),a=a.previousSibling;if(a)n=a,r=Ri(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Ns(t,n,r):i&&Ns(t,i,o)}function sp(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Ri(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(br(a))o=n,s=++r;else break}else{if(ap(n))break;{let a=n.nextSibling;for(;a&&br(a);)o=a.parentNode,s=Pe(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Ri(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&Ns(t,o,s)}function ap(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Ns(t,e,n){let r=t.domSelection();if(Yi(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&ht(t)},50)}function Sc(t,e){let n=t.state.doc.resolve(e);if(!(he||rv)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function kc(t,e,n){let r=t.state.selection;if(r instanceof U&&!r.empty||n.indexOf("s")>-1||De&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Ts(t.state,e);if(s&&s instanceof R)return Yt(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof Je?W.near(s,e):W.findFrom(s,e);return a?Yt(t,a):!1}return!1}function Cc(t,e){if(!(t.state.selection instanceof U))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function Oc(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Pv(t){if(!xe||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Oc(t,r,"true"),setTimeout(()=>Oc(t,r,"false"),20)}return!1}function Rv(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Lv(t,e){let n=e.keyCode,r=Rv(e);if(n==8||De&&n==72&&r=="c")return Cc(t,-1)||ar(t,-1);if(n==46||De&&n==68&&r=="c")return Cc(t,1)||ar(t,1);if(n==13||n==27)return!0;if(n==37||De&&n==66&&r=="c"){let i=n==37?Sc(t,t.state.selection.from)=="ltr"?-1:1:-1;return wc(t,i,r)||ar(t,i)}else if(n==39||De&&n==70&&r=="c"){let i=n==39?Sc(t,t.state.selection.from)=="ltr"?1:-1:1;return wc(t,i,r)||ar(t,i)}else{if(n==38||De&&n==80&&r=="c")return kc(t,-1,r)||ar(t,-1);if(n==40||De&&n==78&&r=="c")return Pv(t)||kc(t,1,r)||sp(t);if(r==(De?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function lp(t,e){t.someProp("transformCopied",d=>{e=d(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let d=r.firstChild;n.push(d.type.name,d.attrs!=d.type.defaultAttrs?d.attrs:null),r=d.content}let s=t.someProp("clipboardSerializer")||rt.fromSchema(t.state.schema),a=hp(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,f,u=0;for(;c&&c.nodeType==1&&(f=dp[c.nodeName.toLowerCase()]);){for(let d=f.length-1;d>=0;d--){let h=a.createElement(f[d]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),u++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${u?` -${u}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",d=>d(e,t))||e.content.textBetween(0,e.content.size,`
10
+
11
+ `);return{dom:l,text:p}}function cp(t,e,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||o||!n);if(l){if(t.someProp("transformPastedText",p=>{e=p(e,o||r,t)}),o)return e?new E(C.from(t.state.schema.text(e.replace(/\r\n?/g,`
12
+ `))),0,0):E.empty;let u=t.someProp("clipboardTextParser",p=>p(e,i,r,t));if(u)a=u;else{let p=i.marks(),{schema:d}=t.state,h=rt.fromSchema(d);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let x=s.appendChild(document.createElement("p"));m&&x.appendChild(h.serializeNode(d.text(m,p)))})}}else t.someProp("transformPastedHTML",u=>{n=u(n,t)}),s=Bv(n),Xi&&zv(s);let c=s&&s.querySelector("[data-pm-slice]"),f=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let u=+f[3];u>0;u--){let p=s.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;s=p}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Bn.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||f),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!$v.test(p.parentNode.nodeName)?{ignore:!0}:null}})),f)a=Hv(Mc(a,+f[1],+f[2]),f[4]);else if(a=E.maxOpen(Fv(a.content,i),!0),a.openStart||a.openEnd){let u=0,p=0;for(let d=a.content.firstChild;u<a.openStart&&!d.type.spec.isolating;u++,d=d.firstChild);for(let d=a.content.lastChild;p<a.openEnd&&!d.type.spec.isolating;p++,d=d.lastChild);a=Mc(a,u,p)}return t.someProp("transformPasted",u=>{a=u(a,t)}),a}const $v=/^(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 Fv(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&o.length&&up(l,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=pp(s[s.length-1],o.length));let f=fp(a,l);s.push(f),i=i.matchType(f.type),o=l}}),s)return C.from(s)}return t}function fp(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,C.from(t));return t}function up(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=up(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(C.from(fp(n,t,i+1))))}}function pp(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,pp(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(C.empty,!0);return t.copy(n.append(r))}function As(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),i<r-1&&(a=As(a,e,n,r,i+1,o)),i>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(C.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Mc(t,e,n){return e<t.openStart&&(t=new E(As(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new E(As(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const dp={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 Ec=null;function hp(){return Ec||(Ec=document.implementation.createHTMLDocument("title"))}function Bv(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=hp().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&dp[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=t,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function zv(t){let e=t.querySelectorAll(he?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function Hv(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=C.from(l.create(r[a+1],i)),o++,s++}return new E(i,o,s)}const we={},Se={},jv={touchstart:!0,touchmove:!0};class Wv{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Vv(t){for(let e in we){let n=we[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{qv(t,r)&&!wa(t,r)&&(t.editable||!(r.type in Se))&&n(t,r)},jv[e]?{passive:!0}:void 0)}xe&&t.dom.addEventListener("input",()=>null),Is(t)}function Et(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Uv(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Is(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>wa(t,r))})}function wa(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function qv(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Kv(t,e){!wa(t,e)&&we[e.type]&&(t.editable||!(e.type in Se))&&we[e.type](t,e)}Se.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!gp(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Ue&&he&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),jn&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Gt(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||Lv(t,n)?n.preventDefault():Et(t,"key")};Se.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Se.keypress=(t,e)=>{let n=e;if(gp(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||De&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof U)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Qi(t){return{left:t.clientX,top:t.clientY}}function Jv(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Sa(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Fn(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function Gv(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&R.isSelectable(r)?(Fn(t,new R(n),"pointer"),!0):!1}function Yv(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof R&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(R.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Fn(t,R.create(t.state.doc,i),"pointer"),!0):!1}function Xv(t,e,n,r,i){return Sa(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?Yv(t,n):Gv(t,n))}function Zv(t,e,n,r){return Sa(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function Qv(t,e,n,r){return Sa(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||eb(t,n,r)}function eb(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Fn(t,U.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)Fn(t,U.create(r,a+1,a+1+s.content.size),"pointer");else if(R.isSelectable(s))Fn(t,R.create(r,a),"pointer");else continue;return!0}}function ka(t){return Li(t)}const mp=De?"metaKey":"ctrlKey";we.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=ka(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&Jv(n,t.input.lastClick)&&!n[mp]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Qi(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new tb(t,s,n,!!r)):(o=="doubleClick"?Zv:Qv)(t,s.pos,s.inside,n)?n.preventDefault():Et(t,"pointer"))};class tb{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[mp],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let f=e.state.doc.resolve(n.pos);o=f.parent,s=f.depth?f.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof R&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ge&&!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)),Et(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(()=>ht(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Qi(e))),this.updateAllowDefault(e),this.allowDefault||!n?Et(this.view,"pointer"):Xv(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||xe&&this.mightDrag&&!this.mightDrag.node.isAtom||he&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Fn(this.view,W.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):Et(this.view,"pointer")}move(e){this.updateAllowDefault(e),Et(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}we.touchstart=t=>{t.input.lastTouch=Date.now(),ka(t),Et(t,"pointer")};we.touchmove=t=>{t.input.lastTouch=Date.now(),Et(t,"pointer")};we.contextmenu=t=>ka(t);function gp(t,e){return t.composing?!0:xe&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const nb=Ue?5e3:-1;Se.compositionstart=Se.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Li(t,!0),t.markCursor=null;else if(Li(t),Ge&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}yp(t,nb)};Se.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionID++,yp(t,20))};function yp(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Li(t),e))}function vp(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=rb());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function rb(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Li(t,e=!1){if(!(Ue&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),vp(t),e||t.docView&&t.docView.dirty){let n=ba(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function ib(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Wn=ke&&At<15||jn&&iv<604;we.copy=Se.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=Wn?null:n.clipboardData,s=r.content(),{dom:a,text:l}=lp(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):ib(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function ob(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function sb(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Nr(t,r.value,null,t.input.shiftKey,e):Nr(t,r.textContent,r.innerHTML,t.input.shiftKey,e)},50)}function Nr(t,e,n,r,i){let o=cp(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||E.empty)))return!0;if(!o)return!1;let s=ob(o),a=s?t.state.tr.replaceSelectionWith(s,t.input.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Se.paste=(t,e)=>{let n=e;if(t.composing&&!Ue)return;let r=Wn?null:n.clipboardData;r&&Nr(t,r.getData("text/plain"),r.getData("text/html"),t.input.shiftKey,n)?n.preventDefault():sb(t,n)};class ab{constructor(e,n){this.slice=e,this.move=n}}const bp=De?"altKey":"ctrlKey";we.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Qi(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof R?i.to-1:i.to))){if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(R.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let c=t.docView.nearestDesc(n.target,!0);c&&c.node.type.spec.draggable&&c!=t.docView&&t.dispatch(t.state.tr.setSelection(R.create(t.state.doc,c.posBefore)))}}let s=t.state.selection.content(),{dom:a,text:l}=lp(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Wn?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Wn||n.dataTransfer.setData("text/plain",l),t.dragging=new ab(s,!n[bp])};we.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Se.dragover=Se.dragenter=(t,e)=>e.preventDefault();Se.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Qi(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",h=>{s=h(s,t)}):s=cp(t,n.dataTransfer.getData(Wn?"Text":"text/plain"),Wn?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[bp]);if(t.someProp("handleDrop",h=>h(t,n,s||E.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?By(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let c=t.state.tr;a&&c.deleteSelection();let f=c.mapping.map(l),u=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=c.doc;if(u?c.replaceRangeWith(f,f,s.content.firstChild):c.replaceRange(f,f,s),c.doc.eq(p))return;let d=c.doc.resolve(f);if(u&&R.isSelectable(s.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new R(d));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,x,w,M)=>h=M),c.setSelection(xa(t,d,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};we.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&ht(t)},20))};we.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};we.beforeinput=(t,e)=>{if(he&&Ue&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Gt(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Se)we[t]=Se[t];function Ar(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Ca{constructor(e,n){this.toDOM=e,this.spec=n||an,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Ee(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Ca&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ar(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Dt{constructor(e,n){this.attrs=e,this.spec=n||an}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Ee(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Dt&&Ar(this.attrs,e.attrs)&&Ar(this.spec,e.spec)}static is(e){return e.type instanceof Dt}destroy(){}}class Oa{constructor(e,n){this.attrs=e,this.spec=n||an}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new Ee(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof Oa&&Ar(this.attrs,e.attrs)&&Ar(this.spec,e.spec)}destroy(){}}class Ee{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Ee(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Ee(e,e,new Ca(n,r))}static inline(e,n,r,i){return new Ee(e,n,new Dt(r,i))}static node(e,n,r,i){return new Ee(e,n,new Oa(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Dt}}const Tn=[],an={};class re{constructor(e,n){this.local=e.length?e:Tn,this.children=n.length?n:Tn}static create(e,n){return n.length?$i(n,e,0,an):pe}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==pe||e.maps.length==0?this:this.mapInner(e,n,0,0,r||an)}mapInner(e,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?lb(this.children,s||[],e,n,r,i,o):s?new re(s.sort(ln),Tn):pe}add(e,n){return n.length?this==pe?re.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((a,l)=>{let c=l+r,f;if(f=wp(n,a,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,f,c+1):i.splice(o,0,l,l+a.nodeSize,$i(f,a,c+1,an)),o+=3}});let s=xp(o?Sp(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new re(s.length?this.local.concat(s).sort(ln):this.local,i||this.children)}remove(e){return e.length==0||this==pe?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,l=r[o+1]+n;for(let f=0,u;f<e.length;f++)(u=e[f])&&u.from>a&&u.to<l&&(e[f]=null,(s||(s=[])).push(u));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(s,a+1);c!=pe?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new re(i,r):pe}forChild(e,n){if(this==pe)return this;if(n.isLeaf)return re.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof Dt){let c=Math.max(o,l.from)-o,f=Math.min(s,l.to)-o;c<f&&(i||(i=[])).push(l.copy(c,f))}}if(i){let a=new re(i.sort(ln),Tn);return r?new wt([a,r]):a}return r||pe}eq(e){if(this==e)return!0;if(!(e instanceof re)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Ma(this.localsInner(e))}localsInner(e){if(this==pe)return Tn;if(e.inlineContent||!this.local.some(Dt.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Dt||n.push(this.local[r]);return n}}re.empty=new re([],[]);re.removeOverlap=Ma;const pe=re.empty;class wt{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,an));return wt.from(r)}forChild(e,n){if(n.isLeaf)return re.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=pe&&(o instanceof wt?r=r.concat(o.members):r.push(o))}return wt.from(r)}eq(e){if(!(e instanceof wt)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?Ma(r?n:n.sort(ln)):Tn}static from(e){switch(e.length){case 0:return pe;case 1:return e[0];default:return new wt(e.every(n=>n instanceof re)?e:e.reduce((n,r)=>n.concat(r instanceof re?r:r.members),[]))}}}function lb(t,e,n,r,i,o,s){let a=t.slice();for(let c=0,f=o;c<n.maps.length;c++){let u=0;n.maps[c].forEach((p,d,h,m)=>{let x=m-h-(d-p);for(let w=0;w<a.length;w+=3){let M=a[w+1];if(M<0||p>M+f-u)continue;let O=a[w]+f-u;d>=O?a[w+1]=p<=O?-2:-1:h>=i&&x&&(a[w]+=x,a[w+1]+=x)}u+=x}),f=n.maps[c].map(f,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let f=n.map(t[c]+o),u=f-i;if(u<0||u>=r.content.size){l=!0;continue}let p=n.map(t[c+1]+o,-1),d=p-i,{index:h,offset:m}=r.content.findIndex(u),x=r.maybeChild(h);if(x&&m==u&&m+x.nodeSize==d){let w=a[c+2].mapInner(n,x,f+1,t[c]+o+1,s);w!=pe?(a[c]=u,a[c+1]=d,a[c+2]=w):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=cb(a,t,e,n,i,o,s),f=$i(c,r,0,s);e=f.local;for(let u=0;u<a.length;u+=3)a[u+1]<0&&(a.splice(u,3),u-=3);for(let u=0,p=0;u<f.children.length;u+=3){let d=f.children[u];for(;p<a.length&&a[p]<d;)p+=3;a.splice(p,0,f.children[u],f.children[u+1],f.children[u+2])}}return new re(e.sort(ln),a)}function xp(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new Ee(i.from+e,i.to+e,i.type))}return n}function cb(t,e,n,r,i,o,s){function a(l,c){for(let f=0;f<l.local.length;f++){let u=l.local[f].map(r,i,c);u?n.push(u):s.onRemove&&s.onRemove(l.local[f].spec)}for(let f=0;f<l.children.length;f+=3)a(l.children[f+2],l.children[f]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return n}function wp(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function Sp(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function $i(t,e,n,r){let i=[],o=!1;e.forEach((a,l)=>{let c=wp(t,a,l+n);if(c){o=!0;let f=$i(c,a,n+l+1,r);f!=pe&&i.push(l,l+a.nodeSize,f)}});let s=xp(o?Sp(t):t,-n).sort(ln);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new re(s,i):pe}function ln(t,e){return t.from-e.from||t.to-e.to}function Ma(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),Tc(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),Tc(e,i,r.copy(o.from,r.to)));break}}}return e}function Tc(t,e,n){for(;e<t.length&&ln(n,t[e])>0;)e++;t.splice(e,0,n)}function Ao(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=pe&&e.push(r)}),t.cursorWrapper&&e.push(re.create(t.state.doc,[t.cursorWrapper.deco])),wt.from(e)}const fb={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ub=ke&&At<=11;class pb{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 db{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new pb,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);ke&&At<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),ub&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,fb)),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 n=0;n<e.length;n++)this.queue.push(e[n]);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(xc(this.view)){if(this.suppressingSelectionUpdates)return ht(this.view);if(ke&&At<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&mn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=Tr(o))n.add(o);for(let o=e.anchorNode;o;o=Tr(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.observer?this.observer.takeRecords():[];this.queue.length&&(n=this.queue.concat(n),this.queue.length=0);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&xc(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let f=0;f<n.length;f++){let u=this.registerMutation(n[f],l);u&&(o=o<0?u.from:Math.min(u.from,o),s=s<0?u.to:Math.max(u.to,s),u.typeOver&&(a=!0))}if(Ge&&l.length>1){let f=l.filter(u=>u.nodeName=="BR");if(f.length==2){let u=f[0],p=f[1];u.parentNode&&u.parentNode.parentNode==p.parentNode?p.remove():u.remove()}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Yi(r)&&(c=ba(e))&&c.eq(W.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,ht(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),hb(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||ht(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let f=0;f<e.addedNodes.length;f++)n.push(e.addedNodes[f]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(ke&&At<=11&&e.addedNodes.length)for(let f=0;f<e.addedNodes.length;f++){let{previousSibling:u,nextSibling:p}=e.addedNodes[f];(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(i=u),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(o=p)}let s=i&&i.parentNode==e.target?Pe(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?Pe(o):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let Nc=new WeakMap,Ac=!1;function hb(t){if(!Nc.has(t)&&(Nc.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Ge,Ac)return;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."),Ac=!0}}function mb(t){let e;function n(l){l.preventDefault(),l.stopImmediatePropagation(),e=l.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0);let r=e.startContainer,i=e.startOffset,o=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return mn(a.node,a.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}function gb(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,f=l.anchorNode;if(f&&t.dom.contains(f.nodeType==1?f:f.parentNode)&&(c=[{node:f,offset:l.anchorOffset}],Yi(l)||c.push({node:l.focusNode,offset:l.focusOffset})),he&&t.input.lastKeyCode===8)for(let x=o;x>i;x--){let w=r.childNodes[x-1],M=w.pmViewDesc;if(w.nodeName=="BR"&&!M){o=x;break}if(!M||M.size)break}let u=t.state.doc,p=t.someProp("domParser")||Bn.fromSchema(t.state.schema),d=u.resolve(s),h=null,m=p.parse(r,{topNode:d.parent,topMatch:d.parent.contentMatchAt(d.index()),topOpen:!0,from:i,to:o,preserveWhitespace:d.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:yb,context:d});if(c&&c[0].pos!=null){let x=c[0].pos,w=c[1]&&c[1].pos;w==null&&(w=x),h={anchor:x+s,head:w+s}}return{doc:m,sel:h,from:s,to:a}}function yb(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(xe&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||xe&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const vb=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function bb(t,e,n,r,i){if(e<0){let A=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,ce=ba(t,A);if(ce&&!t.state.selection.eq(ce)){if(he&&Ue&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",He=>He(t,Gt(13,"Enter"))))return;let te=t.state.tr.setSelection(ce);A=="pointer"?te.setMeta("pointer",!0):A=="key"&&te.scrollIntoView(),t.composing&&te.setMeta("composition",t.input.compositionID),t.dispatch(te)}return}let o=t.state.doc.resolve(e),s=o.sharedDepth(n);e=o.before(s+1),n=t.state.doc.resolve(n).after(s+1);let a=t.state.selection,l=gb(t,e,n),c=t.state.doc,f=c.slice(l.from,l.to),u,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(u=t.state.selection.to,p="end"):(u=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let d=Sb(f.content,l.doc.content,l.from,u,p);if((jn&&t.input.lastIOSEnter>Date.now()-225||Ue)&&i.some(A=>A.nodeType==1&&!vb.test(A.nodeName))&&(!d||d.endA>=d.endB)&&t.someProp("handleKeyDown",A=>A(t,Gt(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!d)if(r&&a instanceof U&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))d={start:a.from,endA:a.to,endB:a.to};else{if(l.sel){let A=Ic(t,t.state.doc,l.sel);if(A&&!A.eq(t.state.selection)){let ce=t.state.tr.setSelection(A);t.composing&&ce.setMeta("composition",t.input.compositionID),t.dispatch(ce)}}return}if(he&&t.cursorWrapper&&l.sel&&l.sel.anchor==t.cursorWrapper.deco.from&&l.sel.head==l.sel.anchor){let A=d.endB-d.start;l.sel={anchor:l.sel.anchor+A,head:l.sel.anchor+A}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&d.start==d.endB&&t.state.selection instanceof U&&(d.start>t.state.selection.from&&d.start<=t.state.selection.from+2&&t.state.selection.from>=l.from?d.start=t.state.selection.from:d.endA<t.state.selection.to&&d.endA>=t.state.selection.to-2&&t.state.selection.to<=l.to&&(d.endB+=t.state.selection.to-d.endA,d.endA=t.state.selection.to)),ke&&At<=11&&d.endB==d.start+1&&d.endA==d.start&&d.start>l.from&&l.doc.textBetween(d.start-l.from-1,d.start-l.from+1)=="  "&&(d.start--,d.endA--,d.endB--);let h=l.doc.resolveNoCache(d.start-l.from),m=l.doc.resolveNoCache(d.endB-l.from),x=c.resolve(d.start),w=h.sameParent(m)&&h.parent.inlineContent&&x.end()>=d.endA,M;if((jn&&t.input.lastIOSEnter>Date.now()-225&&(!w||i.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!w&&h.pos<l.doc.content.size&&(M=W.findFrom(l.doc.resolve(h.pos+1),1,!0))&&M.head==m.pos)&&t.someProp("handleKeyDown",A=>A(t,Gt(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>d.start&&wb(c,d.start,d.endA,h,m)&&t.someProp("handleKeyDown",A=>A(t,Gt(8,"Backspace")))){Ue&&he&&t.domObserver.suppressSelectionUpdates();return}he&&Ue&&d.endB==d.start&&(t.input.lastAndroidDelete=Date.now()),Ue&&!w&&h.start()!=m.start()&&m.parentOffset==0&&h.depth==m.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==d.endA&&(d.endB-=2,m=l.doc.resolveNoCache(d.endB-l.from),setTimeout(()=>{t.someProp("handleKeyDown",function(A){return A(t,Gt(13,"Enter"))})},20));let O=d.start,K=d.endA,F,X,g;if(w){if(h.pos==m.pos)ke&&At<=11&&h.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>ht(t),20)),F=t.state.tr.delete(O,K),X=c.resolve(d.start).marksAcross(c.resolve(d.endA));else if(d.endA==d.endB&&(g=xb(h.parent.content.cut(h.parentOffset,m.parentOffset),x.parent.content.cut(x.parentOffset,d.endA-x.start()))))F=t.state.tr,g.type=="add"?F.addMark(O,K,g.mark):F.removeMark(O,K,g.mark);else if(h.parent.child(h.index()).isText&&h.index()==m.index()-(m.textOffset?0:1)){let A=h.parent.textBetween(h.parentOffset,m.parentOffset);if(t.someProp("handleTextInput",ce=>ce(t,O,K,A)))return;F=t.state.tr.insertText(A,O,K)}}if(F||(F=t.state.tr.replace(O,K,l.doc.slice(d.start-l.from,d.endB-l.from))),l.sel){let A=Ic(t,F.doc,l.sel);A&&!(he&&Ue&&t.composing&&A.empty&&(d.start!=d.endB||t.input.lastAndroidDelete<Date.now()-100)&&(A.head==O||A.head==F.mapping.map(K)-1)||ke&&A.empty&&A.head==O)&&F.setSelection(A)}X&&F.ensureMarks(X),t.composing&&F.setMeta("composition",t.input.compositionID),t.dispatch(F.scrollIntoView())}function Ic(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:xa(t,e.resolve(n.anchor),e.resolve(n.head))}function xb(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,l;for(let f=0;f<r.length;f++)i=r[f].removeFromSet(i);for(let f=0;f<n.length;f++)o=n[f].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],s="add",l=f=>f.mark(a.addToSet(f.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=f=>f.mark(a.removeFromSet(f.marks));else return null;let c=[];for(let f=0;f<e.childCount;f++)c.push(l(e.child(f)));if(C.from(c).eq(t))return{mark:a,type:s}}function wb(t,e,n,r,i){if(!r.parent.isTextblock||n-e<=i.pos-r.pos||Io(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(Io(o,!0,!0));return!s.parent.isTextblock||s.pos>n||Io(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Io(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Sb(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));r-=s+l-o}if(s<o&&t.size<e.size){let l=r<=o&&r>=s?o-r:0;o-=l,a=o+(a-s),s=o}else if(a<o){let l=r<=o&&r>=a?o-r:0;o-=l,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}class kb{constructor(e,n){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 Wv,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Lc),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Pc(this),_c(this),this.nodeViews=Rc(this),this.docView=hc(this.state.doc,Dc(this),Ao(this),this.dom,this),this.domObserver=new db(this,(r,i,o,s)=>bb(this,r,i,o,s)),this.domObserver.start(),Vv(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Is(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Lc),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){let r=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(vp(this),o=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=n.plugins;if(s||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=Rc(this);Ob(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(s||n.handleDOMEvents!=this._props.handleDOMEvents)&&Is(this),this.editable=Pc(this),_c(this);let a=Ao(this),l=Dc(this),c=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",f=i||!this.docView.matchesNode(e.doc,l,a);(f||!e.selection.eq(r.selection))&&(o=!0);let u=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&av(this);if(o){this.domObserver.stop();let p=f&&(ke||he)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&Cb(r.selection,e.selection);if(f){let d=he?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(e.doc,l,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=hc(e.doc,l,a,this.dom,this)),d&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Dv(this))?ht(this,p):(ip(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():u&&lv(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof R){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&lc(this,n.getBoundingClientRect(),e)}else lc(this,this.coordsAtPos(this.state.selection.head,1),e)}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){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(ke){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&cv(this.dom),ht(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}posAtCoords(e){return hv(this,e)}coordsAtPos(e,n=1){return Yu(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return bv(this,n||this.state,e)}pasteHTML(e,n){return Nr(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Nr(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(Uv(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ao(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Kv(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return xe&&this.root.nodeType===11&&ev(this.dom.ownerDocument)==this.dom?mb(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Dc(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Ee.node(0,t.state.doc.content.size,e)]}function _c(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ee.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Pc(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Cb(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Rc(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Ob(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function Lc(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Ft={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:"'"},Fi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Mb=typeof navigator<"u"&&/Mac/.test(navigator.platform),Eb=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ue=0;ue<10;ue++)Ft[48+ue]=Ft[96+ue]=String(ue);for(var ue=1;ue<=24;ue++)Ft[ue+111]="F"+ue;for(var ue=65;ue<=90;ue++)Ft[ue]=String.fromCharCode(ue+32),Fi[ue]=String.fromCharCode(ue);for(var Do in Ft)Fi.hasOwnProperty(Do)||(Fi[Do]=Ft[Do]);function Tb(t){var e=Mb&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Eb&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Fi:Ft)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Nb=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Ab(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))Nb?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function Ib(t){let e=Object.create(null);for(let n in t)e[Ab(n)]=t[n];return e}function _o(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Db(t){return new ze({props:{handleKeyDown:_b(t)}})}function _b(t){let e=Ib(t);return function(n,r){let i=Tb(r),o,s=e[_o(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[_o(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=Ft[r.keyCode])&&o!=i){let a=e[_o(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Pb=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Rb(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Lb=(t,e,n)=>{let r=Rb(t,n);if(!r)return!1;let i=kp(r);if(!i){let s=r.blockRange(),a=s&&Zn(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Mp(t,i,e))return!0;if(r.parent.content.size==0&&(Vn(o,"end")||R.isSelectable(o))){let s=ga(t.doc,r.before(),r.after(),E.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(Vn(o,"end")?W.findFrom(a.doc.resolve(a.mapping.map(i.pos,-1)),-1):R.create(a.doc,i.pos-o.nodeSize)),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function Vn(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const $b=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=kp(r)}let s=o&&o.nodeBefore;return!s||!R.isSelectable(s)?!1:(e&&e(t.tr.setSelection(R.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function kp(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Fb(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const Bb=(t,e,n)=>{let r=Fb(t,n);if(!r)return!1;let i=Cp(r);if(!i)return!1;let o=i.nodeAfter;if(Mp(t,i,e))return!0;if(r.parent.content.size==0&&(Vn(o,"start")||R.isSelectable(o))){let s=ga(t.doc,r.before(),r.after(),E.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(Vn(o,"start")?W.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):R.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},zb=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=Cp(r)}let s=o&&o.nodeAfter;return!s||!R.isSelectable(s)?!1:(e&&e(t.tr.setSelection(R.create(t.doc,o.pos)).scrollIntoView()),!0)};function Cp(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const Hb=(t,e)=>{let n=t.selection,r=n instanceof R,i;if(r){if(n.node.isTextblock||!jt(t.doc,n.from))return!1;i=n.from}else if(i=Fu(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(R.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},jb=(t,e)=>{let n=t.selection,r;if(n instanceof R){if(n.node.isTextblock||!jt(t.doc,n.to))return!1;r=n.to}else if(r=Fu(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Wb=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Zn(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},Vb=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
13
+ `).scrollIntoView()),!0)};function Op(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Ub=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=Op(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(W.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},qb=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Je||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Op(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(s,o.createAndFill());a.setSelection(U.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},Kb=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Ln(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Zn(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},Jb=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(R.create(t.doc,i))),!0)};function Gb(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||jt(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Mp(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(Gb(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let u=e.pos+i.nodeSize,p=C.empty;for(let m=o.length-1;m>=0;m--)p=C.from(o[m].create(null,p));p=C.from(r.copy(p));let d=t.tr.step(new se(e.pos-1,u,e.pos,u,new E(p,1,0),o.length,!0)),h=u+2*o.length;jt(d.doc,h)&&d.join(h),n(d.scrollIntoView())}return!0}let l=W.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),f=c&&Zn(c);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(c,f).scrollIntoView()),!0;if(a&&Vn(i,"start",!0)&&Vn(r,"end")){let u=r,p=[];for(;p.push(u),!u.isTextblock;)u=u.lastChild;let d=i,h=1;for(;!d.isTextblock;d=d.firstChild)h++;if(u.canReplace(u.childCount,u.childCount,d.content)){if(n){let m=C.empty;for(let w=p.length-1;w>=0;w--)m=C.from(p[w].copy(m));let x=t.tr.step(new se(e.pos-p.length,e.pos+i.nodeSize,e.pos+h,e.pos+i.nodeSize-h,new E(m,p.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function Ep(t){return function(e,n){let r=e.selection,i=t<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(e.tr.setSelection(U.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const Yb=Ep(-1),Xb=Ep(1);function Zb(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&ma(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function $c(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let f=n.doc.resolve(c),u=f.index();i=f.parent.canReplaceWith(u,u+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,t,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Qb(t,e=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(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let f=n.doc.resolve(s.start-2);l=new Ii(f,f,s.depth),s.endIndex<s.parent.childCount&&(s=new Ii(i,n.doc.resolve(o.end(s.depth)),s.depth)),a=!0}let c=ma(l,t,e,s);return c?(r&&r(e0(n.tr,s,c,a,t).scrollIntoView()),!0):!1}}function e0(t,e,n,r,i){let o=C.empty;for(let f=n.length-1;f>=0;f--)o=C.from(n[f].type.create(n[f].attrs,o));t.step(new se(e.start-(r?2:0),e.end,e.start,e.end,new E(o,0,0),n.length,!0));let s=0;for(let f=0;f<n.length;f++)n[f].type==i&&(s=f+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let f=e.startIndex,u=e.endIndex,p=!0;f<u;f++,p=!1)!p&&Ln(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(f).nodeSize;return t}function t0(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?n0(e,n,t,o):r0(e,n,o):!0:!1}}function n0(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new se(o-1,s,o,s,new E(C.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ii(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=Zn(r);if(a==null)return!1;i.lift(r,a);let l=i.mapping.map(o,-1)-1;return jt(i.doc,l)&&i.join(l),e(i.scrollIntoView()),!0}function r0(t,e,n){let r=t.tr,i=n.parent;for(let d=n.end,h=n.endIndex-1,m=n.startIndex;h>m;h--)d-=i.child(h).nodeSize,r.delete(d-1,d+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=n.startIndex==0,l=n.endIndex==i.childCount,c=o.node(-1),f=o.index(-1);if(!c.canReplace(f+(a?0:1),f+1,s.content.append(l?C.empty:C.from(i))))return!1;let u=o.pos,p=u+s.nodeSize;return r.step(new se(u-(a?1:0),p+(l?1:0),u+1,p-1,new E((a?C.empty:C.from(i.copy(C.empty))).append(l?C.empty:C.from(i.copy(C.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function i0(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,f=C.from(c?t.create():null),u=new E(C.from(t.create(null,C.from(a.type.create(null,f)))),c?3:1,0),p=o.start,d=o.end;n(e.tr.step(new se(p-(c?3:1),d,p,d,u,1,!0)).scrollIntoView())}return!0}}function eo(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),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}}}class to{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:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...f)=>{const u=l(...f)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,c=e||o.tr,f=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(p=>p===!0)),u={...Object.fromEntries(Object.entries(r).map(([p,d])=>[p,(...m)=>{const x=this.buildProps(c,n),w=d(...m)(x);return a.push(w),u}])),run:f};return u}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...f)=>c(...f)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i;o.storedMarks&&e.setStoredMarks(o.storedMarks);const a={tr:e,editor:i,view:s,state:eo({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...f)=>c(...f)(a)]))}};return a}}class o0{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function N(t,e,n){return t.config[e]===void 0&&t.parent?N(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?N(t.parent,e,n):null}):t.config[e]}function no(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Tp(t){const e=[],{nodeExtensions:n,markExtensions:r}=no(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=N(s,"addGlobalAttributes",a);if(!l)return;l().forEach(f=>{f.types.forEach(u=>{Object.entries(f.attributes).forEach(([p,d])=>{e.push({type:u,name:p,attribute:{...o,...d}})})})})}),i.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=N(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([f,u])=>{const p={...o,...u};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,e.push({type:s.name,name:f,attribute:p})})}),e}function le(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Vt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}i==="class"?r[i]=[r[i],o].join(" "):i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Ds(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Vt(n,r),{})}function Np(t){return typeof t=="function"}function j(t,e=void 0,...n){return Np(t)?e?t.bind(e)(...n):t(...n):t}function s0(t={}){return Object.keys(t).length===0&&t.constructor===Object}function a0(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Fc(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):a0(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function Bc(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&s0(n)?!1:n!=null))}function l0(t,e){var n;const r=Tp(t),{nodeExtensions:i,markExtensions:o}=no(t),s=(n=i.find(c=>N(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(c=>{const f=r.filter(w=>w.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((w,M)=>{const O=N(M,"extendNodeSchema",u);return{...w,...O?O(c):{}}},{}),d=Bc({...p,content:j(N(c,"content",u)),marks:j(N(c,"marks",u)),group:j(N(c,"group",u)),inline:j(N(c,"inline",u)),atom:j(N(c,"atom",u)),selectable:j(N(c,"selectable",u)),draggable:j(N(c,"draggable",u)),code:j(N(c,"code",u)),defining:j(N(c,"defining",u)),isolating:j(N(c,"isolating",u)),attrs:Object.fromEntries(f.map(w=>{var M;return[w.name,{default:(M=w==null?void 0:w.attribute)===null||M===void 0?void 0:M.default}]}))}),h=j(N(c,"parseHTML",u));h&&(d.parseDOM=h.map(w=>Fc(w,f)));const m=N(c,"renderHTML",u);m&&(d.toDOM=w=>m({node:w,HTMLAttributes:Ds(w,f)}));const x=N(c,"renderText",u);return x&&(d.toText=x),[c.name,d]})),l=Object.fromEntries(o.map(c=>{const f=r.filter(x=>x.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((x,w)=>{const M=N(w,"extendMarkSchema",u);return{...x,...M?M(c):{}}},{}),d=Bc({...p,inclusive:j(N(c,"inclusive",u)),excludes:j(N(c,"excludes",u)),group:j(N(c,"group",u)),spanning:j(N(c,"spanning",u)),code:j(N(c,"code",u)),attrs:Object.fromEntries(f.map(x=>{var w;return[x.name,{default:(w=x==null?void 0:x.attribute)===null||w===void 0?void 0:w.default}]}))}),h=j(N(c,"parseHTML",u));h&&(d.parseDOM=h.map(x=>Fc(x,f)));const m=N(c,"renderHTML",u);return m&&(d.toDOM=x=>m({mark:x,HTMLAttributes:Ds(x,f)})),[c.name,d]}));return new gy({topNode:s,nodes:a,marks:l})}function Po(t,e){return e.nodes[t]||e.marks[t]||null}function zc(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const c0=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,a)=>{var l,c;const f=((c=(l=i.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=f.slice(0,Math.max(0,r-o))}),n};function Ea(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Ap{constructor(e){this.find=e.find,this.handler=e.handler}}const f0=(t,e)=>{if(Ea(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,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};function Ro(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(p=>p.type.spec.code))return!1;let f=!1;const u=c0(c)+o;return s.forEach(p=>{if(f)return;const d=f0(u,p.find);if(!d)return;const h=l.state.tr,m=eo({state:l.state,transaction:h}),x={from:r-(d[0].length-o.length),to:i},{commands:w,chain:M,can:O}=new to({editor:n,state:m});p.handler({state:m,range:x,match:d,commands:w,chain:M,can:O})===null||!h.steps.length||(h.setMeta(a,{transform:h,from:r,to:i,text:o}),l.dispatch(h),f=!0)}),f}function u0(t){const{editor:e,rules:n}=t,r=new ze({state:{init(){return null},apply(i,o){const s=i.getMeta(r);return s||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,s,a){return Ro({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Ro({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?Ro({editor:e,from:s.pos,to:s.pos,text:`
14
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function p0(t){return typeof t=="number"}class d0{constructor(e){this.find=e.find,this.handler=e.handler}}const h0=(t,e)=>{if(Ea(e))return[...t.matchAll(e)];const n=e(t);return n?n.map(r=>{const i=[r.text];return i.index=r.index,i.input=t,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function m0(t){const{editor:e,state:n,from:r,to:i,rule:o}=t,{commands:s,chain:a,can:l}=new to({editor:e,state:n}),c=[];return n.doc.nodesBetween(r,i,(u,p)=>{if(!u.isTextblock||u.type.spec.code)return;const d=Math.max(r,p),h=Math.min(i,p+u.content.size),m=u.textBetween(d-p,h-p,void 0,"");h0(m,o.find).forEach(w=>{if(w.index===void 0)return;const M=d+w.index+1,O=M+w[0].length,K={from:n.tr.mapping.map(M),to:n.tr.mapping.map(O)},F=o.handler({state:n,range:K,match:w,commands:s,chain:a,can:l});c.push(F)})}),c.every(u=>u!==null)}function g0(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1;return n.map(a=>new ze({view(l){const c=f=>{var u;r=!((u=l.dom.parentElement)===null||u===void 0)&&u.contains(f.target)?l.dom.parentElement:null};return window.addEventListener("dragstart",c),{destroy(){window.removeEventListener("dragstart",c)}}},props:{handleDOMEvents:{drop:l=>(o=r===l.dom.parentElement,!1),paste:(l,c)=>{var f;const u=(f=c.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return i=!!(u!=null&&u.includes("data-pm-slice")),!1}}},appendTransaction:(l,c,f)=>{const u=l[0],p=u.getMeta("uiEvent")==="paste"&&!i,d=u.getMeta("uiEvent")==="drop"&&!o;if(!p&&!d)return;const h=c.doc.content.findDiffStart(f.doc.content),m=c.doc.content.findDiffEnd(f.doc.content);if(!p0(h)||!m||h===m.b)return;const x=f.tr,w=eo({state:f,transaction:x});if(!(!m0({editor:e,state:w,from:Math.max(h-1,0),to:m.b-1,rule:a})||!x.steps.length))return x}}))}function y0(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}class _n{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=_n.resolve(e),this.schema=l0(this.extensions,n),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:Po(r.name,this.schema)};r.type==="mark"&&(!((i=j(N(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const s=N(r,"onBeforeCreate",o);s&&this.editor.on("beforeCreate",s);const a=N(r,"onCreate",o);a&&this.editor.on("create",a);const l=N(r,"onUpdate",o);l&&this.editor.on("update",l);const c=N(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);const f=N(r,"onTransaction",o);f&&this.editor.on("transaction",f);const u=N(r,"onFocus",o);u&&this.editor.on("focus",u);const p=N(r,"onBlur",o);p&&this.editor.on("blur",p);const d=N(r,"onDestroy",o);d&&this.editor.on("destroy",d)})}static resolve(e){const n=_n.sort(_n.flatten(e)),r=y0(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=N(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=N(r,"priority")||100,s=N(i,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Po(n.name,this.schema)},i=N(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=_n.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Po(s.name,this.schema)},l=[],c=N(s,"addKeyboardShortcuts",a);let f={};if(s.type==="mark"&&s.config.exitable&&(f.ArrowRight=()=>yn.handleExit({editor:e,mark:s})),c){const m=Object.fromEntries(Object.entries(c()).map(([x,w])=>[x,()=>w({editor:e})]));f={...f,...m}}const u=Db(f);l.push(u);const p=N(s,"addInputRules",a);zc(s,e.options.enableInputRules)&&p&&r.push(...p());const d=N(s,"addPasteRules",a);zc(s,e.options.enablePasteRules)&&d&&i.push(...d());const h=N(s,"addProseMirrorPlugins",a);if(h){const m=h();l.push(...m)}return l}).flat();return[u0({editor:e,rules:r}),...g0({editor:e,rules:i}),...o]}get attributes(){return Tp(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=no(this.extensions);return Object.fromEntries(n.filter(r=>!!N(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:le(r.name,this.schema)},s=N(r,"addNodeView",o);if(!s)return[];const a=(l,c,f,u)=>{const p=Ds(l,i);return s()({editor:e,node:l,getPos:f,decorations:u,HTMLAttributes:p,extension:r})};return[r.name,a]}))}}function v0(t){return Object.prototype.toString.call(t).slice(8,-1)}function Lo(t){return v0(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function ro(t,e){const n={...t};return Lo(t)&&Lo(e)&&Object.keys(e).forEach(r=>{Lo(e[r])?r in t?n[r]=ro(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})}),n}class Be{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=j(N(this,"addOptions",{name:this.name}))),this.storage=j(N(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Be(e)}configure(e={}){const n=this.extend();return n.options=ro(this.options,e),n.storage=j(N(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new Be(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=j(N(n,"addOptions",{name:n.name})),n.storage=j(N(n,"addStorage",{name:n.name,options:n.options})),n}}function Ip(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
15
+
16
+ `,textSerializers:s={}}=n||{};let a="",l=!0;return t.nodesBetween(r,i,(c,f,u,p)=>{var d;const h=s==null?void 0:s[c.type.name];h?(c.isBlock&&!l&&(a+=o,l=!0),u&&(a+=h({node:c,pos:f,parent:u,index:p,range:e}))):c.isText?(a+=(d=c==null?void 0:c.text)===null||d===void 0?void 0:d.slice(Math.max(r,f)-f,i-f),l=!1):c.isBlock&&!l&&(a+=o,l=!0)}),a}function Dp(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const b0=Be.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new ze({key:new lt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(f=>f.$from.pos)),a=Math.max(...o.map(f=>f.$to.pos)),l=Dp(n);return Ip(r,{from:s,to:a},{textSerializers:l})}}})]}}),x0=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),w0=(t=!1)=>({commands:e})=>e.setContent("",t),S0=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:f}=e,u=c.resolve(f.map(l)),p=c.resolve(f.map(l+a.nodeSize)),d=u.blockRange(p);if(!d)return;const h=Zn(d);if(a.type.isTextblock){const{defaultType:m}=u.parent.contentMatchAt(u.index());e.setNodeMarkup(d.start,m)}(h||h===0)&&e.lift(d,h)})}),!0},k0=t=>e=>t(e),C0=()=>({state:t,dispatch:e})=>qb(t,e),O0=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},M0=t=>({tr:e,state:n,dispatch:r})=>{const i=le(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),c=o.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1},E0=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},T0=()=>({state:t,dispatch:e})=>Pb(t,e),N0=()=>({commands:t})=>t.keyboardShortcut("Enter"),A0=()=>({state:t,dispatch:e})=>Ub(t,e);function Bi(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Ea(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function _s(t,e,n={}){return t.find(r=>r.type===e&&Bi(r.attrs,n))}function I0(t,e,n={}){return!!_s(t,e,n)}function Ta(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=_s([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(_s([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;a<t.parent.childCount&&I0([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Ut(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const D0=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=Ut(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:f}=a;if(i){const u=Ta(l,o,e);if(u&&u.from<=c&&u.to>=f){const p=U.create(s,u.from,u.to);n.setSelection(p)}}return!0},_0=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function _p(t){return t instanceof U}function Qt(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Pp(t,e=null){if(!e)return null;const n=W.atStart(t),r=W.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?U.create(t,Qt(0,i,o),Qt(t.content.size,i,o)):U.create(t,Qt(e,i,o),Qt(e,i,o))}function Na(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const P0=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{Na()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!_p(n.state.selection))return s(),!0;const a=Pp(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},R0=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),L0=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e);function Hc(t){const e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function zi(t,e,n){if(n={slice:!0,parseOptions:{},...n},typeof t=="object"&&t!==null)try{return Array.isArray(t)&&t.length>0?C.fromArray(t.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),zi("",e,n)}if(typeof t=="string"){const r=Bn.fromSchema(e);return n.slice?r.parseSlice(Hc(t),n.parseOptions).content:r.parse(Hc(t),n.parseOptions)}return zi("",e,n)}function $0(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof de||i instanceof se))return;const o=t.mapping.maps[r];let s=0;o.forEach((a,l,c,f)=>{s===0&&(s=f)}),t.setSelection(W.near(t.doc.resolve(s),n))}const F0=t=>t.toString().startsWith("<"),B0=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const s=zi(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:a,to:l}=typeof t=="number"?{from:t,to:t}:t,c=!0,f=!0;if((F0(s)?s:[s]).forEach(p=>{p.check(),c=c?p.isText&&p.marks.length===0:!1,f=f?p.isBlock:!1}),a===l&&f){const{parent:p}=r.doc.resolve(a);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(a-=1,l+=1)}c?Array.isArray(e)?r.insertText(e.map(p=>p.text||"").join(""),a,l):typeof e=="object"&&e&&e.text?r.insertText(e.text,a,l):r.insertText(e,a,l):r.replaceWith(a,l,s),n.updateSelection&&$0(r,r.steps.length-1,-1)}return!0},z0=()=>({state:t,dispatch:e})=>Hb(t,e),H0=()=>({state:t,dispatch:e})=>jb(t,e),j0=()=>({state:t,dispatch:e})=>Lb(t,e),W0=()=>({state:t,dispatch:e})=>Bb(t,e);function Rp(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function V0(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))Na()||Rp()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const U0=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=V0(t).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l==null||l.steps.forEach(c=>{const f=c.map(r.mapping);f&&i&&r.maybeStep(f)}),!0};function Ir(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?le(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(u,p)=>{if(u.isText)return;const d=Math.max(r,p),h=Math.min(i,p+u.nodeSize);a.push({node:u,from:d,to:h})});const l=i-r,c=a.filter(u=>s?s.name===u.node.type.name:!0).filter(u=>Bi(u.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((u,p)=>u+p.to-p.from,0)>=l}const q0=(t,e={})=>({state:n,dispatch:r})=>{const i=le(t,n.schema);return Ir(n,i,e)?Wb(n,r):!1},K0=()=>({state:t,dispatch:e})=>Kb(t,e),J0=t=>({state:e,dispatch:n})=>{const r=le(t,e.schema);return t0(r)(e,n)},G0=()=>({state:t,dispatch:e})=>Vb(t,e);function io(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function jc(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const Y0=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=io(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=le(t,r.schema)),a==="mark"&&(s=Ut(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,f)=>{o&&o===c.type&&n.setNodeMarkup(f,void 0,jc(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(u=>{s===u.type&&n.addMark(f,f+c.nodeSize,s.create(jc(u.attrs,e)))})})}),!0):!1},X0=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),Z0=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),Q0=()=>({state:t,dispatch:e})=>$b(t,e),ex=()=>({state:t,dispatch:e})=>zb(t,e),tx=()=>({state:t,dispatch:e})=>Jb(t,e),nx=()=>({state:t,dispatch:e})=>Xb(t,e),rx=()=>({state:t,dispatch:e})=>Yb(t,e);function Lp(t,e,n={}){return zi(t,e,{slice:!1,parseOptions:n})}const ix=(t,e=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,a=Lp(t,i.schema,n);return o&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0};function ox(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function sx(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Aa(t){return e=>sx(e.$from,t)}function ax(t,e){const n=rt.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function lx(t,e){const n={from:0,to:t.content.size};return Ip(t,n,e)}function Ia(t,e){const n=Ut(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function cx(t,e){const n=le(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function fx(t,e){const n=io(typeof e=="string"?e:e.name,t.schema);return n==="node"?cx(t,e):n==="mark"?Ia(t,e):{}}function $p(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t-1),s=Ta(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function hi(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function Ps(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Ut(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>o?o.name===u.type.name:!0).find(u=>Bi(u.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:u,$to:p})=>{const d=u.pos,h=p.pos;t.doc.nodesBetween(d,h,(m,x)=>{if(!m.isText&&!m.marks.length)return;const w=Math.max(d,x),M=Math.min(h,x+m.nodeSize),O=M-w;s+=O,a.push(...m.marks.map(K=>({mark:K,from:w,to:M})))})}),s===0)return!1;const l=a.filter(u=>o?o.name===u.mark.type.name:!0).filter(u=>Bi(u.mark.attrs,n,{strict:!1})).reduce((u,p)=>u+p.to-p.from,0),c=a.filter(u=>o?u.mark.type!==o&&u.mark.type.excludes(o):!0).reduce((u,p)=>u+p.to-p.from,0);return(l>0?l+c:l)>=s}function ux(t,e,n={}){if(!e)return Ir(t,null,n)||Ps(t,null,n);const r=io(e,t.schema);return r==="node"?Ir(t,e,n):r==="mark"?Ps(t,e,n):!1}function Wc(t,e){const{nodeExtensions:n}=no(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=j(N(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function px(t){var e;const n=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function dx(t,e,n){var r;const{selection:i}=e;let o=null;if(_p(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(f,u,p)=>{if(c)return!1;if(f.isInline){const d=!p||p.type.allowsMarkType(n),h=!!n.isInSet(f.marks)||!f.marks.some(m=>m.type.excludes(n));c=d&&h}return!c}),c})}const hx=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Ut(t,r.schema);if(i)if(s){const c=Ia(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const f=c.$from.pos,u=c.$to.pos;r.doc.nodesBetween(f,u,(p,d)=>{const h=Math.max(d,f),m=Math.min(d+p.nodeSize,u);p.marks.find(w=>w.type===l)?p.marks.forEach(w=>{l===w.type&&n.addMark(h,m,l.create({...w.attrs,...e}))}):n.addMark(h,m,l.create(e))})});return dx(r,n,l)},mx=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),gx=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=le(t,n.schema);return o.isTextblock?i().command(({commands:s})=>$c(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>$c(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},yx=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Qt(t,0,r.content.size),o=R.create(r,i);e.setSelection(o)}return!0},vx=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=U.atStart(r).from,a=U.atEnd(r).to,l=Qt(i,s,a),c=Qt(o,s,a),f=U.create(r,l,c);e.setSelection(f)}return!0},bx=t=>({state:e,dispatch:n})=>{const r=le(t,e.schema);return i0(r)(e,n)};function Vc(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const xx=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,c=i.extensionManager.attributes,f=hi(c,a.node().type.name,a.node().attrs);if(o instanceof R&&o.node.isBlock)return!a.parentOffset||!Ln(s,a.pos)?!1:(r&&(t&&Vc(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const u=l.parentOffset===l.parent.content.size;o instanceof U&&e.deleteSelection();const p=a.depth===0?void 0:ox(a.node(-1).contentMatchAt(a.indexAfter(-1)));let d=u&&p?[{type:p,attrs:f}]:void 0,h=Ln(e.doc,e.mapping.map(a.pos),1,d);if(!d&&!h&&Ln(e.doc,e.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(h=!0,d=p?[{type:p,attrs:f}]:void 0),h&&(e.split(e.mapping.map(a.pos),1,d),p&&!u&&!a.parentOffset&&a.parent.type!==p)){const m=e.mapping.map(a.before()),x=e.doc.resolve(m);a.node(-1).canReplaceWith(x.index(),x.index()+1,p)&&e.setNodeMarkup(e.mapping.map(a.before()),p)}t&&Vc(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},wx=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;const s=le(t,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const f=a.node(-1);if(f.type!==s)return!1;const u=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let x=C.empty;const w=a.index(-1)?1:a.index(-2)?2:3;for(let g=a.depth-w;g>=a.depth-3;g-=1)x=C.from(a.node(g).copy(x));const M=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,O=hi(u,a.node().type.name,a.node().attrs),K=((o=s.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(O))||void 0;x=x.append(C.from(s.createAndFill(null,K)||void 0));const F=a.before(a.depth-(w-1));e.replace(F,a.after(-M),new E(x,4-w,0));let X=-1;e.doc.nodesBetween(F,e.doc.content.size,(g,A)=>{if(X>-1)return!1;g.isTextblock&&g.content.size===0&&(X=A+1)}),X>-1&&e.setSelection(U.near(e.doc.resolve(X))),e.scrollIntoView()}return!0}const p=l.pos===a.end()?f.contentMatchAt(0).defaultType:null,d=hi(u,f.type.name,f.attrs),h=hi(u,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const m=p?[{type:s,attrs:d},{type:p,attrs:h}]:[{type:s,attrs:d}];if(!Ln(e.doc,a.pos,2))return!1;if(r){const{selection:x,storedMarks:w}=n,{splittableMarks:M}=i.extensionManager,O=w||x.$to.parentOffset&&x.$from.marks();if(e.split(a.pos,2,m).scrollIntoView(),!O||!r)return!0;const K=O.filter(F=>M.includes(F.type.name));e.ensureMarks(K)}return!0},$o=(t,e)=>{const n=Aa(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&jt(t.doc,n.pos)&&t.join(n.pos),!0},Fo=(t,e)=>{const n=Aa(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&jt(t.doc,r)&&t.join(r),!0},Sx=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:c,can:f})=>{const{extensions:u,splittableMarks:p}=i.extensionManager,d=le(t,s.schema),h=le(e,s.schema),{selection:m,storedMarks:x}=s,{$from:w,$to:M}=m,O=w.blockRange(M),K=x||m.$to.parentOffset&&m.$from.marks();if(!O)return!1;const F=Aa(X=>Wc(X.type.name,u))(m);if(O.depth>=1&&F&&O.depth-F.depth<=1){if(F.node.type===d)return c.liftListItem(h);if(Wc(F.node.type.name,u)&&d.validContent(F.node.content)&&a)return l().command(()=>(o.setNodeMarkup(F.pos,d),!0)).command(()=>$o(o,d)).command(()=>Fo(o,d)).run()}return!n||!K||!a?l().command(()=>f().wrapInList(d,r)?!0:c.clearNodes()).wrapInList(d,r).command(()=>$o(o,d)).command(()=>Fo(o,d)).run():l().command(()=>{const X=f().wrapInList(d,r),g=K.filter(A=>p.includes(A.type.name));return o.ensureMarks(g),X?!0:c.clearNodes()}).wrapInList(d,r).command(()=>$o(o,d)).command(()=>Fo(o,d)).run()},kx=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Ut(t,r.schema);return Ps(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},Cx=(t,e,n={})=>({state:r,commands:i})=>{const o=le(t,r.schema),s=le(e,r.schema);return Ir(r,o,n)?i.setNode(s):i.setNode(o,n)},Ox=(t,e={})=>({state:n,commands:r})=>{const i=le(t,n.schema);return Ir(n,i,e)?r.lift(i):r.wrapIn(i,e)},Mx=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},Ex=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},Tx=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Ut(t,r.schema),{$from:c,empty:f,ranges:u}=a;if(!i)return!0;if(f&&s){let{from:p,to:d}=a;const h=(o=c.marks().find(x=>x.type===l))===null||o===void 0?void 0:o.attrs,m=Ta(c,l,h);m&&(p=m.from,d=m.to),n.removeMark(p,d,l)}else u.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,l)});return n.removeStoredMark(l),!0},Nx=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=io(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=le(t,r.schema)),a==="mark"&&(s=Ut(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,f=l.$to.pos;r.doc.nodesBetween(c,f,(u,p)=>{o&&o===u.type&&n.setNodeMarkup(p,void 0,{...u.attrs,...e}),s&&u.marks.length&&u.marks.forEach(d=>{if(s===d.type){const h=Math.max(p,c),m=Math.min(p+u.nodeSize,f);n.addMark(h,m,s.create({...d.attrs,...e}))}})})}),!0):!1},Ax=(t,e={})=>({state:n,dispatch:r})=>{const i=le(t,n.schema);return Zb(i,e)(n,r)},Ix=(t,e={})=>({state:n,dispatch:r})=>{const i=le(t,n.schema);return Qb(i,e)(n,r)};var Dx=Object.freeze({__proto__:null,blur:x0,clearContent:w0,clearNodes:S0,command:k0,createParagraphNear:C0,deleteCurrentNode:O0,deleteNode:M0,deleteRange:E0,deleteSelection:T0,enter:N0,exitCode:A0,extendMarkRange:D0,first:_0,focus:P0,forEach:R0,insertContent:L0,insertContentAt:B0,joinUp:z0,joinDown:H0,joinBackward:j0,joinForward:W0,keyboardShortcut:U0,lift:q0,liftEmptyBlock:K0,liftListItem:J0,newlineInCode:G0,resetAttributes:Y0,scrollIntoView:X0,selectAll:Z0,selectNodeBackward:Q0,selectNodeForward:ex,selectParentNode:tx,selectTextblockEnd:nx,selectTextblockStart:rx,setContent:ix,setMark:hx,setMeta:mx,setNode:gx,setNodeSelection:yx,setTextSelection:vx,sinkListItem:bx,splitBlock:xx,splitListItem:wx,toggleList:Sx,toggleMark:kx,toggleNode:Cx,toggleWrap:Ox,undoInputRule:Mx,unsetAllMarks:Ex,unsetMark:Tx,updateAttributes:Nx,wrapIn:Ax,wrapInList:Ix});const _x=Be.create({name:"commands",addCommands(){return{...Dx}}}),Px=Be.create({name:"editable",addProseMirrorPlugins(){return[new ze({key:new lt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Rx=Be.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new ze({key:new lt("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Lx=Be.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:f,$anchor:u}=l,{pos:p,parent:d}=u,h=W.atStart(c).from===p;return!f||!h||!d.type.isTextblock||d.textContent.length?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Na()||Rp()?o:i},addProseMirrorPlugins(){return[new ze({key:new lt("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(h=>h.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:o,to:s}=e.selection,a=W.atStart(e.doc).from,l=W.atEnd(e.doc).to;if(i||!(o===a&&s===l)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const u=n.tr,p=eo({state:n,transaction:u}),{commands:d}=new to({editor:this.editor,state:p});if(d.clearNodes(),!!u.steps.length)return u}})]}}),$x=Be.create({name:"tabindex",addProseMirrorPlugins(){return[new ze({key:new lt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Fx=Object.freeze({__proto__:null,ClipboardTextSerializer:b0,Commands:_x,Editable:Px,FocusEvents:Rx,Keymap:Lx,Tabindex:$x});const Bx=`.ProseMirror {
17
+ position: relative;
18
+ }
19
+
20
+ .ProseMirror {
21
+ word-wrap: break-word;
22
+ white-space: pre-wrap;
23
+ white-space: break-spaces;
24
+ -webkit-font-variant-ligatures: none;
25
+ font-variant-ligatures: none;
26
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
27
+ }
28
+
29
+ .ProseMirror [contenteditable="false"] {
30
+ white-space: normal;
31
+ }
32
+
33
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
34
+ white-space: pre-wrap;
35
+ }
36
+
37
+ .ProseMirror pre {
38
+ white-space: pre-wrap;
39
+ }
40
+
41
+ img.ProseMirror-separator {
42
+ display: inline !important;
43
+ border: none !important;
44
+ margin: 0 !important;
45
+ width: 1px !important;
46
+ height: 1px !important;
47
+ }
48
+
49
+ .ProseMirror-gapcursor {
50
+ display: none;
51
+ pointer-events: none;
52
+ position: absolute;
53
+ margin: 0;
54
+ }
55
+
56
+ .ProseMirror-gapcursor:after {
57
+ content: "";
58
+ display: block;
59
+ position: absolute;
60
+ top: -2px;
61
+ width: 20px;
62
+ border-top: 1px solid black;
63
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
64
+ }
65
+
66
+ @keyframes ProseMirror-cursor-blink {
67
+ to {
68
+ visibility: hidden;
69
+ }
70
+ }
71
+
72
+ .ProseMirror-hideselection *::selection {
73
+ background: transparent;
74
+ }
75
+
76
+ .ProseMirror-hideselection *::-moz-selection {
77
+ background: transparent;
78
+ }
79
+
80
+ .ProseMirror-hideselection * {
81
+ caret-color: transparent;
82
+ }
83
+
84
+ .ProseMirror-focused .ProseMirror-gapcursor {
85
+ display: block;
86
+ }
87
+
88
+ .tippy-box[data-animation=fade][data-state=hidden] {
89
+ opacity: 0
90
+ }`;function zx(t,e){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style",""),r.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(r),r}let Hx=class extends o0{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=zx(Bx,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,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=Np(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){const n=[...this.options.enableCoreExtensions?Object.values(Fx):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new _n(n,this)}createCommandManager(){this.commandManager=new to({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Lp(this.options.content,this.schema,this.options.parseOptions),n=Pp(e,this.options.autofocus);this.view=new kb(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Dn.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return fx(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return ux(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ax(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
91
+
92
+ `,textSerializers:r={}}=e||{};return lx(this.state.doc,{blockSeparator:n,textSerializers:{...Dp(this.schema),...r}})}get isEmpty(){return px(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!(!((e=this.view)===null||e===void 0)&&e.docView)}};function Hi(t){return new Ap({find:t.find,handler:({state:e,range:n,match:r})=>{const i=j(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],a=r[0];let l=n.to;if(s){const c=a.search(/\S/),f=n.from+a.indexOf(s),u=f+s.length;if($p(n.from,n.to,e.doc).filter(d=>d.mark.type.excluded.find(m=>m===t.type&&m!==d.mark.type)).filter(d=>d.to>f).length)return null;u<n.to&&o.delete(u,n.to),f>n.from&&o.delete(n.from+c,f),l=n.from+c+s.length,o.addMark(n.from+c,l,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function Uc(t){return new Ap({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=j(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&ma(l,t.type,o);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:u,storedMarks:p}=e,{splittableMarks:d}=t.editor.extensionManager,h=p||u.$to.parentOffset&&u.$from.marks();if(h){const m=h.filter(x=>d.includes(x.type.name));s.ensureMarks(m)}}if(t.keepAttributes){const u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,o).run()}const f=s.doc.resolve(n.from-1).nodeBefore;f&&f.type===t.type&&jt(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,f))&&s.join(n.from-1)}})}class yn{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=j(N(this,"addOptions",{name:this.name}))),this.storage=j(N(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new yn(e)}configure(e={}){const n=this.extend();return n.options=ro(this.options,e),n.storage=j(N(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new yn(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=j(N(n,"addOptions",{name:n.name})),n.storage=j(N(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=s.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let xn=class Rs{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=j(N(this,"addOptions",{name:this.name}))),this.storage=j(N(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Rs(e)}configure(e={}){const n=this.extend();return n.options=ro(this.options,e),n.storage=j(N(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new Rs(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=j(N(n,"addOptions",{name:n.name})),n.storage=j(N(n,"addStorage",{name:n.name,options:n.options})),n}};function ji(t){return new d0({find:t.find,handler:({state:e,range:n,match:r})=>{const i=j(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],a=r[0];let l=n.to;if(s){const c=a.search(/\S/),f=n.from+a.indexOf(s),u=f+s.length;if($p(n.from,n.to,e.doc).filter(d=>d.mark.type.excluded.find(m=>m===t.type&&m!==d.mark.type)).filter(d=>d.to>f).length)return null;u<n.to&&o.delete(u,n.to),f>n.from&&o.delete(n.from+c,f),l=n.from+c+s.length,o.addMark(n.from+c,l,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}class jx extends Hx{constructor(){super(...arguments),this.contentComponent=null}}const Wx={name:"EditorContent",props:{editor:{default:null,type:Object}},watch:{editor:{immediate:!0,handler(t){t&&t.options.element&&this.$nextTick(()=>{const e=this.$el;!e||!t.options.element.firstChild||(e.append(...t.options.element.childNodes),t.contentComponent=this,t.setOptions({element:e}),t.createNodeViews())})}}},render(t){return t("div")},beforeDestroy(){const{editor:t}=this;if(!t||(t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;const e=document.createElement("div");e.append(...t.options.element.childNodes),t.setOptions({element:e})}},Vx=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Ux=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,qx=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Kx=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Jx=yn.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Vt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Hi({find:Vx,type:this.type}),Hi({find:qx,type:this.type})]},addPasteRules(){return[ji({find:Ux,type:this.type}),ji({find:Kx,type:this.type})]}}),Gx=xn.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Vt(this.options.HTMLAttributes,t),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)}}}),qc=yn.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Vt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Ia(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Kc=/^\s*([-+*])\s$/,Yx=xn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Vt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Gx.name,this.editor.getAttributes(qc.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Uc({find:Kc,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Uc({find:Kc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(qc.name),editor:this.editor})),[t]}}),Xx=Be.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize"}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;return((t==null?void 0:t.mode)||this.options.mode)==="textSize"?e.textBetween(0,e.content.size,void 0," ").length:e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;return e.textBetween(0,e.content.size," "," ").split(" ").filter(i=>i!=="").length}},addProseMirrorPlugins(){return[new ze({key:new lt("characterCount"),filterTransaction:(t,e)=>{const n=this.options.limit;if(!t.docChanged||n===0||n===null||n===void 0)return!0;const r=this.storage.characters({node:e.doc}),i=this.storage.characters({node:t.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!t.getMeta("paste"))return!1;const s=t.selection.$head.pos,a=i-n,l=s-a,c=s;return t.deleteRange(l,c),!(this.storage.characters({node:t.doc})>n)}})]}}),Zx=xn.create({name:"doc",topNode:!0,content:"block+"}),Qx=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,ew=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,tw=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,nw=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,rw=yn.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Vt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Hi({find:Qx,type:this.type}),Hi({find:tw,type:this.type})]},addPasteRules(){return[ji({find:ew,type:this.type}),ji({find:nw,type:this.type})]}});var Wi=200,ae=function(){};ae.prototype.append=function(e){return e.length?(e=ae.from(e),!this.length&&e||e.length<Wi&&this.leafAppend(e)||this.length<Wi&&e.leafPrepend(this)||this.appendInner(e)):this};ae.prototype.prepend=function(e){return e.length?ae.from(e).append(this):this};ae.prototype.appendInner=function(e){return new iw(this,e)};ae.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?ae.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};ae.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};ae.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};ae.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};ae.from=function(e){return e instanceof ae?e:e&&e.length?new Fp(e):ae.empty};var Fp=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l<s;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,a){for(var l=o-1;l>=s;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Wi)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Wi)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(ae);ae.empty=new Fp([]);var iw=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(ae);const ow=500;class qe{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,c=[],f=[];return this.items.forEach((u,p)=>{if(!u.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,f.push(u);return}if(i){f.push(new Qe(u.map));let d=u.step.map(i.slice(o)),h;d&&s.maybeStep(d).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new Qe(h,void 0,void 0,c.length+f.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(u.step);if(u.selection)return a=i?u.selection.map(i.slice(o)):u.selection,l=new qe(this.items.slice(0,r).append(f.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let f=0;f<e.steps.length;f++){let u=e.steps[f].invert(e.docs[f]),p=new Qe(e.mapping.maps[f],u,n),d;(d=l&&l.merge(p))&&(p=d,f?o.pop():a=a.slice(0,a.length-1)),o.push(p),n&&(s++,n=void 0),i||(l=p)}let c=s-r.depth;return c>aw&&(a=sw(a,c),s-=c),new qe(a.append(o),s)}remapping(e,n){let r=new Rn;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new qe(this.items.append(e.map(n=>new Qe(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},i);let l=n;this.items.forEach(p=>{let d=o.getMirror(--l);if(d==null)return;s=Math.min(s,d);let h=o.maps[d];if(p.step){let m=e.steps[d].invert(e.docs[d]),x=p.selection&&p.selection.map(o.slice(l+1,d));x&&a++,r.push(new Qe(h,m,x))}else r.push(new Qe(h))},i);let c=[];for(let p=n;p<s;p++)c.push(new Qe(o.maps[p]));let f=this.items.slice(0,i).append(c).append(r),u=new qe(f,a);return u.emptyItemCount()>ow&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let f=s.selection&&s.selection.map(n.slice(r));f&&o++;let u=new Qe(c.invert(),l,f),p,d=i.length-1;(p=i.length&&i[d].merge(u))?i[d]=p:i.push(u)}}else s.map&&r--},this.items.length,0),new qe(ae.from(i.reverse()),o)}}qe.empty=new qe(ae.empty,0);function sw(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class Qe{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Qe(n.getMap().invert(),n,this.selection)}}}class bt{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const aw=20;function lw(t,e,n,r){let i=n.getMeta(_t),o;if(i)return i.historyState;n.getMeta(fw)&&(t=new bt(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(_t))return s.getMeta(_t).redo?new bt(t.done.addTransform(n,void 0,r,mi(e)),t.undone,Jc(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new bt(t.done,t.undone.addTransform(n,void 0,r,mi(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!cw(n,t.prevRanges)),c=s?Bo(t.prevRanges,n.mapping):Jc(n.mapping.maps[n.steps.length-1]);return new bt(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,mi(e)),qe.empty,c,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new bt(t.done.rebased(n,o),t.undone.rebased(n,o),Bo(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new bt(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Bo(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function cw(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function Jc(t){let e=[];return t.forEach((n,r,i,o)=>e.push(i,o)),e}function Bo(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function Bp(t,e,n,r){let i=mi(e),o=_t.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,i);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),o,i),c=new bt(r?l:s.remaining,r?s.remaining:l,null,0,-1);n(s.transform.setSelection(a).setMeta(_t,{redo:r,historyState:c}).scrollIntoView())}let zo=!1,Gc=null;function mi(t){let e=t.plugins;if(Gc!=e){zo=!1,Gc=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){zo=!0;break}}return zo}const _t=new lt("history"),fw=new lt("closeHistory");function uw(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new ze({key:_t,state:{init(){return new bt(qe.empty,qe.empty,null,0,-1)},apply(e,n,r){return lw(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?zp:r=="historyRedo"?Hp:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const zp=(t,e)=>{let n=_t.getState(t);return!n||n.done.eventCount==0?!1:(e&&Bp(n,t,e,!1),!0)},Hp=(t,e)=>{let n=_t.getState(t);return!n||n.undone.eventCount==0?!1:(e&&Bp(n,t,e,!0),!0)},pw=Be.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>zp(t,e),redo:()=>({state:t,dispatch:e})=>Hp(t,e)}},addProseMirrorPlugins(){return[uw(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()}}}),dw=xn.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Vt(this.options.HTMLAttributes,t),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)}}}),hw=xn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Vt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),mw=Be.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new ze({key:new lt("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const o=t.type.createAndFill(),s=(o==null?void 0:o.sameMarkup(t))&&o.content.findDiffStart(t.content)===null;return t.descendants((a,l)=>{const c=r>=l&&r<=l+a.nodeSize,f=!a.isLeaf&&!a.childCount;if((c||!this.options.showOnlyCurrent)&&f){const u=[this.options.emptyNodeClass];s&&u.push(this.options.emptyEditorClass);const p=Ee.node(l,l+a.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:c}):this.options.placeholder});i.push(p)}return this.options.includeChildren}),re.create(t,i)}}})]}}),gw=xn.create({name:"text",group:"inline"});/**!
93
+ * @fileOverview Kickass library to create and place poppers near their reference elements.
94
+ * @version 1.16.1
95
+ * @license
96
+ * Copyright (c) 2016 Federico Zivolo and contributors
97
+ *
98
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
99
+ * of this software and associated documentation files (the "Software"), to deal
100
+ * in the Software without restriction, including without limitation the rights
101
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
102
+ * copies of the Software, and to permit persons to whom the Software is
103
+ * furnished to do so, subject to the following conditions:
104
+ *
105
+ * The above copyright notice and this permission notice shall be included in all
106
+ * copies or substantial portions of the Software.
107
+ *
108
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
109
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
110
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
111
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
112
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
113
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
114
+ * SOFTWARE.
115
+ */var Br=typeof window<"u"&&typeof document<"u"&&typeof navigator<"u",yw=function(){for(var t=["Edge","Trident","Firefox"],e=0;e<t.length;e+=1)if(Br&&navigator.userAgent.indexOf(t[e])>=0)return 1;return 0}();function vw(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then(function(){e=!1,t()}))}}function bw(t){var e=!1;return function(){e||(e=!0,setTimeout(function(){e=!1,t()},yw))}}var xw=Br&&window.Promise,ww=xw?vw:bw;function jp(t){var e={};return t&&e.toString.call(t)==="[object Function]"}function wn(t,e){if(t.nodeType!==1)return[];var n=t.ownerDocument.defaultView,r=n.getComputedStyle(t,null);return e?r[e]:r}function Da(t){return t.nodeName==="HTML"?t:t.parentNode||t.host}function zr(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=wn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?t:zr(Da(t))}function Wp(t){return t&&t.referenceNode?t.referenceNode:t}var Yc=Br&&!!(window.MSInputMethodContext&&document.documentMode),Xc=Br&&/MSIE 10/.test(navigator.userAgent);function Qn(t){return t===11?Yc:t===10?Xc:Yc||Xc}function Un(t){if(!t)return document.documentElement;for(var e=Qn(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var r=n&&n.nodeName;return!r||r==="BODY"||r==="HTML"?t?t.ownerDocument.documentElement:document.documentElement:["TH","TD","TABLE"].indexOf(n.nodeName)!==-1&&wn(n,"position")==="static"?Un(n):n}function Sw(t){var e=t.nodeName;return e==="BODY"?!1:e==="HTML"||Un(t.firstElementChild)===t}function Ls(t){return t.parentNode!==null?Ls(t.parentNode):t}function Vi(t,e){if(!t||!t.nodeType||!e||!e.nodeType)return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?t:e,i=n?e:t,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var s=o.commonAncestorContainer;if(t!==s&&e!==s||r.contains(i))return Sw(s)?s:Un(s);var a=Ls(t);return a.host?Vi(a.host,e):Vi(t,Ls(e).host)}function qn(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"top",n=e==="top"?"scrollTop":"scrollLeft",r=t.nodeName;if(r==="BODY"||r==="HTML"){var i=t.ownerDocument.documentElement,o=t.ownerDocument.scrollingElement||i;return o[n]}return t[n]}function kw(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=qn(e,"top"),i=qn(e,"left"),o=n?-1:1;return t.top+=r*o,t.bottom+=r*o,t.left+=i*o,t.right+=i*o,t}function Zc(t,e){var n=e==="x"?"Left":"Top",r=n==="Left"?"Right":"Bottom";return parseFloat(t["border"+n+"Width"])+parseFloat(t["border"+r+"Width"])}function Qc(t,e,n,r){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],Qn(10)?parseInt(n["offset"+t])+parseInt(r["margin"+(t==="Height"?"Top":"Left")])+parseInt(r["margin"+(t==="Height"?"Bottom":"Right")]):0)}function Vp(t){var e=t.body,n=t.documentElement,r=Qn(10)&&getComputedStyle(n);return{height:Qc("Height",e,n,r),width:Qc("Width",e,n,r)}}var Cw=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Ow=function(){function t(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Kn=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},Re=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};function Bt(t){return Re({},t,{right:t.left+t.width,bottom:t.top+t.height})}function $s(t){var e={};try{if(Qn(10)){e=t.getBoundingClientRect();var n=qn(t,"top"),r=qn(t,"left");e.top+=n,e.left+=r,e.bottom+=n,e.right+=r}else e=t.getBoundingClientRect()}catch{}var i={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},o=t.nodeName==="HTML"?Vp(t.ownerDocument):{},s=o.width||t.clientWidth||i.width,a=o.height||t.clientHeight||i.height,l=t.offsetWidth-s,c=t.offsetHeight-a;if(l||c){var f=wn(t);l-=Zc(f,"x"),c-=Zc(f,"y"),i.width-=l,i.height-=c}return Bt(i)}function _a(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=Qn(10),i=e.nodeName==="HTML",o=$s(t),s=$s(e),a=zr(t),l=wn(e),c=parseFloat(l.borderTopWidth),f=parseFloat(l.borderLeftWidth);n&&i&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var u=Bt({top:o.top-s.top-c,left:o.left-s.left-f,width:o.width,height:o.height});if(u.marginTop=0,u.marginLeft=0,!r&&i){var p=parseFloat(l.marginTop),d=parseFloat(l.marginLeft);u.top-=c-p,u.bottom-=c-p,u.left-=f-d,u.right-=f-d,u.marginTop=p,u.marginLeft=d}return(r&&!n?e.contains(a):e===a&&a.nodeName!=="BODY")&&(u=kw(u,e)),u}function Mw(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=t.ownerDocument.documentElement,r=_a(t,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),s=e?0:qn(n),a=e?0:qn(n,"left"),l={top:s-r.top+r.marginTop,left:a-r.left+r.marginLeft,width:i,height:o};return Bt(l)}function Up(t){var e=t.nodeName;if(e==="BODY"||e==="HTML")return!1;if(wn(t,"position")==="fixed")return!0;var n=Da(t);return n?Up(n):!1}function qp(t){if(!t||!t.parentElement||Qn())return document.documentElement;for(var e=t.parentElement;e&&wn(e,"transform")==="none";)e=e.parentElement;return e||document.documentElement}function Pa(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,o={top:0,left:0},s=i?qp(t):Vi(t,Wp(e));if(r==="viewport")o=Mw(s,i);else{var a=void 0;r==="scrollParent"?(a=zr(Da(e)),a.nodeName==="BODY"&&(a=t.ownerDocument.documentElement)):r==="window"?a=t.ownerDocument.documentElement:a=r;var l=_a(a,s,i);if(a.nodeName==="HTML"&&!Up(s)){var c=Vp(t.ownerDocument),f=c.height,u=c.width;o.top+=l.top-l.marginTop,o.bottom=f+l.top,o.left+=l.left-l.marginLeft,o.right=u+l.left}else o=l}n=n||0;var p=typeof n=="number";return o.left+=p?n:n.left||0,o.top+=p?n:n.top||0,o.right-=p?n:n.right||0,o.bottom-=p?n:n.bottom||0,o}function Ew(t){var e=t.width,n=t.height;return e*n}function Kp(t,e,n,r,i){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(t.indexOf("auto")===-1)return t;var s=Pa(n,r,o,i),a={top:{width:s.width,height:e.top-s.top},right:{width:s.right-e.right,height:s.height},bottom:{width:s.width,height:s.bottom-e.bottom},left:{width:e.left-s.left,height:s.height}},l=Object.keys(a).map(function(p){return Re({key:p},a[p],{area:Ew(a[p])})}).sort(function(p,d){return d.area-p.area}),c=l.filter(function(p){var d=p.width,h=p.height;return d>=n.clientWidth&&h>=n.clientHeight}),f=c.length>0?c[0].key:l[0].key,u=t.split("-")[1];return f+(u?"-"+u:"")}function Jp(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,i=r?qp(e):Vi(e,Wp(n));return _a(n,i,r)}function Gp(t){var e=t.ownerDocument.defaultView,n=e.getComputedStyle(t),r=parseFloat(n.marginTop||0)+parseFloat(n.marginBottom||0),i=parseFloat(n.marginLeft||0)+parseFloat(n.marginRight||0),o={width:t.offsetWidth+i,height:t.offsetHeight+r};return o}function Ui(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(n){return e[n]})}function Yp(t,e,n){n=n.split("-")[0];var r=Gp(t),i={width:r.width,height:r.height},o=["right","left"].indexOf(n)!==-1,s=o?"top":"left",a=o?"left":"top",l=o?"height":"width",c=o?"width":"height";return i[s]=e[s]+e[l]/2-r[l]/2,n===a?i[a]=e[a]-r[c]:i[a]=e[Ui(a)],i}function Hr(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function Tw(t,e,n){if(Array.prototype.findIndex)return t.findIndex(function(i){return i[e]===n});var r=Hr(t,function(i){return i[e]===n});return t.indexOf(r)}function Xp(t,e,n){var r=n===void 0?t:t.slice(0,Tw(t,"name",n));return r.forEach(function(i){i.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var o=i.function||i.fn;i.enabled&&jp(o)&&(e.offsets.popper=Bt(e.offsets.popper),e.offsets.reference=Bt(e.offsets.reference),e=o(e,i))}),e}function Nw(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=Jp(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=Kp(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=Yp(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=Xp(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function Zp(t,e){return t.some(function(n){var r=n.name,i=n.enabled;return i&&r===e})}function Ra(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),r=0;r<e.length;r++){var i=e[r],o=i?""+i+n:t;if(typeof document.body.style[o]<"u")return o}return null}function Aw(){return this.state.isDestroyed=!0,Zp(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[Ra("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function Qp(t){var e=t.ownerDocument;return e?e.defaultView:window}function ed(t,e,n,r){var i=t.nodeName==="BODY",o=i?t.ownerDocument.defaultView:t;o.addEventListener(e,n,{passive:!0}),i||ed(zr(o.parentNode),e,n,r),r.push(o)}function Iw(t,e,n,r){n.updateBound=r,Qp(t).addEventListener("resize",n.updateBound,{passive:!0});var i=zr(t);return ed(i,"scroll",n.updateBound,n.scrollParents),n.scrollElement=i,n.eventsEnabled=!0,n}function Dw(){this.state.eventsEnabled||(this.state=Iw(this.reference,this.options,this.state,this.scheduleUpdate))}function _w(t,e){return Qp(t).removeEventListener("resize",e.updateBound),e.scrollParents.forEach(function(n){n.removeEventListener("scroll",e.updateBound)}),e.updateBound=null,e.scrollParents=[],e.scrollElement=null,e.eventsEnabled=!1,e}function Pw(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=_w(this.reference,this.state))}function La(t){return t!==""&&!isNaN(parseFloat(t))&&isFinite(t)}function Fs(t,e){Object.keys(e).forEach(function(n){var r="";["width","height","top","right","bottom","left"].indexOf(n)!==-1&&La(e[n])&&(r="px"),t.style[n]=e[n]+r})}function Rw(t,e){Object.keys(e).forEach(function(n){var r=e[n];r!==!1?t.setAttribute(n,e[n]):t.removeAttribute(n)})}function Lw(t){return Fs(t.instance.popper,t.styles),Rw(t.instance.popper,t.attributes),t.arrowElement&&Object.keys(t.arrowStyles).length&&Fs(t.arrowElement,t.arrowStyles),t}function $w(t,e,n,r,i){var o=Jp(i,e,t,n.positionFixed),s=Kp(n.placement,o,e,t,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return e.setAttribute("x-placement",s),Fs(e,{position:n.positionFixed?"fixed":"absolute"}),n}function Fw(t,e){var n=t.offsets,r=n.popper,i=n.reference,o=Math.round,s=Math.floor,a=function(w){return w},l=o(i.width),c=o(r.width),f=["left","right"].indexOf(t.placement)!==-1,u=t.placement.indexOf("-")!==-1,p=l%2===c%2,d=l%2===1&&c%2===1,h=e?f||u||p?o:s:a,m=e?o:a;return{left:h(d&&!u&&e?r.left-1:r.left),top:m(r.top),bottom:m(r.bottom),right:h(r.right)}}var Bw=Br&&/Firefox/i.test(navigator.userAgent);function zw(t,e){var n=e.x,r=e.y,i=t.offsets.popper,o=Hr(t.instance.modifiers,function(O){return O.name==="applyStyle"}).gpuAcceleration;o!==void 0&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var s=o!==void 0?o:e.gpuAcceleration,a=Un(t.instance.popper),l=$s(a),c={position:i.position},f=Fw(t,window.devicePixelRatio<2||!Bw),u=n==="bottom"?"top":"bottom",p=r==="right"?"left":"right",d=Ra("transform"),h=void 0,m=void 0;if(u==="bottom"?a.nodeName==="HTML"?m=-a.clientHeight+f.bottom:m=-l.height+f.bottom:m=f.top,p==="right"?a.nodeName==="HTML"?h=-a.clientWidth+f.right:h=-l.width+f.right:h=f.left,s&&d)c[d]="translate3d("+h+"px, "+m+"px, 0)",c[u]=0,c[p]=0,c.willChange="transform";else{var x=u==="bottom"?-1:1,w=p==="right"?-1:1;c[u]=m*x,c[p]=h*w,c.willChange=u+", "+p}var M={"x-placement":t.placement};return t.attributes=Re({},M,t.attributes),t.styles=Re({},c,t.styles),t.arrowStyles=Re({},t.offsets.arrow,t.arrowStyles),t}function td(t,e,n){var r=Hr(t,function(a){var l=a.name;return l===e}),i=!!r&&t.some(function(a){return a.name===n&&a.enabled&&a.order<r.order});if(!i){var o="`"+e+"`",s="`"+n+"`";console.warn(s+" modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")}return i}function Hw(t,e){var n;if(!td(t.instance.modifiers,"arrow","keepTogether"))return t;var r=e.element;if(typeof r=="string"){if(r=t.instance.popper.querySelector(r),!r)return t}else if(!t.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var i=t.placement.split("-")[0],o=t.offsets,s=o.popper,a=o.reference,l=["left","right"].indexOf(i)!==-1,c=l?"height":"width",f=l?"Top":"Left",u=f.toLowerCase(),p=l?"left":"top",d=l?"bottom":"right",h=Gp(r)[c];a[d]-h<s[u]&&(t.offsets.popper[u]-=s[u]-(a[d]-h)),a[u]+h>s[d]&&(t.offsets.popper[u]+=a[u]+h-s[d]),t.offsets.popper=Bt(t.offsets.popper);var m=a[u]+a[c]/2-h/2,x=wn(t.instance.popper),w=parseFloat(x["margin"+f]),M=parseFloat(x["border"+f+"Width"]),O=m-t.offsets.popper[u]-w-M;return O=Math.max(Math.min(s[c]-h,O),0),t.arrowElement=r,t.offsets.arrow=(n={},Kn(n,u,Math.round(O)),Kn(n,p,""),n),t}function jw(t){return t==="end"?"start":t==="start"?"end":t}var nd=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],Ho=nd.slice(3);function ef(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=Ho.indexOf(t),r=Ho.slice(n+1).concat(Ho.slice(0,n));return e?r.reverse():r}var jo={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function Ww(t,e){if(Zp(t.instance.modifiers,"inner")||t.flipped&&t.placement===t.originalPlacement)return t;var n=Pa(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),r=t.placement.split("-")[0],i=Ui(r),o=t.placement.split("-")[1]||"",s=[];switch(e.behavior){case jo.FLIP:s=[r,i];break;case jo.CLOCKWISE:s=ef(r);break;case jo.COUNTERCLOCKWISE:s=ef(r,!0);break;default:s=e.behavior}return s.forEach(function(a,l){if(r!==a||s.length===l+1)return t;r=t.placement.split("-")[0],i=Ui(r);var c=t.offsets.popper,f=t.offsets.reference,u=Math.floor,p=r==="left"&&u(c.right)>u(f.left)||r==="right"&&u(c.left)<u(f.right)||r==="top"&&u(c.bottom)>u(f.top)||r==="bottom"&&u(c.top)<u(f.bottom),d=u(c.left)<u(n.left),h=u(c.right)>u(n.right),m=u(c.top)<u(n.top),x=u(c.bottom)>u(n.bottom),w=r==="left"&&d||r==="right"&&h||r==="top"&&m||r==="bottom"&&x,M=["top","bottom"].indexOf(r)!==-1,O=!!e.flipVariations&&(M&&o==="start"&&d||M&&o==="end"&&h||!M&&o==="start"&&m||!M&&o==="end"&&x),K=!!e.flipVariationsByContent&&(M&&o==="start"&&h||M&&o==="end"&&d||!M&&o==="start"&&x||!M&&o==="end"&&m),F=O||K;(p||w||F)&&(t.flipped=!0,(p||w)&&(r=s[l+1]),F&&(o=jw(o)),t.placement=r+(o?"-"+o:""),t.offsets.popper=Re({},t.offsets.popper,Yp(t.instance.popper,t.offsets.reference,t.placement)),t=Xp(t.instance.modifiers,t,"flip"))}),t}function Vw(t){var e=t.offsets,n=e.popper,r=e.reference,i=t.placement.split("-")[0],o=Math.floor,s=["top","bottom"].indexOf(i)!==-1,a=s?"right":"bottom",l=s?"left":"top",c=s?"width":"height";return n[a]<o(r[l])&&(t.offsets.popper[l]=o(r[l])-n[c]),n[l]>o(r[a])&&(t.offsets.popper[l]=o(r[a])),t}function Uw(t,e,n,r){var i=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],s=i[2];if(!o)return t;if(s.indexOf("%")===0){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=r}var l=Bt(a);return l[e]/100*o}else if(s==="vh"||s==="vw"){var c=void 0;return s==="vh"?c=Math.max(document.documentElement.clientHeight,window.innerHeight||0):c=Math.max(document.documentElement.clientWidth,window.innerWidth||0),c/100*o}else return o}function qw(t,e,n,r){var i=[0,0],o=["right","left"].indexOf(r)!==-1,s=t.split(/(\+|\-)/).map(function(f){return f.trim()}),a=s.indexOf(Hr(s,function(f){return f.search(/,|\s/)!==-1}));s[a]&&s[a].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=a!==-1?[s.slice(0,a).concat([s[a].split(l)[0]]),[s[a].split(l)[1]].concat(s.slice(a+1))]:[s];return c=c.map(function(f,u){var p=(u===1?!o:o)?"height":"width",d=!1;return f.reduce(function(h,m){return h[h.length-1]===""&&["+","-"].indexOf(m)!==-1?(h[h.length-1]=m,d=!0,h):d?(h[h.length-1]+=m,d=!1,h):h.concat(m)},[]).map(function(h){return Uw(h,p,e,n)})}),c.forEach(function(f,u){f.forEach(function(p,d){La(p)&&(i[u]+=p*(f[d-1]==="-"?-1:1))})}),i}function Kw(t,e){var n=e.offset,r=t.placement,i=t.offsets,o=i.popper,s=i.reference,a=r.split("-")[0],l=void 0;return La(+n)?l=[+n,0]:l=qw(n,o,s,a),a==="left"?(o.top+=l[0],o.left-=l[1]):a==="right"?(o.top+=l[0],o.left+=l[1]):a==="top"?(o.left+=l[0],o.top-=l[1]):a==="bottom"&&(o.left+=l[0],o.top+=l[1]),t.popper=o,t}function Jw(t,e){var n=e.boundariesElement||Un(t.instance.popper);t.instance.reference===n&&(n=Un(n));var r=Ra("transform"),i=t.instance.popper.style,o=i.top,s=i.left,a=i[r];i.top="",i.left="",i[r]="";var l=Pa(t.instance.popper,t.instance.reference,e.padding,n,t.positionFixed);i.top=o,i.left=s,i[r]=a,e.boundaries=l;var c=e.priority,f=t.offsets.popper,u={primary:function(d){var h=f[d];return f[d]<l[d]&&!e.escapeWithReference&&(h=Math.max(f[d],l[d])),Kn({},d,h)},secondary:function(d){var h=d==="right"?"left":"top",m=f[h];return f[d]>l[d]&&!e.escapeWithReference&&(m=Math.min(f[h],l[d]-(d==="right"?f.width:f.height))),Kn({},h,m)}};return c.forEach(function(p){var d=["left","top"].indexOf(p)!==-1?"primary":"secondary";f=Re({},f,u[d](p))}),t.offsets.popper=f,t}function Gw(t){var e=t.placement,n=e.split("-")[0],r=e.split("-")[1];if(r){var i=t.offsets,o=i.reference,s=i.popper,a=["bottom","top"].indexOf(n)!==-1,l=a?"left":"top",c=a?"width":"height",f={start:Kn({},l,o[l]),end:Kn({},l,o[l]+o[c]-s[c])};t.offsets.popper=Re({},s,f[r])}return t}function Yw(t){if(!td(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=Hr(t.instance.modifiers,function(r){return r.name==="preventOverflow"}).boundaries;if(e.bottom<n.top||e.left>n.right||e.top>n.bottom||e.right<n.left){if(t.hide===!0)return t;t.hide=!0,t.attributes["x-out-of-boundaries"]=""}else{if(t.hide===!1)return t;t.hide=!1,t.attributes["x-out-of-boundaries"]=!1}return t}function Xw(t){var e=t.placement,n=e.split("-")[0],r=t.offsets,i=r.popper,o=r.reference,s=["left","right"].indexOf(n)!==-1,a=["top","left"].indexOf(n)===-1;return i[s?"left":"top"]=o[n]-(a?i[s?"width":"height"]:0),t.placement=Ui(e),t.offsets.popper=Bt(i),t}var Zw={shift:{order:100,enabled:!0,fn:Gw},offset:{order:200,enabled:!0,fn:Kw,offset:0},preventOverflow:{order:300,enabled:!0,fn:Jw,priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:Vw},arrow:{order:500,enabled:!0,fn:Hw,element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:Ww,behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:Xw},hide:{order:800,enabled:!0,fn:Yw},computeStyle:{order:850,enabled:!0,fn:zw,gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:Lw,onLoad:$w,gpuAcceleration:void 0}},Qw={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:Zw},oo=function(){function t(e,n){var r=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Cw(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=ww(this.update.bind(this)),this.options=Re({},t.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(Re({},t.Defaults.modifiers,i.modifiers)).forEach(function(s){r.options.modifiers[s]=Re({},t.Defaults.modifiers[s]||{},i.modifiers?i.modifiers[s]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(s){return Re({name:s},r.options.modifiers[s])}).sort(function(s,a){return s.order-a.order}),this.modifiers.forEach(function(s){s.enabled&&jp(s.onLoad)&&s.onLoad(r.reference,r.popper,r.options,s,r.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return Ow(t,[{key:"update",value:function(){return Nw.call(this)}},{key:"destroy",value:function(){return Aw.call(this)}},{key:"enableEventListeners",value:function(){return Dw.call(this)}},{key:"disableEventListeners",value:function(){return Pw.call(this)}}]),t}();oo.Utils=(typeof window<"u"?window:global).PopperUtils;oo.placements=nd;oo.Defaults=Qw;const e1=oo;var t1='.tippy-iOS{cursor:pointer!important;-webkit-tap-highlight-color:transparent}.tippy-popper{transition-timing-function:cubic-bezier(.165,.84,.44,1);max-width:calc(100% - 8px);pointer-events:none;outline:0}.tippy-popper[x-placement^=top] .tippy-backdrop{border-radius:40% 40% 0 0}.tippy-popper[x-placement^=top] .tippy-roundarrow{bottom:-7px;bottom:-6.5px;-webkit-transform-origin:50% 0;transform-origin:50% 0;margin:0 3px}.tippy-popper[x-placement^=top] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.tippy-popper[x-placement^=top] .tippy-arrow{border-top:8px solid #333;border-right:8px solid transparent;border-left:8px solid transparent;bottom:-7px;margin:0 3px;-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=top] .tippy-backdrop{-webkit-transform-origin:0 25%;transform-origin:0 25%}.tippy-popper[x-placement^=top] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-55%);transform:scale(1) translate(-50%,-55%)}.tippy-popper[x-placement^=top] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-50%,-45%);transform:scale(.2) translate(-50%,-45%);opacity:0}.tippy-popper[x-placement^=top] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}.tippy-popper[x-placement^=top] [data-animation=perspective]{-webkit-transform-origin:bottom;transform-origin:bottom}.tippy-popper[x-placement^=top] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateY(-10px);transform:perspective(700px) translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) rotateX(60deg);transform:perspective(700px) rotateX(60deg)}.tippy-popper[x-placement^=top] [data-animation=fade][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-away][data-state=hidden]{opacity:0}.tippy-popper[x-placement^=top] [data-animation=scale]{-webkit-transform-origin:bottom;transform-origin:bottom}.tippy-popper[x-placement^=top] [data-animation=scale][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateY(-10px) scale(.5);transform:translateY(-10px) scale(.5)}.tippy-popper[x-placement^=bottom] .tippy-backdrop{border-radius:0 0 30% 30%}.tippy-popper[x-placement^=bottom] .tippy-roundarrow{top:-7px;-webkit-transform-origin:50% 100%;transform-origin:50% 100%;margin:0 3px}.tippy-popper[x-placement^=bottom] .tippy-roundarrow svg{position:absolute;left:0}.tippy-popper[x-placement^=bottom] .tippy-arrow{border-bottom:8px solid #333;border-right:8px solid transparent;border-left:8px solid transparent;top:-7px;margin:0 3px;-webkit-transform-origin:50% 100%;transform-origin:50% 100%}.tippy-popper[x-placement^=bottom] .tippy-backdrop{-webkit-transform-origin:0 -50%;transform-origin:0 -50%}.tippy-popper[x-placement^=bottom] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-45%);transform:scale(1) translate(-50%,-45%)}.tippy-popper[x-placement^=bottom] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-50%);transform:scale(.2) translate(-50%);opacity:0}.tippy-popper[x-placement^=bottom] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}.tippy-popper[x-placement^=bottom] [data-animation=perspective]{-webkit-transform-origin:top;transform-origin:top}.tippy-popper[x-placement^=bottom] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateY(10px);transform:perspective(700px) translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) rotateX(-60deg);transform:perspective(700px) rotateX(-60deg)}.tippy-popper[x-placement^=bottom] [data-animation=fade][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-away][data-state=hidden]{opacity:0}.tippy-popper[x-placement^=bottom] [data-animation=scale]{-webkit-transform-origin:top;transform-origin:top}.tippy-popper[x-placement^=bottom] [data-animation=scale][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateY(10px) scale(.5);transform:translateY(10px) scale(.5)}.tippy-popper[x-placement^=left] .tippy-backdrop{border-radius:50% 0 0 50%}.tippy-popper[x-placement^=left] .tippy-roundarrow{right:-12px;-webkit-transform-origin:33.33333333% 50%;transform-origin:33.33333333% 50%;margin:3px 0}.tippy-popper[x-placement^=left] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.tippy-popper[x-placement^=left] .tippy-arrow{border-left:8px solid #333;border-top:8px solid transparent;border-bottom:8px solid transparent;right:-7px;margin:3px 0;-webkit-transform-origin:0 50%;transform-origin:0 50%}.tippy-popper[x-placement^=left] .tippy-backdrop{-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=left] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}.tippy-popper[x-placement^=left] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-75%,-50%);transform:scale(.2) translate(-75%,-50%);opacity:0}.tippy-popper[x-placement^=left] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateX(-20px);transform:translateX(-20px)}.tippy-popper[x-placement^=left] [data-animation=perspective]{-webkit-transform-origin:right;transform-origin:right}.tippy-popper[x-placement^=left] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateX(-10px);transform:perspective(700px) translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) rotateY(-60deg);transform:perspective(700px) rotateY(-60deg)}.tippy-popper[x-placement^=left] [data-animation=fade][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-away][data-state=hidden]{opacity:0}.tippy-popper[x-placement^=left] [data-animation=scale]{-webkit-transform-origin:right;transform-origin:right}.tippy-popper[x-placement^=left] [data-animation=scale][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateX(-10px) scale(.5);transform:translateX(-10px) scale(.5)}.tippy-popper[x-placement^=right] .tippy-backdrop{border-radius:0 50% 50% 0}.tippy-popper[x-placement^=right] .tippy-roundarrow{left:-12px;-webkit-transform-origin:66.66666666% 50%;transform-origin:66.66666666% 50%;margin:3px 0}.tippy-popper[x-placement^=right] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.tippy-popper[x-placement^=right] .tippy-arrow{border-right:8px solid #333;border-top:8px solid transparent;border-bottom:8px solid transparent;left:-7px;margin:3px 0;-webkit-transform-origin:100% 50%;transform-origin:100% 50%}.tippy-popper[x-placement^=right] .tippy-backdrop{-webkit-transform-origin:-50% 0;transform-origin:-50% 0}.tippy-popper[x-placement^=right] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}.tippy-popper[x-placement^=right] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-25%,-50%);transform:scale(.2) translate(-25%,-50%);opacity:0}.tippy-popper[x-placement^=right] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateX(20px);transform:translateX(20px)}.tippy-popper[x-placement^=right] [data-animation=perspective]{-webkit-transform-origin:left;transform-origin:left}.tippy-popper[x-placement^=right] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateX(10px);transform:perspective(700px) translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) rotateY(60deg);transform:perspective(700px) rotateY(60deg)}.tippy-popper[x-placement^=right] [data-animation=fade][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-away][data-state=hidden]{opacity:0}.tippy-popper[x-placement^=right] [data-animation=scale]{-webkit-transform-origin:left;transform-origin:left}.tippy-popper[x-placement^=right] [data-animation=scale][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateX(10px) scale(.5);transform:translateX(10px) scale(.5)}.tippy-tooltip{position:relative;color:#fff;border-radius:.25rem;font-size:.875rem;padding:.3125rem .5625rem;line-height:1.4;text-align:center;background-color:#333}.tippy-tooltip[data-size=small]{padding:.1875rem .375rem;font-size:.75rem}.tippy-tooltip[data-size=large]{padding:.375rem .75rem;font-size:1rem}.tippy-tooltip[data-animatefill]{overflow:hidden;background-color:initial}.tippy-tooltip[data-interactive],.tippy-tooltip[data-interactive] .tippy-roundarrow path{pointer-events:auto}.tippy-tooltip[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-tooltip[data-inertia][data-state=hidden]{transition-timing-function:ease}.tippy-arrow,.tippy-roundarrow{position:absolute;width:0;height:0}.tippy-roundarrow{width:18px;height:7px;fill:#333;pointer-events:none}.tippy-backdrop{position:absolute;background-color:#333;border-radius:50%;width:calc(110% + 2rem);left:50%;top:50%;z-index:-1;transition:all cubic-bezier(.46,.1,.52,.98);-webkit-backface-visibility:hidden;backface-visibility:hidden}.tippy-backdrop:after{content:"";float:left;padding-top:100%}.tippy-backdrop+.tippy-content{transition-property:opacity;will-change:opacity}.tippy-backdrop+.tippy-content[data-state=hidden]{opacity:0}';function ve(){return ve=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ve.apply(this,arguments)}var n1="4.3.5",jr=typeof window<"u"&&typeof document<"u",rd=jr?navigator.userAgent:"",tf=/MSIE |Trident\//.test(rd),id=/UCBrowser\//.test(rd),od=jr&&/iPhone|iPad|iPod/.test(navigator.platform)&&!window.MSStream,tt={a11y:!0,allowHTML:!0,animateFill:!0,animation:"shift-away",appendTo:function(){return document.body},aria:"describedby",arrow:!1,arrowType:"sharp",boundary:"scrollParent",content:"",delay:0,distance:10,duration:[325,275],flip:!0,flipBehavior:"flip",flipOnUpdate:!1,followCursor:!1,hideOnClick:!0,ignoreAttributes:!1,inertia:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,lazy:!0,maxWidth:350,multiple:!1,offset:0,onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},placement:"top",popperOptions:{},role:"tooltip",showOnInit:!1,size:"regular",sticky:!1,target:"",theme:"dark",touch:!0,touchHold:!1,trigger:"mouseenter focus",triggerTarget:null,updateDuration:0,wait:null,zIndex:9999},r1=["arrow","arrowType","boundary","distance","flip","flipBehavior","flipOnUpdate","offset","placement","popperOptions"],lr=jr?Element.prototype:{},$a=lr.matches||lr.matchesSelector||lr.webkitMatchesSelector||lr.mozMatchesSelector||lr.msMatchesSelector;function Dr(t){return[].slice.call(t)}function oi(t,e){return Bs(t,function(n){return $a.call(n,e)})}function Bs(t,e){for(;t;){if(e(t))return t;t=t.parentElement}return null}var zs={passive:!0},Wo=4,Hs="x-placement",Vo="x-out-of-boundaries",sd="tippy-iOS",nf="tippy-active",ad="tippy-popper",ld="tippy-tooltip",cd="tippy-content",fd="tippy-backdrop",ud="tippy-arrow",pd="tippy-roundarrow",Fa=".".concat(ad),i1=".".concat(ld),o1=".".concat(cd),s1=".".concat(fd),a1=".".concat(ud),l1=".".concat(pd),St=!1;function c1(){St||(St=!0,od&&document.body.classList.add(sd),window.performance&&document.addEventListener("mousemove",dd))}var rf=0;function dd(){var t=performance.now();t-rf<20&&(St=!1,document.removeEventListener("mousemove",dd),od||document.body.classList.remove(sd)),rf=t}function f1(){var t=document,e=t.activeElement;e&&e.blur&&e._tippy&&e.blur()}function u1(){document.addEventListener("touchstart",c1,zs),window.addEventListener("blur",f1)}var p1=Object.keys(tt);function d1(t){return p1.reduce(function(e,n){var r=(t.getAttribute("data-tippy-".concat(n))||"").trim();if(!r)return e;if(n==="content")e[n]=r;else try{e[n]=JSON.parse(r)}catch{e[n]=r}return e},{})}function h1(t){var e={isVirtual:!0,attributes:t.attributes||{},contains:function(){},setAttribute:function(i,o){t.attributes[i]=o},getAttribute:function(i){return t.attributes[i]},removeAttribute:function(i){delete t.attributes[i]},hasAttribute:function(i){return i in t.attributes},addEventListener:function(){},removeEventListener:function(){},classList:{classNames:{},add:function(i){t.classList.classNames[i]=!0},remove:function(i){delete t.classList.classNames[i]},contains:function(i){return i in t.classList.classNames}}};for(var n in e)t[n]=e[n]}function m1(t){return{}.toString.call(t)==="[object Object]"&&!t.addEventListener}function g1(t){return!!t._tippy&&!$a.call(t,Fa)}function qi(t,e){return{}.hasOwnProperty.call(t,e)}function y1(t){if(hd(t))return[t];if(t instanceof NodeList)return Dr(t);if(Array.isArray(t))return t;try{return Dr(document.querySelectorAll(t))}catch{return[]}}function si(t,e,n){if(Array.isArray(t)){var r=t[e];return r??n}return t}function of(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function ai(t,e){return t&&t.modifiers&&t.modifiers[e]}function Uo(t,e){return t.indexOf(e)>-1}function Wr(t){return t instanceof Element}function hd(t){return!!(t&&qi(t,"isVirtual"))||Wr(t)}function sf(){return"innerHTML"}function js(t,e){return typeof t=="function"?t.apply(null,e):t}function af(t,e){t.filter(function(n){return n.name==="flip"})[0].enabled=e}function v1(t){return Wr(t)?$a.call(t,"a[href],area[href],button,details,input,textarea,select,iframe,[tabindex]")&&!t.hasAttribute("disabled"):!0}function xr(){return document.createElement("div")}function cr(t,e){t.forEach(function(n){n&&(n.style.transitionDuration="".concat(e,"ms"))})}function lf(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function cf(t,e){var n=ve({},e,{content:js(e.content,[t])},e.ignoreAttributes?{}:d1(t));return(n.arrow||id)&&(n.animateFill=!1),n}function md(t,e){Object.keys(t).forEach(function(n){if(!qi(e,n))throw new Error("[tippy]: `".concat(n,"` is not a valid option"))})}function gd(t,e){t[sf()]=Wr(e)?e[sf()]:e}function yd(t,e){if(Wr(e.content))gd(t,""),t.appendChild(e.content);else if(typeof e.content!="function"){var n=e.allowHTML?"innerHTML":"textContent";t[n]=e.content}}function Ws(t){return{tooltip:t.querySelector(i1),backdrop:t.querySelector(s1),content:t.querySelector(o1),arrow:t.querySelector(a1)||t.querySelector(l1)}}function vd(t){t.setAttribute("data-inertia","")}function b1(t){t.removeAttribute("data-inertia")}function Vs(t){var e=xr();return t==="round"?(e.className=pd,gd(e,'<svg viewBox="0 0 18 7" xmlns="http://www.w3.org/2000/svg"><path d="M0 7s2.021-.015 5.253-4.218C6.584 1.051 7.797.007 9 0c1.203-.007 2.416 1.035 3.761 2.782C16.012 7.005 18 7 18 7H0z"/></svg>')):e.className=ud,e}function bd(){var t=xr();return t.className=fd,t.setAttribute("data-state","hidden"),t}function xd(t,e){t.setAttribute("tabindex","-1"),e.setAttribute("data-interactive","")}function x1(t,e){t.removeAttribute("tabindex"),e.removeAttribute("data-interactive")}function qo(t,e,n){var r=id&&document.body.style.webkitTransition!==void 0?"webkitTransitionEnd":"transitionend";t[e+"EventListener"](r,n)}function Ko(t){var e=t.getAttribute(Hs);return e?e.split("-")[0]:""}function w1(t){t.offsetHeight}function Us(t,e,n){n.split(" ").forEach(function(r){t.classList[e](r+"-theme")})}function S1(t,e){var n=xr();n.className=ad,n.id="tippy-".concat(t),n.style.zIndex=""+e.zIndex,n.style.position="absolute",n.style.top="0",n.style.left="0",e.role&&n.setAttribute("role",e.role);var r=xr();r.className=ld,r.style.maxWidth=e.maxWidth+(typeof e.maxWidth=="number"?"px":""),r.setAttribute("data-size",e.size),r.setAttribute("data-animation",e.animation),r.setAttribute("data-state","hidden"),Us(r,"add",e.theme);var i=xr();return i.className=cd,i.setAttribute("data-state","hidden"),e.interactive&&xd(n,r),e.arrow&&r.appendChild(Vs(e.arrowType)),e.animateFill&&(r.appendChild(bd()),r.setAttribute("data-animatefill","")),e.inertia&&vd(r),yd(i,e),r.appendChild(i),n.appendChild(r),n}function k1(t,e,n){var r=Ws(t),i=r.tooltip,o=r.content,s=r.backdrop,a=r.arrow;t.style.zIndex=""+n.zIndex,i.setAttribute("data-size",n.size),i.setAttribute("data-animation",n.animation),i.style.maxWidth=n.maxWidth+(typeof n.maxWidth=="number"?"px":""),n.role?t.setAttribute("role",n.role):t.removeAttribute("role"),e.content!==n.content&&yd(o,n),!e.animateFill&&n.animateFill?(i.appendChild(bd()),i.setAttribute("data-animatefill","")):e.animateFill&&!n.animateFill&&(i.removeChild(s),i.removeAttribute("data-animatefill")),!e.arrow&&n.arrow?i.appendChild(Vs(n.arrowType)):e.arrow&&!n.arrow&&i.removeChild(a),e.arrow&&n.arrow&&e.arrowType!==n.arrowType&&i.replaceChild(Vs(n.arrowType),a),!e.interactive&&n.interactive?xd(t,i):e.interactive&&!n.interactive&&x1(t,i),!e.inertia&&n.inertia?vd(i):e.inertia&&!n.inertia&&b1(i),e.theme!==n.theme&&(Us(i,"remove",e.theme),Us(i,"add",n.theme))}function C1(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.exclude,n=t.duration;Dr(document.querySelectorAll(Fa)).forEach(function(r){var i=r._tippy;if(i){var o=!1;e&&(o=g1(e)?i.reference===e:r===e.popper),o||i.hide(n)}})}function O1(t,e,n,r){if(!t)return!0;var i=n.clientX,o=n.clientY,s=r.interactiveBorder,a=r.distance,l=e.top-o>(t==="top"?s+a:s),c=o-e.bottom>(t==="bottom"?s+a:s),f=e.left-i>(t==="left"?s+a:s),u=i-e.right>(t==="right"?s+a:s);return l||c||f||u}function M1(t){return-(t-10)+"px"}var E1=1,li=[];function wd(t,e){var n=cf(t,e);if(!n.multiple&&t._tippy)return null;var r,i,o,s,a,l=!1,c=!1,f,u=!1,p=!1,d,h,m=[],x,w=of(Xe,n.interactiveDebounce),M=E1++,O=S1(M,n),K=Ws(O),F=null,X={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},g={id:M,reference:t,popper:O,popperChildren:K,popperInstance:F,props:n,state:X,clearDelayTimeouts:qr,set:qa,setContent:Ld,show:lo,hide:tr,enable:Pd,disable:Rd,destroy:$d};return t._tippy=g,O._tippy=g,H(),n.lazy||Vr(),n.showOnInit&&Ur(),n.a11y&&!n.target&&!v1(te())&&te().setAttribute("tabindex","0"),O.addEventListener("mouseenter",function(S){g.props.interactive&&g.state.isVisible&&r==="mouseenter"&&Ur(S,!0)}),O.addEventListener("mouseleave",function(){g.props.interactive&&r==="mouseenter"&&document.addEventListener("mousemove",w)}),g;function A(){document.removeEventListener("mousemove",V)}function ce(){document.body.removeEventListener("mouseleave",qt),document.removeEventListener("mousemove",w),li=li.filter(function(S){return S!==w})}function te(){return g.props.triggerTarget||t}function He(){document.addEventListener("click",Ua,!0)}function v(){document.removeEventListener("click",Ua,!0)}function y(){return[g.popperChildren.tooltip,g.popperChildren.backdrop,g.popperChildren.content]}function k(){var S=g.props.followCursor;return S&&r!=="focus"||St&&S==="initial"}function T(){cr([O],tf?0:g.props.updateDuration);var S=t.getBoundingClientRect();function D(){var $=t.getBoundingClientRect();(S.top!==$.top||S.right!==$.right||S.bottom!==$.bottom||S.left!==$.left)&&g.popperInstance.scheduleUpdate(),S=$,g.state.isMounted&&requestAnimationFrame(D)}D()}function _(S,D){P(S,function(){!g.state.isVisible&&O.parentNode&&O.parentNode.contains(O)&&D()})}function z(S,D){P(S,D)}function P(S,D){var $=g.popperChildren.tooltip;function Z(gt){gt.target===$&&(qo($,"remove",Z),D())}if(S===0)return D();qo($,"remove",h),qo($,"add",Z),h=Z}function I(S,D){var $=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;te().addEventListener(S,D,$),m.push({eventType:S,handler:D,options:$})}function H(){g.props.touchHold&&!g.props.target&&(I("touchstart",ge,zs),I("touchend",je,zs)),g.props.trigger.trim().split(" ").forEach(function(S){if(S!=="manual")if(g.props.target)switch(S){case"mouseenter":I("mouseover",kn),I("mouseout",Cn);break;case"focus":I("focusin",kn),I("focusout",Cn);break;case"click":I(S,kn);break}else switch(I(S,ge),S){case"mouseenter":I("mouseleave",je);break;case"focus":I(tf?"focusout":"blur",Ze);break}})}function q(){m.forEach(function(S){var D=S.eventType,$=S.handler,Z=S.options;te().removeEventListener(D,$,Z)}),m=[]}function V(S){var D=i=S,$=D.clientX,Z=D.clientY;if(x){var gt=Bs(S.target,function(Ga){return Ga===t}),Kt=t.getBoundingClientRect(),nr=g.props.followCursor,We=nr==="horizontal",Ie=nr==="vertical",Ve=Uo(["top","bottom"],Ko(O)),ye=O.getAttribute(Hs),ct=ye?!!ye.split("-")[1]:!1,ft=Ve?O.offsetWidth:O.offsetHeight,Kr=ft/2,Ka=Ve?0:ct?ft:Kr,Ja=Ve?ct?ft:Kr:0;(gt||!g.props.interactive)&&(g.popperInstance.reference=ve({},g.popperInstance.reference,{referenceNode:t,clientWidth:0,clientHeight:0,getBoundingClientRect:function(){return{width:Ve?ft:0,height:Ve?0:ft,top:(We?Kt.top:Z)-Ka,bottom:(We?Kt.bottom:Z)+Ka,left:(Ie?Kt.left:$)-Ja,right:(Ie?Kt.right:$)+Ja}}}),g.popperInstance.update()),nr==="initial"&&g.state.isVisible&&A()}}function ne(S){if(S){var D=oi(S.target,g.props.target);D&&!D._tippy&&wd(D,ve({},g.props,{content:js(e.content,[D]),appendTo:e.appendTo,target:"",showOnInit:!0}))}}function ge(S){!g.state.isEnabled||Wa(S)||(g.state.isVisible||(r=S.type,S instanceof MouseEvent&&(i=S,li.forEach(function(D){return D(S)}))),S.type==="click"&&g.props.hideOnClick!==!1&&g.state.isVisible?qt():Ur(S))}function Xe(S){var D=oi(S.target,Fa)===O,$=Bs(S.target,function(Z){return Z===t});D||$||O1(Ko(O),O.getBoundingClientRect(),S,g.props)&&(ce(),qt())}function je(S){if(!Wa(S)){if(g.props.interactive){document.body.addEventListener("mouseleave",qt),document.addEventListener("mousemove",w),li.push(w);return}qt()}}function Ze(S){S.target===te()&&(g.props.interactive&&S.relatedTarget&&O.contains(S.relatedTarget)||qt())}function kn(S){oi(S.target,g.props.target)&&Ur(S)}function Cn(S){oi(S.target,g.props.target)&&qt()}function Wa(S){var D="ontouchstart"in window,$=Uo(S.type,"touch"),Z=g.props.touchHold;return D&&St&&Z&&!$||St&&!Z&&$}function Va(){!p&&d&&(p=!0,w1(O),d())}function Vr(){var S=g.props.popperOptions,D=g.popperChildren,$=D.tooltip,Z=D.arrow,gt=ai(S,"preventOverflow");function Kt(We){g.props.flip&&!g.props.flipOnUpdate&&(We.flipped&&(g.popperInstance.options.placement=We.placement),af(g.popperInstance.modifiers,!1)),$.setAttribute(Hs,We.placement),We.attributes[Vo]!==!1?$.setAttribute(Vo,""):$.removeAttribute(Vo),f&&f!==We.placement&&u&&($.style.transition="none",requestAnimationFrame(function(){$.style.transition=""})),f=We.placement,u=g.state.isVisible;var Ie=Ko(O),Ve=$.style;Ve.top=Ve.bottom=Ve.left=Ve.right="",Ve[Ie]=M1(g.props.distance);var ye=gt&&gt.padding!==void 0?gt.padding:Wo,ct=typeof ye=="number",ft=ve({top:ct?ye:ye.top,bottom:ct?ye:ye.bottom,left:ct?ye:ye.left,right:ct?ye:ye.right},!ct&&ye);ft[Ie]=ct?ye+g.props.distance:(ye[Ie]||0)+g.props.distance,g.popperInstance.modifiers.filter(function(Kr){return Kr.name==="preventOverflow"})[0].padding=ft,x=ft}var nr=ve({eventsEnabled:!1,placement:g.props.placement},S,{modifiers:ve({},S?S.modifiers:{},{preventOverflow:ve({boundariesElement:g.props.boundary,padding:Wo},gt),arrow:ve({element:Z,enabled:!!Z},ai(S,"arrow")),flip:ve({enabled:g.props.flip,padding:g.props.distance+Wo,behavior:g.props.flipBehavior},ai(S,"flip")),offset:ve({offset:g.props.offset},ai(S,"offset"))}),onCreate:function(Ie){Kt(Ie),Va(),S&&S.onCreate&&S.onCreate(Ie)},onUpdate:function(Ie){Kt(Ie),Va(),S&&S.onUpdate&&S.onUpdate(Ie)}});g.popperInstance=new e1(t,O,nr)}function _d(){p=!1;var S=k();g.popperInstance?(af(g.popperInstance.modifiers,g.props.flip),S||(g.popperInstance.reference=t,g.popperInstance.enableEventListeners()),g.popperInstance.scheduleUpdate()):(Vr(),S||g.popperInstance.enableEventListeners());var D=g.props.appendTo,$=D==="parent"?t.parentNode:js(D,[t]);$.contains(O)||($.appendChild(O),g.props.onMount(g),g.state.isMounted=!0)}function Ur(S,D){if(qr(),!g.state.isVisible){if(g.props.target)return ne(S);if(l=!0,S&&!D&&g.props.onTrigger(g,S),g.props.wait)return g.props.wait(g,S);k()&&!g.state.isMounted&&(g.popperInstance||Vr(),document.addEventListener("mousemove",V)),He();var $=si(g.props.delay,0,tt.delay);$?o=setTimeout(function(){lo()},$):lo()}}function qt(){if(qr(),!g.state.isVisible){A(),v();return}l=!1;var S=si(g.props.delay,1,tt.delay);S?s=setTimeout(function(){g.state.isVisible&&tr()},S):a=requestAnimationFrame(function(){tr()})}function Ua(S){g.props.interactive&&O.contains(S.target)||te().contains(S.target)&&(St||g.state.isVisible&&Uo(g.props.trigger,"click"))||g.props.hideOnClick===!0&&(qr(),tr())}function Pd(){g.state.isEnabled=!0}function Rd(){g.state.isEnabled=!1}function qr(){clearTimeout(o),clearTimeout(s),cancelAnimationFrame(a)}function qa(S){S=S||{},md(S,tt),q();var D=g.props,$=cf(t,ve({},g.props,{},S,{ignoreAttributes:!0}));$.ignoreAttributes=qi(S,"ignoreAttributes")?S.ignoreAttributes||!1:D.ignoreAttributes,g.props=$,H(),ce(),w=of(Xe,$.interactiveDebounce),k1(O,D,$),g.popperChildren=Ws(O),g.popperInstance&&(r1.some(function(Z){return qi(S,Z)&&S[Z]!==D[Z]})?(g.popperInstance.destroy(),Vr(),g.state.isVisible&&g.popperInstance.enableEventListeners(),g.props.followCursor&&i&&V(i)):g.popperInstance.update())}function Ld(S){qa({content:S})}function lo(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:si(g.props.duration,0,tt.duration[1]);if(!(g.state.isDestroyed||!g.state.isEnabled||St&&!g.props.touch)&&!te().hasAttribute("disabled")&&g.props.onShow(g)!==!1){He(),O.style.visibility="visible",g.state.isVisible=!0,g.props.interactive&&te().classList.add(nf);var D=y();cr(D.concat(O),0),d=function(){if(g.state.isVisible){var Z=k();Z&&i?V(i):Z||g.popperInstance.update(),g.popperChildren.backdrop&&(g.popperChildren.content.style.transitionDelay=Math.round(S/12)+"ms"),g.props.sticky&&T(),cr([O],g.props.updateDuration),cr(D,S),lf(D,"visible"),z(S,function(){g.props.aria&&te().setAttribute("aria-".concat(g.props.aria),O.id),g.props.onShown(g),g.state.isShown=!0})}},_d()}}function tr(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:si(g.props.duration,1,tt.duration[1]);if(!(g.state.isDestroyed||!g.state.isEnabled&&!c)&&!(g.props.onHide(g)===!1&&!c)){v(),O.style.visibility="hidden",g.state.isVisible=!1,g.state.isShown=!1,u=!1,g.props.interactive&&te().classList.remove(nf);var D=y();cr(D,S),lf(D,"hidden"),_(S,function(){l||A(),g.props.aria&&te().removeAttribute("aria-".concat(g.props.aria)),g.popperInstance.disableEventListeners(),g.popperInstance.options.placement=g.props.placement,O.parentNode.removeChild(O),g.props.onHidden(g),g.state.isMounted=!1})}}function $d(S){if(!g.state.isDestroyed){c=!0,g.state.isMounted&&tr(0),q(),delete t._tippy;var D=g.props.target;D&&S&&Wr(t)&&Dr(t.querySelectorAll(D)).forEach(function($){$._tippy&&$._tippy.destroy()}),g.popperInstance&&g.popperInstance.destroy(),c=!1,g.state.isDestroyed=!0}}}function T1(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.delay,r=n===void 0?t[0].props.delay:n,i=e.duration,o=i===void 0?0:i,s=!1;t.forEach(function(p){p._originalProps?p.set(p._originalProps):p._originalProps=ve({},p.props)});function a(p){s=p,u()}function l(p){p._originalProps.onShow(p),t.forEach(function(d){d.set({duration:o}),d.state.isVisible&&d.hide()}),a(!0)}function c(p){p._originalProps.onHide(p),a(!1)}function f(p){p._originalProps.onShown(p),p.set({duration:p._originalProps.duration})}function u(){t.forEach(function(p){p.set({onShow:l,onShown:f,onHide:c,delay:s?[0,Array.isArray(r)?r[1]:r]:r,duration:s?o:p._originalProps.duration})})}u()}var ff=!1;function zt(t,e){md(e||{},tt),ff||(u1(),ff=!0);var n=ve({},tt,{},e);m1(t)&&h1(t);var r=y1(t).reduce(function(i,o){var s=o&&wd(o,n);return s&&i.push(s),i},[]);return hd(t)?r[0]:r}zt.version=n1;zt.defaults=tt;zt.setDefaults=function(t){Object.keys(t).forEach(function(e){tt[e]=t[e]})};zt.hideAll=C1;zt.group=T1;function N1(){Dr(document.querySelectorAll("[data-tippy]")).forEach(function(t){var e=t.getAttribute("data-tippy");e&&zt(t,{content:e})})}jr&&setTimeout(N1);function A1(t){if(jr){var e=document.createElement("style");e.type="text/css",e.textContent=t,e.setAttribute("data-tippy-stylesheet","");var n=document.head,r=n.querySelector("style,link");r?n.insertBefore(e,r):n.appendChild(e)}}A1(t1);var Tt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var I1="Expected a function",kd="__lodash_hash_undefined__",Cd=1/0,D1="[object Function]",_1="[object GeneratorFunction]",P1="[object Symbol]",R1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,L1=/^\w*$/,$1=/^\./,F1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B1=/[\\^$.*+?()[\]{}|]/g,z1=/\\(\\)?/g,H1=/^\[object .+?Constructor\]$/,j1=typeof Tt=="object"&&Tt&&Tt.Object===Object&&Tt,W1=typeof self=="object"&&self&&self.Object===Object&&self,Ba=j1||W1||Function("return this")();function V1(t,e){return t==null?void 0:t[e]}function U1(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var q1=Array.prototype,K1=Function.prototype,Od=Object.prototype,Jo=Ba["__core-js_shared__"],uf=function(){var t=/[^.]+$/.exec(Jo&&Jo.keys&&Jo.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Md=K1.toString,za=Od.hasOwnProperty,Ed=Od.toString,J1=RegExp("^"+Md.call(za).replace(B1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pf=Ba.Symbol,G1=q1.splice,Y1=Td(Ba,"Map"),_r=Td(Object,"create"),df=pf?pf.prototype:void 0,hf=df?df.toString:void 0;function vn(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function X1(){this.__data__=_r?_r(null):{}}function Z1(t){return this.has(t)&&delete this.__data__[t]}function Q1(t){var e=this.__data__;if(_r){var n=e[t];return n===kd?void 0:n}return za.call(e,t)?e[t]:void 0}function eS(t){var e=this.__data__;return _r?e[t]!==void 0:za.call(e,t)}function tS(t,e){var n=this.__data__;return n[t]=_r&&e===void 0?kd:e,this}vn.prototype.clear=X1;vn.prototype.delete=Z1;vn.prototype.get=Q1;vn.prototype.has=eS;vn.prototype.set=tS;function er(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function nS(){this.__data__=[]}function rS(t){var e=this.__data__,n=so(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():G1.call(e,n,1),!0}function iS(t){var e=this.__data__,n=so(e,t);return n<0?void 0:e[n][1]}function oS(t){return so(this.__data__,t)>-1}function sS(t,e){var n=this.__data__,r=so(n,t);return r<0?n.push([t,e]):n[r][1]=e,this}er.prototype.clear=nS;er.prototype.delete=rS;er.prototype.get=iS;er.prototype.has=oS;er.prototype.set=sS;function Sn(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function aS(){this.__data__={hash:new vn,map:new(Y1||er),string:new vn}}function lS(t){return ao(this,t).delete(t)}function cS(t){return ao(this,t).get(t)}function fS(t){return ao(this,t).has(t)}function uS(t,e){return ao(this,t).set(t,e),this}Sn.prototype.clear=aS;Sn.prototype.delete=lS;Sn.prototype.get=cS;Sn.prototype.has=fS;Sn.prototype.set=uS;function so(t,e){for(var n=t.length;n--;)if(SS(t[n][0],e))return n;return-1}function pS(t,e){e=gS(e,t)?[e]:mS(e);for(var n=0,r=e.length;t!=null&&n<r;)t=t[xS(e[n++])];return n&&n==r?t:void 0}function dS(t){if(!Ad(t)||vS(t))return!1;var e=kS(t)||U1(t)?J1:H1;return e.test(wS(t))}function hS(t){if(typeof t=="string")return t;if(ja(t))return hf?hf.call(t):"";var e=t+"";return e=="0"&&1/t==-Cd?"-0":e}function mS(t){return Nd(t)?t:bS(t)}function ao(t,e){var n=t.__data__;return yS(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Td(t,e){var n=V1(t,e);return dS(n)?n:void 0}function gS(t,e){if(Nd(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||ja(t)?!0:L1.test(t)||!R1.test(t)||e!=null&&t in Object(e)}function yS(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function vS(t){return!!uf&&uf in t}var bS=Ha(function(t){t=OS(t);var e=[];return $1.test(t)&&e.push(""),t.replace(F1,function(n,r,i,o){e.push(i?o.replace(z1,"$1"):r||n)}),e});function xS(t){if(typeof t=="string"||ja(t))return t;var e=t+"";return e=="0"&&1/t==-Cd?"-0":e}function wS(t){if(t!=null){try{return Md.call(t)}catch{}try{return t+""}catch{}}return""}function Ha(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(I1);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s),s};return n.cache=new(Ha.Cache||Sn),n}Ha.Cache=Sn;function SS(t,e){return t===e||t!==t&&e!==e}var Nd=Array.isArray;function kS(t){var e=Ad(t)?Ed.call(t):"";return e==D1||e==_1}function Ad(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function CS(t){return!!t&&typeof t=="object"}function ja(t){return typeof t=="symbol"||CS(t)&&Ed.call(t)==P1}function OS(t){return t==null?"":hS(t)}function MS(t,e,n){var r=t==null?void 0:pS(t,e);return r===void 0?n:r}var ES=MS;const TS=Sd(ES);function NS(t){const n=new RegExp(/[!@#$^%^&*(),.?":{}|<>]/g).test(t.value[0]);return t.isWord&&!n}function mf(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gf(t,e,n,r){const i=r(),o=i.map(f=>NS(f)?`\\b(${mf(f.value)})\\b`:`(${mf(f.value)})`).join("|"),s=new RegExp(o,"ig");let a=[],l={active:!1};if(i.length<1)return{highlights:a,on:l};function c(f,u,p){const d=i.find(h=>h.value===p);if(d!==void 0){const h=d.overrideClass;if(e&&e.pos>=f&&e.pos<=u){const m=TS(n,"on.decorationId",(Math.random()+1).toString(36).substr(2,5));a.push({from:f,to:u,text:p,decorationId:m,overrideClass:h}),l.active=!0,l.decorationId=m,l.range={to:u,from:f},l.query=p,l.text=p}else a.push({from:f,to:u,text:p,overrideClass:h})}}return t.descendants((f,u)=>{if(f.isText){let p;for(;p=s.exec(f.text);)c(u+p.index,u+p.index+p[0].length,p[0])}}),{highlights:a,on:l}}const AS=xn.create({name:"Warning",addOptions(){return{getErrorWords:()=>[],onChange:()=>{},onEnter:()=>{},onExit:()=>{},onKeyDown:()=>{},defaultClass:"underline-red"}},group:"inline*",inline:!0,atom:!1,selectable:!1,parseHTML(){return[{tag:"[data-mention-id]",getAttrs:t=>{const e=t.getAttribute("data-mention-id"),n=t.innerText.split(this.options.matcher.char).join("");return{id:e,label:n}}}]},addProseMirrorPlugins(){const t=this;return[new ze({key:new lt("warning"),appendTransaction:(e,n,r)=>{const i=r.doc.content.size,o=r.selection.$from.pos,s=r.selection.$to.pos,a=r.tr;return a.selection.$from.pos=Math.min(i,o),a.selection.$to.pos=Math.min(i,s),a},view(){return{update:(e,n)=>{const r=this.key.getState(n).on,i=this.key.getState(e.state).on,o=r.active&&i.active&&r.range.from!==i.range.from,s=!r.active&&i.active,a=r.active&&!i.active,l=!s&&!a&&r.query!==i.query,c=s||o,f=l,u=a||o;if(!c&&!f&&!u)return;const p=u&&!f?r:i,d=document.querySelector('[data-decoration-id="'+p.decorationId+'"]'),h=d?{getBoundingClientRect(){return d.getBoundingClientRect()},clientWidth:d.clientWidth,clientHeight:d.clientHeight}:null,m={view:e,range:p.range,text:p.text,decorationNode:d,virtualNode:h,command:function({range:x,attrs:w}){const M=e.state.tr.replaceWith(x.from,x.to,e.state.schema.text(w.label)),O=e.dispatch(M);return setTimeout(()=>{document.getElementsByClassName("editor__content")[0].normalize()}),O}};u&&t.options.onExit(m),f&&t.options.onChange(m),c&&t.options.onEnter(m)}}},state:{init(e,{doc:n}){return gf(n,null,{},t.options.getErrorWords)},apply(e,n){const{selection:r}=e;Object.assign({},n);const i=r.$from;return gf(e.doc,i,n,t.options.getErrorWords)}},props:{handleKeyDown(e,n){const{active:r,range:i}=this.getState(e.state).on;return r?t.options.onKeyDown({event:n}):!1},decorations(e){let n=[];return this.getState(e).highlights.forEach(r=>{n.push(Ee.inline(r.from,r.to,{class:r.overrideClass?r.overrideClass:t.options.defaultClass,"data-decoration-id":r.decorationId?r.decorationId:void 0}))}),re.create(e.doc,n)}}})]}});var IS=1/0,DS="[object Symbol]",Id=/&(?:amp|lt|gt|quot|#39|#96);/g,_S=RegExp(Id.source),PS={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},RS=typeof Tt=="object"&&Tt&&Tt.Object===Object&&Tt,LS=typeof self=="object"&&self&&self.Object===Object&&self,$S=RS||LS||Function("return this")();function FS(t){return function(e){return t==null?void 0:t[e]}}var BS=FS(PS),zS=Object.prototype,HS=zS.toString,yf=$S.Symbol,vf=yf?yf.prototype:void 0,bf=vf?vf.toString:void 0;function jS(t){if(typeof t=="string")return t;if(VS(t))return bf?bf.call(t):"";var e=t+"";return e=="0"&&1/t==-IS?"-0":e}function WS(t){return!!t&&typeof t=="object"}function VS(t){return typeof t=="symbol"||WS(t)&&HS.call(t)==DS}function US(t){return t==null?"":jS(t)}function qS(t){return t=US(t),t&&_S.test(t)?t.replace(Id,BS):t}var KS=qS;const JS=Sd(KS);function Dd(t,e,n,r,i,o,s,a){var l=typeof t=="function"?t.options:t;e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),o&&(l._scopeId="data-v-"+o);var c;if(s?(c=function(p){p=p||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!p&&typeof __VUE_SSR_CONTEXT__<"u"&&(p=__VUE_SSR_CONTEXT__),i&&i.call(this,p),p&&p._registeredComponents&&p._registeredComponents.add(s)},l._ssrRegister=c):i&&(c=a?function(){i.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:i),c)if(l.functional){l._injectStyles=c;var f=l.render;l.render=function(d,h){return c.call(h),f(d,h)}}else{var u=l.beforeCreate;l.beforeCreate=u?[].concat(u,c):[c]}return{exports:t,options:l}}const GS={name:"tiptapEditor",props:{height:{type:String,default:"300px"},id:{type:String,default:null},value:{type:String,default:""},warnings:{type:Array,default:()=>[]},maxCharacterCount:{type:Number,default:null},placeholder:{type:String,default:"write your content here..."},showMenu:{type:Boolean,default:!0}},components:{EditorContent:Wx},data(){return{editor:null,currentWarning:null,currentOptions:null,currentValue:"",navigatedOptionIndex:0,insertOption:()=>{},optionsRange:null,currentCharacterCount:0}},computed:{errors(){return this.warnings.length<1?[]:this.warnings.map(t=>{const e=t.isWord===void 0?!0:t.isWord;return{overrideClass:t.overrideClass,isWord:e,value:e?t.value:JS(t.value),message:t.message,options:(t.options||[]).map((n,r)=>({value:n,id:r}))}})},maxCharacterCountExceeded(){if(this.editor)return this.editor.storage.characterCount.characters()>=this.maxCharacterCount},characterCountPercentage(){if(this.editor)return Math.round(100/this.maxCharacterCount*this.editor.storage.characterCount.characters())}},mounted(){this.currentValue=this.value,this.editor=new jx({content:this.value,parseOptions:{preserveWhitespace:"full"},onUpdate:({getJSON:t,getHTML:e})=>{this.currentValue=this.editor.getHTML(),this.$emit("update:value",this.currentValue)},extensions:[Jx,Yx,Xx.configure({limit:this.maxCharacterCount}),Zx,pw,rw,dw,hw,mw.configure({placeholder:this.placeholder}),gw,AS.configure({getErrorWords:this.getErrorWords,onEnter:({range:t,command:e,virtualNode:n,text:r})=>{this.currentWarning=this.errors.find(i=>i.value===r),this.currentOptions=this.currentWarning.options||[],this.navigatedOptionIndex=0,this.optionRange=t,this.renderPopup(n),this.insertOption=e},onChange:({range:t,virtualNode:e,text:n})=>{this.currentWarning=this.errors.find(r=>r.value===n),this.currentOptions=this.currentWarning.options||[],this.navigatedOptionIndex=0,this.optionRange=t,this.renderPopup(e)},onExit:()=>{this.navigatedOptionIndex=0,this.currentOptions=null,this.optionRange=null,this.destroyPopup()},onKeyDown:({event:t})=>t.keyCode===38&&this.currentOptions!==null?(this.upHandler(),!0):t.keyCode===40&&this.currentOptions!==null?(this.downHandler(),!0):t.keyCode===13?this.enterHandler():t.keyCode===27?(this.navigatedOptionIndex=0,this.optionRange=null,this.currentOptions=null,this.destroyPopup(),!0):!1})]}),zt.setDefaults({content:this.$refs.errors,trigger:"mouseenter",interactive:!0,theme:"dark",placement:"top-start",performance:!0,inertia:!0,duration:[400,200],showOnInit:!0,arrow:!0,arrowType:"round",hideOnClick:!1})},destroyed(){this.editor.destroy(),this.popup&&this.popup.destroy()},methods:{getErrorWords(){return this.errors.length<1?[]:this.errors.map(t=>({value:t.value,overrideClass:t.overrideClass,isWord:t.isWord}))},upHandler(){this.navigatedOptionIndex=(this.navigatedOptionIndex+this.currentOptions.length-1)%this.currentOptions.length},downHandler(){this.navigatedOptionIndex=(this.navigatedOptionIndex+1)%this.currentOptions.length},enterHandler(){if(this.currentOptions.length===0)return!1;const t=this.currentOptions[this.navigatedOptionIndex];return t&&this.selectOption(t),!0},selectOption(t){this.insertOption({range:this.optionRange,attrs:{id:t.id,label:t.value}}),this.editor.commands.focus()},renderPopup(t){this.popup||(this.popup=zt(t,{content:this.$refs.errors}))},destroyPopup(){this.popup&&(this.popup.destroy(),this.popup=null)},toolbarGoLeft(t){t.preventDefault();const e=t.target.previousSibling;e&&e.focus!==void 0&&e.focus()},toolbarGoRight(t){t.preventDefault();const e=t.target.nextSibling;e&&e.focus!==void 0&&e.focus()}},watch:{warnings:function(t,e){if(this.editor){const n=this.editor.selection;this.editor.setContent(this.currentValue),this.editor.setSelection(n.from,n.to)}}}};var YS=function(){var e=this,n=e._self._c;return n("div",[n("div",{staticClass:"tiptap-editor",attrs:{tabindex:"0"}},[e.showMenu&&e.editor?n("div",{staticClass:"menubar",attrs:{role:"toolbar","aria-controls":e.id||null}},[n("button",{class:{"is-active":e.editor.isActive("bold")},attrs:{"aria-pressed":`${e.editor.isActive("bold")?"true":"false"}`,"aria-label":"bold",value:"bold",type:"button"},on:{keyup:[function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"left",37,r.key,["Left","ArrowLeft"])||"button"in r&&r.button!==0?null:e.toolbarGoLeft.apply(null,arguments)},function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"right",39,r.key,["Right","ArrowRight"])||"button"in r&&r.button!==2?null:e.toolbarGoRight.apply(null,arguments)}],click:function(r){e.editor.chain().focus().toggleBold().run()}}},[n("b",[e._v("B")])]),n("button",{class:{"is-active":e.editor.isActive("italic")},attrs:{"aria-pressed":`${e.editor.isActive("italic")?"true":"false"}`,value:"italic",type:"button"},on:{click:function(r){e.editor.chain().focus().toggleItalic().run()},keyup:[function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"left",37,r.key,["Left","ArrowLeft"])||"button"in r&&r.button!==0?null:e.toolbarGoLeft.apply(null,arguments)},function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"right",39,r.key,["Right","ArrowRight"])||"button"in r&&r.button!==2?null:e.toolbarGoRight.apply(null,arguments)}]}},[n("i",[e._v("I")])]),n("button",{class:{"is-active":e.editor.isActive("bulletList")},attrs:{"aria-label":"bullet list",value:"bulletlist",type:"button"},on:{click:function(r){e.editor.chain().focus().toggleBulletList().run()},keyup:[function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"left",37,r.key,["Left","ArrowLeft"])||"button"in r&&r.button!==0?null:e.toolbarGoLeft.apply(null,arguments)},function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"right",39,r.key,["Right","ArrowRight"])||"button"in r&&r.button!==2?null:e.toolbarGoRight.apply(null,arguments)}]}},[n("svg",{staticClass:"svg-inline--fa fa-list-ul fa-w-16",attrs:{"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"list-ul",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"}},[n("path",{attrs:{fill:"currentColor",d:"M96 96c0 26.51-21.49 48-48 48S0 122.51 0 96s21.49-48 48-48 48 21.49 48 48zM48 208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm0 160c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm96-236h352c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h352c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h352c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H144c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"}})])])]):e._e(),n("editor-content",{staticClass:"editor__content",style:{height:e.height},attrs:{editor:e.editor,id:e.id||null,role:"textbox","aria-label":"text area",tabindex:"-1"}}),e.maxCharacterCount&&e.editor?n("div",{staticClass:"character-count"},[n("svg",{class:e.maxCharacterCountExceeded?"character-count__graph--warning":"character-count__graph",attrs:{height:"20",width:"20",viewBox:"0 0 20 20"}},[n("circle",{attrs:{r:"10",cx:"10",cy:"10",fill:"#e9ecef"}}),n("circle",{attrs:{r:"5",cx:"10",cy:"10",fill:"transparent",stroke:"currentColor","stroke-width":"10","stroke-dasharray":`calc(${e.characterCountPercentage} * 31.4 / 100) 31.4`,transform:"rotate(-90) translate(-20)"}}),n("circle",{attrs:{r:"6",cx:"10",cy:"10",fill:"white"}})]),n("div",{staticClass:"character-count__text",attrs:{"aria-live":"polite"}},[e._v(" "+e._s(e.editor.storage.characterCount.characters())+" / "+e._s(e.maxCharacterCount)+" characters ")])]):e._e()],1),n("div",{ref:"errors",staticClass:"error-list",attrs:{"v-show":!1}},[e.currentWarning?[n("b",[e._v(e._s(e.currentWarning.message))]),e._l(e.currentOptions,function(r,i){return n("div",{key:r.id,staticClass:"error-list__item",class:{selected:e.navigatedOptionIndex===i},on:{click:function(o){return e.selectOption(r)}}},[e._v(" "+e._s(r.value)+" ")])})]:e._e()],2)])},XS=[],ZS=Dd(GS,YS,XS,!1,null,null,null,null);const QS=ZS.exports,ek={name:"app",components:{tiptapEditor:QS},data(){return{maxCharacterCount:200,height:"200px",showMenu:!0,warnings:[{value:"red",message:"did you mean...",options:["read","reed"]},{value:"prob|emati(",isWord:!1,message:"What even is this?"},{value:"<script&gt;",isWord:!1,message:"you sure you wanted a tag?",overrideClass:"underline-blue"},{value:"green",message:"I really like this!",overrideClass:"underline-green"},{value:"orange",message:"this is a bad idea!",overrideClass:"underline-orange"}],localtext:"Hi! 👋🏻 &lt;script&gt; welcome to tiptap editor, here is a red mark blue with suggestions. Even prob|emati( strings. You can highlight with other colors, e.g blue, orange, and green!!",localcount:null}}};var tk=function(){var e=this,n=e._self._c;return n("tiptapEditor",{attrs:{value:e.localtext,warnings:e.warnings,showMenu:e.showMenu,maxCharacterCount:e.maxCharacterCount,height:e.height,id:"unique_id",placeholder:"write something will-ya!"},on:{"update:value":function(r){e.localtext=r},"new-character-count":function(r){e.localcount=r}}})},nk=[],rk=Dd(ek,tk,nk,!1,null,null,null,null);const ik=rk.exports;ee.config.productionTip=!1;new ee({render:t=>t(ik)}).$mount("#app");