"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3468],{3457:function(t,e,n){n.d(e,{Nl:function(){return s},fz:function(){return h},iz:function(){return o},jE:function(){return l}});var r=n(959);let i=(0,r.createContext)({}),s=()=>{let t=function(){let{dom:t,editor:e,setLoading:n,editorFactory:s}=(0,r.useContext)(i),o=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let r=o.current;if(!s||!r)return;t.current=r;let i=s(r);if(i)return n(!0),i.create().then(t=>{e.current=t}).finally(()=>{n(!1)}).catch(console.error),()=>{var t;null==(t=e.current)||t.destroy()}},[t,e,s,n]),o}();return r.createElement("div",{"data-milkdown-root":!0,ref:t})},o=({children:t})=>{let e=(0,r.useRef)(void 0),[n,s]=(0,r.useState)(void 0),o=(0,r.useRef)(),[l,h]=(0,r.useState)(!0),a=(0,r.useMemo)(()=>({loading:l,dom:e,editor:o,setLoading:h,editorFactory:n,setEditorFactory:s}),[l,n]);return r.createElement(i.Provider,{value:a},t)};function l(t,e=[]){let n=(0,r.useContext)(i),s=(0,r.useCallback)(t,e);return(0,r.useLayoutEffect)(()=>{n.setEditorFactory(()=>s)},[n,s]),{loading:n.loading,get:()=>n.editor.current}}function h(){let t=(0,r.useContext)(i),e=(0,r.useCallback)(()=>t.editor.current,[t.editor]);return[t.loading,e]}},6089:function(t,e,n){n.d(e,{cL:function(){return D},js:function(){return k},mg:function(){return w},UF:function(){return M},eK:function(){return O},YX:function(){return A},AQ:function(){return z}});var r,i,s,o,l=n(959),h=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},a=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},c=(t,e,n)=>(h(t,e,"access private method"),n);class p{constructor({node:t,view:e,getPos:n,decorations:i,innerDecorations:s,options:o}){a(this,r),this.selected=!1,this.selectNode=()=>{var t,e;this.selected=!0,null==(e=(t=this.options).selectNode)||e.call(t)},this.deselectNode=()=>{var t,e;this.selected=!1,null==(e=(t=this.options).deselectNode)||e.call(t)},this.shouldUpdate=t=>!(t.type!==this.node.type||t.sameMarkup(this.node)&&t.content.eq(this.node.content)),this.update=(t,e,n)=>{var r,i;let s;let o=this.options.update;return o&&(s=o(t,e,n)),"boolean"!=typeof s&&(s=this.shouldUpdate(t)),this.node=t,this.decorations=e,this.innerDecorations=n,s&&(null==(i=(r=this.options).onUpdate)||i.call(r)),s},this.shouldIgnoreMutation=t=>!this.dom||!this.contentDOM||!!this.node.isLeaf||!!this.node.isAtom||"selection"!==t.type&&(this.contentDOM===t.target&&"attributes"===t.type||!this.contentDOM.contains(t.target)),this.ignoreMutation=t=>{let e;if(!this.dom||!this.contentDOM)return!0;let n=this.options.ignoreMutation;return n&&(e=n(t)),"boolean"!=typeof e&&(e=this.shouldIgnoreMutation(t)),e},this.destroy=()=>{var t,e,n;null==(e=(t=this.options).destroy)||e.call(t),this.dom.remove(),null==(n=this.contentDOM)||n.remove()},this.setAttrs=t=>{let{dispatch:e,state:n}=this.view,r=this.getPos();if("number"==typeof r)return e(n.tr.setNodeMarkup(r,void 0,{...this.node.attrs,...t}))},this.node=t,this.view=e,this.getPos=n,this.decorations=i,this.innerDecorations=s,this.options=o,this.dom=this.createDOM(o.as),this.contentDOM=t.isLeaf?null:this.createContentDOM(o.contentAs),this.dom.setAttribute("data-node-view-root","true"),this.contentDOM&&(this.contentDOM.setAttribute("data-node-view-content","true"),this.contentDOM.style.whiteSpace="inherit"),this.setSelection=o.setSelection,this.stopEvent=o.stopEvent}createDOM(t){return c(this,r,i).call(this,t)}createContentDOM(t){return c(this,r,i).call(this,t)}get component(){return this.options.component}}r=new WeakSet,i=function(t){let{node:e}=this;return null==t?document.createElement(e.isInline?"span":"div"):t instanceof HTMLElement?t:t instanceof Function?t(e):document.createElement(t)};class u{constructor(t){this.view=t.view,this.options=t.options}get component(){return this.options.component}get root(){var t,e;let n=null==(e=(t=this.options).root)?void 0:e.call(t,this.view.dom);return n||(n=this.view.dom.parentElement??document.body),n}update(t,e){var n,r;this.view=t,this.prevState=e,null==(r=(n=this.options).update)||r.call(n,t,e)}destroy(){var t,e;null==(e=(t=this.options).destroy)||e.call(t)}}class d{constructor({pos:t,spec:e,options:n}){a(this,s),this.pos=t,this.options=n,this.spec=e,this.dom=c(this,s,o).call(this,n.as),this.dom.setAttribute("data-widget-view-root","true")}bind(t,e){this.view=t,this.getPos=e}get component(){return this.options.component}}s=new WeakSet,o=function(t){return t instanceof HTMLElement?t:document.createElement(t)};let f=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((t,e)=>((e&=63)<36?t+=e.toString(36):e<62?t+=(e-26).toString(36).toUpperCase():e>62?t+="-":t+="_",t),"");var m=n(422),g=n(5095);let y=(0,l.createContext)({contentRef:()=>{},view:null,getPos:()=>0,setAttrs:()=>{},node:null,selected:!1,decorations:[],innerDecorations:null}),k=()=>(0,l.useContext)(y),x=(0,l.createContext)(t=>{throw Error("out of scope")}),w=()=>(0,l.useContext)(x);class v extends p{constructor(){super(...arguments),this.key=f(),this.context={contentRef:t=>{t&&this.contentDOM&&t.firstChild!==this.contentDOM&&t.appendChild(this.contentDOM)},view:this.view,getPos:this.getPos,setAttrs:this.setAttrs,node:this.node,selected:this.selected,decorations:this.decorations,innerDecorations:this.innerDecorations},this.updateContext=()=>{Object.assign(this.context,{node:this.node,selected:this.selected,decorations:this.decorations,innerDecorations:this.innerDecorations})},this.render=()=>{let t=this.component;return(0,m.createPortal)(l.createElement(y.Provider,{value:this.context},l.createElement(t,null)),this.dom,this.key)}}}let S=(0,l.createContext)({view:null}),M=()=>(0,l.useContext)(S),C=(0,l.createContext)(t=>{throw Error("out of scope")}),O=()=>(0,l.useContext)(C),b=(t,e)=>(0,l.useCallback)(n=>(r,i,s,o,l)=>{let h=new v({node:r,view:i,getPos:s,decorations:o,innerDecorations:l,options:{...n,onUpdate(){var e;null==(e=n.onUpdate)||e.call(n),t(h)},selectNode(){var e;null==(e=n.selectNode)||e.call(n),t(h)},deselectNode(){var e;null==(e=n.deselectNode)||e.call(n),t(h)},destroy(){var t;null==(t=n.destroy)||t.call(n),e(h)}}});return t(h,!1),h},[e,t]);class E extends u{constructor(){super(...arguments),this.key=f(),this.context={view:this.view,prevState:this.prevState},this.updateContext=()=>{Object.assign(this.context,{view:this.view,prevState:this.prevState})},this.render=()=>{let t=this.component;return(0,m.createPortal)(l.createElement(S.Provider,{value:this.context},l.createElement(t,null)),this.root,this.key)}}}let N=(t,e)=>(0,l.useCallback)(n=>r=>{let i=new E({view:r,options:{...n,update:(e,r)=>{var s;null==(s=n.update)||s.call(n,e,r),t(i)},destroy:()=>{var t;null==(t=n.destroy)||t.call(n),e(i)}}});return t(i,!1),i},[e,t]),T=()=>{let[t,e]=(0,l.useState)({}),n=(0,l.useRef)(!1);(0,l.useEffect)(()=>(requestAnimationFrame(()=>{n.current=!0}),()=>{n.current=!1}),[]);let r=(0,l.useCallback)(t=>{n.current?(0,m.flushSync)(t):t()},[]),i=(0,l.useCallback)((t,n=!0)=>{r(()=>{n&&t.updateContext(),e(e=>({...e,[t.key]:t.render()}))})},[r]),s=(0,l.useCallback)(t=>{r(()=>{e(e=>{let n={...e};return delete n[t.key],n})})},[r]);return{portals:t,renderReactRenderer:i,removeReactRenderer:s}},R=(0,l.createContext)({view:null,getPos:()=>{}}),A=()=>(0,l.useContext)(R),I=(0,l.createContext)(t=>{throw Error("out of scope")}),z=()=>(0,l.useContext)(I);class F extends d{constructor(){super(...arguments),this.key=f(),this.context={view:this.view,getPos:this.getPos,spec:this.spec},this.updateContext=()=>{Object.assign(this.context,{view:this.view,getPos:this.getPos,spec:this.spec})},this.render=()=>{let t=this.component;return(0,m.createPortal)(l.createElement(R.Provider,{value:this.context},l.createElement(t,null)),this.dom,this.key)}}}let J=(t,e)=>(0,l.useCallback)(n=>(r,i={})=>{let s=new F({pos:r,options:n}),o={...i,destroy:t=>{var n;null==(n=i.destroy)||n.call(i,t),e(s)}};return s.spec=o,g.p.widget(r,(e,n)=>(s.bind(e,n),t(s),s.dom),o)},[e,t]),D=({children:t})=>{let{renderReactRenderer:e,removeReactRenderer:n,portals:r}=T(),i=b(e,n),s=N(e,n),o=J(e,n),h=(0,l.useMemo)(()=>Object.values(r),[r]);return l.createElement(x.Provider,{value:i},l.createElement(C.Provider,{value:s},l.createElement(I.Provider,{value:o},t,h)))}},5570:function(t,e,n){function r(t){this.content=t}n.d(e,{aw:function(){return P},PW:function(){return U},HY:function(){return i},vc:function(){return h},ZU:function(){return D},NB:function(){return M},Ts:function(){return v},Jq:function(){return F},e4:function(){return a},V_:function(){return $},p2:function(){return c}}),r.prototype={constructor:r,find:function(t){for(var e=0;e>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)};class i{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;et&&!1!==n(l,r+o,i||null,s)&&l.content.size){let i=o+1;l.nodesBetween(Math.max(0,t-i),Math.min(l.content.size,e-i),n,r+i)}o=h}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",s=!0;return this.nodesBetween(t,e,(o,l)=>{o.isText?(i+=o.text.slice(Math.max(t,l)-l,e-l),s=!n):o.isLeaf?(r?i+="function"==typeof r?r(o):r:o.type.spec.leafText&&(i+=o.type.spec.leafText(o)),s=!n):!s&&o.isBlock&&(i+=n,s=!0)},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),s=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),s=1);st)for(let i=0,s=0;st&&((se)&&(o=o.isText?o.cut(Math.max(0,t-s),Math.min(o.text.length,e-s)):o.cut(Math.max(0,t-s-1),Math.min(o.content.size,e-s-1))),n.push(o),r+=o.nodeSize),s=l}return new i(n,r)}cutByIndex(t,e){return t==e?i.empty:0==t&&e==this.content.length?this:new i(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),s=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new i(r,s)}addToStart(t){return new i([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new i(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;ethis.size||t<0)throw RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=t){if(i==t||e>0)return o(n+1,i);return o(n,r)}r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return i.empty;if(!Array.isArray(e))throw RangeError("Invalid input for Fragment.fromJSON");return new i(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return i.empty;let e,n=0;for(let r=0;rthis.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;et.type.rank-e.type.rank),e}}h.none=[];class a extends Error{}class c{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=function t(e,n,r,i){let{index:s,offset:o}=e.findIndex(n),l=e.maybeChild(s);if(o==n||l.isText)return i&&!i.canReplace(s,s,r)?null:e.cut(0,n).append(r).append(e.cut(n));let h=t(l.content,n-o-1,r);return h&&e.replaceChild(s,l.copy(h))}(this.content,t+this.openStart,e);return n&&new c(n,this.openStart,this.openEnd)}removeBetween(t,e){return new c(function t(e,n,r){let{index:i,offset:s}=e.findIndex(n),o=e.maybeChild(i),{index:l,offset:h}=e.findIndex(r);if(s==n||o.isText){if(h!=r&&!e.child(l).isText)throw RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(r))}if(i!=l)throw RangeError("Removing non-flat range");return e.replaceChild(i,o.copy(t(o.content,n-s-1,r-s-1)))}(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return c.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new c(i.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new c(t,n,r)}}function p(t,e){if(!e.type.compatibleContent(t.type))throw new a("Cannot join "+e.type.name+" onto "+t.type.name)}function u(t,e,n){let r=t.node(n);return p(r,e.node(n)),r}function d(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 f(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(d(t.nodeAfter,r),s++));for(let t=s;tn&&d(m(u(t,e,n+1),g(t,e,n+1)),r),f(e,null,n,r),new i(r)}c.empty=new c(i.empty,0,0);class y{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new v(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&e<=t.content.size))throw RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let e=t;;){let{index:t,offset:s}=e.content.findIndex(i),o=i-s;if(n.push(e,t,r+s),!o||(e=e.child(t)).isText)break;i=o-1,r+=s+1}return new y(e,n,i)}static resolveCached(t,e){for(let n=0;nt.depth)throw new a("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new a("Inconsistent open depths");return function t(e,n,r,s){let o=e.index(s),l=e.node(s);if(o==n.index(s)&&s=0;t--)r=e.node(t).copy(i.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(r,e);return m(l,function t(e,n,r,s,o){let l=e.depth>o&&u(e,n,o+1),h=s.depth>o&&u(r,s,o+1),a=[];return f(null,e,o,a),l&&h&&n.index(o)==r.index(o)?(p(l,h),d(m(l,t(e,n,r,s,o+1)),a)):(l&&d(m(l,g(e,n,o+1)),a),f(n,r,o,a),h&&d(m(h,g(r,s,o+1)),a)),f(s,null,o,a),new i(a)}(e,t,o,n,s))}{let t=e.parent,i=t.content;return m(t,i.cut(0,e.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(t,e,n,0)}(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(!(e=e.maybeChild(n)))return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(nt&&this.nodesBetween(t,e,t=>(n.isInSet(t.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),O(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=i.empty,r=0,s=n.childCount){let o=this.contentMatchAt(t).matchFragment(n,r,s),l=o&&o.matchFragment(this.content,e);if(!l||!l.validEnd)return!1;for(let t=r;tt.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,e){if(!e)throw RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=i.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}M.prototype.text=void 0;class C extends M{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):O(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new C(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new C(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function O(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class b{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){var n;let r,i=new E(t,e);if(null==i.next)return b.empty;let s=function t(e){let n=[];do n.push(function(e){let n=[];do n.push(function(e){let n=function(e){if(e.eat("(")){let n=t(e);return e.eat(")")||e.err("Missing closing paren"),n}if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=(function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let t in n){let r=n[t];r.groups.indexOf(e)>-1&&i.push(r)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i})(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}}(e);for(;;)if(e.eat("+"))n={type:"plus",expr:n};else if(e.eat("*"))n={type:"star",expr:n};else if(e.eat("?"))n={type:"opt",expr:n};else if(e.eat("{"))n=function(t,e){let n=N(t),r=n;return t.eat(",")&&(r="}"!=t.next?N(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}(e,n);else break;return n}(e));while(e.next&&")"!=e.next&&"|"!=e.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(e));while(e.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let o=(n=function(t){let e=[[]];return i(function t(e,s){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(t(n,s)),[]);if("seq"==e.type)for(let r=0;;r++){let o=t(e.exprs[r],s);if(r==e.exprs.length-1)return o;i(o,s=n())}else if("star"==e.type){let o=n();return r(s,o),i(t(e.expr,o),o),[r(o)]}else if("plus"==e.type){let o=n();return i(t(e.expr,s),o),i(t(e.expr,o),o),[r(o)]}else if("opt"==e.type)return[r(s)].concat(t(e.expr,s));else if("range"==e.type){let o=s;for(let r=0;rt.to=e)}}(s),r=Object.create(null),function t(e){let i=[];e.forEach(t=>{n[t].forEach(({term:t,to:e})=>{let r;if(t){for(let e=0;e{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})}})});let s=r[e.join(",")]=new b(e.indexOf(n.length-1)>-1);for(let e=0;et.createAndFill()));for(let t=0;t=this.next.length)throw RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return!function e(n){t.push(n);for(let r=0;r{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n"+t.indexOf(e.next[n].next);return r}).join("\n")}}b.empty=new b(!0);class E{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw SyntaxError(t+" (in content expression '"+this.string+"')")}}function N(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function T(t,e){return e-t}function R(t,e){let n=[];return function e(r){let i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(let t=0;t-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;en[t]=new F(t,e,r));let r=e.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class J{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class D{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=z(r.attrs),this.excluded=null;let i=A(this.attrs);this.instance=i?new h(this,i):null}create(t=null){return!t&&this.instance?this.instance:new h(this,I(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach((t,i)=>n[t]=new D(t,r++,e,i)),n}removeFromSet(t){for(var e=0;e-1}}class ${constructor(t){this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=r.from(t.nodes),e.marks=r.from(t.marks||{}),this.nodes=F.compile(this.spec.nodes,this),this.marks=D.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],r=e.spec.content||"",i=e.spec.marks;e.contentMatch=n[r]||(n[r]=b.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==i?null:i?B(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:B(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else if(t instanceof F){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new C(n,n.defaultAttrs,t,h.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return M.fromJSON(this,t)}markFromJSON(t){return h.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw RangeError("Unknown node type: "+t);return e}}function B(t,e){let n=[];for(let r=0;r-1)&&n.push(o=r)}if(!o)throw SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class P{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach(t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)}),this.normalizeLists=!this.tags.some(e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)})}parse(t,e={}){let n=new Y(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new Y(this,e,!0);return n.addAll(t,e.from,e.to),c.maxOpen(n.finish())}matchTag(t,e,n){for(let i=n?this.tags.indexOf(n)+1:0;it.length)||61==s.charCodeAt(t.length)&&s.slice(t.length+1)==e)){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r{n(t=_(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)})}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach(t=>{n(t=_(t)),t.node||t.ignore||t.mark||(t.node=e)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new P(t,P.schemaRules(t)))}}let j={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},q={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},W={ol:!0,ul:!0};function L(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class H{constructor(t,e,n,r,i,s,o){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=h.none,this.stashMarks=[],this.match=s||(4&o?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(i.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let e=this.type.contentMatch,n;return(n=e.findWrapping(t.type))?(this.match=e,n):null}}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t=this.content[this.content.length-1],e;t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))&&(t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=t.withText(t.text.slice(0,t.text.length-e[0].length)))}let e=i.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;e{s.push(t);for(let n=0;ns.indexOf(i)&&o(i))return!0}};if(o(i.contentMatch))return!0}}(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!j.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Y{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r=e.topNode,i,s=L(null,e.preserveWhitespace,0)|(n?4:0);i=r?new H(r.type,r.attrs,h.none,h.none,!0,e.topMatch||r.type.contentMatch,s):n?new H(null,null,h.none,h.none,!0,null,s):new H(t.schema.topNodeType,null,h.none,h.none,!0,null,s),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){3==t.nodeType?this.addTextNode(t):1==t.nodeType&&this.addElement(t)}withStyleRules(t,e){let n=t.getAttribute("style");if(!n)return e();let r=this.readStyles(function(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}(n));if(!r)return;let[i,s]=r,o=this.top;for(let t=0;tthis.addAll(t)),e&&this.sync(r),this.needsBlock=s}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,!1===i.consuming?r:void 0)})}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let e=h.none,n=h.none;for(let r=0;r{s.clearMark(t)&&(n=t.addToSet(n))}):e=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(e),!1===s.consuming)i=s;else break}return[e,n]}addElementByRule(t,e,n){let r,i,s;e.node?(i=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(i.create(e.attrs))||this.leafFallback(t):r=this.enter(i,e.attrs||null,e.preserveWhitespace):(s=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(s));let o=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(o)&&this.open--,s&&this.removePendingMark(s,o)}addAll(t,e,n){let r=e||0;for(let i=e?t.childNodes[e]:t.firstChild,s=null==n?null:t.childNodes[n];i!=s;i=i.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(i);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],s=i.findWrapping(t);if(s&&(!e||e.length>s.length)&&(e=s,n=i,!s.length)||i.solid)break}if(!e)return!1;this.sync(n);for(let t=0;tthis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),s=(t,o)=>{for(;t>=0;t--){let l=e[t];if(""==l){if(t==e.length-1||0==t)continue;for(;o>=i;o--)if(s(t-1,o))return!0;return!1}{let t=o>0||0==o&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!t||t.name!=l&&-1==t.groups.indexOf(l))return!1;o--}}return!0};return s(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(t){let e=function(t,e){for(let n=0;n=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function _(t){let e={};for(let n in t)e[n]=t[n];return e}class U{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=K(e).createDocumentFragment());let r=n,i=[];return t.forEach(t=>{if(i.length||t.marks.length){let n=0,s=0;for(;n=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&U.renderSpec(K(n),r(t,e))}static renderSpec(t,e,n=null){let r;if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let i=e[0],s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let o=n?t.createElementNS(n,i):t.createElement(i),l=e[1],h=1;if(l&&"object"==typeof l&&null==l.nodeType&&!Array.isArray(l)){for(let t in h=2,l)if(null!=l[t]){let e=t.indexOf(" ");e>0?o.setAttributeNS(t.slice(0,e),t.slice(e+1),l[t]):o.setAttribute(t,l[t])}}for(let i=h;ih)throw RangeError("Content hole must be the only child of its parent node");return{dom:o,contentDOM:o}}{let{dom:e,contentDOM:i}=U.renderSpec(t,s,n);if(o.appendChild(e),i){if(r)throw RangeError("Multiple content holes");r=i}}}return{dom:o,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new U(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=V(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return V(t.marks)}}function V(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function K(t){return t.document||window.document}},3317:function(t,e,n){n.d(e,{Bs:function(){return c},C1:function(){return f},H$:function(){return E},Sy:function(){return C},Y1:function(){return o},qv:function(){return u},xm:function(){return l},yy:function(){return M}});var r=n(5570),i=n(5084);let s=Object.create(null);class o{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new l(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e=0;r--){let i=e<0?g(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):g(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(i)return i}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new f(t.node(0))}static atStart(t){return g(t,t,0,0,1)||new f(t)}static atEnd(t){return g(t,t,t.content.size,t.childCount,-1)||new f(t)}static fromJSON(t,e){if(!e||!e.type)throw RangeError("Invalid input for Selection.fromJSON");let n=s[e.type];if(!n)throw RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in s)throw RangeError("Duplicate use of selection JSON ID "+t);return s[t]=e,e.prototype.jsonID=t,e}getBookmark(){return c.between(this.$anchor,this.$head).getBookmark()}}o.prototype.visible=!0;class l{constructor(t,e){this.$from=t,this.$to=e}}let h=!1;function a(t){h||t.parent.inlineContent||(h=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class c extends o{constructor(t,e=t){a(t),a(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return o.near(n);let r=t.resolve(e.map(this.anchor));return new c(r.parent.inlineContent?r:n,n)}replace(t,e=r.p2.empty){if(super.replace(t,e),e==r.p2.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof c&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new p(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new c(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if((!n||r)&&(n=r>=0?1:-1),!e.parent.inlineContent){let t=o.findFrom(e,n,!0)||o.findFrom(e,-n,!0);if(!t)return o.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r?t=e:(t=(o.findFrom(t,-n,!0)||o.findFrom(t,n,!0)).$anchor).posnew f(t)};function g(t,e,n,r,i,s=!1){if(e.inlineContent)return c.create(t,n);for(let o=r-(i>0?0:1);i>0?o=0;o+=i){let r=e.child(o);if(r.isAtom){if(!s&&u.isSelectable(r))return u.create(t,n-(i<0?r.nodeSize:0))}else{let e=g(t,r,n+i,i<0?r.childCount:0,i,s);if(e)return e}n+=r.nodeSize*i}return null}function y(t,e,n){let r,s=t.steps.length-1;if(s{null==r&&(r=i)}),t.setSelection(o.near(t.doc.resolve(r),n)))}class k extends i.wx{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return r.vc.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.vc.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let t=this.doc.resolve(e);i=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(o.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function x(t,e){return e&&t?t.bind(e):t}class w{constructor(t,e,n){this.name=t,this.init=x(e.init,n),this.apply=x(e.apply,n)}}let v=[new w("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new w("selection",{init:(t,e)=>t.selection||o.atStart(e.doc),apply:t=>t.selection}),new w("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new w("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class S{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=v.slice(),e&&e.forEach(t=>{if(this.pluginsByKey[t.key])throw RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new w(t.key,t.spec.state,t))})}}class M{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;nt.toJSON())),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],i=r.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw RangeError("Required config field 'schema' missing");let i=new S(t.schema,t.plugins),s=new M(i);return i.fields.forEach(i=>{if("doc"==i.name)s.doc=r.NB.fromJSON(t.schema,e.doc);else if("selection"==i.name)s.selection=o.fromJSON(s.doc,e.selection);else if("storedMarks"==i.name)e.storedMarks&&(s.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let r in n){let o=n[r],l=o.spec.state;if(o.key==i.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(e,r)){s[i.name]=l.fromJSON.call(o,t,e[r],s);return}}s[i.name]=i.init(t,s)}}),s}}class C{constructor(t){this.spec=t,this.props={},t.props&&function t(e,n,r){for(let i in e){let s=e[i];s instanceof Function?s=s.bind(n):"handleDOMEvents"==i&&(s=t(s,n,{})),r[i]=s}return r}(t.props,this,this.props),this.key=t.key?t.key.key:b("plugin")}getState(t){return t[this.key]}}let O=Object.create(null);function b(t){return t in O?t+"$"+ ++O[t]:(O[t]=0,t+"$")}class E{constructor(t="key"){this.key=b(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}},5084:function(t,e,n){n.d(e,{Ax:function(){return v},FC:function(){return g},Mn:function(){return S},Pu:function(){return m},WJ:function(){return p},dR:function(){return C},k9:function(){return k},nd:function(){return x},nj:function(){return M},vs:function(){return o},wx:function(){return J}});var r=n(5570);class i{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class s{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&s.empty)return s.empty}recover(t){let e=0,n=65535&t;if(!this.inverted)for(let t=0;tt)break;let a=this.ranges[l+s],c=this.ranges[l+o],p=h+a;if(t<=p){let s=a?t==h?-1:t==p?1:e:e,o=h+r+(s<0?0:c);if(n)return o;let u=t==(e<0?h:p)?null:l/3+(t-h)*65536,d=t==h?2:t==p?1:4;return(e<0?t!=h:t!=p)&&(d|=8),new i(o,d,u)}r+=c-a}return n?t+r:new i(t+r,0,null)}touches(t,e){let n=0,r=65535&e,i=this.inverted?2:1,s=this.inverted?1:2;for(let e=0;et)break;let l=this.ranges[e+i];if(t<=o+l&&e==3*r)return!0;n+=this.ranges[e+s]-l}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new o;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;nn&&et.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,i),e.openStart,e.openEnd);return a.fromReplace(t,this.from,this.to,s)}invert(){return new u(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new p(e.pos,n.pos,this.mark)}merge(t){return t instanceof p&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new p(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new p(e.from,e.to,t.markFromJSON(e.mark))}}h.jsonID("addMark",p);class u extends h{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new r.p2(c(e.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),e.openStart,e.openEnd);return a.fromReplace(t,this.from,this.to,n)}invert(){return new p(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new u(e.pos,n.pos,this.mark)}merge(t){return t instanceof u&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new u(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new u(e.from,e.to,t.markFromJSON(e.mark))}}h.jsonID("removeMark",u);class d extends h{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return a.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return a.fromReplace(t,this.pos,this.pos+1,new r.p2(r.HY.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;nn.pos?null:new g(e.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new g(e.from,e.to,e.gapFrom,e.gapTo,r.p2.fromJSON(t,e.slice),e.insert,!!e.structure)}}function y(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let t=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function k(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),i=t.$from.index(n),s=t.$to.indexAfter(n);if(ns;t--,e--){let n=i.node(t),s=i.index(t);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(s,n.childCount),l=r&&r[e+1];l&&(o=o.replaceChild(0,l.type.create(l.attrs)));let h=r&&r[e]||n;if(!n.canReplace(s+1,n.childCount)||!h.type.validContent(o))return!1}let l=i.indexAfter(s),h=r&&r[0];return i.node(s).canReplaceWith(l,l,h?h.type:i.node(s+1).type)}function S(t,e){var n,r;let i=t.resolve(e),s=i.index();return n=i.nodeBefore,r=i.nodeAfter,!!(n&&r&&!n.isLeaf&&n.canAppend(r))&&i.parent.canReplace(s,s+1)}function M(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let t=0;t=0;e--){let n=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,s=r.index(e)+(n>0?1:0),o=r.node(e),l=!1;if(1==t)l=o.canReplace(s,s,i);else{let t=o.contentMatchAt(s).findWrapping(i.firstChild.type);l=t&&o.canReplaceWith(s,s,t[0])}if(l)return 0==n?r.pos:n<0?r.before(e+1):r.after(e+1)}return null}function C(t,e,n=e,i=r.p2.empty){if(e==n&&!i.size)return null;let s=t.resolve(e),o=t.resolve(n);return O(s,o,i)?new m(e,n,i):new b(s,o,i).fit()}function O(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}h.jsonID("replaceAround",g);class b{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=r.HY.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=r.HY.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(t<0?this.$to:n.doc.resolve(t));if(!i)return null;let s=this.placed,o=n.depth,l=i.depth;for(;o&&l&&1==s.childCount;)s=s.firstChild.content,o--,l--;let h=new r.p2(s,o,l);return t>-1?new g(n.pos,t,this.$to.pos,this.$to.end(),h,e):h.size||n.pos!=this.$to.pos?new m(n.pos,i.pos,h):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t=null,i=(n?(t=T(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let s=this.depth;s>=0;s--){let{type:o,match:l}=this.frontier[s],h,a=null;if(1==e&&(i?l.matchType(i.type)||(a=l.fillBefore(r.HY.from(i),!1)):t&&o.compatibleContent(t.type)))return{sliceDepth:n,frontierDepth:s,parent:t,inject:a};if(2==e&&i&&(h=l.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:s,parent:t,wrap:h};if(t&&l.matchType(t.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=T(t,e);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new r.p2(t,e+1,Math.max(n,i.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=T(t,e);if(i.childCount<=1&&e>0){let s=t.size-e<=e+i.size;this.unplaced=new r.p2(E(t,e-1,1),e-1,s?e-1:n)}else this.unplaced=new r.p2(E(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:i,wrap:s}){for(;this.depth>e;)this.closeFrontierNode();if(s)for(let t=0;t1||0==h||t.content.size)&&(p=e,c.push(function t(e,n,i){if(n<=0)return e;let s=e.content;return n>1&&(s=s.replaceChild(0,t(s.firstChild,n-1,1==s.childCount?i-1:0))),n>0&&(s=e.type.contentMatch.fillBefore(s).append(s),i<=0&&(s=s.append(e.type.contentMatch.matchFragment(s).fillBefore(r.HY.empty,!0)))),e.copy(s)}(t.mark(u.allowedMarks(t.marks)),1==a?h:0,a==l.childCount?d:-1)))}let f=a==l.childCount;f||(d=-1),this.placed=N(this.placed,e,r.HY.from(c)),this.frontier[e].match=p,f&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=l;t1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],i=e=0;n--){let{match:e,type:r}=this.frontier[n],i=R(t,n,r,e,!0);if(!i||i.childCount)continue t}return{depth:e,fit:s,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=N(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=N(this.placed,this.depth,r.HY.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(r.HY.empty,!0);t.childCount&&(this.placed=N(this.placed,this.frontier.length,t))}}function E(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(E(t.firstChild.content,e-1,n)))}function N(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(N(t.lastChild.content,e-1,n)))}function T(t,e){for(let n=0;n=0;i--){let r=t.start(i);if(re.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(r==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==r-1)&&n.push(i)}return n}class I extends h{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return a.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let i=e.type.create(n,null,e.marks);return a.fromReplace(t,this.pos,this.pos+1,new r.p2(r.HY.from(i),0,e.isLeaf?0:1))}getMap(){return s.empty}invert(t){return new I(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new I(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new I(e.pos,e.attr,e.value)}}h.jsonID("attr",I);class z extends h{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let n in t.attrs)e[n]=t.attrs[n];e[this.attr]=this.value;let n=t.type.create(e,t.content,t.marks);return a.ok(n)}getMap(){return s.empty}invert(t){return new z(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new z(e.attr,e.value)}}h.jsonID("docAttr",z);let F=class extends Error{};(F=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n}).prototype=Object.create(Error.prototype),F.prototype.constructor=F,F.prototype.name="TransformError";class J{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new o}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new F(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=r.p2.empty){let i=C(this.doc,t,e,n);return i&&this.step(i),this}replaceWith(t,e,n){return this.replace(t,e,new r.p2(r.HY.from(n),0,0))}delete(t,e){return this.replace(t,e,r.p2.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return!function(t,e,n,i){if(!i.size)return t.deleteRange(e,n);let s=t.doc.resolve(e),o=t.doc.resolve(n);if(O(s,o,i))return t.step(new m(e,n,i));let l=A(s,t.doc.resolve(n));0==l[l.length-1]&&l.pop();let h=-(s.depth+1);l.unshift(h);for(let t=s.depth,e=s.pos-1;t>0;t--,e--){let n=s.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;l.indexOf(t)>-1?h=t:s.before(t)==e&&l.splice(1,0,-t)}let a=l.indexOf(h),c=[],p=i.openStart;for(let t=i.content,e=0;;e++){let n=t.firstChild;if(c.push(n),e==i.openStart)break;t=n.content}for(let t=p-1;t>=0;t--){var u;let e=c[t],n=(u=e.type).spec.defining||u.spec.definingForContent;if(n&&!e.sameMarkup(s.node(Math.abs(h)-1)))p=t;else if(n||!e.type.isTextblock)break}for(let e=i.openStart;e>=0;e--){let h=(e+p+1)%(i.openStart+1),u=c[h];if(u)for(let e=0;es){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.HY.empty,!0))}return e}(i.content,0,i.openStart,h),h,i.openEnd))}}let d=t.steps.length;for(let r=l.length-1;r>=0&&(t.replace(e,n,i),!(t.steps.length>d));r--){let t=l[r];t<0||(e=s.before(t),n=o.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return!function(t,e,n,i){if(!i.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let r=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let t=r.depth-1;t>=0;t--){let e=r.index(t);if(r.node(t).canReplaceWith(e,e,n))return r.before(t+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let t=r.depth-1;t>=0;t--){let e=r.indexAfter(t);if(r.node(t).canReplaceWith(e,e,n))return r.after(t+1);if(e0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return t.delete(r.before(n),i.after(n))}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)}(this,t,e),this}lift(t,e){return!function(t,e,n){let{$from:i,$to:s,depth:o}=e,l=i.before(o+1),h=s.after(o+1),a=l,c=h,p=r.HY.empty,u=0;for(let t=o,e=!1;t>n;t--)e||i.index(t)>0?(e=!0,p=r.HY.from(i.node(t).copy(p)),u++):a--;let d=r.HY.empty,f=0;for(let t=o,e=!1;t>n;t--)e||s.after(t+1)=0;t--){if(i.size){let e=n[t].type.contentMatch.matchFragment(i);if(!e||!e.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.HY.from(n[t].type.create(n[t].attrs,i))}let s=e.start,o=e.end;t.step(new g(s,o,s,o,new r.p2(i,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,i=null){return!function(t,e,n,i,s){if(!i.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(e,n)=>{var l,h;let a,c;if(e.isTextblock&&!e.hasMarkup(i,s)&&(l=t.doc,h=t.mapping.slice(o).map(n),c=(a=l.resolve(h)).index(),a.parent.canReplaceWith(c,c+1,i))){t.clearIncompatible(t.mapping.slice(o).map(n,1),i);let l=t.mapping.slice(o),h=l.map(n,1),a=l.map(n+e.nodeSize,1);return t.step(new g(h,a,h+1,a-1,new r.p2(r.HY.from(i.create(s,null,e.marks)),0,0),1,!0)),!1}})}(this,t,e,n,i),this}setNodeMarkup(t,e,n=null,i){return!function(t,e,n,i,s){let o=t.doc.nodeAt(e);if(!o)throw RangeError("No node at given position");n||(n=o.type);let l=n.create(i,null,s||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,l);if(!n.validContent(o.content))throw RangeError("Invalid content for node type "+n.name);t.step(new g(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new r.p2(r.HY.from(l),0,0),1,!0))}(this,t,e,n,i),this}setNodeAttribute(t,e,n){return this.step(new I(t,e,n)),this}setDocAttribute(t,e){return this.step(new z(t,e)),this}addNodeMark(t,e){return this.step(new d(t,e)),this}removeNodeMark(t,e){if(!(e instanceof r.vc)){let n=this.doc.nodeAt(t);if(!n)throw RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new f(t,e)),this}split(t,e=1,n){return!function(t,e,n=1,i){let s=t.doc.resolve(e),o=r.HY.empty,l=r.HY.empty;for(let t=s.depth,e=s.depth-n,h=n-1;t>e;t--,h--){o=r.HY.from(s.node(t).copy(o));let e=i&&i[h];l=r.HY.from(e?e.type.create(e.attrs,l):s.node(t).copy(l))}t.step(new m(e,e,new r.p2(o.append(l),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){var r;let i,s,o,l;return r=this,o=[],l=[],r.doc.nodesBetween(t,e,(r,h,a)=>{if(!r.isInline)return;let c=r.marks;if(!n.isInSet(c)&&a.type.allowsMarkType(n.type)){let a=Math.max(h,t),d=Math.min(h+r.nodeSize,e),f=n.addToSet(c);for(let t=0;tr.step(t)),l.forEach(t=>r.step(t)),this}removeMark(t,e,n){var i;let s,o;return i=this,s=[],o=0,i.doc.nodesBetween(t,e,(i,l)=>{if(!i.isInline)return;o++;let h=null;if(n instanceof r.ZU){let t=i.marks,e;for(;e=n.isInSet(t);)(h||(h=[])).push(e),t=e.removeFromSet(t)}else n?n.isInSet(i.marks)&&(h=[n]):h=i.marks;if(h&&h.length){let n=Math.min(l+i.nodeSize,e);for(let e=0;ei.step(new u(t.from,t.to,t.style))),this}clearIncompatible(t,e,n){return!function(t,e,n,i=n.contentMatch){let s=t.doc.nodeAt(e),o=[],l=e+1;for(let e=0;e=0;e--)t.step(o[e])}(this,t,e,n),this}}}}]);