pleroma/priv/static/adminfe/static/js/chunk-0ae4.08b37e98.js
2022-11-22 23:53:01 +01:00

25 lines
286 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-0ae4"],{"+/fp":function(e,t){e.exports=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}},"49oK":function(e,t,n){"use strict";n.d(t,"a",function(){return g}),n.d(t,"b",function(){return m});for(var r={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:"'"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},s="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),o=("undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=o||s&&+s[1]<57,c=0;c<10;c++)r[48+c]=r[96+c]=String(c);for(c=1;c<=24;c++)r[c+111]="F"+c;for(c=65;c<=90;c++)r[c]=String.fromCharCode(c+32),i[c]=String.fromCharCode(c);for(var h in r)i.hasOwnProperty(h)||(i[h]=r[h]);var d=n("b/sn");const u="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function p(e){let t,n,r,i,s=e.split(/-(?!$)/),o=s[s.length-1];"Space"==o&&(o=" ");for(let l=0;l<s.length-1;l++){let e=s[l];if(/^(cmd|meta|m)$/i.test(e))i=!0;else if(/^a(lt)?$/i.test(e))t=!0;else if(/^(c|ctrl|control)$/i.test(e))n=!0;else if(/^s(hift)?$/i.test(e))r=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);u?i=!0:n=!0}}return t&&(o="Alt-"+o),n&&(o="Ctrl-"+o),i&&(o="Meta-"+o),r&&(o="Shift-"+o),o}function f(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function m(e){return new d.d({props:{handleKeyDown:g(e)}})}function g(e){let t=function(e){let t=Object.create(null);for(let n in e)t[p(n)]=e[n];return t}(e);return function(e,n){let s,o=function(e){var t=!(a&&(e.ctrlKey||e.altKey||e.metaKey)||l&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?i:r)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),c=1==o.length&&" "!=o,h=t[f(o,n,!c)];if(h&&h(e.state,e.dispatch,e))return!0;if(c&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(s=r[n.keyCode])&&s!=o){let r=t[f(s,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}else if(c&&n.shiftKey){let r=t[f(o,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}},"4MG8":function(e,t,n){const r=n("T9Ld"),i=n("66f7"),s=n("SbYC"),o=n("+/fp"),l=n("hyX7"),a=n("J7Ao"),{merge:c,checkSanitizeDeprecation:h,escape:d}=n("rUJ1"),{getDefaults:u,changeDefaults:p,defaults:f}=n("vbtb");function m(e,t,n){if(void 0===e||null===e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(n||"function"==typeof t){n||(n=t,t=null),t=c({},m.defaults,t||{}),h(t);const s=t.highlight;let o,l,a=0;try{o=r.lex(e,t)}catch(e){return n(e)}l=o.length;const d=function(e){if(e)return t.highlight=s,n(e);let r;try{r=i.parse(o,t)}catch(t){e=t}return t.highlight=s,e?n(e):n(null,r)};if(!s||s.length<3)return d();if(delete t.highlight,!l)return d();for(;a<o.length;a++)!function(e){"code"!==e.type?--l||d():s(e.text,e.lang,function(t,n){return t?d(t):null==n||n===e.text?--l||d():(e.text=n,e.escaped=!0,void(--l||d()))})}(o[a])}else try{return t=c({},m.defaults,t||{}),h(t),i.parse(r.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||m.defaults).silent)return"<p>An error occurred:</p><pre>"+d(e.message+"",!0)+"</pre>";throw e}}m.options=m.setOptions=function(e){return c(m.defaults,e),p(m.defaults),m},m.getDefaults=u,m.defaults=f,m.Parser=i,m.parser=i.parse,m.Renderer=s,m.TextRenderer=o,m.Lexer=r,m.lexer=r.lex,m.InlineLexer=l,m.inlineLexer=l.output,m.Slugger=a,m.parse=m,e.exports=m},"66f7":function(e,t,n){const r=n("SbYC"),i=n("J7Ao"),s=n("hyX7"),o=n("+/fp"),{defaults:l}=n("vbtb"),{merge:a,unescape:c}=n("rUJ1");e.exports=class e{constructor(e){this.tokens=[],this.token=null,this.options=e||l,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new i}static parse(t,n){return new e(n).parse(t)}parse(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,a({},this.options,{renderer:new o})),this.tokens=e.reverse();let t="";for(;this.next();)t+=this.tok();return t}next(){return this.token=this.tokens.pop(),this.token}peek(){return this.tokens[this.tokens.length-1]||0}parseText(){let e=this.token.text;for(;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}tok(){let e="";switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,c(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":{let t,n,r,i,s="";for(r="",t=0;t<this.token.header.length;t++)r+=this.renderer.tablecell(this.inline.output(this.token.header[t]),{header:!0,align:this.token.align[t]});for(s+=this.renderer.tablerow(r),t=0;t<this.token.cells.length;t++){for(n=this.token.cells[t],r="",i=0;i<n.length;i++)r+=this.renderer.tablecell(this.inline.output(n[i]),{header:!1,align:this.token.align[i]});e+=this.renderer.tablerow(r)}return this.renderer.table(s,e)}case"blockquote_start":for(e="";"blockquote_end"!==this.next().type;)e+=this.tok();return this.renderer.blockquote(e);case"list_start":{e="";const t=this.token.ordered,n=this.token.start;for(;"list_end"!==this.next().type;)e+=this.tok();return this.renderer.list(e,t,n)}case"list_item_start":{e="";const t=this.token.loose,n=this.token.checked,r=this.token.task;if(this.token.task)if(t)if("text"===this.peek().type){const e=this.peek();e.text=this.renderer.checkbox(n)+" "+e.text}else this.tokens.push({type:"text",text:this.renderer.checkbox(n)});else e+=this.renderer.checkbox(n);for(;"list_item_end"!==this.next().type;)e+=t||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(e,r,n)}case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText());default:{const e='Token with "'+this.token.type+'" type was not found.';if(!this.options.silent)throw new Error(e);console.log(e)}}}}},"8j27":function(e,t,n){"use strict";n.d(t,"a",function(){return ne}),n.d(t,"b",function(){return ce}),n.d(t,"c",function(){return re}),n.d(t,"d",function(){return ie}),n.d(t,"e",function(){return se}),n.d(t,"f",function(){return pe}),n.d(t,"g",function(){return oe}),n.d(t,"h",function(){return he}),n.d(t,"i",function(){return de}),n.d(t,"j",function(){return le}),n.d(t,"k",function(){return ae}),n.d(t,"l",function(){return ue});var r=n("zUJn"),i=n("qd4/"),s=(n("POQ2"),n("cD+i"),n("oV9I")),o=n("byeC"),l=n("b/sn"),a=n("49oK"),c=n("uSMm");let h,d;if("undefined"!=typeof WeakMap){let e=new WeakMap;h=(t=>e.get(t)),d=((t,n)=>(e.set(t,n),n))}else{let e=[],t=10,n=0;h=(t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]}),d=((r,i)=>(n==t&&(n=0),e[n++]=r,e[n++]=i))}class u{constructor(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r}}class p{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,s=r+1,o=i+1;for(let e=1;s<this.width&&this.map[t+e]==n;e++)s++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return new u(r,i,s,o)}throw new RangeError("No cell with offset "+e+" found")}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError("No cell with offset "+e+" found")}nextCell(e,t,n){let{left:r,right:i,top:s,bottom:o}=this.findCell(e);return"horiz"==t?(n<0?0==r:i==this.width)?null:this.map[s*this.width+(n<0?r-1:i)]:(n<0?0==s:o==this.height)?null:this.map[r+this.width*(n<0?s-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:s}=this.findCell(e),{left:o,right:l,top:a,bottom:c}=this.findCell(t);return new u(Math.min(n,o),Math.min(i,a),Math.max(r,l),Math.max(s,c))}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let s=r*this.width+i,o=this.map[s];n[o]||(n[o]=!0,i==e.left&&i&&this.map[s-1]==o||r==e.top&&r&&this.map[s-this.width]==o||t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let s=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?s-1:this.map[n]}i=s}}static get(e){return h(e)||d(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);let t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),s=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(s+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);s+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=s:t!=s&&(t=Math.max(t,s))}return t}(e),n=e.childCount,r=[],i=0,s=null,o=[];for(let c=0,h=t*n;c<h;c++)r[c]=0;for(let c=0,h=0;c<n;c++){let l=e.child(c);h++;for(let e=0;;e++){for(;i<r.length&&0!=r[i];)i++;if(e==l.childCount)break;let a=l.child(e),{colspan:d,rowspan:u,colwidth:p}=a.attrs;for(let e=0;e<u;e++){if(e+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:h,n:u-e});break}let l=i+e*t;for(let e=0;e<d;e++){0==r[l+e]?r[l+e]=h:(s||(s=[])).push({type:"collision",row:c,pos:h,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];null==i||i!=n&&1==o[r+1]?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,h+=a.nodeSize}let a=(c+1)*t,d=0;for(;i<a;)0==r[i++]&&d++;d&&(s||(s=[])).push({type:"missing",row:c,n:d}),h++}let l=new p(t,n,r,s),a=!1;for(let c=0;!a&&c<o.length;c+=2)null!=o[c]&&o[c+1]<n&&(a=!0);a&&function(e,t,n){e.problems||(e.problems=[]);for(let r=0,i={};r<e.map.length;r++){let s=e.map[r];if(i[s])continue;i[s]=!0;let o=n.nodeAt(s),l=null;for(let n=0;n<o.attrs.colspan;n++){let i=(r+n)%e.width,s=t[2*i];null==s||o.attrs.colwidth&&o.attrs.colwidth[n]==s||((l||(l=f(o.attrs)))[n]=s)}l&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}(l,o,e);return l}(e))}}function f(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function m(e,t){let n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(e=>Number(e)):null,i=Number(e.getAttribute("colspan")||1),s={colspan:i,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==i?r:null};for(let o in t){let n=t[o].getFromDOM,r=n&&n(e);null!=r&&(s[o]=r)}return s}function g(e,t){let n={};1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(","));for(let r in t){let i=t[r].setDOMAttr;i&&i(e.attrs[r],n)}return n}function y(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}new l.e("selectingCells");function w(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function b(e){let t=e.selection.$head;for(let n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function x(e){let t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:w(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head)}function k(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function v(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function S(e,t,n){let r=e.start(-1),i=p.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==i?null:e.node(0).resolve(r+i)}function C(e,t,n){let r={};for(let i in e)r[i]=e[i];return r[t]=n,r}function O(e,t,n=1){let r=C(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}class M extends l.f{constructor(e,t=e){let n=e.node(-1),r=p.get(n),i=e.start(-1),s=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),a=r.cellsInRect(s).filter(e=>e!=t.pos-i);a.unshift(t.pos-i);let c=a.map(e=>{let t=n.nodeAt(e),r=e+i+1;return new l.g(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(e,t){let n=e.resolve(t.map(this.$anchorCell.pos)),r=e.resolve(t.map(this.$headCell.pos));if(k(n)&&k(r)&&v(n,r)){let e=this.$anchorCell.node(-1)!=n.node(-1);return e&&this.isRowSelection()?M.rowSelection(n,r):e&&this.isColSelection()?M.colSelection(n,r):new M(n,r)}return l.h.between(n,r)}content(){let e=this.$anchorCell.node(-1),t=p.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},s=[];for(let a=r.top;a<r.bottom;a++){let n=[];for(let s=a*t.width+r.left,o=r.left;o<r.right;o++,s++){let o=t.map[s];if(!i[o]){i[o]=!0;let s=t.findCell(o),l=e.nodeAt(o),a=r.left-s.left,c=s.right-r.right;if(a>0||c>0){let e=l.attrs;a>0&&(e=O(e,0,a)),c>0&&(e=O(e,e.colspan-c,c)),l=s.left<r.left?l.type.createAndFill(e):l.type.create(e,l.content)}if(s.top<r.top||s.bottom>r.bottom){let e=C(l.attrs,"rowspan",Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top));l=s.top<r.top?l.type.createAndFill(e):l.type.create(e,l.content)}n.push(l)}}s.push(e.child(a).copy(o.c.from(n)))}const l=this.isColSelection()&&this.isRowSelection()?e:s;return new o.j(o.c.from(l),1,1)}replace(e,t=o.j.empty){let n=e.steps.length,r=this.ranges;for(let s=0;s<r.length;s++){let{$from:i,$to:l}=r[s],a=e.mapping.slice(n);e.replace(a.map(i.pos),a.map(l.pos),s?o.j.empty:t)}let i=l.f.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new o.j(o.c.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=p.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let s=0;s<i.length;s++)e(t.nodeAt(i[s]),r+i[s])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){let n=p.get(e.node(-1)),r=e.start(-1),i=n.findCell(e.pos-r),s=n.findCell(t.pos-r),o=e.node(0);return i.top<=s.top?(i.top>0&&(e=o.resolve(r+n.map[i.left])),s.bottom<n.height&&(t=o.resolve(r+n.map[n.width*(n.height-1)+s.right-1]))):(s.top>0&&(t=o.resolve(r+n.map[s.left])),i.bottom<n.height&&(e=o.resolve(r+n.map[n.width*(n.height-1)+i.right-1]))),new M(e,t)}isRowSelection(){let e=p.get(this.$anchorCell.node(-1)),t=this.$anchorCell.start(-1),n=e.colCount(this.$anchorCell.pos-t),r=e.colCount(this.$headCell.pos-t);if(Math.min(n,r)>0)return!1;let i=n+this.$anchorCell.nodeAfter.attrs.colspan,s=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,s)==e.width}eq(e){return e instanceof M&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){let n=p.get(e.node(-1)),r=e.start(-1),i=n.findCell(e.pos-r),s=n.findCell(t.pos-r),o=e.node(0);return i.left<=s.left?(i.left>0&&(e=o.resolve(r+n.map[i.top*n.width])),s.right<n.width&&(t=o.resolve(r+n.map[n.width*(s.top+1)-1]))):(s.left>0&&(t=o.resolve(r+n.map[s.top*n.width])),i.right<n.width&&(e=o.resolve(r+n.map[n.width*(i.top+1)-1]))),new M(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new M(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){return new M(e.resolve(t),e.resolve(n))}getBookmark(){return new N(this.$anchorCell.pos,this.$headCell.pos)}}M.prototype.visible=!1,l.f.jsonID("cell",M);class N{constructor(e,t){this.anchor=e,this.head=t}map(e){return new N(e.map(this.anchor),e.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&v(t,n)?new M(t,n):l.f.near(n,1)}}Object(a.a)({ArrowLeft:A("horiz",-1),ArrowRight:A("horiz",1),ArrowUp:A("vert",-1),ArrowDown:A("vert",1),"Shift-ArrowLeft":D("horiz",-1),"Shift-ArrowRight":D("horiz",1),"Shift-ArrowUp":D("vert",-1),"Shift-ArrowDown":D("vert",1),Backspace:T,"Mod-Backspace":T,Delete:T,"Mod-Delete":T});function E(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function A(e,t){return(n,r,i)=>{let s=n.selection;if(s instanceof M)return E(n,r,l.f.near(s.$headCell,t));if("horiz"!=e&&!s.empty)return!1;let o=R(i,e,t);if(null==o)return!1;if("horiz"==e)return E(n,r,l.f.near(n.doc.resolve(s.head+t),t));{let i,s=n.doc.resolve(o),a=S(s,e,t);return E(n,r,i=a?l.f.near(a,1):t<0?l.f.near(n.doc.resolve(s.before(-1)),-1):l.f.near(n.doc.resolve(s.after(-1)),1))}}}function D(e,t){return(n,r,i)=>{let s=n.selection;if(!(s instanceof M)){let r=R(i,e,t);if(null==r)return!1;s=new M(n.doc.resolve(r))}let o=S(s.$headCell,e,t);return!!o&&E(n,r,new M(s.$anchorCell,o))}}function T(e,t){let n=e.selection;if(!(n instanceof M))return!1;if(t){let r=e.tr,i=y(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new o.j(i,0,0))}),r.docChanged&&t(r)}return!0}function R(e,t,n){if(!(e.state.selection instanceof l.h))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let s=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:s.childCount))return null;if("cell"==s.type.spec.tableRole||"header_cell"==s.type.spec.tableRole){let s=r.before(i),o="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(o)?s:null}}return null}new l.e("fix-tables");function I(e){let t,n=e.selection,r=x(e),i=r.node(-1),s=r.start(-1),o=p.get(i);return(t=n instanceof M?o.rectBetween(n.$anchorCell.pos-s,n.$headCell.pos-s):o.findCell(r.pos-s)).tableStart=s,t.map=o,t.table=i,t}function $(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let i=0;i<r.length;i++){const e=t.table.nodeAt(r[i]);if(e&&e.type!==n.header_cell)return!1}return!0}function z(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!b(t))return!1;if(n){let r=y(t.schema),i=I(t),s=t.tr,o=i.map.cellsInRect("column"==e?new u(i.left,0,i.right,i.map.height):"row"==e?new u(0,i.top,i.map.width,i.bottom):i),l=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)l[e].type==r.header_cell&&s.setNodeMarkup(i.tableStart+o[e],r.cell,l[e].attrs);if(0==s.steps.length)for(let e=0;e<o.length;e++)s.setNodeMarkup(i.tableStart+o[e],r.header_cell,l[e].attrs);n(s)}return!0}}(e):function(t,n){if(!b(t))return!1;if(n){let r=y(t.schema),i=I(t),s=t.tr,o=$("row",i,r),l=$("column",i,r),a=("column"===e?o:"row"===e&&l)?1:0,c="column"==e?new u(0,a,1,i.map.height):"row"==e?new u(a,0,i.map.width,1):i,h="column"==e?l?r.cell:r.header_cell:"row"==e?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(c).forEach(e=>{const t=e+i.tableStart,n=s.doc.nodeAt(t);n&&s.setNodeMarkup(t,h,n.attrs)}),n(s)}return!0}}z("row",{useDeprecatedLogic:!0}),z("column",{useDeprecatedLogic:!0}),z("cell",{useDeprecatedLogic:!0});new l.e("tableColumnResizing");new l.e("collab");var P=function(){};P.prototype.append=function(e){return e.length?(e=P.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},P.prototype.prepend=function(e){return e.length?P.from(e).append(this):this},P.prototype.appendInner=function(e){return new j(this,e)},P.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?P.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},P.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},P.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},P.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},P.from=function(e){return e instanceof P?e:e&&e.length?new _(e):P.empty};var _=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(P);P.empty=new _([]);var j=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(P),B=P;const V=500;class F{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let s,o,l=e.tr,a=[],c=[];return this.items.forEach((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new L(e.map));let t,i=e.step.map(n.slice(r));i&&l.maybeStep(i).doc&&(t=l.mapping.maps[l.mapping.maps.length-1],a.push(new L(t,void 0,void 0,a.length+c.length))),r--,t&&n.appendMap(t,r)}else l.maybeStep(e.step);return e.selection?(s=n?e.selection.map(n.slice(r)):e.selection,o=new F(this.items.slice(0,i).append(c.reverse().concat(a)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:o,transform:l,selection:s}}addTransform(e,t,n,r){let i=[],s=this.eventCount,o=this.items,l=!r&&o.length?o.get(o.length-1):null;for(let c=0;c<e.steps.length;c++){let n,a=e.steps[c].invert(e.docs[c]),h=new L(e.mapping.maps[c],a,t);(n=l&&l.merge(h))&&(h=n,c?i.pop():o=o.slice(0,o.length-1)),i.push(h),t&&(s++,t=void 0),r||(l=h)}let a=s-n.depth;return a>J&&(o=function(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&0==t--)return n=r,!1}),e.slice(n)}(o,a),s-=a),new F(o.append(i),s)}remapping(e,t){let n=new c.a;return this.items.forEach((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(e){return 0==this.eventCount?this:new F(this.items.append(e.map(e=>new L(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,s=e.steps.length,o=this.eventCount;this.items.forEach(e=>{e.selection&&o--},r);let l=t;this.items.forEach(t=>{let r=i.getMirror(--l);if(null==r)return;s=Math.min(s,r);let a=i.maps[r];if(t.step){let s=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(l+1,r));c&&o++,n.push(new L(a,s,c))}else n.push(new L(a))},r);let a=[];for(let d=t;d<s;d++)a.push(new L(i.maps[d]));let c=this.items.slice(0,r).append(a).append(n),h=new F(c,o);return h.emptyItemCount()>V&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((s,o)=>{if(o>=e)r.push(s),s.selection&&i++;else if(s.step){let e=s.step.map(t.slice(n)),o=e&&e.getMap();if(n--,o&&t.appendMap(o,n),e){let l=s.selection&&s.selection.map(t.slice(n));l&&i++;let a,c=new L(o.invert(),e,l),h=r.length-1;(a=r.length&&r[h].merge(c))?r[h]=a:r.push(c)}}else s.map&&n--},this.items.length,0),new F(B.from(r.reverse()),i)}}F.empty=new F(B.empty,0);class L{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new L(t.getMap().invert(),t,this.selection)}}}class q{constructor(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r}}const J=20;function W(e){let t=[];return e.forEach((e,n,r,i)=>t.push(r,i)),t}function H(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),s=t.map(e[r+1],-1);i<=s&&n.push(i,s)}return n}function K(e,t,n,r){let i=Z(t),s=X.get(t).spec.config,o=(r?e.undone:e.done).popEvent(t,i);if(!o)return;let l=o.selection.resolve(o.transform.doc),a=(r?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),s,i),c=new q(r?a:o.remaining,r?o.remaining:a,null,0);n(o.transform.setSelection(l).setMeta(X,{redo:r,historyState:c}).scrollIntoView())}let U=!1,G=null;function Z(e){let t=e.plugins;if(G!=t){U=!1,G=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){U=!0;break}}return U}const X=new l.e("history"),Y=new l.e("closeHistory");function Q(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new l.d({key:X,state:{init:()=>new q(F.empty,F.empty,null,0),apply:(t,n,r)=>(function(e,t,n,r){let i,s=n.getMeta(X);if(s)return s.historyState;n.getMeta(Y)&&(e=new q(e.done,e.undone,null,0));let o=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(o&&o.getMeta(X))return o.getMeta(X).redo?new q(e.done.addTransform(n,void 0,r,Z(t)),e.undone,W(n.mapping.maps[n.steps.length-1]),e.prevTime):new q(e.done,e.undone.addTransform(n,void 0,r,Z(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new q(e.done.rebased(n,i),e.undone.rebased(n,i),H(e.prevRanges,n.mapping),e.prevTime):new q(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),H(e.prevRanges,n.mapping),e.prevTime);{let i=0==e.prevTime||!o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}(n,e.prevRanges)),s=o?H(e.prevRanges,n.mapping):W(n.mapping.maps[n.steps.length-1]);return new q(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,Z(t)),F.empty,s,n.time)}})(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?ee:"historyRedo"==n?te:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const ee=(e,t)=>{let n=X.getState(e);return!(!n||0==n.done.eventCount)&&(t&&K(n,e,t,!1),!0)},te=(e,t)=>{let n=X.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&K(n,e,t,!0),!0)};
/*!
* tiptap-extensions v1.35.1
* (c) 2021 überdosis GbR (limited liability)
* @license MIT
*/
class ne extends r.f{get name(){return"blockquote"}get schema(){return{content:"block*",group:"block",defining:!0,draggable:!1,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]}}commands({type:e}){return()=>Object(i.s)(e)}keys({type:e}){return{"Ctrl->":Object(i.s)(e)}}inputRules({type:e}){return[Object(i.u)(/^\s*>\s$/,e)]}}class re extends r.f{get name(){return"bullet_list"}get schema(){return{content:"list_item+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]}}commands({type:e,schema:t}){return()=>Object(i.q)(e,t.nodes.list_item)}keys({type:e,schema:t}){return{"Shift-Ctrl-8":Object(i.q)(e,t.nodes.list_item)}}inputRules({type:e}){return[Object(i.u)(/^\s*([-+*])\s$/,e)]}}class ie extends r.f{get name(){return"code_block"}get schema(){return{content:"text*",marks:"",group:"block",code:!0,defining:!0,draggable:!1,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:()=>["pre",["code",0]]}}commands({type:e,schema:t}){return()=>Object(i.p)(e,t.nodes.paragraph)}keys({type:e}){return{"Shift-Ctrl-\\":Object(i.k)(e)}}inputRules({type:e}){return[Object(i.o)(/^```$/,e)]}}class se extends r.f{get name(){return"heading"}get defaultOptions(){return{levels:[1,2,3,4,5,6]}}get schema(){return{attrs:{level:{default:1}},content:"inline*",group:"block",defining:!0,draggable:!1,parseDOM:this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}})),toDOM:e=>[`h${e.attrs.level}`,0]}}commands({type:e,schema:t}){return n=>Object(i.p)(e,t.nodes.paragraph,n)}keys({type:e}){return this.options.levels.reduce((t,n)=>({...t,...{[`Shift-Ctrl-${n}`]:Object(i.k)(e,{level:n})}}),{})}inputRules({type:e}){return this.options.levels.map(t=>Object(i.o)(new RegExp(`^(#{1,${t}})\\s$`),e,()=>({level:t})))}}class oe extends r.f{get name(){return"horizontal_rule"}get schema(){return{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]}}commands({type:e}){return()=>(t,n)=>n(t.tr.replaceSelectionWith(e.create()))}inputRules({type:e}){return[Object(i.g)(/^(?:---|___\s|\*\*\*\s)$/,e)]}}class le extends r.f{get name(){return"list_item"}get schema(){return{content:"paragraph block*",defining:!0,draggable:!1,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}}keys({type:e}){return{Enter:Object(i.m)(e),Tab:Object(i.l)(e),"Shift-Tab":Object(i.d)(e)}}}class ae extends r.f{get name(){return"ordered_list"}get schema(){return{attrs:{order:{default:1}},content:"list_item+",group:"block",parseDOM:[{tag:"ol",getAttrs:e=>({order:e.hasAttribute("start")?+e.getAttribute("start"):1})}],toDOM:e=>1===e.attrs.order?["ol",0]:["ol",{start:e.attrs.order},0]}}commands({type:e,schema:t}){return()=>Object(i.q)(e,t.nodes.list_item)}keys({type:e,schema:t}){return{"Shift-Ctrl-9":Object(i.q)(e,t.nodes.list_item)}}inputRules({type:e}){return[Object(i.u)(/^(\d+)\.\s$/,e,e=>({order:+e[1]}),(e,t)=>t.childCount+t.attrs.order===+e[1])]}}!function(e){let t=e.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(let r in t)n[r]={default:t[r].default};e.tableGroup,e.cellContent,e.cellContent}({tableGroup:"block",cellContent:"block+",cellAttributes:{background:{default:null,getFromDOM:e=>e.style.backgroundColor||null,setDOMAttr(e,t){if(e){const n={style:`${t.style||""}background-color: ${e};`};Object.assign(t,n)}}}}});class ce extends r.e{get name(){return"bold"}get schema(){return{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:()=>["strong",0]}}keys({type:e}){return{"Mod-b":Object(i.r)(e)}}commands({type:e}){return()=>Object(i.r)(e)}inputRules({type:e}){return[Object(i.e)(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,e)]}pasteRules({type:e}){return[Object(i.f)(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g,e)]}}class he extends r.e{get name(){return"italic"}get schema(){return{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}}keys({type:e}){return{"Mod-i":Object(i.r)(e)}}commands({type:e}){return()=>Object(i.r)(e)}inputRules({type:e}){return[Object(i.e)(/(?:^|[^_])(_([^_]+)_)$/,e),Object(i.e)(/(?:^|[^*])(\*([^*]+)\*)$/,e)]}pasteRules({type:e}){return[Object(i.f)(/_([^_]+)_/g,e),Object(i.f)(/\*([^*]+)\*/g,e)]}}class de extends r.e{get name(){return"link"}get defaultOptions(){return{openOnClick:!0,target:null}}get schema(){return{attrs:{href:{default:null},target:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:e=>({href:e.getAttribute("href"),target:e.getAttribute("target")})}],toDOM:e=>["a",{...e.attrs,rel:"noopener noreferrer nofollow",target:e.attrs.target||this.options.target},0]}}commands({type:e}){return t=>t.href?Object(i.t)(e,t):Object(i.i)(e)}pasteRules({type:e}){return[Object(i.h)(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b([-a-zA-Z0-9@:%_+.~#?&//=,()!]*)/gi,e,e=>({href:e}))]}get plugins(){return this.options.openOnClick?[new r.g({props:{handleClick:(e,t,n)=>{const{schema:r}=e.state,i=Object(s.d)(e.state,r.marks.link);i.href&&n.target instanceof HTMLAnchorElement&&(n.stopPropagation(),window.open(i.href,i.target))}}})]:[]}}class ue extends r.e{get name(){return"underline"}get schema(){return{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:e=>"underline"===e}],toDOM:()=>["u",0]}}keys({type:e}){return{"Mod-u":Object(i.r)(e)}}commands({type:e}){return()=>Object(i.r)(e)}}class pe extends r.d{get name(){return"history"}get defaultOptions(){return{depth:"",newGroupDelay:""}}keys(){return{"Mod-z":ee,"Mod-y":te,"Shift-Mod-z":te,"Mod-я":ee,"Shift-Mod-я":te}}get plugins(){return[Q({depth:this.options.depth,newGroupDelay:this.options.newGroupDelay})]}commands(){return{undo:()=>ee,redo:()=>te,undoDepth:()=>(function(e){let t=X.getState(e);return t?t.done.eventCount:0}),redoDepth:()=>(function(e){let t=X.getState(e);return t?t.undone.eventCount:0})}}}},Bz7v:function(e,t,n){"use strict";var r=n("Xb7u"),i=s(Error);function s(e){return t.displayName=e.displayName||e.name,t;function t(t){return t&&(t=r.apply(null,arguments)),new e(t)}}e.exports=i,i.eval=s(EvalError),i.range=s(RangeError),i.reference=s(ReferenceError),i.syntax=s(SyntaxError),i.type=s(TypeError),i.uri=s(URIError),i.create=s},ECCn:function(e,t){function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){var r=e[t];"object"!=typeof r||Object.isFrozen(r)||n(r)}),e}var r=n,i=n;r.default=i;class s{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function o(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function l(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(e){for(const t in e)n[t]=e[t]}),n}const a="</span>",c=e=>!!e.kind;class h{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=o(e)}openNode(e){if(!c(e))return;let t=e.kind;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){c(e)&&(this.buffer+=a)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class d{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{d._collapse(e)}))}}class u extends d{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new h(this,this.options).value()}finalize(){return!0}}function p(e){return e?"string"==typeof e?e:e.source:null}const f=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const m="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",g={begin:"\\\\[\\s\\S]",relevance:0},y={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[g]},w={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[g]},b={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},x=function(e,t,n={}){const r=l({className:"comment",begin:e,end:t,contains:[]},n);return r.contains.push(b),r.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),r},k=x("//","$"),v=x("/\\*","\\*/"),S=x("#","$"),C={className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},O={className:"number",begin:m,relevance:0},M={className:"number",begin:"\\b(0b[01]+)",relevance:0},N={className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},E={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[g,{begin:/\[/,end:/\]/,relevance:0,contains:[g]}]}]},A={className:"title",begin:"[a-zA-Z]\\w*",relevance:0},D={className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},T={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var R=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:m,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>p(e)).join("")}(t,/.*\b/,e.binary,/\b.*/)),l({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:g,APOS_STRING_MODE:y,QUOTE_STRING_MODE:w,PHRASAL_WORDS_MODE:b,COMMENT:x,C_LINE_COMMENT_MODE:k,C_BLOCK_COMMENT_MODE:v,HASH_COMMENT_MODE:S,NUMBER_MODE:C,C_NUMBER_MODE:O,BINARY_NUMBER_MODE:M,CSS_NUMBER_MODE:N,REGEXP_MODE:E,TITLE_MODE:A,UNDERSCORE_TITLE_MODE:D,METHOD_GUARD:T,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function I(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function $(e,t){Array.isArray(e.illegal)&&(e.illegal=function(...e){return"("+e.map(e=>p(e)).join("|")+")"}(...e.illegal))}const z=["of","and","for","in","not","or","if","then","parent","list","value"],P="keyword";function _(e,t,n=P){const r={};return"string"==typeof e?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,_(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){const n=t.split("|");r[n[0]]=[e,function(e,t){if(t)return Number(t);return function(e){return z.includes(e.toLowerCase())}(e)?0:1}(n[0],n[1])]})}}function j(e,{plugins:t}){function n(t,n){return new RegExp(p(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=function(e){return new RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=(()=>null));const e=this.regexes.map(e=>e[1]);this.matcherRe=n(function(e,t="|"){let n=0;return e.map(e=>{const t=n+=1;let r=p(e),i="";for(;r.length>0;){const e=f.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i}).map(e=>`(${e})`).join(t)}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new r;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=l(e.classNameAliases||{}),function t(r,s){const o=r;if(r.isCompiled)return o;[function(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}].forEach(e=>e(r,s)),e.compilerExtensions.forEach(e=>e(r,s)),r.__beforeBegin=null,[function(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=I,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))},$,function(e,t){void 0===e.relevance&&(e.relevance=1)}].forEach(e=>e(r,s)),r.isCompiled=!0;let a=null;if("object"==typeof r.keywords&&(a=r.keywords.$pattern,delete r.keywords.$pattern),r.keywords&&(r.keywords=_(r.keywords,e.case_insensitive)),r.lexemes&&a)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return a=a||r.lexemes||/\w+/,o.keywordPatternRe=n(a,!0),s&&(r.begin||(r.begin=/\B|\b/),o.beginRe=n(r.begin),r.endSameAsBegin&&(r.end=r.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(o.endRe=n(r.end)),o.terminatorEnd=p(r.end)||"",r.endsWithParent&&s.terminatorEnd&&(o.terminatorEnd+=(r.end?"|":"")+s.terminatorEnd)),r.illegal&&(o.illegalRe=n(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map(function(e){return function(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return l(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(e)?l(e,{starts:e.starts?l(e.starts):null}):Object.isFrozen(e)?l(e):e}("self"===e?r:e)})),r.contains.forEach(function(e){t(e,o)}),r.starts&&t(r.starts,s),o.matcher=function(e){const t=new i;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(o),o}(e)}function B(e){const t={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,o(this.code);let t={};return this.autoDetect?(t=e.highlightAuto(this.code),this.detectedLanguage=t.language):(t=e.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),t.value},autoDetect(){return!this.language||function(e){return Boolean(e||""===e)}(this.autodetect)},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:t,VuePlugin:{install(e){e.component("highlightjs",t)}}}}const V={"after:highlightElement":({el:e,result:t,text:n})=>{const r=L(e);if(!r.length)return;const i=document.createElement("div");i.innerHTML=t.value,t.value=function(e,t,n){let r=0,i="";const s=[];function l(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset<t[0].offset?e:t:"start"===t[0].event?e:t:e.length?e:t}function a(e){i+="<"+F(e)+[].map.call(e.attributes,function(e){return" "+e.nodeName+'="'+o(e.value)+'"'}).join("")+">"}function c(e){i+="</"+F(e)+">"}function h(e){("start"===e.event?a:c)(e.node)}for(;e.length||t.length;){let t=l();if(i+=o(n.substring(r,t[0].offset)),r=t[0].offset,t===e){s.reverse().forEach(c);do{h(t.splice(0,1)[0]),t=l()}while(t===e&&t.length&&t[0].offset===r);s.reverse().forEach(a)}else"start"===t[0].event?s.push(t[0].node):s.pop(),h(t.splice(0,1)[0])}return i+o(n.substr(r))}(r,L(i),n)}};function F(e){return e.nodeName.toLowerCase()}function L(e){const t=[];return function e(n,r){for(let i=n.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(t.push({event:"start",offset:r,node:i}),r=e(i,r),F(i).match(/br|hr|img|input/)||t.push({event:"stop",offset:r,node:i}));return r}(e,0),t}const q={},J=e=>{console.error(e)},W=(e,...t)=>{console.log(`WARN: ${e}`,...t)},H=(e,t)=>{q[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),q[`${e}/${t}`]=!0)},K=o,U=l,G=Symbol("nomatch");var Z=function(e){const t=Object.create(null),n=Object.create(null),i=[];let o=!0;const l=/(^(<[^>]+>|\t|)+|\n)/gm,a="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let h={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:u};function d(e){return h.noHighlightRe.test(e)}function p(e,t,n,r){let i="",s="";"object"==typeof t?(i=e,n=t.ignoreIllegals,s=t.language,r=void 0):(H("10.7.0","highlight(lang, code, ...args) has been deprecated."),H("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),s=e,i=t);const o={code:i,language:s};M("before:highlight",o);const l=o.result?o.result:f(o.language,o.code,n,r);return l.code=o.code,M("after:highlight",l),l}function f(e,n,r,l){function c(e,t){const n=x.case_insensitive?t[0].toLowerCase():t[0];return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]}function d(){null!=C.subLanguage?function(){if(""===N)return;let e=null;if("string"==typeof C.subLanguage){if(!t[C.subLanguage])return void M.addText(N);e=f(C.subLanguage,N,!0,O[C.subLanguage]),O[C.subLanguage]=e.top}else e=m(N,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(E+=e.relevance),M.addSublanguage(e.emitter,e.language)}():function(){if(!C.keywords)return void M.addText(N);let e=0;C.keywordPatternRe.lastIndex=0;let t=C.keywordPatternRe.exec(N),n="";for(;t;){n+=N.substring(e,t.index);const r=c(C,t);if(r){const[e,i]=r;if(M.addText(n),n="",E+=i,e.startsWith("_"))n+=t[0];else{const n=x.classNameAliases[e]||e;M.addKeyword(t[0],n)}}else n+=t[0];e=C.keywordPatternRe.lastIndex,t=C.keywordPatternRe.exec(N)}n+=N.substr(e),M.addText(n)}(),N=""}function u(e){return e.className&&M.openNode(x.classNameAliases[e.className]||e.className),C=Object.create(e,{parent:{value:C}})}function p(e){return 0===C.matcher.regexIndex?(N+=e[0],1):(T=!0,0)}function g(e){const t=e[0],n=e.rule,r=new s(n),i=[n.__beforeBegin,n["on:begin"]];for(const s of i)if(s&&(s(e,r),r.isMatchIgnored))return p(t);return n&&n.endSameAsBegin&&(n.endRe=function(e){return new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}(t)),n.skip?N+=t:(n.excludeBegin&&(N+=t),d(),n.returnBegin||n.excludeBegin||(N=t)),u(n),n.returnBegin?0:t.length}function y(e){const t=e[0],r=n.substr(e.index),i=function e(t,n,r){let i=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(t.endRe,r);if(i){if(t["on:end"]){const e=new s(t);t["on:end"](n,e),e.isMatchIgnored&&(i=!1)}if(i){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,r)}(C,e,r);if(!i)return G;const o=C;o.skip?N+=t:(o.returnEnd||o.excludeEnd||(N+=t),d(),o.excludeEnd&&(N=t));do{C.className&&M.closeNode(),C.skip||C.subLanguage||(E+=C.relevance),C=C.parent}while(C!==i.parent);return i.starts&&(i.endSameAsBegin&&(i.starts.endRe=i.endRe),u(i.starts)),o.returnEnd?0:t.length}let w={};function b(t,i){const s=i&&i[0];if(N+=t,null==s)return d(),0;if("begin"===w.type&&"end"===i.type&&w.index===i.index&&""===s){if(N+=n.slice(i.index,i.index+1),!o){const t=new Error("0 width match regex");throw t.languageName=e,t.badRule=w.rule,t}return 1}if(w=i,"begin"===i.type)return g(i);if("illegal"===i.type&&!r){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(C.className||"<unnamed>")+'"');throw e.mode=C,e}if("end"===i.type){const e=y(i);if(e!==G)return e}if("illegal"===i.type&&""===s)return 1;if(D>1e5&&D>3*i.index)throw new Error("potential infinite loop, way more iterations than matches");return N+=s,s.length}const x=S(e);if(!x)throw J(a.replace("{}",e)),new Error('Unknown language: "'+e+'"');const k=j(x,{plugins:i});let v="",C=l||k;const O={},M=new h.__emitter(h);!function(){const e=[];for(let t=C;t!==x;t=t.parent)t.className&&e.unshift(t.className);e.forEach(e=>M.openNode(e))}();let N="",E=0,A=0,D=0,T=!1;try{for(C.matcher.considerAll();;){D++,T?T=!1:C.matcher.considerAll(),C.matcher.lastIndex=A;const e=C.matcher.exec(n);if(!e)break;const t=b(n.substring(A,e.index),e);A=e.index+t}return b(n.substr(A)),M.closeAllNodes(),M.finalize(),v=M.toHTML(),{relevance:Math.floor(E),value:v,language:e,illegal:!1,emitter:M,top:C}}catch(t){if(t.message&&t.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:t.message,context:n.slice(A-100,A+100),mode:t.mode},sofar:v,relevance:0,value:K(n),emitter:M};if(o)return{illegal:!1,relevance:0,value:K(n),emitter:M,language:e,top:C,errorRaised:t};throw t}}function m(e,n){n=n||h.languages||Object.keys(t);const r=function(e){const t={relevance:0,emitter:new h.__emitter(h),value:K(e),illegal:!1,top:c};return t.emitter.addText(e),t}(e),i=n.filter(S).filter(O).map(t=>f(t,e,!1));i.unshift(r);const s=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(S(e.language).supersetOf===t.language)return 1;if(S(t.language).supersetOf===e.language)return-1}return 0}),[o,l]=s,a=o;return a.second_best=l,a}const g={"before:highlightElement":({el:e})=>{h.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ /]*>/g,"\n"))},"after:highlightElement":({result:e})=>{h.useBR&&(e.value=e.value.replace(/\n/g,"<br>"))}},y=/^(<[^>]+>|\t)+/gm,w={"after:highlightElement":({result:e})=>{h.tabReplace&&(e.value=e.value.replace(y,e=>e.replace(/\t/g,h.tabReplace)))}};function b(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=h.languageDetectRe.exec(t);if(n){const t=S(n[1]);return t||(W(a.replace("{}",n[1])),W("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>d(e)||S(e))}(e);if(d(r))return;M("before:highlightElement",{el:e,language:r});const i=(t=e).textContent,s=r?p(i,{language:r,ignoreIllegals:!0}):m(i);M("after:highlightElement",{el:e,result:s,text:i}),e.innerHTML=s.value,function(e,t,r){const i=t?n[t]:r;e.classList.add("hljs"),i&&e.classList.add(i)}(e,r,s.language),e.result={language:s.language,re:s.relevance,relavance:s.relevance},s.second_best&&(e.second_best={language:s.second_best.language,re:s.second_best.relevance,relavance:s.second_best.relevance})}const x=()=>{x.called||(x.called=!0,H("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead."),document.querySelectorAll("pre code").forEach(b))};let k=!1;function v(){"loading"!==document.readyState?document.querySelectorAll("pre code").forEach(b):k=!0}function S(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function C(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function O(e){const t=S(e);return t&&!t.disableAutodetect}function M(e,t){const n=e;i.forEach(function(e){e[n]&&e[n](t)})}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",function(){k&&v()},!1),Object.assign(e,{highlight:p,highlightAuto:m,highlightAll:v,fixMarkup:function(e){return H("10.2.0","fixMarkup will be removed entirely in v11.0"),H("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),function(e){return h.tabReplace||h.useBR?e.replace(l,e=>"\n"===e?h.useBR?"<br>":e:h.tabReplace?e.replace(/\t/g,h.tabReplace):e):e}(e)},highlightElement:b,highlightBlock:function(e){return H("10.7.0","highlightBlock will be removed entirely in v12.0"),H("10.7.0","Please use highlightElement now."),b(e)},configure:function(e){e.useBR&&(H("10.3.0","'useBR' will be removed entirely in v11.0"),H("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),h=U(h,e)},initHighlighting:x,initHighlightingOnLoad:function(){H("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),k=!0},registerLanguage:function(n,r){let i=null;try{i=r(e)}catch(e){if(J("Language definition for '{}' could not be registered.".replace("{}",n)),!o)throw e;J(e),i=c}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&C(i.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:S,registerAliases:C,requireLanguage:function(e){H("10.4.0","requireLanguage will be removed entirely in v11."),H("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const t=S(e);if(t)return t;throw new Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:O,inherit:U,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=(t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))})),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=(t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))}))}(e),i.push(e)},vuePlugin:B(e).VuePlugin}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString="10.7.3";for(const s in R)"object"==typeof R[s]&&r(R[s]);return Object.assign(e,R),e.addPlugin(g),e.addPlugin(V),e.addPlugin(w),e}({});e.exports=Z},J7Ao:function(e,t){e.exports=class{constructor(){this.seen={}}slug(e){let t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){const e=t;do{this.seen[e]++,t=e+"-"+this.seen[e]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t}}},POQ2:function(e,t,n){"use strict";var r=n("ECCn"),i=n("Bz7v");t.highlight=o,t.highlightAuto=function(e,t){var n,l,a,c,h=t||{},d=h.subset||r.listLanguages(),u=h.prefix,p=d.length,f=-1;null!==u&&void 0!==u||(u=s);if("string"!=typeof e)throw i("Expected `string` for value, got `%s`",e);l={relevance:0,language:null,value:[]},n={relevance:0,language:null,value:[]};for(;++f<p;)c=d[f],r.getLanguage(c)&&((a=o(c,e,t)).language=c,a.relevance>l.relevance&&(l=a),a.relevance>n.relevance&&(l=n,n=a));l.language&&(n.secondBest=l);return n},t.registerLanguage=function(e,t){r.registerLanguage(e,t)},t.listLanguages=function(){return r.listLanguages()},t.registerAlias=function(e,t){var n,i=e;t&&((i={})[e]=t);for(n in i)r.registerAliases(i[n],{languageName:n})},l.prototype.addText=function(e){var t,n,r=this.stack;if(""===e)return;t=r[r.length-1],(n=t.children[t.children.length-1])&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})},l.prototype.addKeyword=function(e,t){this.openNode(t),this.addText(e),this.closeNode()},l.prototype.addSublanguage=function(e,t){var n=this.stack,r=n[n.length-1],i=e.rootNode.children,s=t?{type:"element",tagName:"span",properties:{className:[t]},children:i}:i;r.children=r.children.concat(s)},l.prototype.openNode=function(e){var t=this.stack,n=this.options.classPrefix+e,r=t[t.length-1],i={type:"element",tagName:"span",properties:{className:[n]},children:[]};r.children.push(i),t.push(i)},l.prototype.closeNode=function(){this.stack.pop()},l.prototype.closeAllNodes=a,l.prototype.finalize=a,l.prototype.toHTML=function(){return""};var s="hljs-";function o(e,t,n){var o,a=r.configure({}),c=(n||{}).prefix;if("string"!=typeof e)throw i("Expected `string` for name, got `%s`",e);if(!r.getLanguage(e))throw i("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw i("Expected `string` for value, got `%s`",t);if(null!==c&&void 0!==c||(c=s),r.configure({__emitter:l,classPrefix:c}),o=r.highlight(t,{language:e,ignoreIllegals:!0}),r.configure(a||{}),o.errorRaised)throw o.errorRaised;return{relevance:o.relevance,language:o.language,value:o.emitter.rootNode.children}}function l(e){this.options=e,this.rootNode={children:[]},this.stack=[this.rootNode]}function a(){}},RCw7:function(e,t,n){"use strict";n.d(t,"a",function(){return M}),n.d(t,"b",function(){return k}),n.d(t,"c",function(){return u}),n.d(t,"d",function(){return h}),n.d(t,"e",function(){return b}),n.d(t,"f",function(){return x}),n.d(t,"g",function(){return w});var r=n("uSMm"),i=n("byeC"),s=n("b/sn");const o=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function l(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function a(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function c(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const h=(e,t)=>{let{$from:n,$to:i}=e.selection,s=n.blockRange(i),o=s&&Object(r.k)(s);return null!=o&&(t&&t(e.tr.lift(s,o).scrollIntoView()),!0)};function d(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const u=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),l=d(i.contentMatchAt(o));if(!l||!i.canReplaceWith(o,o,l))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,l.createAndFill());i.setSelection(s.f.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},p=(e,t)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof s.c&&e.selection.node.isBlock)return!(!n.parentOffset||!Object(r.g)(e.doc,n.pos))&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(t){let o=i.parentOffset==i.parent.content.size,l=e.tr;(e.selection instanceof s.h||e.selection instanceof s.a)&&l.deleteSelection();let a=0==n.depth?null:d(n.node(-1).contentMatchAt(n.indexAfter(-1))),c=o&&a?[{type:a}]:void 0,h=Object(r.g)(l.doc,l.mapping.map(n.pos),1,c);if(c||h||!Object(r.g)(l.doc,l.mapping.map(n.pos),1,a?[{type:a}]:void 0)||(a&&(c=[{type:a}]),h=!0),h&&(l.split(l.mapping.map(n.pos),1,c),!o&&!n.parentOffset&&n.parent.type!=a)){let e=l.mapping.map(n.before()),t=l.doc.resolve(e);a&&n.node(-1).canReplaceWith(t.index(),t.index()+1,a)&&l.setNodeMarkup(l.mapping.map(n.before()),a)}t(l.scrollIntoView())}return!0};function f(e,t,n){let o,a,c=t.nodeBefore,h=t.nodeAfter;if(c.type.spec.isolating||h.type.spec.isolating)return!1;if(function(e,t,n){let i=t.nodeBefore,s=t.nodeAfter,o=t.index();return!(!(i&&s&&i.type.compatibleContent(s.type))||(!i.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!s.isTextblock&&!Object(r.f)(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,i.type,i.contentMatchAt(i.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let d=t.parent.canReplace(t.index(),t.index()+1);if(d&&(o=(a=c.contentMatchAt(c.childCount)).findWrapping(h.type))&&a.matchType(o[0]||h.type).validEnd){if(n){let s=t.pos+h.nodeSize,l=i.c.empty;for(let e=o.length-1;e>=0;e--)l=i.c.from(o[e].create(null,l));l=i.c.from(c.copy(l));let a=e.tr.step(new r.b(t.pos-1,s,t.pos,s,new i.j(l,1,0),o.length,!0)),d=s+2*o.length;Object(r.f)(a.doc,d)&&a.join(d),n(a.scrollIntoView())}return!0}let u=s.f.findFrom(t,1),p=u&&u.$from.blockRange(u.$to),f=p&&Object(r.k)(p);if(null!=f&&f>=t.depth)return n&&n(e.tr.lift(p,f).scrollIntoView()),!0;if(d&&l(h,"start",!0)&&l(c,"end")){let s=c,o=[];for(;o.push(s),!s.isTextblock;)s=s.lastChild;let l=h,a=1;for(;!l.isTextblock;l=l.firstChild)a++;if(s.canReplace(s.childCount,s.childCount,l.content)){if(n){let s=i.c.empty;for(let e=o.length-1;e>=0;e--)s=i.c.from(o[e].copy(s));n(e.tr.step(new r.b(t.pos-o.length,t.pos+h.nodeSize,t.pos+a,t.pos+h.nodeSize-a,new i.j(s,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function m(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(s.h.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const g=m(-1),y=m(1);function w(e,t=null){return function(n,i){let{$from:s,$to:o}=n.selection,l=s.blockRange(o),a=l&&Object(r.i)(l,e,t);return!!a&&(i&&i(n.tr.wrap(l,a).scrollIntoView()),!0)}}function b(e,t=null){return function(n,r){let{from:i,to:s}=n.selection,o=!1;return n.doc.nodesBetween(i,s,(r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}}),!!o&&(r&&r(n.tr.setBlockType(i,s,e,t).scrollIntoView()),!0)}}function x(e,t=null){return function(n,r){let{empty:i,$cursor:s,ranges:o}=n.selection;if(i&&!s||!function(e,t,n){for(let r=0;r<t.length;r++){let{$from:i,$to:s}=t[r],o=0==i.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,s.pos,e=>{if(o)return!1;o=e.inlineContent&&e.type.allowsMarkType(n)}),o)return!0}return!1}(n.doc,o,e))return!1;if(r)if(s)e.isInSet(n.storedMarks||s.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{let i=!1,s=n.tr;for(let t=0;!i&&t<o.length;t++){let{$from:r,$to:s}=o[t];i=n.doc.rangeHasMark(r.pos,s.pos,e)}for(let n=0;n<o.length;n++){let{$from:r,$to:l}=o[n];if(i)s.removeMark(r.pos,l.pos,e);else{let n=r.pos,i=l.pos,o=r.nodeAfter,a=l.nodeBefore,c=o&&o.isText?/^\s*/.exec(o.text)[0].length:0,h=a&&a.isText?/\s*$/.exec(a.text)[0].length:0;n+c<i&&(n+=c,i-=h),s.addMark(n,i,e.create(t))}}r(s.scrollIntoView())}return!0}}function k(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let v=k(o,(e,t,n)=>{let{$cursor:o}=e.selection;if(!o||(n?!n.endOfTextblock("backward",e):o.parentOffset>0))return!1;let c=a(o);if(!c){let n=o.blockRange(),i=n&&Object(r.k)(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let h=c.nodeBefore;if(!h.type.spec.isolating&&f(e,c,t))return!0;if(0==o.parent.content.size&&(l(h,"end")||s.c.isSelectable(h))){let n=Object(r.l)(e.doc,o.before(),o.after(),i.j.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(l(h,"end")?s.f.findFrom(r.doc.resolve(r.mapping.map(c.pos,-1)),-1):s.c.create(r.doc,c.pos-h.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!h.isAtom||c.depth!=o.depth-1||(t&&t(e.tr.delete(c.pos-h.nodeSize,c.pos).scrollIntoView()),0))},(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=a(r)}let l=o&&o.nodeBefore;return!(!l||!s.c.isSelectable(l)||(t&&t(e.tr.setSelection(s.c.create(e.doc,o.pos-l.nodeSize)).scrollIntoView()),0))}),S=k(o,(e,t,n)=>{let{$cursor:o}=e.selection;if(!o||(n?!n.endOfTextblock("forward",e):o.parentOffset<o.parent.content.size))return!1;let a=c(o);if(!a)return!1;let h=a.nodeAfter;if(f(e,a,t))return!0;if(0==o.parent.content.size&&(l(h,"start")||s.c.isSelectable(h))){let n=Object(r.l)(e.doc,o.before(),o.after(),i.j.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(l(h,"start")?s.f.findFrom(r.doc.resolve(r.mapping.map(a.pos)),1):s.c.create(r.doc,r.mapping.map(a.pos))),t(r.scrollIntoView())}return!0}}return!(!h.isAtom||a.depth!=o.depth-1||(t&&t(e.tr.delete(a.pos,a.pos+h.nodeSize).scrollIntoView()),0))},(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=c(r)}let l=o&&o.nodeAfter;return!(!l||!s.c.isSelectable(l)||(t&&t(e.tr.setSelection(s.c.create(e.doc,o.pos)).scrollIntoView()),0))});const C={Enter:k((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))},(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof s.a||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=d(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=e.tr.insert(n,o.createAndFill());l.setSelection(s.h.create(l.doc,n+1)),t(l.scrollIntoView())}return!0},(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Object(r.g)(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),s=i&&Object(r.k)(i);return null!=s&&(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)},p),"Mod-Enter":u,Backspace:v,"Mod-Backspace":v,"Shift-Backspace":v,Delete:S,"Mod-Delete":S,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new s.a(e.doc))),!0)},O={"Ctrl-h":C.Backspace,"Alt-Backspace":C["Mod-Backspace"],"Ctrl-d":C.Delete,"Ctrl-Alt-Backspace":C["Mod-Delete"],"Alt-Delete":C["Mod-Delete"],"Alt-d":C["Mod-Delete"],"Ctrl-a":g,"Ctrl-e":y};for(let N in C)O[N]=C[N];const M=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?O:C},SbYC:function(e,t,n){const{defaults:r}=n("vbtb"),{cleanUrl:i,escape:s}=n("rUJ1");e.exports=class{constructor(e){this.options=e||r}code(e,t,n){const r=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,r);null!=t&&t!==e&&(n=!0,e=t)}return r?'<pre><code class="'+this.options.langPrefix+s(r,!0)+'">'+(n?e:s(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:s(e,!0))+"</code></pre>"}blockquote(e){return"<blockquote>\n"+e+"</blockquote>\n"}html(e){return e}heading(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e){return"<li>"+e+"</li>\n"}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+"</p>\n"}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return"<tr>\n"+e+"</tr>\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,n){if(null===(e=i(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<a href="'+s(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>"}image(e,t,n){if(null===(e=i(this.options.sanitize,this.options.baseUrl,e)))return n;let r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"}text(e){return e}}},T9Ld:function(e,t,n){const{defaults:r}=n("vbtb"),{block:i}=n("e56X"),{rtrim:s,splitCells:o,escape:l}=n("rUJ1");e.exports=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.rules=i.normal,this.options.pedantic?this.rules=i.pedantic:this.options.gfm&&(this.rules=i.gfm)}static get rules(){return i}static lex(t,n){return new e(n).lex(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.token(e,!0)}token(e,t){let n,r,a,c,h,d,u,p,f,m,g,y,w,b,x,k;for(e=e.replace(/^ +$/gm,"");e;)if((a=this.rules.newline.exec(e))&&(e=e.substring(a[0].length),a[0].length>1&&this.tokens.push({type:"space"})),a=this.rules.code.exec(e)){const t=this.tokens[this.tokens.length-1];e=e.substring(a[0].length),t&&"paragraph"===t.type?t.text+="\n"+a[0].trimRight():(a=a[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?a:s(a,"\n")}))}else if(a=this.rules.fences.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"code",lang:a[2]?a[2].trim():a[2],text:a[3]||""});else if(a=this.rules.heading.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"heading",depth:a[1].length,text:a[2]});else if((a=this.rules.nptable.exec(e))&&(d={type:"table",header:o(a[1].replace(/^ *| *\| *$/g,"")),align:a[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:a[3]?a[3].replace(/\n$/,"").split("\n"):[]}).header.length===d.align.length){for(e=e.substring(a[0].length),g=0;g<d.align.length;g++)/^ *-+: *$/.test(d.align[g])?d.align[g]="right":/^ *:-+: *$/.test(d.align[g])?d.align[g]="center":/^ *:-+ *$/.test(d.align[g])?d.align[g]="left":d.align[g]=null;for(g=0;g<d.cells.length;g++)d.cells[g]=o(d.cells[g],d.header.length);this.tokens.push(d)}else if(a=this.rules.hr.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"hr"});else if(a=this.rules.blockquote.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"blockquote_start"}),a=a[0].replace(/^ *> ?/gm,""),this.token(a,t),this.tokens.push({type:"blockquote_end"});else if(a=this.rules.list.exec(e)){for(e=e.substring(a[0].length),u={type:"list_start",ordered:b=(c=a[2]).length>1,start:b?+c:"",loose:!1},this.tokens.push(u),p=[],n=!1,w=(a=a[0].match(this.rules.item)).length,g=0;g<w;g++)m=(d=a[g]).length,~(d=d.replace(/^ *([*+-]|\d+\.) */,"")).indexOf("\n ")&&(m-=d.length,d=this.options.pedantic?d.replace(/^ {1,4}/gm,""):d.replace(new RegExp("^ {1,"+m+"}","gm"),"")),g!==w-1&&(h=i.bullet.exec(a[g+1])[0],(c.length>1?1===h.length:h.length>1||this.options.smartLists&&h!==c)&&(e=a.slice(g+1).join("\n")+e,g=w-1)),r=n||/\n\n(?!\s*$)/.test(d),g!==w-1&&(n="\n"===d.charAt(d.length-1),r||(r=n)),r&&(u.loose=!0),k=void 0,(x=/^\[[ xX]\] /.test(d))&&(k=" "!==d[1],d=d.replace(/^\[[ xX]\] +/,"")),f={type:"list_item_start",task:x,checked:k,loose:r},p.push(f),this.tokens.push(f),this.token(d,!1),this.tokens.push({type:"list_item_end"});if(u.loose)for(w=p.length,g=0;g<w;g++)p[g].loose=!0;this.tokens.push({type:"list_end"})}else if(a=this.rules.html.exec(e))e=e.substring(a[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===a[1]||"script"===a[1]||"style"===a[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):l(a[0]):a[0]});else if(t&&(a=this.rules.def.exec(e)))e=e.substring(a[0].length),a[3]&&(a[3]=a[3].substring(1,a[3].length-1)),y=a[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[y]||(this.tokens.links[y]={href:a[2],title:a[3]});else if((a=this.rules.table.exec(e))&&(d={type:"table",header:o(a[1].replace(/^ *| *\| *$/g,"")),align:a[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:a[3]?a[3].replace(/\n$/,"").split("\n"):[]}).header.length===d.align.length){for(e=e.substring(a[0].length),g=0;g<d.align.length;g++)/^ *-+: *$/.test(d.align[g])?d.align[g]="right":/^ *:-+: *$/.test(d.align[g])?d.align[g]="center":/^ *:-+ *$/.test(d.align[g])?d.align[g]="left":d.align[g]=null;for(g=0;g<d.cells.length;g++)d.cells[g]=o(d.cells[g].replace(/^ *\| *| *\| *$/g,""),d.header.length);this.tokens.push(d)}else if(a=this.rules.lheading.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"heading",depth:"="===a[2].charAt(0)?1:2,text:a[1]});else if(t&&(a=this.rules.paragraph.exec(e)))e=e.substring(a[0].length),this.tokens.push({type:"paragraph",text:"\n"===a[1].charAt(a[1].length-1)?a[1].slice(0,-1):a[1]});else if(a=this.rules.text.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"text",text:a[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens}}},Xb7u:function(e,t,n){!function(){var t;function n(e){for(var t,n,r,i,s=1,o=[].slice.call(arguments),l=0,a=e.length,c="",h=!1,d=!1,u=function(){return o[s++]},p=function(){for(var n="";/\d/.test(e[l]);)n+=e[l++],t=e[l];return n.length>0?parseInt(n):null};l<a;++l)if(t=e[l],h)switch(h=!1,"."==t?(d=!1,t=e[++l]):"0"==t&&"."==e[l+1]?(d=!0,t=e[l+=2]):d=!0,i=p(),t){case"b":c+=parseInt(u(),10).toString(2);break;case"c":"string"==typeof(n=u())||n instanceof String?c+=n:c+=String.fromCharCode(parseInt(n,10));break;case"d":c+=parseInt(u(),10);break;case"f":r=String(parseFloat(u()).toFixed(i||6)),c+=d?r:r.replace(/^0/,"");break;case"j":c+=JSON.stringify(u());break;case"o":c+="0"+parseInt(u(),10).toString(8);break;case"s":c+=u();break;case"x":c+="0x"+parseInt(u(),10).toString(16);break;case"X":c+="0x"+parseInt(u(),10).toString(16).toUpperCase();break;default:c+=t}else"%"===t?h=!0:c+=t;return c}(t=e.exports=n).format=n,t.vsprintf=function(e,t){return n.apply(null,[e].concat(t))},"undefined"!=typeof console&&"function"==typeof console.log&&(t.printf=function(){console.log(n.apply(null,arguments))})}()},"b/sn":function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return M}),n.d(t,"c",function(){return u}),n.d(t,"d",function(){return N}),n.d(t,"e",function(){return D}),n.d(t,"f",function(){return o}),n.d(t,"g",function(){return l}),n.d(t,"h",function(){return h});var r=n("byeC"),i=n("uSMm");const s=Object.create(null);class o{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new l(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=r.j.empty){let n=t.content.lastChild,i=null;for(let r=0;r<t.openEnd;r++)i=n,n=n.lastChild;let s=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:a,$to:c}=o[l],h=e.mapping.slice(s);e.replaceRange(h.map(a.pos),h.map(c.pos),l?r.j.empty:t),0==l&&y(e,s,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:s,$to:o}=r[i],l=e.mapping.slice(n),a=l.map(s.pos),c=l.map(o.pos);i?e.deleteRange(a,c):(e.replaceRangeWith(a,c,t),y(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new h(e):g(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let i=e.depth-1;i>=0;i--){let r=t<0?g(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):g(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new f(e.node(0))}static atStart(e){return g(e,e,0,0,1)||new f(e)}static atEnd(e){return g(e,e,e.content.size,e.childCount,-1)||new f(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=s[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in s)throw new RangeError("Duplicate use of selection JSON ID "+e);return s[e]=t,t.prototype.jsonID=e,t}getBookmark(){return h.between(this.$anchor,this.$head).getBookmark()}}o.prototype.visible=!0;class l{constructor(e,t){this.$from=e,this.$to=t}}let a=!1;function c(e){a||e.parent.inlineContent||(a=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class h extends o{constructor(e,t=e){c(e),c(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return o.near(n);let r=e.resolve(t.map(this.anchor));return new h(r.parent.inlineContent?r:n,n)}replace(e,t=r.j.empty){if(super.replace(e,t),t==r.j.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof h&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new d(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new h(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=o.findFrom(t,n,!0)||o.findFrom(t,-n,!0);if(!e)return o.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(o.findFrom(e,-n,!0)||o.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new h(e,t)}}o.jsonID("text",h);class d{constructor(e,t){this.anchor=e,this.head=t}map(e){return new d(e.map(this.anchor),e.map(this.head))}resolve(e){return h.between(e.resolve(this.anchor),e.resolve(this.head))}}class u extends o{constructor(e){let t=e.nodeAfter;super(e,e.node(0).resolve(e.pos+t.nodeSize)),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?o.near(i):new u(i)}content(){return new r.j(r.c.from(this.node),0,0)}eq(e){return e instanceof u&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new p(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new u(e.resolve(t.anchor))}static create(e,t){return new u(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}u.prototype.visible=!1,o.jsonID("node",u);class p{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new d(n,n):new p(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&u.isSelectable(n)?new u(t):o.near(t)}}class f extends o{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=r.j.empty){if(t==r.j.empty){e.delete(0,e.doc.content.size);let t=o.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new f(e)}map(e){return new f(e)}eq(e){return e instanceof f}getBookmark(){return m}}o.jsonID("all",f);const m={map(){return this},resolve:e=>new f(e)};function g(e,t,n,r,i,s=!1){if(t.inlineContent)return h.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(r.isAtom){if(!s&&u.isSelectable(r))return u.create(e,n-(i<0?r.nodeSize:0))}else{let t=g(e,r,n+i,i<0?r.childCount:0,i,s);if(t)return t}n+=r.nodeSize*i}return null}function y(e,t,n){let r=e.steps.length-1;if(r<t)return;let s,l=e.steps[r];(l instanceof i.c||l instanceof i.b)&&(e.mapping.maps[r].forEach((e,t,n,r)=>{null==s&&(s=r)}),e.setSelection(o.near(e.doc.resolve(s),n)))}const w=1,b=2,x=4;class k extends i.e{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|w)&~b,this.storedMarks=null,this}get selectionSet(){return(this.updated&w)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=b,this}ensureMarks(e){return r.d.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&b)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~b,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.d.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(o.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=x,this}get scrolledIntoView(){return(this.updated&x)>0}}function v(e,t){return t&&e?e.bind(t):e}class S{constructor(e,t,n){this.name=e,this.init=v(t.init,n),this.apply=v(t.apply,n)}}const C=[new S("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new S("selection",{init:(e,t)=>e.selection||o.atStart(t.doc),apply:e=>e.selection}),new S("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new S("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class O{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=C.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new S(e.key,e.spec.state,e))})}}class M{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let o=this.config.plugins[s];if(o.spec.appendTransaction){let l=r?r[s].n:0,a=r?r[s].state:this,c=l<t.length&&o.spec.appendTransaction.call(o,l?t.slice(l):t,a,n);if(c&&n.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<s?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),i=!0}r&&(r[s]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new M(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new k(this)}static create(e){let t=new O(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new M(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new O(this.schema,e.plugins),n=t.fields,r=new M(t);for(let i=0;i<n.length;i++){let t=n[i].name;r[t]=this.hasOwnProperty(t)?this[t]:n[i].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new O(e.schema,e.plugins),s=new M(i);return i.fields.forEach(i=>{if("doc"==i.name)s.doc=r.f.fromJSON(e.schema,t.doc);else if("selection"==i.name)s.selection=o.fromJSON(s.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.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(t,r))return void(s[i.name]=l.fromJSON.call(o,e,t[r],s))}s[i.name]=i.init(e,s)}}),s}}class N{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let i in t){let s=t[i];s instanceof Function?s=s.bind(n):"handleDOMEvents"==i&&(s=e(s,n,{})),r[i]=s}return r}(e.props,this,this.props),this.key=e.key?e.key.key:A("plugin")}getState(e){return e[this.key]}}const E=Object.create(null);function A(e){return e in E?e+"$"+ ++E[e]:(E[e]=0,e+"$")}class D{constructor(e="key"){this.key=A(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}},byeC:function(e,t,n){"use strict";function r(e){this.content=e}n.d(t,"a",function(){return W}),n.d(t,"b",function(){return ie}),n.d(t,"c",function(){return s}),n.d(t,"d",function(){return c}),n.d(t,"e",function(){return L}),n.d(t,"f",function(){return O}),n.d(t,"g",function(){return S}),n.d(t,"h",function(){return h}),n.d(t,"i",function(){return q}),n.d(t,"j",function(){return d}),r.prototype={constructor:r,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,s=i.find(e),o=i.content.slice();return-1==s?o.push(n||e,t):(o[s+1]=t,n&&(o[s]=n)),new r(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new r(n)},addToStart:function(e,t){return new r([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new r(n)},addBefore:function(e,t,n){var i=this.remove(t),s=i.content.slice(),o=i.find(e);return s.splice(-1==o?s.length:o,0,t,n),new r(s)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=r.from(e)).size?new r(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=r.from(e)).size?new r(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=r.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};var i=r;class s{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,r=0,i){for(let s=0,o=0;o<t;s++){let l=this.content[s],a=o+l.nodeSize;if(a>e&&!1!==n(l,r+o,i||null,s)&&l.content.size){let i=o+1;l.nodesBetween(Math.max(0,e-i),Math.min(l.content.size,t-i),n,r+i)}o=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",s=!0;return this.nodesBetween(e,t,(o,l)=>{o.isText?(i+=o.text.slice(Math.max(e,l)-l,t-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(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new s(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,s=0;s<t;i++){let o=this.content[i],l=s+o.nodeSize;l>e&&((s<e||l>t)&&(o=o.isText?o.cut(Math.max(0,e-s),Math.min(o.text.length,t-s)):o.cut(Math.max(0,e-s-1),Math.min(o.content.size,t-s-1))),n.push(o),r+=o.nodeSize),s=l}return new s(n,r)}cutByIndex(e,t){return e==t?s.empty:0==e&&t==this.content.length?this:new s(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new s(r,i)}addToStart(e){return new s([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new s(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return function e(t,n,r){for(let i=0;;i++){if(i==t.childCount||i==n.childCount)return t.childCount==n.childCount?null:r;let s=t.child(i),o=n.child(i);if(s!=o){if(!s.sameMarkup(o))return r;if(s.isText&&s.text!=o.text){for(let e=0;s.text[e]==o.text[e];e++)r++;return r}if(s.content.size||o.content.size){let t=e(s.content,o.content,r+1);if(null!=t)return t}r+=s.nodeSize}else r+=s.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,i){for(let s=t.childCount,o=n.childCount;;){if(0==s||0==o)return s==o?null:{a:r,b:i};let l=t.child(--s),a=n.child(--o),c=l.nodeSize;if(l!=a){if(!l.sameMarkup(a))return{a:r,b:i};if(l.isText&&l.text!=a.text){let e=0,t=Math.min(l.text.length,a.text.length);for(;e<t&&l.text[l.text.length-e-1]==a.text[a.text.length-e-1];)e++,r--,i--;return{a:r,b:i}}if(l.content.size||a.content.size){let t=e(l.content,a.content,r-1,i-1);if(t)return t}r-=c,i-=c}else r-=c,i-=c}}(this,e,t,n)}findIndex(e,t=-1){if(0==e)return l(0,e);if(e==this.size)return l(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?l(n+1,i):l(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return s.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new s(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return s.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new s(t||e,n)}static from(e){if(!e)return s.empty;if(e instanceof s)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new s([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}s.empty=new s([],0);const o={index:0,offset:0};function l(e,t){return o.index=e,o.offset=t,o}function a(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!a(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t&&a(e[n],t[n])))return!1;for(let n in t)if(!(n in e))return!1}return!0}class c{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&a(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return c.none;if(e instanceof c)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}c.none=[];class h extends Error{}class d{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=function e(t,n,r,i){let{index:s,offset:o}=t.findIndex(n),l=t.maybeChild(s);if(o==n||l.isText)return i&&!i.canReplace(s,s,r)?null:t.cut(0,n).append(r).append(t.cut(n));let a=e(l.content,n-o-1,r);return a&&t.replaceChild(s,l.copy(a))}(this.content,e+this.openStart,t);return n&&new d(n,this.openStart,this.openEnd)}removeBetween(e,t){return new d(function e(t,n,r){let{index:i,offset:s}=t.findIndex(n),o=t.maybeChild(i);let{index:l,offset:a}=t.findIndex(r);if(s==n||o.isText){if(a!=r&&!t.child(l).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=l)throw new RangeError("Removing non-flat range");return t.replaceChild(i,o.copy(e(o.content,n-s-1,r-s-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return d.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new d(s.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new d(e,n,r)}}function u(e,t,n){if(n.openStart>e.depth)throw new h("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new h("Inconsistent open depths");return function e(t,n,r,i){let o=t.index(i),l=t.node(i);if(o==n.index(i)&&i<t.depth-r.openStart){let s=e(t,n,r,i+1);return l.copy(l.content.replaceChild(o,s))}if(r.content.size){if(r.openStart||r.openEnd||t.depth!=i||n.depth!=i){let{start:e,end:o}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)r=t.node(i).copy(s.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t);return y(l,function e(t,n,r,i,o){let l=t.depth>o&&f(t,n,o+1);let a=i.depth>o&&f(r,i,o+1);let c=[];g(null,t,o,c);l&&a&&n.index(o)==r.index(o)?(p(l,a),m(y(l,e(t,n,r,i,o+1)),c)):(l&&m(y(l,w(t,n,o+1)),c),g(n,r,o,c),a&&m(y(a,w(r,i,o+1)),c));g(i,null,o,c);return new s(c)}(t,e,o,n,i))}{let e=t.parent,i=e.content;return y(e,i.cut(0,t.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}return y(l,w(t,n,i))}(e,t,n,0)}function p(e,t){if(!t.type.compatibleContent(e.type))throw new h("Cannot join "+t.type.name+" onto "+e.type.name)}function f(e,t,n){let r=e.node(n);return p(r,t.node(n)),r}function m(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function g(e,t,n,r){let i=(t||e).node(n),s=0,o=t?t.index(n):i.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(m(e.nodeAfter,r),s++));for(let l=s;l<o;l++)m(i.child(l),r);t&&t.depth==n&&t.textOffset&&m(t.nodeBefore,r)}function y(e,t){if(!e.type.validContent(t))throw new h("Invalid content for node "+e.type.name);return e.copy(t)}function w(e,t,n){let r=[];if(g(null,e,n,r),e.depth>n){m(y(f(e,t,n+1),w(e,t,n+1)),r)}return g(t,null,n,r),new s(r)}d.empty=new d(s.empty,0,0);class b{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let i=0;i<e;i++)r+=n.child(i).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return c.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var s=0;s<i.length;s++)!1!==i[s].type.spec.inclusive||r&&i[s].isInSet(r.marks)||(i=i[s--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new S(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let s=e;;){let{index:e,offset:t}=s.content.findIndex(i),o=i-t;if(n.push(s,e,r+t),!o)break;if((s=s.child(e)).isText)break;i=o-1,r+=t+1}return new b(t,n,i)}static resolveCached(e,t){for(let r=0;r<x.length;r++){let n=x[r];if(n.pos==t&&n.doc==e)return n}let n=x[k]=b.resolve(e,t);return k=(k+1)%v,n}}let x=[],k=0,v=12;class S{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const C=Object.create(null);class O{constructor(e,t,n,r=c.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||s.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&a(this.attrs,t||e.defaultAttrs||C)&&c.sameSet(this.marks,n||c.none)}copy(e=null){return e==this.content?this:new O(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new O(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return d.empty;let r=this.resolve(e),i=this.resolve(t),s=n?0:r.sharedDepth(t),o=r.start(s),l=r.node(s).content.cut(r.pos-o,i.pos-o);return new d(l,r.depth-s,i.depth-s)}replace(e,t,n){return u(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return b.resolveCached(this,e)}resolveNoCache(e){return b.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),N(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=s.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let s=r;s<i;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),s=i&&i.matchFragment(this.content,t);return!!s&&s.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let e=c.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!c.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=s.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}O.prototype.text=void 0;class M extends O{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):N(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new M(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new M(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function N(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class E{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new A(e,t);if(null==n.next)return E.empty;let r=D(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);P(e,n).forEach(e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})})});let s=t[r.join(",")]=new E(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(z);s.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return s}(P(e,0))}(function(e){let t=[[]];return i(function e(t,s){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,s)),[]);if("seq"!=t.type){if("star"==t.type){let o=n();return r(s,o),i(e(t.expr,o),o),[r(o)]}if("plus"==t.type){let o=n();return i(e(t.expr,s),o),i(e(t.expr,o),o),[r(o)]}if("opt"==t.type)return[r(s)].concat(e(t.expr,s));if("range"==t.type){let o=s;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,o),r),o=r}if(-1==t.max)i(e(t.expr,o),o);else for(let s=t.min;s<t.max;s++){let s=n();r(o,s),i(e(t.expr,o),s),o=s}return[r(o)]}if("name"==t.type)return[r(s,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let o=e(t.exprs[r],s);if(r==t.exprs.length-1)return o;i(o,s=n())}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,s=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];s.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(o)&&r.push(o)}i&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,l){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return s.from(l.map(e=>e.createAndFill()));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,l.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:s,next:o}=i.next[e];s.isLeaf||s.hasRequiredAttrs()||s.name in t||r.type&&!o.validEnd||(n.push({match:s.contentMatch,type:s,via:r}),t[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let i=0;i<t.next.length;i++)r+=(i?", ":"")+t.next[i].type.name+"->"+e.indexOf(t.next[i].next);return r}).join("\n")}}E.empty=new E(!0);class A{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function D(e){let t=[];do{t.push(T(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function T(e){let t=[];do{t.push(R(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function R(e){let t=function(e){if(e.eat("(")){let t=D(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let s in n){let e=n[s];e.groups.indexOf(t)>-1&&i.push(e)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=$(e,t)}return t}function I(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function $(e,t){let n=I(e),r=n;return e.eat(",")&&(r="}"!=e.next?I(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function z(e,t){return t-e}function P(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:s}=i[e];r||-1!=n.indexOf(s)||t(s)}}(t),n.sort(z)}function _(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function j(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function B(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new F(e[n]);return t}class V{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=B(n.attrs),this.defaultAttrs=_(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==E.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:j(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new O(this,this.computeAttrs(e),s.from(t),c.setFrom(n))}createChecked(e=null,t,n){if(t=s.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new O(this,this.computeAttrs(e),t,c.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=s.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(s.empty,!0);return i?new O(this,e,t.append(i),c.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:c.none:e}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new V(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class F{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class L{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=B(r.attrs),this.excluded=null;let i=_(this.attrs);this.instance=i?new c(this,i):null}create(e=null){return!e&&this.instance?this.instance:new c(this,j(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new L(e,r++,t,i)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class q{constructor(e){this.cached=Object.create(null),this.spec={nodes:i.from(e.nodes),marks:i.from(e.marks||{}),topNode:e.topNode},this.nodes=V.compile(this.spec.nodes,this),this.marks=L.compile(this.spec.marks,this);let t=Object.create(null);for(let n in this.nodes){if(n in this.marks)throw new RangeError(n+" can not be both a node and a mark");let e=this.nodes[n],r=e.spec.content||"",i=e.spec.marks;e.contentMatch=t[r]||(t[r]=E.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==i?null:i?J(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let n in this.marks){let e=this.marks[n],t=e.spec.excludes;e.excluded=null==t?[e]:""==t?[]:J(this,t.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof V))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new M(n,n.defaultAttrs,e,c.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return O.fromJSON(this,e)}markFromJSON(e){return c.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function J(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e.marks[i],o=s;if(s)n.push(s);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=r)}if(!o)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class W{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new ee(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new ee(this,t,!0);return n.addAll(e,t.from,t.to),d.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(te(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],s=r.style;if(!(0!=s.indexOf(e)||r.context&&!n.matchesContext(r.context)||s.length>e.length&&(61!=s.charCodeAt(e.length)||s.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let r in e.marks){let t=e.marks[r].spec.parseDOM;t&&t.forEach(e=>{n(e=ne(e)),e.mark=r})}for(let r in e.nodes){let t=e.nodes[r].spec.parseDOM;t&&t.forEach(e=>{n(e=ne(e)),e.node=r})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new W(e,W.schemaRules(e)))}}const H={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},K={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},U={ol:!0,ul:!0},G=1,Z=2,X=4;function Y(e,t,n){return null!=t?(t?G:0)|("full"===t?Z:0):e&&"pre"==e.whitespace?G|Z:n&~X}class Q{constructor(e,t,n,r,i,s,o){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=c.none,this.stashMarks=[],this.match=s||(o&X?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(s.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&G)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=s.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(s.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):re(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!H.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ee{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,s=Y(null,t.preserveWhitespace,0)|(n?X:0);r=i?new Q(i.type,i.attrs,c.none,c.none,!0,t.topMatch||i.type.contentMatch,s):new Q(n?null:e.schema.topNodeType,null,c.none,c.none,!0,null,s),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style"),n=t?this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(let e=0;e<n.length;e++)this.addPendingMark(n[e]);if(this.addElement(e),null!=n)for(let e=0;e<n.length;e++)this.removePendingMark(n[e],r)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(n.options&Z||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&G)t=n.options&Z?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();U.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&U.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:K.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let t,n=this.top,s=this.needsBlock;if(H.hasOwnProperty(r))t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=s}else this.addElementByRule(e,i,!1===i.consuming?n:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=c.none;e:for(let n=0;n<e.length;n+=2)for(let r=void 0;;){let i=this.parser.matchStyle(e[n],e[n+1],this,r);if(!i)continue e;if(i.ignore)return null;if(t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;r=i}return t}addElementByRule(e,t,n){let r,i,s;if(t.node)(i=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace);else{s=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(s)}let o=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(o)&&this.open--,s&&this.removePendingMark(s,o)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,s=null==n?null:e.childNodes[n];i!=s;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],s=i.findWrapping(e);if(s&&(!t||t.length>s.length)&&(t=s,n=i,!s.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let r=0;r<t.length;r++)this.enterInner(t[r],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let s=Y(e,r,i.options);i.options&X&&0==i.content.length&&(s|=X),this.nodes.push(new Q(e,t,i.activeMarks,i.pendingMarks,n,null,s)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)){t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),s=(e,o)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;o>=i;o--)if(s(e-1,o))return!0;return!1}{let e=o>0||0==o&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=l&&-1==e.groups.indexOf(l))return!1;o--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function te(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ne(e){let t={};for(let n in e)t[n]=e[n];return t}function re(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let s=[],o=e=>{s.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(s.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}class ie{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=oe(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,s=0;for(;n<i.length&&s<e.marks.length;){let t=e.marks[s];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,s++}else s++}for(;n<i.length;)r=i.pop()[1];for(;s<e.marks.length;){let n=e.marks[s++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=ie.renderSpec(oe(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&ie.renderSpec(oe(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let o=n?e.createElementNS(n,i):e.createElement(i),l=t[1],a=1;if(l&&"object"==typeof l&&null==l.nodeType&&!Array.isArray(l)){a=2;for(let e in l)if(null!=l[e]){let t=e.indexOf(" ");t>0?o.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):o.setAttribute(e,l[e])}}for(let c=a;c<t.length;c++){let i=t[c];if(0===i){if(c<t.length-1||c>a)throw new RangeError("Content hole must be the only child of its parent node");return{dom:o,contentDOM:o}}{let{dom:t,contentDOM:s}=ie.renderSpec(e,i,n);if(o.appendChild(t),s){if(r)throw new RangeError("Multiple content holes");r=s}}}return{dom:o,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ie(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=se(e.nodes);return t.text||(t.text=(e=>e.text)),t}static marksFromSchema(e){return se(e.marks)}}function se(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function oe(e){return e.document||window.document}},"cD+i":function(e,t,n){"use strict";n.d(t,"a",function(){return $t}),n.d(t,"b",function(){return _t}),n.d(t,"c",function(){return rn});var r=n("b/sn"),i=n("byeC"),s=n("uSMm");const o="undefined"!=typeof navigator?navigator:null,l="undefined"!=typeof document?document:null,a=o&&o.userAgent||"",c=/Edge\/(\d+)/.exec(a),h=/MSIE \d/.exec(a),d=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(a),u=!!(h||d||c),p=h?document.documentMode:d?+d[1]:c?+c[1]:0,f=!u&&/gecko\/(\d+)/i.test(a);f&&(/Firefox\/(\d+)/.exec(a)||[0,0])[1];const m=!u&&/Chrome\/(\d+)/.exec(a),g=!!m,y=m?+m[1]:0,w=!u&&!!o&&/Apple Computer/.test(o.vendor),b=w&&(/Mobile\/\w+/.test(a)||!!o&&o.maxTouchPoints>2),x=b||!!o&&/Mac/.test(o.platform),k=/Android \d/.test(a),v=!!l&&"webkitFontSmoothing"in l.documentElement.style,S=v?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,C=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},O=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let M=null;const N=function(e,t,n){let r=M||(M=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},E=function(e,t,n,r){return n&&(D(e,t,n,r,-1)||D(e,t,n,r,1))},A=/^(img|br|input|textarea|hr)$/i;function D(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:T(e))){let n=e.parentNode;if(!n||1!=n.nodeType||R(e)||A.test(e.nodeName)||"false"==e.contentEditable)return!1;t=C(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?T(e):0}}}function T(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function R(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const I=function(e){let t=e.isCollapsed;return t&&g&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function $(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function z(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function P(e,t){return"number"==typeof e?e:e[t]}function _(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function j(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let o=n||e.dom;o;o=O(o)){if(1!=o.nodeType)continue;let e=o,n=e==s.body,l=n?z(s):_(e),a=0,c=0;if(t.top<l.top+P(r,"top")?c=-(l.top-t.top+P(i,"top")):t.bottom>l.bottom-P(r,"bottom")&&(c=t.bottom-l.bottom+P(i,"bottom")),t.left<l.left+P(r,"left")?a=-(l.left-t.left+P(i,"left")):t.right>l.right-P(r,"right")&&(a=t.right-l.right+P(i,"right")),a||c)if(n)s.defaultView.scrollBy(a,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),a&&(e.scrollLeft+=a);let i=e.scrollLeft-n,s=e.scrollTop-r;t={left:t.left-i,top:t.top-s,right:t.right-i,bottom:t.bottom-s}}if(n)break}}function B(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=O(r));return t}function V(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:s}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=s&&(r.scrollLeft=s)}}let F=null;function L(e,t){let n,r,i=2e8,s=0,o=t.top,l=t.top;for(let a=e.firstChild,c=0;a;a=a.nextSibling,c++){let e;if(1==a.nodeType)e=a.getClientRects();else{if(3!=a.nodeType)continue;e=N(a).getClientRects()}for(let h=0;h<e.length;h++){let d=e[h];if(d.top<=o&&d.bottom>=l){o=Math.max(d.bottom,o),l=Math.min(d.top,l);let e=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(e<i){n=a,i=e,r=e&&3==n.nodeType?{left:d.right<t.left?d.right:d.left,top:t.top}:t,1==a.nodeType&&e&&(s=c+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(s=c+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=W(r,1);if(n.top!=n.bottom&&q(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:s}:L(n,r)}function q(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function J(e,t){let n,r=e.dom.ownerDocument,i=0;if(r.caretPositionFromPoint)try{let e=r.caretPositionFromPoint(t.left,t.top);e&&({offsetNode:n,offset:i}=e)}catch(e){}if(!n&&r.caretRangeFromPoint){let e=r.caretRangeFromPoint(t.left,t.top);e&&({startContainer:n,startOffset:i}=e)}let s,o=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!o||!e.dom.contains(1!=o.nodeType?o.parentNode:o)){let n=e.dom.getBoundingClientRect();if(!q(t,n))return null;if(!(o=function e(t,n,r){let i=t.childNodes.length;if(i&&r.top<r.bottom)for(let s=Math.max(0,Math.min(i-1,Math.floor(i*(n.top-r.top)/(r.bottom-r.top))-2)),o=s;;){let r=t.childNodes[o];if(1==r.nodeType){let t=r.getClientRects();for(let i=0;i<t.length;i++){let s=t[i];if(q(n,s))return e(r,n,s)}}if((o=(o+1)%i)==s)break}return t}(e.dom,t,n)))return null}if(w)for(let a=o;n&&a;a=O(a))a.draggable&&(n=void 0);if(o=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(o,t),n){if(f&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length))<n.childNodes.length){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(e,t,n,r){let i=-1;for(let s=t;s!=e.dom;){let t=e.docView.nearestDesc(s,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>r.left||e.top>r.top)i=t.posBefore;else{if(!(e.right<r.left||e.bottom<r.top))break;i=t.posAfter}}s=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,1)}(e,n,i,t))}null==s&&(s=function(e,t,n){let{node:r,offset:i}=L(t,n),s=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();s=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,s)}(e,o,t));let l=e.docView.nearestDesc(o,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function W(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const H=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function K(e,t,n){let{node:r,offset:i,atom:s}=e.docView.domFromPos(t,n<0?-1:1),o=v||f;if(3==r.nodeType){if(!o||!H.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,s=n<0?1:-1;return n<0&&!i?(t++,s=-1):n>=0&&i==r.nodeValue.length?(e--,s=1):n<0?e--:t++,U(W(N(r,e,t),s),s<0)}{let e=W(N(r,i,i),n);if(f&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=W(N(r,i-1,i-1),-1);if(t.top==e.top){let n=W(N(r,i,i+1),-1);if(n.top!=e.top)return U(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(null==s&&i&&(n<0||i==T(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return G(e.getBoundingClientRect(),!1)}if(null==s&&i<T(r)){let e=r.childNodes[i];if(1==e.nodeType)return G(e.getBoundingClientRect(),!0)}return G(r.getBoundingClientRect(),n>=0)}if(null==s&&i&&(n<0||i==T(r))){let e=r.childNodes[i-1],t=3==e.nodeType?N(e,T(e)-(o?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return U(W(t,1),!1)}if(null==s&&i<T(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?N(e,0,o?0:1):1==e.nodeType?e:null:null;if(t)return U(W(t,-1),!0)}return U(W(3==r.nodeType?N(r):r,-n),n>=0)}function U(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function G(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Z(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const X=/[\u0590-\u08ac]/;let Y=null,Q=null,ee=!1;function te(e,t,n){return Y==t&&Q==n?ee:(Y=t,Q=n,ee="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return Z(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let r=K(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=N(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0})}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,l=e.domSelection();return X.test(r.parent.textContent)&&l.modify?Z(e,t,()=>{let t=l.getRangeAt(0),i=l.focusNode,s=l.focusOffset,o=l.caretBidiLevel;l.modify("move",n,"character");let a=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==l.focusNode.nodeType?l.focusNode:l.focusNode.parentNode)||i==l.focusNode&&s==l.focusOffset;return l.removeAllRanges(),l.addRange(t),null!=o&&(l.caretBidiLevel=o),a}):"left"==n||"backward"==n?s:o}(e,t,n))}const ne=0,re=1,ie=2,se=3;class oe{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=ne,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>C(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,s=this.getDesc(r);if(s&&(!t||s.node)){if(!n||!(i=s.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return s;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n,r=0,i=0;for(let s=0;r<this.children.length;r++){let t=this.children[r],n=s+t.size;if(n>e||t instanceof pe){i=e-s;break}s=n}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof le&&n.side>=0;r--);if(t<=0){let e,n=!0;for(;(e=r?this.children[r-1]:null)&&e.dom.parentNode!=this.contentDOM;r--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?C(e.dom)+1:0}}{let e,n=!0;for(;(e=r<this.children.length?this.children[r]:null)&&e.dom.parentNode!=this.contentDOM;r++,n=!1);return e&&n&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?C(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let s=n,o=0;;o++){let n=this.children[o],l=s+n.size;if(-1==r&&e<=l){let i=s+n.border;if(e>=i&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=s;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=C(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||o==this.children.length-1)){t=l;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=C(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}s=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),s=Math.max(e,t);for(let d=0,u=0;d<this.children.length;d++){let o=this.children[d],l=u+o.size;if(i>u&&s<l)return o.setSelection(e-u-o.border,t-u-o.border,n,r);u=l}let o=this.domFromPos(e,e?-1:1),l=t==e?o:this.domFromPos(t,t?-1:1),a=n.getSelection(),c=!1;if((f||w)&&e==t){let{node:e,offset:t}=o;if(3==e.nodeType){if((c=!(!t||"\n"!=e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let n,r=e;r;r=r.parentNode){if(n=r.nextSibling){"BR"==n.nodeName&&(o=l={node:n.parentNode,offset:C(n)+1});break}let e=r.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(f&&a.focusNode&&a.focusNode!=l.node&&1==a.focusNode.nodeType){let e=a.focusNode.childNodes[a.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||c&&w)&&E(o.node,o.offset,a.anchorNode,a.anchorOffset)&&E(l.node,l.offset,a.focusNode,a.focusOffset))return;let h=!1;if((a.extend||e==t)&&!c){a.collapse(o.node,o.offset);try{e!=t&&a.extend(l.node,l.offset),h=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!h){if(e>t){let e=o;o=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(o.node,o.offset),a.removeAllRanges(),a.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],s=n+i.size;if(n==s?e<=s&&t>=n:e<s&&t>n){let r=n+i.border,o=s-i.border;if(e>=r&&t<=o)return this.dirty=e==n||t==s?ie:re,void(e!=r||t!=o||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=se);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?se:ie}n=s}this.dirty=ie}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?ie:re;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class le extends oe{constructor(e,t,n,r){let i,s=t.type.toDOM;if("function"==typeof s&&(s=s(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r)),!t.type.spec.raw){if(1!=s.nodeType){let e=document.createElement("span");e.appendChild(s),s=e}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==ne&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class ae extends oe{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class ce extends oe{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let s=r.nodeViews[t.type.name],o=s&&s(t,r,n);return o&&o.dom||(o=i.b.renderSpec(document,t.type.spec.toDOM(t,n))),new ce(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return this.dirty&se||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!=se&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=ne){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=ne}}slice(e,t,n){let r=ce.create(this.parent,this.mark,!0,n),i=this.children,s=this.size;t<s&&(i=Oe(i,t,s,n)),e>0&&(i=Oe(i,0,e,n));for(let o=0;o<i.length;o++)i[o].parent=r;return r.children=i,r}}class he extends oe{constructor(e,t,n,r,i,s,o,l,a){super(e,[],i,s),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o,s&&this.updateChildren(l,a)}static create(e,t,n,r,s,o){let l,a=s.nodeViews[t.type.name],c=a&&a(t,s,()=>l?l.parent?l.parent.posBeforeChild(l):void 0:o,n,r),h=c&&c.dom,d=c&&c.contentDOM;if(t.isText)if(h){if(3!=h.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(t.text);else h||({dom:h,contentDOM:d}=i.b.renderSpec(document,t.type.spec.toDOM(t)));d||t.isText||"BR"==h.nodeName||(h.hasAttribute("contenteditable")||(h.contentEditable="false"),t.type.spec.draggable&&(h.draggable=!0));let u=h;return h=xe(h,n,t),c?l=new fe(e,t,n,r,h,d||null,u,c,s,o+1):t.isText?new ue(e,t,n,r,h,u,s):new he(e,t,n,r,h,d||null,u,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=(()=>i.c.empty))}else e.contentElement=this.contentDOM;else e.getContent=(()=>this.node.content);return e}matchesNode(e,t,n){return this.dirty==ne&&e.eq(this.node)&&ke(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,s=e.composing?this.localCompositionInfo(e,t):null,o=s&&s.pos>-1?s:null,l=s&&s.pos<0,a=new Se(this,o&&o.node);!function(e,t,n,r){let i=t.locals(e),s=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(s,o),n),s+=o.nodeSize}return}let o=0,l=[],a=null;for(let c=0;;){if(o<i.length&&i[o].to==s){let e,t=i[o++];for(;o<i.length&&i[o].to==s;)(e||(e=[t])).push(i[o++]);if(e){e.sort(Ce);for(let t=0;t<e.length;t++)n(e[t],c,!!a)}else n(t,c,!!a)}let h,d;if(a)d=-1,h=a,a=null;else{if(!(c<e.childCount))break;d=c,h=e.child(c++)}for(let e=0;e<l.length;e++)l[e].to<=s&&l.splice(e--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)l.push(i[o++]);let u=s+h.nodeSize;if(h.isText){let e=u;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<u&&(a=h.cut(e-s),h=h.cut(0,e-s),u=e,d=-1)}let p=h.isInline&&!h.isLeaf?l.filter(e=>!e.inline):l.slice();r(h,p,t.forChild(s,h),d),s=u}}(this.node,this.innerDeco,(t,s,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(s==this.node.childCount?i.d.none:this.node.child(s).marks,n,e),a.placeWidget(t,e,r)},(t,i,o,c)=>{let h;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,i,o,c)||l&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(h=a.findIndexWithChild(s.node))>-1&&a.updateNodeAt(t,i,o,h,e)||a.updateNextNode(t,i,o,e,c)||a.addNode(t,i,o,e,r),r+=t.nodeSize}),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==ie)&&(o&&this.protectLocalComposition(e,o),function e(t,n,r){let i=t.firstChild,s=!1;for(let o=0;o<n.length;o++){let l=n[o],a=l.dom;if(a.parentNode==t){for(;a!=i;)i=ve(i),s=!0;i=i.nextSibling}else s=!0,t.insertBefore(a,i);if(l instanceof ce){let n=i?i.previousSibling:t.lastChild;e(l.contentDOM,l.children,r),i=n?n.nextSibling:t.firstChild}}for(;i;)i=ve(i),s=!0;s&&r.trackWrites==t&&(r.trackWrites=null)}(this.contentDOM,this.children,e),b&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof r.h)||n<t||i>t+this.node.content.size)return null;let s=e.domSelection(),o=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];e=e.childNodes[t-1],t=T(e)}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(s.focusNode,s.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,r=function(e,t,n,r){for(let i=0,s=0;i<e.childCount&&s<=r;){let o=e.child(i++),l=s;if(s+=o.nodeSize,!o.isText)continue;let a=o.text;for(;i<e.childCount;){let t=e.child(i++);if(s+=t.nodeSize,!t.isText)break;a+=t.text}if(s>=n){let e=l<r?a.lastIndexOf(t,r-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return-1}(this.node.content,e,n-t,i-t);return r<0?null:{node:o,pos:r,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new ae(this,i,t,r);e.input.compositionNodes.push(s),this.children=Oe(this.children,n,n+r.length,e,s)}update(e,t,n,r){return!(this.dirty==se||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=ne}updateOuterDeco(e){if(ke(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=we(this.dom,this.nodeDOM,ye(this.outerDeco,this.node,t),ye(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function de(e,t,n,r,i){return xe(r,t,e),new he(void 0,e,t,n,r,r,r,i,0)}class ue extends he{constructor(e,t,n,r,i,s,o){super(e,t,n,r,i,null,s,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(this.dirty==se||this.dirty!=ne&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==ne&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=ne,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new ue(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=se)}get domAtom(){return!1}}class pe extends oe{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ne&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class fe extends he{constructor(e,t,n,r,i,s,o,l,a,c){super(e,t,n,r,i,s,o,a,c),this.spec=l}update(e,t,n,r){if(this.dirty==se)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}const me=function(e){e&&(this.nodeName=e)};me.prototype=Object.create(null);const ge=[new me];function ye(e,t,n){if(0==e.length)return ge;let r=n?ge[0]:new me,i=[r];for(let s=0;s<e.length;s++){let o=e[s].type.attrs;if(o){o.nodeName&&i.push(r=new me(o.nodeName));for(let e in o){let s=o[e];null!=s&&(n&&1==i.length&&i.push(r=new me(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+s:"style"==e?r.style=(r.style?r.style+";":"")+s:"nodeName"!=e&&(r[e]=s))}}}return i}function we(e,t,n,r){if(n==ge&&r==ge)return t;let i=t;for(let s=0;s<r.length;s++){let t=r[s],o=n[s];if(s){let n;o&&o.nodeName==t.nodeName&&i!=e&&(n=i.parentNode)&&n.nodeName.toLowerCase()==t.nodeName?i=n:((n=document.createElement(t.nodeName)).pmIsDeco=!0,n.appendChild(i),o=ge[0],i=n)}be(i,o||ge[0],t)}return i}function be(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function xe(e,t,n){return we(e,e,ge,ye(t,n,1!=e.nodeType))}function ke(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function ve(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Se{constructor(e,t){this.lock=t,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,s=new Map,o=[];e:for(;i>0;){let l;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof ce)){l=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=e.child(i-1))break;--i,s.set(l,i),o.push(l)}}return{index:i,matched:s,matches:o.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;r<s&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=ne,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++)if(this.top.children[t].matchesMark(e[i])){r=t;break}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=ce.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,s=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))s=this.top.children.indexOf(i,this.index);else for(let o=this.index,l=Math.min(this.top.children.length,o+5);o<l;o++){let r=this.top.children[o];if(r.matchesNode(e,t,n)&&!this.preMatch.matched.has(r)){s=o;break}}return!(s<0)&&(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,n,r,i){let s=this.top.children[r];return s.dirty==se&&s.dom==s.contentDOM&&(s.dirty=ie),!!s.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,i){for(let s=this.index;s<this.top.children.length;s++){let o=this.top.children[s];if(o instanceof he){let l=this.preMatch.matched.get(o);if(null!=l&&l!=i)return!1;let a=o.dom;if(!(this.lock&&(a==this.lock||1==a.nodeType&&a.contains(this.lock.parentNode))&&!(e.isText&&o.node&&o.node.isText&&o.nodeDOM.nodeValue==e.text&&o.dirty!=se&&ke(t,o.outerDeco)))&&o.update(e,t,n,r))return this.destroyBetween(this.index,s),o.dom!=a&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(e,t,n,r,i){this.top.children.splice(this.index++,0,he.create(this.top,e,t,n,r,i)),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new le(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof ce;)e=(t=e).children[t.children.length-1];e&&e instanceof ue&&!/\n$/.test(e.node.text)||((w||g)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new pe(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}function Ce(e,t){return e.type.side-t.type.side}function Oe(e,t,n,r,i){let s=[];for(let o=0,l=0;o<e.length;o++){let a=e[o],c=l,h=l+=a.size;c>=n||h<=t?s.push(a):(c<t&&s.push(a.slice(0,t-c,r)),i&&(s.push(i),i=void 0),h>n&&s.push(a.slice(n-c,a.size,r)))}return s}function Me(e,t=null){let n=e.domSelection(),i=e.state.doc;if(!n.focusNode)return null;let s=e.docView.nearestDesc(n.focusNode),o=s&&0==s.size,l=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(l<0)return null;let a,c,h=i.resolve(l);if(I(n)){for(a=h;s&&!s.node;)s=s.parent;let e=s.node;if(s&&e.isAtom&&r.c.isSelectable(e)&&s.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==T(e);r||i;){if(e==n)return!0;let t=C(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==T(e)}}(n.focusNode,n.focusOffset,s.dom))){let e=s.posBefore;c=new r.c(l==e?h:i.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=i.resolve(t)}if(!c){c=ze(e,a,h,"pointer"==t||e.state.selection.head<h.pos&&!o?1:-1)}return c}function Ne(e){return e.editable?e.hasFocus():_e(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Ee(e,t=!1){let n=e.state.selection;if(Ie(e,n),Ne(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&g){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&E(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,C(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&u&&p<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let i,s,{anchor:o,head:l}=n;!Ae||n instanceof r.h||(n.$from.parent.inlineContent||(i=De(e,n.from)),n.empty||n.$from.parent.inlineContent||(s=De(e,n.to))),e.docView.setSelection(o,l,e.root,t),Ae&&(i&&Re(i),s&&Re(s)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=(()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{Ne(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))}))}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Ae=w||g&&y<63;function De(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(w&&i&&"false"==i.contentEditable)return Te(i);if(!(i&&"false"!=i.contentEditable||s&&"false"!=s.contentEditable)){if(i)return Te(i);if(s)return Te(s)}}function Te(e){return e.contentEditable="true",w&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Re(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Ie(e,t){if(t instanceof r.c){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&($e(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else $e(e)}function $e(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function ze(e,t,n,i){return e.someProp("createSelectionBetween",r=>r(e,t,n))||r.h.between(t,n,i)}function Pe(e){return(!e.editable||e.root.activeElement==e.dom)&&_e(e)}function _e(e){let t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function je(e,t){let{$anchor:n,$head:i}=e.selection,s=t>0?n.max(i):n.min(i),o=s.parent.inlineContent?s.depth?e.doc.resolve(t>0?s.after():s.before()):null:s;return o&&r.f.findFrom(o,t)}function Be(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ve(e,t,n){let i=e.state.selection;if(!(i instanceof r.h)){if(i instanceof r.c&&i.node.isInline)return Be(e,new r.h(t>0?i.$to:i.$from));{let n=je(e.state,t);return!!n&&Be(e,n)}}if(!i.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=je(e.state,t);return!!(n&&n instanceof r.c)&&Be(e,n)}if(!(x&&n.indexOf("m")>-1)){let n,s=i.$head,o=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!o||o.isText)return!1;let l=t<0?s.pos-o.nodeSize:s.pos;return!!(o.isAtom||(n=e.docView.descAt(l))&&!n.contentDOM)&&(r.c.isSelectable(o)?Be(e,new r.c(t<0?e.state.doc.resolve(s.pos-o.nodeSize):s)):!!v&&Be(e,new r.h(e.state.doc.resolve(t<0?l:l+o.nodeSize))))}}function Fe(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Le(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function qe(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,s,o=!1;for(f&&1==n.nodeType&&r<Fe(n)&&Le(n.childNodes[r])&&(o=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(Le(e))i=n,s=--r;else{if(3!=e.nodeType)break;r=(n=e).nodeValue.length}}}else{if(We(n))break;{let t=n.previousSibling;for(;t&&Le(t);)i=n.parentNode,s=C(t),t=t.previousSibling;if(t)r=Fe(n=t);else{if((n=n.parentNode)==e.dom)break;r=0}}}o?He(e,t,n,r):i&&He(e,t,i,s)}function Je(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,s,o=Fe(n);for(;;)if(r<o){if(1!=n.nodeType)break;if(!Le(n.childNodes[r]))break;i=n,s=++r}else{if(We(n))break;{let t=n.nextSibling;for(;t&&Le(t);)i=t.parentNode,s=C(t)+1,t=t.nextSibling;if(t)r=0,o=Fe(n=t);else{if((n=n.parentNode)==e.dom)break;r=o=0}}}i&&He(e,t,i,s)}function We(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function He(e,t,n,r){if(I(t)){let e=document.createRange();e.setEnd(n,r),e.setStart(n,r),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Ee(e)},50)}function Ke(e,t,n){let i=e.state.selection;if(i instanceof r.h&&!i.empty||n.indexOf("s")>-1)return!1;if(x&&n.indexOf("m")>-1)return!1;let{$from:s,$to:o}=i;if(!s.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=je(e.state,t);if(n&&n instanceof r.c)return Be(e,n)}if(!s.parent.inlineContent){let n=t<0?s:o,l=i instanceof r.a?r.f.near(n,t):r.f.findFrom(n,t);return!!l&&Be(e,l)}return!1}function Ue(e,t){if(!(e.state.selection instanceof r.h))return!0;let{$head:n,$anchor:i,empty:s}=e.state.selection;if(!n.sameParent(i))return!0;if(!s)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function Ge(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ze(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||x&&72==n&&"c"==r?Ue(e,-1)||qe(e):46==n||x&&68==n&&"c"==r?Ue(e,1)||Je(e):13==n||27==n||(37==n||x&&66==n&&"c"==r?Ve(e,-1,r)||qe(e):39==n||x&&70==n&&"c"==r?Ve(e,1,r)||Je(e):38==n||x&&80==n&&"c"==r?Ke(e,-1,r)||qe(e):40==n||x&&78==n&&"c"==r?function(e){if(!w||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Ge(e,n,"true"),setTimeout(()=>Ge(e,n,"false"),20)}return!1}(e)||Ke(e,1,r)||Je(e):r==(x?"m":"c")&&(66==n||73==n||89==n||90==n))}function Xe(e,t){let n=[],{content:r,openStart:s,openEnd:o}=t;for(;s>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){s--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let l=e.someProp("clipboardSerializer")||i.b.fromSchema(e.state.schema),a=lt(),c=a.createElement("div");c.appendChild(l.serializeFragment(r,{document:a}));let h,d=c.firstChild,u=0;for(;d&&1==d.nodeType&&(h=st[d.nodeName.toLowerCase()]);){for(let e=h.length-1;e>=0;e--){let t=a.createElement(h[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),u++}d=c.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${s} ${o}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:c,text:e.someProp("clipboardTextSerializer",e=>e(t))||t.content.textBetween(0,t.content.size,"\n\n")}}function Ye(e,t,n,r,s){let o,l,a=s.parent.type.spec.code;if(!n&&!t)return null;let c=t&&(r||a||!n);if(c){if(e.someProp("transformPastedText",e=>{t=e(t,a||r)}),a)return t?new i.j(i.c.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):i.j.empty;let n=e.someProp("clipboardTextParser",e=>e(t,s,r));if(n)l=n;else{let n=s.marks(),{schema:r}=e.state,l=i.b.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(l.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",e=>{n=e(n)}),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=lt().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&st[i[1].toLowerCase()])&&(e=n.map(e=>"<"+e+">").join("")+e+n.map(e=>"</"+e+">").reverse().join(""));if(r.innerHTML=e,n)for(let s=0;s<n.length;s++)r=r.querySelector(n[s])||r;return r}(n),v&&function(e){let t=e.querySelectorAll(g?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let h=o&&o.querySelector("[data-pm-slice]"),d=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let i=+d[3];i>0&&o.firstChild;i--)o=o.firstChild;if(!l){let t=e.someProp("clipboardParser")||e.someProp("domParser")||i.a.fromSchema(e.state.schema);l=t.parseSlice(o,{preserveWhitespace:!(!c&&!d),context:s,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Qe.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(d)l=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:s,openStart:o,openEnd:l}=e;for(let a=n.length-2;a>=0;a-=2){let e=r.nodes[n[a]];if(!e||e.hasRequiredAttrs())break;s=i.c.from(e.create(n[a+1],s)),o++,l++}return new i.j(s,o,l)}(it(l,+d[1],+d[2]),d[4]);else if((l=i.j.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,s=t.node(n),o=s.contentMatchAt(t.index(n)),l=[];if(e.forEach(e=>{if(!l)return;let t,n=o.findWrapping(e.type);if(!n)return l=null;if(t=l.length&&r.length&&tt(n,r,e,l[l.length-1],0))l[l.length-1]=t;else{l.length&&(l[l.length-1]=nt(l[l.length-1],r.length));let t=et(e,n);l.push(t),o=o.matchType(t.type),r=n}}),l)return i.c.from(l)}return e}(l.content,s),!0)).openStart||l.openEnd){let e=0,t=0;for(let n=l.content.firstChild;e<l.openStart&&!n.type.spec.isolating;e++,n=n.firstChild);for(let n=l.content.lastChild;t<l.openEnd&&!n.type.spec.isolating;t++,n=n.lastChild);l=it(l,e,t)}return e.someProp("transformPasted",e=>{l=e(l)}),l}const Qe=/^(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 et(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,i.c.from(e));return e}function tt(e,t,n,r,s){if(s<e.length&&s<t.length&&e[s]==t[s]){let o=tt(e,t,n,r.lastChild,s+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(s==e.length-1?n.type:e[s+1]))return r.copy(r.content.append(i.c.from(et(n,e,s+1))))}}function nt(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,nt(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(i.c.empty,!0);return e.copy(n.append(r))}function rt(e,t,n,r,s,o){let l=t<0?e.firstChild:e.lastChild,a=l.content;return s<r-1&&(a=rt(a,t,n,r,s+1,o)),s>=n&&(a=t<0?l.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=s).append(a):a.append(l.contentMatchAt(l.childCount).fillBefore(i.c.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(a))}function it(e,t,n){return t<e.openStart&&(e=new i.j(rt(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new i.j(rt(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const st={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 ot=null;function lt(){return ot||(ot=document.implementation.createHTMLDocument("title"))}const at={};let ct={};class ht{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function dt(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function ut(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=(t=>pt(e,t)))})}function pt(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function ft(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function mt(e){return{left:e.clientX,top:e.clientY}}function gt(e,t,n,r,i){if(-1==r)return!1;let s=e.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(e.someProp(t,t=>o>s.depth?t(e,n,s.nodeAfter,s.before(o),i,!0):t(e,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function yt(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function wt(e,t,n,i,s){return gt(e,"handleClickOn",t,n,i)||e.someProp("handleClick",n=>n(e,t,i))||(s?function(e,t){if(-1==t)return!1;let n,i,s=e.state.selection;s instanceof r.c&&(n=s.node);let o=e.state.doc.resolve(t);for(let l=o.depth+1;l>0;l--){let e=l>o.depth?o.nodeAfter:o.node(l);if(r.c.isSelectable(e)){i=n&&s.$from.depth>0&&l>=s.$from.depth&&o.before(s.$from.depth+1)==s.$from.pos?o.before(s.$from.depth):o.before(l);break}}return null!=i&&(yt(e,r.c.create(e.state.doc,i),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return!!(i&&i.isAtom&&r.c.isSelectable(i))&&(yt(e,new r.c(n),"pointer"),!0)}(e,n))}function bt(e,t,n,i){return gt(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",n=>n(e,t,i))||function(e,t,n){if(0!=n.button)return!1;let i=e.state.doc;if(-1==t)return!!i.inlineContent&&(yt(e,r.h.create(i,0,i.content.size),"pointer"),!0);let s=i.resolve(t);for(let o=s.depth+1;o>0;o--){let t=o>s.depth?s.nodeAfter:s.node(o),n=s.before(o);if(t.inlineContent)yt(e,r.h.create(i,n+1,n+1+t.content.size),"pointer");else{if(!r.c.isSelectable(t))continue;yt(e,r.c.create(i,n),"pointer")}return!0}}(e,n,i)}function xt(e){return Mt(e)}ct.keydown=((e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!vt(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!k||!g||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!b||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",t=>t(e,n))||Ze(e,n)?n.preventDefault():dt(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,$(13,"Enter"))),e.input.lastIOSEnter=0)},200)}}),ct.keyup=((e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)}),ct.keypress=((e,t)=>{let n=t;if(vt(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||x&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let i=e.state.selection;if(!(i instanceof r.h&&i.$from.sameParent(i.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",n=>n(e,i.$from.pos,i.$to.pos,t))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}});const kt=x?"metaKey":"ctrlKey";at.mousedown=((e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=xt(e),s=Date.now(),o="singleClick";s-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[kt]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:s,x:n.clientX,y:n.clientY,type:o};let l=e.posAtCoords(mt(n));l&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new class{constructor(e,t,n,i){let s,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[kt],this.allowDefault=n.shiftKey,t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);s=n.parent,o=n.depth?n.before():0}const l=i?null:n.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a?a.dom:null;let{selection:c}=e.state;(0==n.button&&s.type.spec.draggable&&!1!==s.type.spec.selectable||c instanceof r.c&&c.from<=o&&c.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!f||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)),dt(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(()=>Ee(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(mt(e))),this.allowDefault||!t?dt(this.view,"pointer"):wt(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||w&&this.mightDrag&&!this.mightDrag.node.isAtom||g&&!(this.view.state.selection instanceof r.h)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(yt(this.view,r.f.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):dt(this.view,"pointer")}move(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),dt(this.view,"pointer"),0==e.buttons&&this.done()}}(e,l,n,!!i)):("doubleClick"==o?function(e,t,n,r){return gt(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}:bt)(e,l.pos,l.inside,n)?n.preventDefault():dt(e,"pointer"))});function vt(e,t){return!!e.composing||!!(w&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}at.touchdown=(e=>{xt(e),dt(e,"pointer")}),at.contextmenu=(e=>xt(e));const St=k?5e3:-1;function Ct(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Mt(e),t))}function Ot(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Mt(e,t=!1){if(!(k&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Ot(e),t||e.docView&&e.docView.dirty){let t=Me(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}ct.compositionstart=ct.compositionupdate=(e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)))e.markCursor=e.state.storedMarks||n.marks(),Mt(e,!0),e.markCursor=null;else if(Mt(e),f&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}Ct(e,St)}),ct.compositionend=((e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Ct(e,20))});const Nt=u&&p<15||b&&S<604;function Et(e,t,n,r){let s=Ye(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,r,s||i.j.empty)))return!0;if(!s)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(s),l=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(s);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}at.copy=ct.cut=((e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let s=Nt?null:n.clipboardData,o=r.content(),{dom:l,text:a}=Xe(e,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,l),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}),ct.paste=((e,t)=>{let n=t;if(e.composing&&!k)return;let r=Nt?null:n.clipboardData;r&&Et(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Et(e,r.value,null,t):Et(e,r.textContent,r.innerHTML,t)},50)}(e,n)});const At=x?"altKey":"ctrlKey";at.dragstart=((e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let s=e.state.selection,o=s.empty?null:e.posAtCoords(mt(n));if(o&&o.pos>=s.from&&o.pos<=(s instanceof r.c?s.to-1:s.to));else if(i&&i.mightDrag)e.dispatch(e.state.tr.setSelection(r.c.create(e.state.doc,i.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(r.c.create(e.state.doc,t.posBefore)))}let l=e.state.selection.content(),{dom:a,text:c}=Xe(e,l);n.dataTransfer.clearData(),n.dataTransfer.setData(Nt?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Nt||n.dataTransfer.setData("text/plain",c),e.dragging=new class{constructor(e,t){this.slice=e,this.move=t}}(l,!n[At])}),at.dragend=(e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)}),ct.dragover=ct.dragenter=((e,t)=>t.preventDefault()),ct.drop=((e,t)=>{let n=t,o=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let l=e.posAtCoords(mt(n));if(!l)return;let a=e.state.doc.resolve(l.pos);if(!a)return;let c=o&&o.slice;c?e.someProp("transformPasted",e=>{c=e(c)}):c=Ye(e,n.dataTransfer.getData(Nt?"Text":"text/plain"),Nt?null:n.dataTransfer.getData("text/html"),!1,a);let h=!(!o||n[At]);if(e.someProp("handleDrop",t=>t(e,n,c||i.j.empty,h)))return void n.preventDefault();if(!c)return;n.preventDefault();let d=c?Object(s.h)(e.state.doc,a.pos,c):a.pos;null==d&&(d=a.pos);let u=e.state.tr;h&&u.deleteSelection();let p=u.mapping.map(d),f=0==c.openStart&&0==c.openEnd&&1==c.content.childCount,m=u.doc;if(f?u.replaceRangeWith(p,p,c.content.firstChild):u.replaceRange(p,p,c),u.doc.eq(m))return;let g=u.doc.resolve(p);if(f&&r.c.isSelectable(c.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(c.content.firstChild))u.setSelection(new r.c(g));else{let t=u.mapping.map(d);u.mapping.maps[u.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),u.setSelection(ze(e,g,u.doc.resolve(t)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}),at.focus=(e=>{e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&Ee(e)},20))}),at.blur=((e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)}),at.beforeinput=((e,t)=>{if(g&&k&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,$(8,"Backspace"))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}});for(let hn in ct)at[hn]=ct[hn];function Dt(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Tt{constructor(e,t){this.toDOM=e,this.spec=t||Pt,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:s}=e.mapResult(t.from+r,this.side<0?-1:1);return s?null:new $t(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Tt&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Dt(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Rt{constructor(e,t){this.attrs=e,this.spec=t||Pt}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,s=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new $t(i,s,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Rt&&Dt(this.attrs,e.attrs)&&Dt(this.spec,e.spec)}static is(e){return e.type instanceof Rt}destroy(){}}class It{constructor(e,t){this.attrs=e,this.spec=t||Pt}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let s=e.mapResult(t.to+r,-1);return s.deleted||s.pos<=i.pos?null:new $t(i.pos-n,s.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof It&&Dt(this.attrs,e.attrs)&&Dt(this.spec,e.spec)}destroy(){}}class $t{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new $t(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new $t(e,e,new Tt(t,n))}static inline(e,t,n,r){return new $t(e,t,new Rt(n,r))}static node(e,t,n,r){return new $t(e,t,new It(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Rt}}const zt=[],Pt={};class _t{constructor(e,t){this.local=e.length?e:zt,this.children=t.length?t:zt}static create(e,t){return t.length?qt(t,e,0,Pt):jt}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let s=0;s<this.local.length;s++){let o=this.local[s];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let o=this.children[s]+1;this.children[s+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==jt||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Pt)}mapInner(e,t,n,r,i){let s;for(let o=0;o<this.local.length;o++){let l=this.local[o].map(e,n,r);l&&l.type.valid(t,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[o].spec)}return this.children.length?function(e,t,n,r,i,s,o){let l=e.slice(),a=(e,t,n,r)=>{for(let o=0;o<l.length;o+=3){let a,c=l[o+1];if(c<0||e>c+s)continue;let h=l[o]+s;t>=h?l[o+1]=e<=h?-2:-1:n>=i&&(a=r-n-(t-e))&&(l[o]+=a,l[o+1]+=a)}};for(let h=0;h<n.maps.length;h++)n.maps[h].forEach(a);let c=!1;for(let h=0;h<l.length;h+=3)if(l[h+1]<0){if(-2==l[h+1]){c=!0,l[h+1]=-1;continue}let t=n.map(e[h]+s),a=t-i;if(a<0||a>=r.content.size){c=!0;continue}let d=n.map(e[h+1]+s,-1),u=d-i,{index:p,offset:f}=r.content.findIndex(a),m=r.maybeChild(p);if(m&&f==a&&f+m.nodeSize==u){let r=l[h+2].mapInner(n,m,t+1,e[h]+s+1,o);r!=jt?(l[h]=a,l[h+1]=u,l[h+2]=r):(l[h+1]=-2,c=!0)}else c=!0}if(c){let a=function(e,t,n,r,i,s,o){function l(e,t){for(let s=0;s<e.local.length;s++){let l=e.local[s].map(r,i,t);l?n.push(l):o.onRemove&&o.onRemove(e.local[s].spec)}for(let n=0;n<e.children.length;n+=3)l(e.children[n+2],e.children[n]+t+1)}for(let a=0;a<e.length;a+=3)-1==e[a+1]&&l(e[a+2],t[a]+s+1);return n}(l,e,t,n,i,s,o),c=qt(a,r,0,o);t=c.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new _t(t.sort(Jt),l)}(this.children,s||[],e,t,n,r,i):s?new _t(s.sort(Jt),zt):jt}add(e,t){return t.length?this==jt?_t.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach((e,s)=>{let o,l=s+n;if(o=Ft(t,e,l)){for(r||(r=this.children.slice());i<r.length&&r[i]<s;)i+=3;r[i]==s?r[i+2]=r[i+2].addInner(e,o,l+1):r.splice(i,0,s,s+e.nodeSize,qt(o,e,l+1,Pt)),i+=3}});let s=Vt(i?Lt(t):t,-n);for(let o=0;o<s.length;o++)s[o].type.valid(e,s[o])||s.splice(o--,1);return new _t(s.length?this.local.concat(s).sort(Jt):this.local,r||this.children)}remove(e){return 0==e.length||this==jt?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let i=0;i<n.length;i+=3){let r,s=n[i]+t,o=n[i+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>s&&t.to<o&&(e[n]=null,(r||(r=[])).push(t));if(!r)continue;n==this.children&&(n=this.children.slice());let l=n[i+2].removeInner(r,s+1);l!=jt?n[i+2]=l:(n.splice(i,3),i-=3)}if(r.length)for(let i,s=0;s<e.length;s++)if(i=e[s])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new _t(r,n):jt}forChild(e,t){if(this==jt)return this;if(t.isLeaf)return _t.empty;let n,r;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=e){this.children[o]==e&&(n=this.children[o+2]);break}let i=e+1,s=i+t.content.size;for(let o=0;o<this.local.length;o++){let e=this.local[o];if(e.from<s&&e.to>i&&e.type instanceof Rt){let t=Math.max(i,e.from)-i,n=Math.min(s,e.to)-i;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let e=new _t(r.sort(Jt),zt);return n?new Bt([e,n]):e}return n||jt}eq(e){if(this==e)return!0;if(!(e instanceof _t)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Wt(this.localsInner(e))}localsInner(e){if(this==jt)return zt;if(e.inlineContent||!this.local.some(Rt.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof Rt||t.push(this.local[n]);return t}}_t.empty=new _t([],[]),_t.removeOverlap=Wt;const jt=_t.empty;class Bt{constructor(e){this.members=e}map(e,t){const n=this.members.map(n=>n.map(e,t,Pt));return Bt.from(n)}forChild(e,t){if(t.isLeaf)return _t.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=jt&&(i instanceof Bt?n=n.concat(i.members):n.push(i))}return Bt.from(n)}eq(e){if(!(e instanceof Bt)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?Wt(n?t:t.sort(Jt)):zt}static from(e){switch(e.length){case 0:return jt;case 1:return e[0];default:return new Bt(e)}}}function Vt(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new $t(i.from+t,i.to+t,i.type))}return n}function Ft(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let s,o=0;o<e.length;o++)(s=e[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),e[o]=null);return i}function Lt(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function qt(e,t,n,r){let i=[],s=!1;t.forEach((t,o)=>{let l=Ft(e,t,o+n);if(l){s=!0;let e=qt(l,t,n+o+1,r);e!=jt&&i.push(o,o+t.nodeSize,e)}});let o=Vt(s?Lt(e):e,-n).sort(Jt);for(let l=0;l<o.length;l++)o[l].type.valid(t,o[l])||(r.onRemove&&r.onRemove(o[l].spec),o.splice(l--,1));return o.length||i.length?new _t(o,i):jt}function Jt(e,t){return e.from-t.from||e.to-t.to}function Wt(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let s=t[i];if(s.from!=r.from){s.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,s.from),Ht(t,i,r.copy(s.from,r.to)));break}s.to!=r.to&&(t==e&&(t=e.slice()),t[i]=s.copy(s.from,r.to),Ht(t,i+1,s.copy(r.to,s.to)))}}return t}function Ht(e,t,n){for(;t<e.length&&Jt(n,e[t])>0;)t++;e.splice(t,0,n)}function Kt(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=jt&&t.push(r)}),e.cursorWrapper&&t.push(_t.create(e.state.doc,[e.cursorWrapper.deco])),Bt.from(t)}const Ut={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Gt=u&&p<=11;class Zt{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 Xt{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Zt,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);u&&p<=11&&e.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),Gt&&(this.onCharData=(e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()})),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Ut)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Pe(this.view)){if(this.suppressingSelectionUpdates)return Ee(this.view);if(u&&p<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&E(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&Pe(this.view)&&!this.ignoreSelectionChange(t),r=-1,i=-1,s=!1,o=[];if(this.view.editable)for(let l=0;l<e.length;l++){let t=this.registerMutation(e[l],o);t&&(r=r<0?t.from:Math.min(t.from,r),i=i<0?t.to:Math.max(t.to,i),t.typeOver&&(s=!0))}if(f&&o.length>1){let e=o.filter(e=>"BR"==e.nodeName);if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,i),function(e){if(Yt)return;Yt=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,i,s,o),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||Ee(this.view),this.currentSelection.set(t))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(u&&p<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:s}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!s||Array.prototype.indexOf.call(e.addedNodes,s)<0)&&(i=s)}let s=r&&r.parentNode==e.target?C(r)+1:0,o=n.localPosFromDOM(e.target,s,-1),l=i&&i.parentNode==e.target?C(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,l,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let Yt=!1;function Qt(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(w&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||w&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function en(e,t,n,s,o){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Me(e,t);if(n&&!e.state.selection.eq(n)){let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.dispatch(r)}return}let l=e.state.doc.resolve(t),a=l.sharedDepth(n);t=l.before(a+1),n=e.state.doc.resolve(n).after(a+1);let c=e.state.selection,h=function(e,t,n){let r,{node:s,fromOffset:o,toOffset:l,from:a,to:c}=e.docView.parseRange(t,n),h=e.domSelection(),d=h.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:h.anchorOffset}],I(h)||r.push({node:h.focusNode,offset:h.focusOffset})),g&&8===e.input.lastKeyCode)for(let i=l;i>o;i--){let e=s.childNodes[i-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){l=i;break}if(!t||t.size)break}let u=e.state.doc,p=e.someProp("domParser")||i.a.fromSchema(e.state.schema),f=u.resolve(a),m=null,y=p.parse(s,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:l,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Qt,context:f});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),m={anchor:e+a,head:t+a}}return{doc:y,sel:m,from:a,to:c}}(e,t,n);if(g&&e.cursorWrapper&&h.sel&&h.sel.anchor==e.cursorWrapper.deco.from&&h.sel.head==h.sel.anchor){let t=e.cursorWrapper.deco.type.toDOM.nextSibling,n=t&&t.nodeValue?t.nodeValue.length:1;h.sel={anchor:h.sel.anchor+n,head:h.sel.anchor+n}}let d,f,m=e.state.doc,y=m.slice(h.from,h.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(d=e.state.selection.to,f="end"):(d=e.state.selection.from,f="start"),e.input.lastKeyCode=null;let w=function(e,t,n,r,i){let s=e.findDiffStart(t,n);if(null==s)return null;let{a:o,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){let e=Math.max(0,s-Math.min(o,l));r-=o+e-s}if(o<s&&e.size<t.size){let e=r<=s&&r>=o?s-r:0;l=(s-=e)+(l-o),o=s}else if(l<s){let e=r<=s&&r>=l?s-r:0;o=(s-=e)+(o-l),l=s}return{start:s,endA:o,endB:l}}(y.content,h.doc.content,h.from,d,f);if((b&&e.input.lastIOSEnter>Date.now()-225||k)&&o.some(e=>"DIV"==e.nodeName||"P"==e.nodeName)&&(!w||w.endA>=w.endB)&&e.someProp("handleKeyDown",t=>t(e,$(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(!w){if(!(s&&c instanceof r.h&&!c.empty&&c.$head.sameParent(c.$anchor))||e.composing||h.sel&&h.sel.anchor!=h.sel.head){if(h.sel){let t=tn(e,e.state.doc,h.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}w={start:c.from,endA:c.to,endB:c.to}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&w.start==w.endB&&e.state.selection instanceof r.h&&(w.start>e.state.selection.from&&w.start<=e.state.selection.from+2&&e.state.selection.from>=h.from?w.start=e.state.selection.from:w.endA<e.state.selection.to&&w.endA>=e.state.selection.to-2&&e.state.selection.to<=h.to&&(w.endB+=e.state.selection.to-w.endA,w.endA=e.state.selection.to)),u&&p<=11&&w.endB==w.start+1&&w.endA==w.start&&w.start>h.from&&"  "==h.doc.textBetween(w.start-h.from-1,w.start-h.from+1)&&(w.start--,w.endA--,w.endB--);let x,v=h.doc.resolveNoCache(w.start-h.from),S=h.doc.resolveNoCache(w.endB-h.from),C=m.resolve(w.start),O=v.sameParent(S)&&v.parent.inlineContent&&C.end()>=w.endA;if((b&&e.input.lastIOSEnter>Date.now()-225&&(!O||o.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!O&&v.pos<h.doc.content.size&&(x=r.f.findFrom(h.doc.resolve(v.pos+1),1,!0))&&x.head==S.pos)&&e.someProp("handleKeyDown",t=>t(e,$(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>w.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||nn(r,!0,!1)<i.pos)return!1;let s=e.resolve(t);if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=e.resolve(nn(s,!0,!0));return!(!o.parent.isTextblock||o.pos>n||nn(o,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(o.parent.content)}(m,w.start,w.endA,v,S)&&e.someProp("handleKeyDown",t=>t(e,$(8,"Backspace"))))return void(k&&g&&e.domObserver.suppressSelectionUpdates());g&&k&&w.endB==w.start&&(e.input.lastAndroidDelete=Date.now()),k&&!O&&v.start()!=S.start()&&0==S.parentOffset&&v.depth==S.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==w.endA&&(w.endB-=2,S=h.doc.resolveNoCache(w.endB-h.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,$(13,"Enter"))})},20));let M,N,E,A=w.start,D=w.endA;if(O)if(v.pos==S.pos)u&&p<=11&&0==v.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ee(e),20)),M=e.state.tr.delete(A,D),N=m.resolve(w.start).marksAcross(m.resolve(w.endA));else if(w.endA==w.endB&&(E=function(e,t){let n,r,s,o=e.firstChild.marks,l=t.firstChild.marks,a=o,c=l;for(let i=0;i<l.length;i++)a=l[i].removeFromSet(a);for(let i=0;i<o.length;i++)c=o[i].removeFromSet(c);if(1==a.length&&0==c.length)r=a[0],n="add",s=(e=>e.mark(r.addToSet(e.marks)));else{if(0!=a.length||1!=c.length)return null;r=c[0],n="remove",s=(e=>e.mark(r.removeFromSet(e.marks)))}let h=[];for(let i=0;i<t.childCount;i++)h.push(s(t.child(i)));if(i.c.from(h).eq(e))return{mark:r,type:n}}(v.parent.content.cut(v.parentOffset,S.parentOffset),C.parent.content.cut(C.parentOffset,w.endA-C.start()))))M=e.state.tr,"add"==E.type?M.addMark(A,D,E.mark):M.removeMark(A,D,E.mark);else if(v.parent.child(v.index()).isText&&v.index()==S.index()-(S.textOffset?0:1)){let t=v.parent.textBetween(v.parentOffset,S.parentOffset);if(e.someProp("handleTextInput",n=>n(e,A,D,t)))return;M=e.state.tr.insertText(t,A,D)}if(M||(M=e.state.tr.replace(A,D,h.doc.slice(w.start-h.from,w.endB-h.from))),h.sel){let t=tn(e,M.doc,h.sel);t&&!(g&&k&&e.composing&&t.empty&&(w.start!=w.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==A||t.head==M.mapping.map(D)-1)||u&&t.empty&&t.head==A)&&M.setSelection(t)}N&&M.ensureMarks(N),e.dispatch(M.scrollIntoView())}function tn(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:ze(e,t.resolve(n.anchor),t.resolve(n.head))}function nn(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class rn{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ht,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(cn),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=ln(this),on(this),this.nodeViews=an(this),this.docView=de(this.state.doc,sn(this),Kt(this),this.dom,this),this.domObserver=new Xt(this,(e,t,n,r)=>en(this,e,t,n,r)),this.domObserver.start(),function(e){for(let t in at){let n=at[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=(t=>{!ft(e,t)||pt(e,t)||!e.editable&&t.type in ct||n(e,t)}))}w&&e.dom.addEventListener("input",()=>null),ut(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&ut(this),this._props=e,e.plugins&&(e.plugins.forEach(cn),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}updateStateInner(e,t){let n=this.state,i=!1,s=!1;if(e.storedMarks&&this.composing&&(Ot(this),s=!0),this.state=e,t){let e=an(this);(function(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,i=!0),ut(this)}this.editable=ln(this),on(this);let o=Kt(this),l=sn(this),a=t?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",c=i||!this.docView.matchesNode(e.doc,l,o);!c&&e.selection.eq(n.selection)||(s=!0);let h="preserve"==a&&s&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let s=(r.left+r.right)/2,o=i+1;o<Math.min(innerHeight,r.bottom);o+=5){let r=e.root.elementFromPoint(s,o);if(!r||r==e.dom||!e.dom.contains(r))continue;let l=r.getBoundingClientRect();if(l.top>=i-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:B(e.dom)}}(this);if(s){this.domObserver.stop();let t=c&&(u||g)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(c){let n=g?this.trackWrites=this.domSelection().focusNode:null;!i&&this.docView.update(e.doc,l,o,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=de(e.doc,l,o,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return E(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Ee(this,t):(Ie(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(n),"reset"==a)this.dom.scrollTop=0;else if("to selection"==a){let t=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",e=>e(this)));else if(e.selection instanceof r.c){let n=this.docView.domAfterPos(e.selection.from);1==n.nodeType&&j(this,n.getBoundingClientRect(),t)}else j(this,this.coordsAtPos(e.selection.head,1),t)}else h&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;V(n,0==r?0:r-t)}(h)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let s=0;s<this.directPlugins.length;s++){let r=this.directPlugins[s].props[e];if(null!=r&&(n=t?t(r):r))return n}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let r=i[s].props[e];if(null!=r&&(n=t?t(r):r))return n}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(F)return e.focus(F);let t=B(e);e.focus(null==F?{get preventScroll(){return F={preventScroll:!0},!0}}:void 0),F||(F=!1,V(t,0))}(this.dom),Ee(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=(()=>t.ownerDocument.getSelection())),this._root=t;return e||document}posAtCoords(e){return J(this,e)}coordsAtPos(e,t=1){return K(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return te(this,t||this.state,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Kt(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){pt(e,t)||!at[t.type]||!e.editable&&t.type in ct||at[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function sn(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e&&(t.class+=" "+n[e]),"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),[$t.node(0,e.state.doc.content.size,t)]}function on(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:$t.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function ln(e){return!e.someProp("editable",t=>!1===t(e.state))}function an(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function cn(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}},cqjR:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return l}),n.d(t,"c",function(){return d}),n.d(t,"d",function(){return c}),n.d(t,"e",function(){return h});var r=n("b/sn"),i=n("uSMm");class s{constructor(e,t){this.match=e,this.match=e,this.handler="string"==typeof t?function(e){return function(t,n,r,i){let s=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);s+=n[0].slice(e+n[1].length);let t=(r+=e)-i;t>0&&(s=n[0].slice(e-t,e)+s,r=i)}return t.tr.insertText(s,r,i)}}(t):t}}const o=500;function l({rules:e}){let t=new r.d({state:{init:()=>null,apply(e,t){let n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(n,r,i,s)=>a(n,r,i,s,e,t),handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&a(n,r.pos,r.pos,"",e,t)})}}},isInputRules:!0});return t}function a(e,t,n,r,i,s){if(e.composing)return!1;let l=e.state,a=l.doc.resolve(t);if(a.parent.type.spec.code)return!1;let c=a.parent.textBetween(Math.max(0,a.parentOffset-o),a.parentOffset,null,"")+r;for(let o=0;o<i.length;o++){let a=i[o].match.exec(c),h=a&&i[o].handler(l,a,t-(a[0].length-r.length),n);if(h)return e.dispatch(h.setMeta(s,{transform:h,from:t,to:n,text:r})),!0}return!1}const c=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let i,s=n[r];if(s.spec.isInputRules&&(i=s.getState(e))){if(t){let n=e.tr,r=i.transform;for(let e=r.steps.length-1;e>=0;e--)n.step(r.steps[e].invert(r.docs[e]));if(i.text){let t=n.doc.resolve(i.from).marks();n.replaceWith(i.from,i.to,e.schema.text(i.text,t))}else n.delete(i.from,i.to);t(n)}return!0}}return!1};new s(/--$/,"—"),new s(/\.\.\.$/,"…"),new s(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new s(/"$/,"”"),new s(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,""),new s(/'$/,"");function h(e,t,n=null,r){return new s(e,(e,s,o,l)=>{let a=n instanceof Function?n(s):n,c=e.tr.delete(o,l),h=c.doc.resolve(o).blockRange(),d=h&&Object(i.i)(h,t,a);if(!d)return null;c.wrap(h,d);let u=c.doc.resolve(o-1).nodeBefore;return u&&u.type==t&&Object(i.f)(c.doc,o-1)&&(!r||r(s,u))&&c.join(o-1),c})}function d(e,t,n=null){return new s(e,(e,r,i,s)=>{let o=e.doc.resolve(i),l=n instanceof Function?n(r):n;return o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t)?e.tr.delete(i,s).setBlockType(i,i,t,l):null})}},e56X:function(e,t,n){const{noopTest:r,edit:i,merge:s}=n("rUJ1"),o={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:r,table:r,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};o.def=i(o.def).replace("label",o._label).replace("title",o._title).getRegex(),o.bullet=/(?:[*+-]|\d{1,9}\.)/,o.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,o.item=i(o.item,"gm").replace(/bull/g,o.bullet).getRegex(),o.list=i(o.list).replace(/bull/g,o.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+o.def.source+")").getRegex(),o._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",o._comment=/<!--(?!-?>)[\s\S]*?-->/,o.html=i(o.html,"i").replace("comment",o._comment).replace("tag",o._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),o.paragraph=i(o._paragraph).replace("hr",o.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",o._tag).getRegex(),o.blockquote=i(o.blockquote).replace("paragraph",o.paragraph).getRegex(),o.normal=s({},o),o.gfm=s({},o.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),o.gfm.nptable=i(o.gfm.nptable).replace("hr",o.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",o._tag).getRegex(),o.gfm.table=i(o.gfm.table).replace("hr",o.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",o._tag).getRegex(),o.pedantic=s({},o.normal,{html:i("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",o._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:r,paragraph:i(o.normal._paragraph).replace("hr",o.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",o.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const l={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:r,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:r,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,_punctuation:"!\"#$%&'()*+,\\-./:;<=>?@\\[^_{|}~"};l.em=i(l.em).replace(/punctuation/g,l._punctuation).getRegex(),l._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,l._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,l._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,l.autolink=i(l.autolink).replace("scheme",l._scheme).replace("email",l._email).getRegex(),l._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,l.tag=i(l.tag).replace("comment",o._comment).replace("attribute",l._attribute).getRegex(),l._label=/(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,l._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,l._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,l.link=i(l.link).replace("label",l._label).replace("href",l._href).replace("title",l._title).getRegex(),l.reflink=i(l.reflink).replace("label",l._label).getRegex(),l.normal=s({},l),l.pedantic=s({},l.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:i(/^!?\[(label)\]\((.*?)\)/).replace("label",l._label).getRegex(),reflink:i(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",l._label).getRegex()}),l.gfm=s({},l.normal,{escape:i(l.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),l.gfm.url=i(l.gfm.url,"i").replace("email",l.gfm._extended_email).getRegex(),l.breaks=s({},l.gfm,{br:i(l.br).replace("{2,}","*").getRegex(),text:i(l.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),e.exports={block:o,inline:l}},hyX7:function(e,t,n){const r=n("SbYC"),{defaults:i}=n("vbtb"),{inline:s}=n("e56X"),{findClosingBracket:o,escape:l}=n("rUJ1");e.exports=class e{constructor(e,t){if(this.options=t||i,this.links=e,this.rules=s.normal,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=s.pedantic:this.options.gfm&&(this.options.breaks?this.rules=s.breaks:this.rules=s.gfm)}static get rules(){return s}static output(t,n,r){return new e(n,r).output(t)}output(t){let n,r,i,s,a,c,h="";for(;t;)if(a=this.rules.escape.exec(t))t=t.substring(a[0].length),h+=l(a[1]);else if(a=this.rules.tag.exec(t))!this.inLink&&/^<a /i.test(a[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(a[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(a[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(a[0])&&(this.inRawBlock=!1),t=t.substring(a[0].length),h+=this.renderer.html(this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):l(a[0]):a[0]);else if(a=this.rules.link.exec(t)){const r=o(a[2],"()");if(r>-1){const e=(0===a[0].indexOf("!")?5:4)+a[1].length+r;a[2]=a[2].substring(0,r),a[0]=a[0].substring(0,e).trim(),a[3]=""}t=t.substring(a[0].length),this.inLink=!0,i=a[2],this.options.pedantic?(n=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i))?(i=n[1],s=n[3]):s="":s=a[3]?a[3].slice(1,-1):"",i=i.trim().replace(/^<([\s\S]*)>$/,"$1"),h+=this.outputLink(a,{href:e.escapes(i),title:e.escapes(s)}),this.inLink=!1}else if((a=this.rules.reflink.exec(t))||(a=this.rules.nolink.exec(t))){if(t=t.substring(a[0].length),n=(a[2]||a[1]).replace(/\s+/g," "),!(n=this.links[n.toLowerCase()])||!n.href){h+=a[0].charAt(0),t=a[0].substring(1)+t;continue}this.inLink=!0,h+=this.outputLink(a,n),this.inLink=!1}else if(a=this.rules.strong.exec(t))t=t.substring(a[0].length),h+=this.renderer.strong(this.output(a[4]||a[3]||a[2]||a[1]));else if(a=this.rules.em.exec(t))t=t.substring(a[0].length),h+=this.renderer.em(this.output(a[6]||a[5]||a[4]||a[3]||a[2]||a[1]));else if(a=this.rules.code.exec(t))t=t.substring(a[0].length),h+=this.renderer.codespan(l(a[2].trim(),!0));else if(a=this.rules.br.exec(t))t=t.substring(a[0].length),h+=this.renderer.br();else if(a=this.rules.del.exec(t))t=t.substring(a[0].length),h+=this.renderer.del(this.output(a[1]));else if(a=this.rules.autolink.exec(t))t=t.substring(a[0].length),i="@"===a[2]?"mailto:"+(r=l(this.mangle(a[1]))):r=l(a[1]),h+=this.renderer.link(i,null,r);else if(this.inLink||!(a=this.rules.url.exec(t))){if(a=this.rules.text.exec(t))t=t.substring(a[0].length),this.inRawBlock?h+=this.renderer.text(this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):l(a[0]):a[0]):h+=this.renderer.text(l(this.smartypants(a[0])));else if(t)throw new Error("Infinite loop on byte: "+t.charCodeAt(0))}else{if("@"===a[2])i="mailto:"+(r=l(a[0]));else{do{c=a[0],a[0]=this.rules._backpedal.exec(a[0])[0]}while(c!==a[0]);r=l(a[0]),i="www."===a[1]?"http://"+r:r}t=t.substring(a[0].length),h+=this.renderer.link(i,null,r)}return h}static escapes(t){return t?t.replace(e.rules._escapes,"$1"):t}outputLink(e,t){const n=t.href,r=t.title?l(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,l(e[1]))}smartypants(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e}mangle(e){if(!this.options.mangle)return e;const t=e.length;let n,r="",i=0;for(;i<t;i++)n=e.charCodeAt(i),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}}},oV9I:function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"b",function(){return l}),n.d(t,"c",function(){return a}),n.d(t,"d",function(){return h}),n.d(t,"e",function(){return d}),n.d(t,"f",function(){return u}),n.d(t,"g",function(){return p}),n.d(t,"h",function(){return f}),n.d(t,"i",function(){return m});var r=n("b/sn");
/*!
* tiptap-utils v1.13.0
* (c) 2021 überdosis GbR (limited liability)
* @license MIT
*/function i(e,t){return t?e.createChecked(null,t):e.createAndFill()}function s(e,t,n,r,s){const o=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}(e),l=[],a=[];for(let h=0;h<n;h+=1){const e=i(o.cell,s);if(e&&a.push(e),r){const e=i(o.header_cell,s);e&&l.push(e)}}const c=[];for(let i=0;i<t;i+=1)c.push(o.row.createChecked(null,r&&0===i?l:a));return o.table.createChecked(null,c)}function o(e,t,n){if(!e)throw new Error('Invalid "node" parameter');if(!t)throw new Error('Invalid "predicate" parameter');return function(e){const t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)throw new Error('Invalid "node" parameter');const n=[];return e.descendants((e,r)=>{if(n.push({node:e,pos:r}),!t)return!1}),n}(e,n).filter(e=>t(e.node))}function l(e,t){return o(e,e=>e.isBlock,t)}function a(e){return t=>(function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}})(t.$from,e)}function c(e){return function(t){if(function(e){return e instanceof r.c}(t)){const{node:n}=t,{$from:r}=t;if(function(e,t){return Array.isArray(e)&&e.indexOf(t.type)>-1||t.type===e}(e,n))return{node:n,pos:r.pos,depth:r.depth}}}}function h(e,t){const{from:n,to:r}=e.selection;let i=[];e.doc.nodesBetween(n,r,e=>{i=[...i,...e.marks]});const s=i.find(e=>e.type.name===t.name);return s?s.attrs:{}}function d(e=null,t=null){if(!e||!t)return!1;const n=e.parent.childAfter(e.parentOffset);if(!n.node)return!1;const r=n.node.marks.find(e=>e.type===t);if(!r)return!1;let i=e.index(),s=e.start()+n.offset,o=i+1,l=s+n.node.nodeSize;for(;i>0&&r.isInSet(e.parent.child(i-1).marks);)i-=1,s-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&r.isInSet(e.parent.child(o).marks);)l+=e.parent.child(o).nodeSize,o+=1;return{from:s,to:l}}function u(e,t){const{from:n,to:r}=e.selection;let i=[];e.doc.nodesBetween(n,r,e=>{i=[...i,e]});const s=i.reverse().find(e=>e.type.name===t.name);return s?s.attrs:{}}function p(e,t){const{from:n,$from:r,to:i,empty:s}=e.selection;return s?!!t.isInSet(e.storedMarks||r.marks()):!!e.doc.rangeHasMark(n,i,t)}function f({types:e,node:t}){return Array.isArray(e)&&e.includes(t.type)||t.type===e}function m(e,t,n={}){const r=c(t)(e.selection)||a(e=>e.type===t)(e.selection);return Object.keys(n).length&&r?r.node.hasMarkup(t,{...r.node.attrs,...n}):!!r}},"qd4/":function(e,t,n){"use strict";n.d(t,"a",function(){return r.b}),n.d(t,"b",function(){return r.c}),n.d(t,"k",function(){return r.e}),n.d(t,"r",function(){return r.f}),n.d(t,"d",function(){return c}),n.d(t,"l",function(){return h}),n.d(t,"m",function(){return a}),n.d(t,"o",function(){return d.c}),n.d(t,"u",function(){return d.e}),n.d(t,"c",function(){return p}),n.d(t,"e",function(){return f}),n.d(t,"f",function(){return y}),n.d(t,"g",function(){return m}),n.d(t,"h",function(){return g}),n.d(t,"i",function(){return w}),n.d(t,"j",function(){return b}),n.d(t,"n",function(){return x}),n.d(t,"p",function(){return k}),n.d(t,"q",function(){return S}),n.d(t,"s",function(){return C}),n.d(t,"t",function(){return O});var r=n("RCw7"),i=n("uSMm"),s=n("byeC"),o=n("b/sn");function l(e,t=null){return function(n,r){let{$from:o,$to:l}=n.selection,a=o.blockRange(l),c=!1,h=a;if(!a)return!1;if(a.depth>=2&&o.node(a.depth-1).type.compatibleContent(e)&&0==a.startIndex){if(0==o.index(a.depth-1))return!1;let e=n.doc.resolve(a.start-2);h=new s.g(e,e,a.depth),a.endIndex<a.parent.childCount&&(a=new s.g(o,n.doc.resolve(l.end(a.depth)),a.depth)),c=!0}let d=Object(i.i)(h,e,t,a);return!!d&&(r&&r(function(e,t,n,r,o){let l=s.c.empty;for(let i=n.length-1;i>=0;i--)l=s.c.from(n[i].type.create(n[i].attrs,l));e.step(new i.b(t.start-(r?2:0),t.end,t.start,t.end,new s.j(l,0,0),n.length,!0));let a=0;for(let i=0;i<n.length;i++)n[i].type==o&&(a=i+1);let c=n.length-a,h=t.start+n.length-(r?2:0),d=t.parent;for(let s=t.startIndex,u=t.endIndex,p=!0;s<u;s++,p=!1)!p&&Object(i.g)(e.doc,h,c)&&(e.split(h,c),h+=2*c),h+=d.child(s).nodeSize;return e}(n.tr,a,d,c,e).scrollIntoView()),!0)}}function a(e){return function(t,n){let{$from:r,$to:l,node:a}=t.selection;if(a&&a.isBlock||r.depth<2||!r.sameParent(l))return!1;let c=r.node(-1);if(c.type!=e)return!1;if(0==r.parent.content.size&&r.node(-1).childCount==r.indexAfter(-1)){if(3==r.depth||r.node(-3).type!=e||r.index(-2)!=r.node(-2).childCount-1)return!1;if(n){let i=s.c.empty,l=r.index(-1)?1:r.index(-2)?2:3;for(let e=r.depth-l;e>=r.depth-3;e--)i=s.c.from(r.node(e).copy(i));let a=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;i=i.append(s.c.from(e.createAndFill()));let c=r.before(r.depth-(l-1)),h=t.tr.replace(c,r.after(-a),new s.j(i,4-l,0)),d=-1;h.doc.nodesBetween(c,h.doc.content.size,(e,t)=>{if(d>-1)return!1;e.isTextblock&&0==e.content.size&&(d=t+1)}),d>-1&&h.setSelection(o.f.near(h.doc.resolve(d))),n(h.scrollIntoView())}return!0}let h=l.pos==r.end()?c.contentMatchAt(0).defaultType:null,d=t.tr.delete(r.pos,l.pos),u=h?[null,{type:h}]:void 0;return!!Object(i.g)(d.doc,r.pos,2,u)&&(n&&n(d.split(r.pos,2,u).scrollIntoView()),!0)}}function c(e){return function(t,n){let{$from:r,$to:o}=t.selection,l=r.blockRange(o,t=>t.childCount>0&&t.firstChild.type==e);return!!l&&(!n||(r.node(l.depth-1).type==e?function(e,t,n,r){let o=e.tr,l=r.end,a=r.$to.end(r.depth);l<a&&(o.step(new i.b(l-1,a,l,a,new s.j(s.c.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new s.g(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));const c=Object(i.k)(r);return null!=c&&(t(o.lift(r,c).scrollIntoView()),!0)}(t,n,e,l):function(e,t,n){let r=e.tr,o=n.parent;for(let i=n.end,s=n.endIndex-1,m=n.startIndex;s>m;s--)i-=o.child(s).nodeSize,r.delete(i-1,i+1);let l=r.doc.resolve(n.start),a=l.nodeAfter;if(r.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;let c=0==n.startIndex,h=n.endIndex==o.childCount,d=l.node(-1),u=l.index(-1);if(!d.canReplace(u+(c?0:1),u+1,a.content.append(h?s.c.empty:s.c.from(o))))return!1;let p=l.pos,f=p+a.nodeSize;return r.step(new i.b(p-(c?1:0),f+(h?1:0),p+1,f-1,new s.j((c?s.c.empty:s.c.from(o.copy(s.c.empty))).append(h?s.c.empty:s.c.from(o.copy(s.c.empty))),c?0:1,h?0:1),c?0:1)),t(r.scrollIntoView()),!0}(t,n,l)))}}function h(e){return function(t,n){let{$from:r,$to:o}=t.selection,l=r.blockRange(o,t=>t.childCount>0&&t.firstChild.type==e);if(!l)return!1;let a=l.startIndex;if(0==a)return!1;let c=l.parent,h=c.child(a-1);if(h.type!=e)return!1;if(n){let r=h.lastChild&&h.lastChild.type==c.type,o=s.c.from(r?e.create():null),a=new s.j(s.c.from(e.create(null,s.c.from(c.type.create(null,o)))),r?3:1,0),d=l.start,u=l.end;n(t.tr.step(new i.b(d-(r?3:1),u,d,u,a,1,!0)).scrollIntoView())}return!0}}var d=n("cqjR"),u=n("oV9I");
/*!
* tiptap-commands v1.17.0
* (c) 2021 überdosis GbR (limited liability)
* @license MIT
*/
function p(e=""){return(t,n)=>{const{$from:r}=t.selection,{pos:i}=r.pos;return n(t.tr.insertText(e,i)),!0}}function f(e,t,n){return new d.a(e,(e,r,i,s)=>{const o=n instanceof Function?n(r):n,{tr:l}=e,a=r.length-1;let c=s,h=i;if(r[a]){const n=i+r[0].indexOf(r[a-1]),o=n+r[a-1].length-1,d=n+r[a-1].lastIndexOf(r[a]),u=d+r[a].length;if(function(e,t,n){let r=[];return n.doc.nodesBetween(e,t,(e,t)=>{r=[...r,...e.marks.map(n=>({start:t,end:t+e.nodeSize,mark:n}))]}),r}(i,s,e).filter(e=>{const{excluded:n}=e.mark.type;return n.find(e=>e.name===t.name)}).filter(e=>e.end>n).length)return!1;u<o&&l.delete(u,o),d>n&&l.delete(n,d),c=(h=n)+r[a].length}return l.addMark(h,c,t.create(o)),l.removeStoredMark(t),l})}function m(e,t,n){return new d.a(e,(e,r,i,s)=>{const o=n instanceof Function?n(r):n,{tr:l}=e;return r[0]&&l.replaceWith(i-1,s,t.create(o)),l})}function g(e,t,n){const r=i=>{const o=[];return i.forEach(i=>{if(i.isText){const{text:r}=i;let s,l=0;do{if(s=e.exec(r)){const e=s.index,r=e+s[0].length,a=n instanceof Function?n(s[0]):n;e>0&&o.push(i.cut(l,e)),o.push(i.cut(e,r).mark(t.create(a).addToSet(i.marks))),l=r}}while(s);l<r.length&&o.push(i.cut(l))}else o.push(i.copy(r(i.content)))}),s.c.fromArray(o)};return new o.d({props:{transformPasted:e=>new s.j(r(e.content),e.openStart,e.openEnd)}})}function y(e,t,n){const r=(i,o)=>{const l=[];return i.forEach(i=>{if(i.isText){const{text:r,marks:s}=i;let a,c=0;const h=!!s.filter(e=>"link"===e.type.name)[0];for(;!h&&null!==(a=e.exec(r));)if(o&&o.type.allowsMarkType(t)&&a[1]){const e=a.index,r=e+a[0].length,s=e+a[0].indexOf(a[1]),o=s+a[1].length,h=n instanceof Function?n(a):n;e>0&&l.push(i.cut(c,e)),l.push(i.cut(s,o).mark(t.create(h).addToSet(i.marks))),c=r}c<r.length&&l.push(i.cut(c))}else l.push(i.copy(r(i.content,i)))}),s.c.fromArray(l)};return new o.d({props:{transformPasted:e=>new s.j(r(e.content),e.openStart,e.openEnd)}})}function w(e){return(t,n)=>{const{tr:r,selection:i}=t;let{from:s,to:o}=i;const{$from:l,empty:a}=i;if(a){const t=Object(u.e)(l,e);s=t.from,o=t.to}return r.removeMark(s,o,e),n(r)}}function b(e=null,t,n={},r=s.c.empty){return(i,s)=>{const{$from:o,$to:l}=i.selection,a=o.index(),c=e?e.from:o.pos,h=e?e.to:l.pos;return!!o.parent.canReplaceWith(a,a,t)&&(s&&s(i.tr.replaceWith(c,h,t.create(n,r))),!0)}}function x(e){return function(t,n){const{$from:r,$to:i,node:o}=t.selection;if(o&&o.isBlock||r.depth<2||!r.sameParent(i))return!1;const l=r.node(-1);if(l.type!=e)return!1;if(0==r.parent.content.size){if(2==r.depth||r.node(-3).type!=e||r.index(-2)!=r.node(-2).childCount-1)return!1;if(n){let i=s.c.empty;const o=r.index(-1)>0;for(let e=r.depth-(o?1:2);e>=r.depth-3;e--)i=s.c.from(r.node(e).copy(i));i=i.append(s.c.from(e.createAndFill()));const l=t.tr.replace(r.before(o?null:-1),r.after(-3),new s.j(i,o?3:2,2));l.setSelection(t.selection.constructor.near(l.doc.resolve(r.pos+(o?3:2)))),n(l.scrollIntoView())}return!0}const a=i.pos==r.end()?l.contentMatchAt(r.indexAfter(-1)).defaultType:null,c=t.tr.delete(r.pos,i.pos);let h=a&&[{type:e},{type:a}];return h||(h=[{type:e},null]),!!function(e,t,n=1,r){const i=e.resolve(t),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,h=n-2;c>s;c--,h--){const e=i.node(c),t=i.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount);const s=r&&r[h]||e;if(s!=e&&(n=n.replaceChild(0,s.type.create(s.attrs))),!e.canReplace(t+1,e.childCount))return!1}const l=i.indexAfter(s),a=r&&r[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}(c.doc,r.pos,2,h)&&(n&&n(c.split(r.pos,2,h).scrollIntoView()),!0)}}function k(e,t,n={}){return(i,s,o)=>{return Object(u.i)(i,e,n)?Object(r.e)(t)(i,s,o):Object(r.e)(e,n)(i,s,o)}}function v(e,t){return e.type===t.nodes.bullet_list||e.type===t.nodes.ordered_list||e.type===t.nodes.todo_list}function S(e,t){return(n,r,i)=>{const{schema:s,selection:o}=n,{$from:a,$to:h}=o,d=a.blockRange(h);if(!d)return!1;const p=Object(u.c)(e=>v(e,s))(o);if(d.depth>=1&&p&&d.depth-p.depth<=1){if(p.node.type===e)return c(t)(n,r,i);if(v(p.node,s)&&e.validContent(p.node.content)){const{tr:t}=n;return t.setNodeMarkup(p.pos,e),r&&r(t),!1}}return l(e)(n,r,i)}}function C(e,t={}){return(n,i,s)=>{return Object(u.i)(n,e,t)?Object(r.d)(n,i):Object(r.g)(e,t)(n,i,s)}}function O(e,t){return(n,r)=>{const{tr:i,selection:s,doc:o}=n,{ranges:l,empty:a}=s;if(a){const{from:n,to:r}=Object(u.e)(s.$from,e);o.rangeHasMark(n,r,e)&&i.removeMark(n,r,e),i.addMark(n,r,e.create(t))}else l.forEach(n=>{const{$to:r,$from:s}=n;o.rangeHasMark(s.pos,r.pos,e)&&i.removeMark(s.pos,r.pos,e),i.addMark(s.pos,r.pos,e.create(t))});return r(i)}}},rUJ1:function(e,t){const n=/[&<>"']/,r=/[&<>"']/g,i=/[<>"']|&(?!#?\w+;)/,s=/[<>"']|&(?!#?\w+;)/g,o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},l=e=>o[e];const a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function c(e){return e.replace(a,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const h=/(^|[^\[])\^/g;const d=/[^\w:]/g,u=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const p={},f=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function y(e,t){p[" "+e]||(f.test(e)?p[" "+e]=e+"/":p[" "+e]=w(e,"/",!0));const n=-1===(e=p[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(m,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(g,"$1")+t:e+t}function w(e,t,n){const r=e.length;if(0===r)return"";let i=0;for(;i<r;){const s=e.charAt(r-i-1);if(s!==t||n){if(s===t||!n)break;i++}else i++}return e.substr(0,r-i)}e.exports={escape:function(e,t){if(t){if(n.test(e))return e.replace(r,l)}else if(i.test(e))return e.replace(s,l);return e},unescape:c,edit:function(e,t){e=e.source||e,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(h,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(c(n)).replace(d,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!u.test(n)&&(n=y(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:y,noopTest:{exec:function(){}},merge:function(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},splitCells:function(e,t){const n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n},rtrim:w,findClosingBracket:function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if("\\"===e[i])i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&--r<0)return i;return-1},checkSanitizeDeprecation:function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}}},uSMm:function(e,t,n){"use strict";n.d(t,"a",function(){return f}),n.d(t,"b",function(){return v}),n.d(t,"c",function(){return k}),n.d(t,"d",function(){return g}),n.d(t,"e",function(){return W}),n.d(t,"f",function(){return A}),n.d(t,"g",function(){return E}),n.d(t,"h",function(){return R}),n.d(t,"i",function(){return M}),n.d(t,"j",function(){return T}),n.d(t,"k",function(){return O}),n.d(t,"l",function(){return I});var r=n("byeC");const i=65535,s=Math.pow(2,16);function o(e,t){return e+t*s}function l(e){return e&i}const a=1,c=2,h=4,d=8;class u{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&d)>0}get deletedBefore(){return(this.delInfo&(a|h))>0}get deletedAfter(){return(this.delInfo&(c|h))>0}get deletedAcross(){return(this.delInfo&h)>0}}class p{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&p.empty)return p.empty}recover(e){let t=0,n=l(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(e&i))/s}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let p=this.ranges[l]-(this.inverted?r:0);if(p>e)break;let f=this.ranges[l+i],m=this.ranges[l+s],g=p+f;if(e<=g){let i=p+r+((f?e==p?-1:e==g?1:t:t)<0?0:m);if(n)return i;let s=e==(t<0?p:g)?null:o(l/3,e-p),y=e==p?c:e==g?a:h;return(t<0?e!=p:e!=g)&&(y|=d),new u(i,y,s)}r+=m-f}return n?e+r:new u(e+r,0,null)}touches(e,t){let n=0,r=l(t),i=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let t=this.ranges[o]-(this.inverted?n:0);if(t>e)break;let l=this.ranges[o+i];if(e<=t+l&&o==3*r)return!0;n+=this.ranges[o+s]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let s=this.ranges[r],o=s-(this.inverted?i:0),l=s+(this.inverted?0:i),a=this.ranges[r+t],c=this.ranges[r+n];e(o,o+a,l,l+c),i+=c-a}}invert(){return new p(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?p.empty:new p(e<0?[0,-e,0]:[0,0,e])}}p.empty=new p([]);class f{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new f(this.maps,this.mirror,e,t)}copy(){return new f(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new f;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let i=this.from;i<this.to;i++){let n=this.maps[i].mapResult(e,t);if(null!=n.recover){let t=this.getMirror(i);if(null!=t&&t>i&&t<this.to){i=t,e=this.maps[t].recover(n.recover);continue}}r|=n.delInfo,e=n.pos}return n?e:new u(e,r,null)}}const m=Object.create(null);class g{getMap(){return p.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=m[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in m)throw new RangeError("Duplicate use of step JSON ID "+e);return m[e]=t,t.prototype.jsonID=e,t}}class y{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new y(e,null)}static fail(e){return new y(null,e)}static fromReplace(e,t,n,i){try{return y.ok(e.replace(t,n,i))}catch(e){if(e instanceof r.h)return y.fail(e.message);throw e}}}function w(e,t,n){let i=[];for(let r=0;r<e.childCount;r++){let s=e.child(r);s.content.size&&(s=s.copy(w(s.content,t,s))),s.isInline&&(s=t(s,n,r)),i.push(s)}return r.c.fromArray(i)}class b extends g{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),s=new r.j(w(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,i),t.openStart,t.openEnd);return y.fromReplace(e,this.from,this.to,s)}invert(){return new x(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new b(t.pos,n.pos,this.mark)}merge(e){return e instanceof b&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new b(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new b(t.from,t.to,e.markFromJSON(t.mark))}}g.jsonID("addMark",b);class x extends g{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new r.j(w(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return y.fromReplace(e,this.from,this.to,n)}invert(){return new b(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new x(t.pos,n.pos,this.mark)}merge(e){return e instanceof x&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new x(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new x(t.from,t.to,e.markFromJSON(t.mark))}}g.jsonID("removeMark",x);class k extends g{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&S(e,this.from,this.to)?y.fail("Structure replace would overwrite content"):y.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new p([this.from,this.to-this.from,this.slice.size])}invert(e){return new k(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new k(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof k)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?r.j.empty:new r.j(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new k(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?r.j.empty:new r.j(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new k(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new k(t.from,t.to,r.j.fromJSON(e,t.slice),!!t.structure)}}g.jsonID("replace",k);class v extends g{constructor(e,t,n,r,i,s,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=s,this.structure=o}apply(e){if(this.structure&&(S(e,this.from,this.gapFrom)||S(e,this.gapTo,this.to)))return y.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return y.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?y.fromReplace(e,this.from,this.to,n):y.fail("Content does not fit in gap")}getMap(){return new p([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new v(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new v(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new v(t.from,t.to,t.gapFrom,t.gapTo,r.j.fromJSON(e,t.slice),t.insert,!!t.structure)}}function S(e,t,n){let r=e.resolve(t),i=n-t,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let e=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function C(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function O(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),s=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,s,t))return n;if(0==n||r.type.spec.isolating||!C(r,i,s))break}return null}function M(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.contentMatchAt(r).findWrapping(t);if(!s)return null;let o=s.length?s[0]:t;return n.canReplaceWith(r,i,o)?s:null}(e,t),s=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.child(r),o=t.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:t).contentMatch;for(let a=r;l&&a<i;a++)l=l.matchType(n.child(a).type);return l&&l.validEnd?o:null}(r,t);return s?i.map(N).concat({type:t,attrs:n}).concat(s.map(N)):null}function N(e){return{type:e,attrs:null}}function E(e,t,n=1,r){let i=e.resolve(t),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,h=n-2;c>s;c--,h--){let e=i.node(c),t=i.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),s=r&&r[h]||e;if(s!=e&&(n=n.replaceChild(0,s.type.create(s.attrs))),!e.canReplace(t+1,e.childCount)||!s.type.validContent(n))return!1}let l=i.indexAfter(s),a=r&&r[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function A(e,t){let n=e.resolve(t),r=n.index();return D(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function D(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function T(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let e,s,o=r.index(i);if(i==r.depth?(e=r.nodeBefore,s=r.nodeAfter):n>0?(e=r.node(i+1),o++,s=r.node(i).maybeChild(o)):(e=r.node(i).maybeChild(o-1),s=r.node(i+1)),e&&!e.isTextblock&&D(e,s)&&r.node(i).canReplace(o,o+1))return t;if(0==i)break;t=n<0?r.before(i):r.after(i)}}function R(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(0==n.openStart&&n.size?2:1);s++)for(let e=r.depth;e>=0;e--){let t=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,n=r.index(e)+(t>0?1:0),o=r.node(e),l=!1;if(1==s)l=o.canReplace(n,n,i);else{let e=o.contentMatchAt(n).findWrapping(i.firstChild.type);l=e&&o.canReplaceWith(n,n,e[0])}if(l)return 0==t?r.pos:t<0?r.before(e+1):r.after(e+1)}return null}function I(e,t,n=t,i=r.j.empty){if(t==n&&!i.size)return null;let s=e.resolve(t),o=e.resolve(n);return $(s,o,i)?new k(t,n,i):new z(s,o,i).fit()}function $(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}g.jsonID("replaceAround",v);class z{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=r.c.empty;for(let r=0;r<=e.depth;r++){let t=e.node(r);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(r))})}for(let i=e.depth;i>0;i--)this.placed=r.c.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));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 a=new r.j(s,o,l);return e>-1?new v(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new k(n.pos,i.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,i=null,s=(n=t?(i=j(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild;for(let o=this.depth;o>=0;o--){let n,{type:l,match:a}=this.frontier[o],c=null;if(1==e&&(s?a.matchType(s.type)||(c=a.fillBefore(r.c.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:o,parent:i,inject:c};if(2==e&&s&&(n=a.findWrapping(s.type)))return{sliceDepth:t,frontierDepth:o,parent:i,wrap:n};if(i&&a.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=j(e,t);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new r.j(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=j(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new r.j(P(e,t-1,1),t-1,s?t-1:n)}else this.unplaced=new r.j(P(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let r=0;r<s.length;r++)this.openFrontierNode(s[r]);let o=this.unplaced,l=n?n.content:o.content,a=o.openStart-e,c=0,h=[],{match:d,type:u}=this.frontier[t];if(i){for(let e=0;e<i.childCount;e++)h.push(i.child(e));d=d.matchFragment(i)}let p=l.size+e-(o.content.size-o.openEnd);for(;c<l.childCount;){let e=l.child(c),t=d.matchType(e.type);if(!t)break;(++c>1||0==a||e.content.size)&&(d=t,h.push(B(e.mark(u.allowedMarks(e.marks)),1==c?a:0,c==l.childCount?p:-1)))}let f=c==l.childCount;f||(p=-1),this.placed=_(this.placed,t,r.c.from(h)),this.frontier[t].match=d,f&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let r=0,m=l;r<p;r++){let e=m.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),m=e.content}this.unplaced=f?0==e?r.j.empty:new r.j(P(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new r.j(P(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!V(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=V(e,t,r,n,i);if(s){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=V(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=_(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=_(this.placed,this.depth,r.c.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(r.c.empty,!0);e.childCount&&(this.placed=_(this.placed,this.frontier.length,e))}}function P(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(P(e.firstChild.content,t-1,n)))}function _(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(_(e.lastChild.content,t-1,n)))}function j(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function B(e,t,n){if(t<=0)return e;let i=e.content;return t>1&&(i=i.replaceChild(0,B(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(r.c.empty,!0)))),e.copy(i)}function V(e,t,n,r,i){let s=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let l=r.fillBefore(s.content,!0,o);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,s.content,o)?l:null}function F(e){return e.spec.defining||e.spec.definingForContent}function L(e,t,n,i,s){if(t<n){let r=e.firstChild;e=e.replaceChild(0,r.copy(L(r.content,t+1,n,i,r)))}if(t>i){let t=s.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.c.empty,!0))}return e}function q(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}let J=class extends Error{};(J=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),J.prototype.constructor=J,J.prototype.name="TransformError";class W{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new f}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new J(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=r.j.empty){let i=I(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new r.j(r.c.from(n),0,0))}delete(e,t){return this.replace(e,t,r.j.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let s=e.doc.resolve(t),o=e.doc.resolve(n);if($(s,o,i))return e.step(new k(t,n,i));let l=q(s,e.doc.resolve(n));0==l[l.length-1]&&l.pop();let a=-(s.depth+1);l.unshift(a);for(let r=s.depth,p=s.pos-1;r>0;r--,p--){let e=s.node(r).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;l.indexOf(r)>-1?a=r:s.before(r)==p&&l.splice(1,0,-r)}let c=l.indexOf(a),h=[],d=i.openStart;for(let r=i.content,p=0;;p++){let e=r.firstChild;if(h.push(e),p==i.openStart)break;r=e.content}for(let r=d-1;r>=0;r--){let e=h[r].type,t=F(e);if(t&&s.node(c).type!=e)d=r;else if(t||!e.isTextblock)break}for(let p=i.openStart;p>=0;p--){let t=(p+d+1)%(i.openStart+1),a=h[t];if(a)for(let h=0;h<l.length;h++){let d=l[(h+c)%l.length],u=!0;d<0&&(u=!1,d=-d);let p=s.node(d-1),f=s.index(d-1);if(p.canReplaceWith(f,f,a.type,a.marks))return e.replace(s.before(d),u?o.after(d):n,new r.j(L(i.content,0,i.openStart,t),t,i.openEnd))}}let u=e.steps.length;for(let r=l.length-1;r>=0&&(e.replace(t,n,i),!(e.steps.length>u));r--){let e=l[r];e<0||(t=s.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let e=r.index(i);if(r.node(i).canReplaceWith(e,e,n))return r.before(i+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let e=r.indexAfter(i);if(r.node(i).canReplaceWith(e,e,n))return r.after(i+1);if(e<r.node(i).childCount)return null}return null}(e.doc,t,i.type);null!=r&&(t=n=r)}e.replaceRange(t,n,new r.j(r.c.from(i),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),s=q(r,i);for(let o=0;o<s.length;o++){let t=s[o],n=o==s.length-1;if(n&&0==t||r.node(t).type.contentMatch.validEnd)return e.delete(r.start(t),i.end(t));if(t>0&&(n||r.node(t-1).canReplace(r.index(t-1),i.indexAfter(t-1))))return e.delete(r.before(t),i.after(t))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o)return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:i,$to:s,depth:o}=t,l=i.before(o+1),a=s.after(o+1),c=l,h=a,d=r.c.empty,u=0;for(let m=o,g=!1;m>n;m--)g||i.index(m)>0?(g=!0,d=r.c.from(i.node(m).copy(d)),u++):c--;let p=r.c.empty,f=0;for(let m=o,g=!1;m>n;m--)g||s.after(m+1)<s.end(m)?(g=!0,p=r.c.from(s.node(m).copy(p)),f++):h++;e.step(new v(c,h,l,a,new r.j(d.append(p),u,f),d.size-u,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let i=new k(t-n,t+n,r.j.empty,!0);e.step(i)}(this,e,t),this}wrap(e,t){return function(e,t,n){let i=r.c.empty;for(let l=n.length-1;l>=0;l--){if(i.size){let e=n[l].type.contentMatch.matchFragment(i);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.c.from(n[l].type.create(n[l].attrs,i))}let s=t.start,o=t.end;e.step(new v(s,o,s,o,new r.j(i,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,i=null){return function(e,t,n,i,s){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{if(t.isTextblock&&!t.hasMarkup(i,s)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),i)){e.clearIncompatible(e.mapping.slice(o).map(n,1),i);let l=e.mapping.slice(o),a=l.map(n,1),c=l.map(n+t.nodeSize,1);return e.step(new v(a,c,a+1,c-1,new r.j(r.c.from(i.create(s,null,t.marks)),0,0),1,!0)),!1}})}(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i=[]){return function(e,t,n,i,s){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let l=n.create(i,null,s||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,l);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new v(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new r.j(r.c.from(l),0,0),1,!0))}(this,e,t,n,i),this}split(e,t=1,n){return function(e,t,n=1,i){let s=e.doc.resolve(t),o=r.c.empty,l=r.c.empty;for(let a=s.depth,c=s.depth-n,h=n-1;a>c;a--,h--){o=r.c.from(s.node(a).copy(o));let e=i&&i[h];l=r.c.from(e?e.type.create(e.attrs,l):s.node(a).copy(l))}e.step(new k(t,t,new r.j(o.append(l),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,s,o=[],l=[];e.doc.nodesBetween(t,n,(e,a,c)=>{if(!e.isInline)return;let h=e.marks;if(!r.isInSet(h)&&c.type.allowsMarkType(r.type)){let c=Math.max(a,t),d=Math.min(a+e.nodeSize,n),u=r.addToSet(h);for(let e=0;e<h.length;e++)h[e].isInSet(u)||(i&&i.to==c&&i.mark.eq(h[e])?i.to=d:o.push(i=new x(c,d,h[e])));s&&s.to==c?s.to=d:l.push(s=new b(c,d,r))}}),o.forEach(t=>e.step(t)),l.forEach(t=>e.step(t))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,i){let s=[],o=0;e.doc.nodesBetween(t,n,(e,l)=>{if(!e.isInline)return;o++;let a=null;if(i instanceof r.e){let t,n=e.marks;for(;t=i.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else i?i.isInSet(e.marks)&&(a=[i]):a=e.marks;if(a&&a.length){let r=Math.min(l+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,i=a[e];for(let e=0;e<s.length;e++){let t=s[e];t.step==o-1&&i.eq(s[e].style)&&(n=t)}n?(n.to=r,n.step=o):s.push({style:i,from:Math.max(l,t),to:r,step:o})}}}),s.forEach(t=>e.step(new x(t.from,t.to,t.style)))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,i=n.contentMatch){let s=e.doc.nodeAt(t),o=[],l=t+1;for(let a=0;a<s.childCount;a++){let t=s.child(a),c=l+t.nodeSize,h=i.matchType(t.type);if(h){i=h;for(let r=0;r<t.marks.length;r++)n.allowsMarkType(t.marks[r].type)||e.step(new x(l,c,t.marks[r]))}else o.push(new k(l,c,r.j.empty));l=c}if(!i.validEnd){let t=i.fillBefore(r.c.empty,!0);e.replace(l,l,new r.j(t,0,0))}for(let r=o.length-1;r>=0;r--)e.step(o[r])}(this,e,t,n),this}}},vbtb:function(e,t){function n(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,xhtml:!1}}e.exports={defaults:{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,xhtml:!1},getDefaults:n,changeDefaults:function(t){e.exports.defaults=t}}},zUJn:function(e,t,n){"use strict";n.d(t,"g",function(){return r.d}),n.d(t,"h",function(){return r.e}),n.d(t,"a",function(){return R}),n.d(t,"b",function(){return I}),n.d(t,"c",function(){return z}),n.d(t,"d",function(){return S}),n.d(t,"e",function(){return O}),n.d(t,"f",function(){return N});var r=n("b/sn"),i=n("cD+i"),s=n("byeC"),o=n("uSMm");class l{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?t.bottom:t.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:t.left,right:t.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos);e={left:t.left-this.width/2,right:t.left+this.width/2,top:t.top,bottom:t.bottom}}let n,r,i=this.editorView.dom.offsetParent;if(this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!i||i==document.body&&"static"==getComputedStyle(i).position)n=-pageXOffset,r=-pageYOffset;else{let e=i.getBoundingClientRect();n=e.left-i.scrollLeft,r=e.top-i.scrollTop}this.element.style.left=e.left-n+"px",this.element.style.top=e.top-r+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(e=Object(o.h)(this.editorView.state.doc,e,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}var a=n("49oK");class c extends r.f{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return c.valid(n)?new c(n):r.f.near(n)}content(){return s.j.empty}eq(e){return e instanceof c&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new c(e.resolve(t.pos))}getBookmark(){return new h(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&c.valid(e))return e;let i=e.pos,s=null;for(let n=e.depth;;n--){let r=e.node(n);if(t>0?e.indexAfter(n)<r.childCount:e.index(n)>0){s=r.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;i+=t;let o=e.doc.resolve(i);if(c.valid(o))return o}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!r.c.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),n=!1;continue e}break}s=o,i+=t;let l=e.doc.resolve(i);if(c.valid(l))return l}return null}}}c.prototype.visible=!1,c.findFrom=c.findGapCursorFrom,r.f.jsonID("gapcursor",c);class h{constructor(e){this.pos=e}map(e){return new h(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return c.valid(t)?new c(t):r.f.near(t)}}const d=Object(a.a)({ArrowLeft:u("horiz",-1),ArrowRight:u("horiz",1),ArrowUp:u("vert",-1),ArrowDown:u("vert",1)});function u(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,i,s){let o=e.selection,l=t>0?o.$to:o.$from,a=o.empty;if(o instanceof r.h){if(!s.endOfTextblock(n)||0==l.depth)return!1;a=!1,l=e.doc.resolve(t>0?l.after():l.before())}let h=c.findGapCursorFrom(l,t,a);return!!h&&(i&&i(e.tr.setSelection(new c(h))),!0)}}function p(e,t,n){if(!e||!e.editable)return!1;let i=e.state.doc.resolve(t);if(!c.valid(i))return!1;let s=e.posAtCoords({left:n.clientX,top:n.clientY});return!(s&&s.inside>-1&&r.c.isSelectable(e.state.doc.nodeAt(s.inside)))&&(e.dispatch(e.state.tr.setSelection(new c(i))),!0)}function f(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof c))return!1;let{$from:n}=e.state.selection,i=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!i)return!1;let o=s.c.empty;for(let r=i.length-1;r>=0;r--)o=s.c.from(i[r].createAndFill(null,o));let l=e.state.tr.replace(n.pos,n.pos,new s.j(o,0,0));return l.setSelection(r.h.near(l.doc.resolve(n.pos+1))),e.dispatch(l),!1}function m(e){if(!(e.selection instanceof c))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",i.b.create(e.doc,[i.a.widget(e.selection.head,t,{key:"gapcursor"})])}var g=n("RCw7"),y=n("cqjR"),w=n("oV9I"),b=n("Kw5r"),x=n("qd4/");class k{constructor(e,{editor:t,extension:n,parent:r,node:i,view:s,decorations:o,getPos:l}){this.component=e,this.editor=t,this.extension=n,this.parent=r,this.node=i,this.view=s,this.decorations=o,this.isNode=!!this.node.marks,this.isMark=!this.isNode,this.getPos=this.isMark?this.getMarkPos:l,this.captureEvents=!0,this.dom=this.createDOM(),this.contentDOM=this.vm.$refs.content}createDOM(){const e=b.default.extend(this.component),t={editor:this.editor,node:this.node,view:this.view,getPos:()=>this.getPos(),decorations:this.decorations,selected:!1,options:this.extension.options,updateAttrs:e=>this.updateAttrs(e)};return"function"==typeof this.extension.setSelection&&(this.setSelection=this.extension.setSelection),"function"==typeof this.extension.update&&(this.update=this.extension.update),this.vm=new e({parent:this.parent,propsData:t}).$mount(),this.vm.$el}update(e,t){return e.type===this.node.type&&(e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,this.updateComponentProps({node:e,decorations:t}),!0))}updateComponentProps(e){if(!this.vm._props)return;const t=b.default.config.silent;b.default.config.silent=!0,Object.entries(e).forEach(([e,t])=>{this.vm._props[e]=t}),b.default.config.silent=t}updateAttrs(e){if(!this.view.editable)return;const{state:t}=this.view,{type:n}=this.node,r=this.getPos(),i={...this.node.attrs,...e},s=this.isMark?t.tr.removeMark(r.from,r.to,n).addMark(r.from,r.to,n.create(i)):t.tr.setNodeMarkup(r,null,i);this.view.dispatch(s)}ignoreMutation(e){return"selection"!==e.type&&(!this.contentDOM||!this.contentDOM.contains(e.target))}stopEvent(e){if("function"==typeof this.extension.stopEvent)return this.extension.stopEvent(e);const t=!!this.extension.schema.draggable;if(t&&"mousedown"===e.type){const t=e.target.closest&&e.target.closest("[data-drag-handle]");t&&(this.dom===t||this.dom.contains(t))&&(this.captureEvents=!1,document.addEventListener("dragend",()=>{this.captureEvents=!0},{once:!0}))}const n="copy"===e.type,r="paste"===e.type,i="cut"===e.type,s=e.type.startsWith("drag")||"drop"===e.type;return!(t&&s||n||r||i)&&this.captureEvents}selectNode(){this.updateComponentProps({selected:!0})}deselectNode(){this.updateComponentProps({selected:!1})}getMarkPos(){const e=this.view.posAtDOM(this.dom),t=this.view.state.doc.resolve(e);return Object(w.e)(t,this.node.type)}destroy(){this.vm.$destroy()}}class v{on(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}emit(e,...t){this._callbacks=this._callbacks||{};const n=this._callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){if(arguments.length){const n=this._callbacks?this._callbacks[e]:null;n&&(t?this._callbacks[e]=n.filter(e=>e!==t):delete this._callbacks[e])}else this._callbacks={};return this}}class S{constructor(e={}){this.options={...this.defaultOptions,...e}}init(){return null}bindEditor(e=null){this.editor=e}get name(){return null}get type(){return"extension"}get defaultOptions(){return{}}get plugins(){return[]}inputRules(){return[]}pasteRules(){return[]}keys(){return{}}}class C{constructor(e=[],t){e.forEach(e=>{e.bindEditor(t),e.init()}),this.extensions=e}get nodes(){return this.extensions.filter(e=>"node"===e.type).reduce((e,{name:t,schema:n})=>({...e,[t]:n}),{})}get options(){const{view:e}=this;return this.extensions.reduce((t,n)=>({...t,[n.name]:new Proxy(n.options,{set(t,n,r){const i=t[n]!==r;return Object.assign(t,{[n]:r}),i&&e.updateState(e.state),!0}})}),{})}get marks(){return this.extensions.filter(e=>"mark"===e.type).reduce((e,{name:t,schema:n})=>({...e,[t]:n}),{})}get plugins(){return this.extensions.filter(e=>e.plugins).reduce((e,{plugins:t})=>[...e,...t],[])}keymaps({schema:e}){const t=this.extensions.filter(e=>["extension"].includes(e.type)).filter(e=>e.keys).map(t=>t.keys({schema:e})),n=this.extensions.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.keys).map(t=>t.keys({type:e[`${t.type}s`][t.name],schema:e}));return[...t,...n].map(e=>Object(a.b)(e))}inputRules({schema:e,excludedExtensions:t}){if(!(t instanceof Array)&&t)return[];const n=t instanceof Array?this.extensions.filter(e=>!t.includes(e.name)):this.extensions,r=n.filter(e=>["extension"].includes(e.type)).filter(e=>e.inputRules).map(t=>t.inputRules({schema:e})),i=n.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.inputRules).map(t=>t.inputRules({type:e[`${t.type}s`][t.name],schema:e}));return[...r,...i].reduce((e,t)=>[...e,...t],[])}pasteRules({schema:e,excludedExtensions:t}){if(!(t instanceof Array)&&t)return[];const n=t instanceof Array?this.extensions.filter(e=>!t.includes(e.name)):this.extensions,r=n.filter(e=>["extension"].includes(e.type)).filter(e=>e.pasteRules).map(t=>t.pasteRules({schema:e})),i=n.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.pasteRules).map(t=>t.pasteRules({type:e[`${t.type}s`][t.name],schema:e}));return[...r,...i].reduce((e,t)=>[...e,...t],[])}commands({schema:e,view:t}){return this.extensions.filter(e=>e.commands).reduce((n,r)=>{const{name:i,type:s}=r,o={},l=r.commands({schema:e,...["node","mark"].includes(s)?{type:e[`${s}s`][i]}:{}}),a=(e,n)=>!!t.editable&&(t.focus(),e(n)(t.state,t.dispatch,t)),c=(e,t)=>{Array.isArray(t)?o[e]=(e=>t.forEach(t=>a(t,e))):"function"==typeof t&&(o[e]=(e=>a(t,e)))};return"object"==typeof l?Object.entries(l).forEach(([e,t])=>{c(e,t)}):c(i,l),{...n,...o}},{})}}class O extends S{constructor(e={}){super(e)}get type(){return"mark"}get view(){return null}get schema(){return null}command(){return()=>{}}}function M(e=0,t=0,n=0){return Math.min(Math.max(parseInt(e,10),t),n)}class N extends S{constructor(e={}){super(e)}get type(){return"node"}get view(){return null}get schema(){return null}command(){return()=>{}}}class E extends N{get name(){return"doc"}get schema(){return{content:"block+"}}}class A extends N{get name(){return"paragraph"}get schema(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:()=>["p",0]}}commands({type:e}){return()=>Object(x.k)(e)}}class D extends N{get name(){return"text"}get schema(){return{group:"inline"}}}var T='.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n';class R extends v{constructor(e={}){super(),this.defaultOptions={editorProps:{},editable:!0,autoFocus:null,extensions:[],content:"",topNode:"doc",emptyDocument:{type:"doc",content:[{type:"paragraph"}]},useBuiltInExtensions:!0,disableInputRules:!1,disablePasteRules:!1,dropCursor:{},enableDropCursor:!0,enableGapCursor:!0,parseOptions:{},injectCSS:!0,onInit:()=>{},onTransaction:()=>{},onUpdate:()=>{},onFocus:()=>{},onBlur:()=>{},onPaste:()=>{},onDrop:()=>{}},this.events=["init","transaction","update","focus","blur","paste","drop"],this.init(e)}init(e={}){this.setOptions({...this.defaultOptions,...e}),this.focused=!1,this.selection={from:0,to:0},this.element=document.createElement("div"),this.extensions=this.createExtensions(),this.nodes=this.createNodes(),this.marks=this.createMarks(),this.schema=this.createSchema(),this.plugins=this.createPlugins(),this.keymaps=this.createKeymaps(),this.inputRules=this.createInputRules(),this.pasteRules=this.createPasteRules(),this.view=this.createView(),this.commands=this.createCommands(),this.setActiveNodesAndMarks(),this.options.injectCSS&&function(e){{const t=document.createElement("style");t.type="text/css",t.textContent=e;const{head:n}=document,{firstChild:r}=n;r?n.insertBefore(t,r):n.appendChild(t)}}(T),null!==this.options.autoFocus&&this.focus(this.options.autoFocus),this.events.forEach(e=>{this.on(e,this.options[
/*!
* tiptap v1.32.1
* (c) 2021 überdosis GbR (limited liability)
* @license MIT
*/
function(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,(e,t)=>0===t?e.toLowerCase():e.toUpperCase()).replace(/\s+/g,"")}(`on ${e}`)]||(()=>{}))}),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view}setOptions(e){this.options={...this.options,...e},this.view&&this.state&&this.view.updateState(this.state)}get builtInExtensions(){return this.options.useBuiltInExtensions?[new E,new D,new A]:[]}get state(){return this.view?this.view.state:null}createExtensions(){return new C([...this.builtInExtensions,...this.options.extensions],this)}createPlugins(){return this.extensions.plugins}createKeymaps(){return this.extensions.keymaps({schema:this.schema})}createInputRules(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}createPasteRules(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}createCommands(){return this.extensions.commands({schema:this.schema,view:this.view})}createNodes(){return this.extensions.nodes}createMarks(){return this.extensions.marks}createSchema(){return new s.i({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}createState(){return r.b.create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[...this.plugins,Object(y.b)({rules:this.inputRules}),...this.pasteRules,...this.keymaps,Object(a.b)({Backspace:y.d}),Object(a.b)(g.a),...this.options.enableDropCursor?[function(e={}){return new r.d({view:t=>new l(t,e)})}(this.options.dropCursor)]:[],...this.options.enableGapCursor?[new r.d({props:{decorations:m,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&c.valid(n)?new c(n):null,handleClick:p,handleKeyDown:d,handleDOMEvents:{beforeinput:f}}})]:[],new r.d({key:new r.e("editable"),props:{editable:()=>this.options.editable}}),new r.d({props:{attributes:{tabindex:0},handleDOMEvents:{focus:(e,t)=>{this.focused=!0,this.emit("focus",{event:t,state:e.state,view:e});const n=this.state.tr.setMeta("focused",!0);this.view.dispatch(n)},blur:(e,t)=>{this.focused=!1,this.emit("blur",{event:t,state:e.state,view:e});const n=this.state.tr.setMeta("focused",!1);this.view.dispatch(n)}}}}),new r.d({props:this.options.editorProps})]})}createDocument(e,t=this.options.parseOptions){if(null===e)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"==typeof e)try{return this.schema.nodeFromJSON(e)}catch(t){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",t),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"==typeof e){const n=`<div>${e}</div>`,r=(new window.DOMParser).parseFromString(n,"text/html").body.firstElementChild;return s.a.fromSchema(this.schema).parse(r,t)}return!1}createView(){return new i.c(this.element,{state:this.createState(),handlePaste:(...e)=>{this.emit("paste",...e)},handleDrop:(...e)=>{this.emit("drop",...e)},dispatchTransaction:this.dispatchTransaction.bind(this)})}setParentComponent(e=null){e&&this.view.setProps({nodeViews:this.initNodeViews({parent:e,extensions:[...this.builtInExtensions,...this.options.extensions]})})}initNodeViews({parent:e,extensions:t}){return t.filter(e=>["node","mark"].includes(e.type)).filter(e=>e.view).reduce((t,n)=>{return{...t,[n.name]:(t,r,i,s)=>{const o=n.view;return new k(o,{editor:this,extension:n,parent:e,node:t,view:r,getPos:i,decorations:s})}}},{})}dispatchTransaction(e){const t=this.state.apply(e);this.view.updateState(t),this.selection={from:this.state.selection.from,to:this.state.selection.to},this.setActiveNodesAndMarks(),this.emit("transaction",{getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emitUpdate(e)}emitUpdate(e){this.emit("update",{getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:e})}resolveSelection(e=null){if(this.selection&&null===e)return this.selection;if("start"===e||!0===e)return{from:0,to:0};if("end"===e){const{doc:e}=this.state;return{from:e.content.size,to:e.content.size}}return{from:e,to:e}}focus(e=null){if(this.view.focused&&null===e||!1===e)return;const{from:t,to:n}=this.resolveSelection(e);this.setSelection(t,n),setTimeout(()=>this.view.focus(),10)}setSelection(e=0,t=0){const{doc:n,tr:i}=this.state,s=M(e,0,n.content.size),o=M(t,0,n.content.size),l=r.h.create(n,s,o),a=i.setSelection(l);this.view.dispatch(a)}blur(){this.view.dom.blur()}getSchemaJSON(){return JSON.parse(JSON.stringify({nodes:this.extensions.nodes,marks:this.extensions.marks}))}getHTML(){const e=document.createElement("div"),t=s.b.fromSchema(this.schema).serializeFragment(this.state.doc.content);return e.appendChild(t),e.innerHTML}getJSON(){return this.state.doc.toJSON()}setContent(e={},t=!1,n){const{doc:i,tr:s}=this.state,o=this.createDocument(e,n),l=r.h.create(i,0,i.content.size),a=s.setSelection(l).replaceSelectionWith(o,!1).setMeta("preventUpdate",!t);this.view.dispatch(a)}clearContent(e=!1){this.setContent(this.options.emptyDocument,e)}setActiveNodesAndMarks(){this.activeMarks=Object.entries(this.schema.marks).reduce((e,[t,n])=>({...e,[t]:(e={})=>Object(w.g)(this.state,n,e)}),{}),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce((e,[t,n])=>({...e,[t]:Object(w.d)(this.state,n)}),{}),this.activeNodes=Object.entries(this.schema.nodes).reduce((e,[t,n])=>({...e,[t]:(e={})=>Object(w.i)(this.state,n,e)}),{})}getMarkAttrs(e=null){return this.activeMarkAttrs[e]}getNodeAttrs(e=null){return{...Object(w.f)(this.state,this.schema.nodes[e])}}get isActive(){return Object.entries({...this.activeMarks,...this.activeNodes}).reduce((e,[t,n])=>({...e,[t]:(e={})=>n(e)}),{})}registerPlugin(e=null,t){const n="function"==typeof t?t(e,this.state.plugins):[e,...this.state.plugins],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(e=null){if(!e||!this.view.docView)return;const t=this.state.reconfigure({plugins:this.state.plugins.filter(t=>!t.key.startsWith(`${e}$`))});this.view.updateState(t)}destroy(){this.view&&this.view.destroy()}}var I={props:{editor:{default:null,type:Object}},watch:{editor:{immediate:!0,handler(e){e&&e.element&&this.$nextTick(()=>{this.$el.appendChild(e.element.firstChild),e.setParentComponent(this)})}}},render:e=>e("div"),beforeDestroy(){this.editor.element=this.$el}};class ${constructor({options:e}){this.options=e,this.preventHide=!1,this.mousedownHandler=this.handleClick.bind(this),this.options.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.blurHandler=(()=>{this.preventHide?this.preventHide=!1:this.options.editor.emit("menubar:focusUpdate",!1)}),this.options.editor.on("blur",this.blurHandler)}handleClick(){this.preventHide=!0}destroy(){this.options.element.removeEventListener("mousedown",this.mousedownHandler),this.options.editor.off("blur",this.blurHandler)}}var z={props:{editor:{default:null,type:Object}},data:()=>({focused:!1}),watch:{editor:{immediate:!0,handler(e){e&&this.$nextTick(()=>{e.registerPlugin(function(e){return new r.d({key:new r.e("menu_bar"),view:t=>new $({editorView:t,options:e})})}({editor:e,element:this.$el})),this.focused=e.focused,e.on("focus",()=>{this.focused=!0}),e.on("menubar:focusUpdate",e=>{this.focused=e})})}}},render(){return this.editor?this.$scopedSlots.default({focused:this.focused,focus:this.editor.focus,commands:this.editor.commands,isActive:this.editor.isActive,getMarkAttrs:this.editor.getMarkAttrs.bind(this.editor),getNodeAttrs:this.editor.getNodeAttrs.bind(this.editor)}):null}};Object,Boolean;Object}}]);
//# sourceMappingURL=chunk-0ae4.08b37e98.js.map