@tempots/beatui 0.66.0 → 0.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,15 @@
1
- "use strict";const A=require("@tempots/dom"),It=require("./toolbar-wEm8iNet.cjs"),Rr=require("./translations-hMQlZmD4.cjs"),No=require("./link-portal-_tiDFZqh.cjs"),Io=require("@tempots/ui"),Ro=require("./theme-Dt6lCAvY.cjs");function q(t){this.content=t}q.prototype={constructor:q,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,u=r.find(t),i=r.content.slice();return u==-1?i.push(n||t,e):(i[u+1]=e,n&&(i[u]=n)),new q(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new q(n)},addToStart:function(t,e){return new q([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new q(n)},addBefore:function(t,e,n){var r=this.remove(e),u=r.content.slice(),i=r.find(t);return u.splice(i==-1?u.length:i,0,e,n),new q(u)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=q.from(t),t.size?new q(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=q.from(t),t.size?new q(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=q.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};q.from=function(t){if(t instanceof q)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new q(e)};function Fi(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let u=t.child(r),i=e.child(r);if(u==i){n+=u.nodeSize;continue}if(!u.sameMarkup(i))return n;if(u.isText&&u.text!=i.text){for(let s=0;u.text[s]==i.text[s];s++)n++;return n}if(u.content.size||i.content.size){let s=Fi(u.content,i.content,n+1);if(s!=null)return s}n+=u.nodeSize}}function Ni(t,e,n,r){for(let u=t.childCount,i=e.childCount;;){if(u==0||i==0)return u==i?null:{a:n,b:r};let s=t.child(--u),o=e.child(--i),l=s.nodeSize;if(s==o){n-=l,r-=l;continue}if(!s.sameMarkup(o))return{a:n,b:r};if(s.isText&&s.text!=o.text){let a=0,c=Math.min(s.text.length,o.text.length);for(;a<c&&s.text[s.text.length-a-1]==o.text[o.text.length-a-1];)a++,n--,r--;return{a:n,b:r}}if(s.content.size||o.content.size){let a=Ni(s.content,o.content,n-1,r-1);if(a)return a}n-=l,r-=l}}class x{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,u=0,i){for(let s=0,o=0;o<n;s++){let l=this.content[s],a=o+l.nodeSize;if(a>e&&r(l,u+o,i||null,s)!==!1&&l.content.size){let c=o+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,u+c)}o=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,u){let i="",s=!0;return this.nodesBetween(e,n,(o,l)=>{let a=o.isText?o.text.slice(Math.max(e,l)-l,n-l):o.isLeaf?u?typeof u=="function"?u(o):u:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&a||o.isTextblock)&&r&&(s?s=!1:i+=r),i+=a},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,u=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(u[u.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)u.push(e.content[i]);return new x(u,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],u=0;if(n>e)for(let i=0,s=0;s<n;i++){let o=this.content[i],l=s+o.nodeSize;l>e&&((s<e||l>n)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,n-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,n-s-1))),r.push(o),u+=o.nodeSize),s=l}return new x(r,u)}cutByIndex(e,n){return e==n?x.empty:e==0&&n==this.content.length?this:new x(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let u=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return u[e]=n,new x(u,i)}addToStart(e){return new x([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new x(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let u=this.content[n];e(u,r,n),r+=u.nodeSize}}findDiffStart(e,n=0){return Fi(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ni(this,e,n,r)}findIndex(e){if(e==0)return tn(0,e);if(e==this.size)return tn(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 u=this.child(n),i=r+u.nodeSize;if(i>=e)return i==e?tn(n+1,i):tn(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,n){if(!n)return x.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new x(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return x.empty;let n,r=0;for(let u=0;u<e.length;u++){let i=e[u];r+=i.nodeSize,u&&i.isText&&e[u-1].sameMarkup(i)?(n||(n=e.slice(0,u)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new x(n||e,r)}static from(e){if(!e)return x.empty;if(e instanceof x)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new x([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}x.empty=new x([],0);const Pn={index:0,offset:0};function tn(t,e){return Pn.index=t,Pn.offset=e,Pn}function hn(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!hn(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!hn(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}class w{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let u=0;u<e.length;u++){let i=e[u];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,u));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,u)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&hn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let u=r.create(n.attrs);return r.checkAttrs(u.attrs),u}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return w.none;if(e instanceof w)return[e];let n=e.slice();return n.sort((r,u)=>r.type.rank-u.type.rank),n}}w.none=[];class pn extends Error{}class C{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Ri(this.content,e+this.openStart,n);return r&&new C(r,this.openStart,this.openEnd)}removeBetween(e,n){return new C(Ii(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return C.empty;let r=n.openStart||0,u=n.openEnd||0;if(typeof r!="number"||typeof u!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new C(x.fromJSON(e,n.content),r,u)}static maxOpen(e,n=!0){let r=0,u=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)u++;return new C(e,r,u)}}C.empty=new C(x.empty,0,0);function Ii(t,e,n){let{index:r,offset:u}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:o}=t.findIndex(n);if(u==e||i.isText){if(o!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Ii(i.content,e-u-1,n-u-1)))}function Ri(t,e,n,r){let{index:u,offset:i}=t.findIndex(e),s=t.maybeChild(u);if(i==e||s.isText)return r&&!r.canReplace(u,u,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=Ri(s.content,e-i-1,n,s);return o&&t.replaceChild(u,s.copy(o))}function Bo(t,e,n){if(n.openStart>t.depth)throw new pn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new pn("Inconsistent open depths");return Bi(t,e,n,0)}function Bi(t,e,n,r){let u=t.index(r),i=t.node(r);if(u==e.index(r)&&r<t.depth-n.openStart){let s=Bi(t,e,n,r+1);return i.copy(i.content.replaceChild(u,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,o=s.content;return Ge(s,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}else{let{start:s,end:o}=vo(n,t);return Ge(i,zi(t,s,o,e,r))}else return Ge(i,mn(t,e,r))}function vi(t,e){if(!e.type.compatibleContent(t.type))throw new pn("Cannot join "+e.type.name+" onto "+t.type.name)}function pr(t,e,n){let r=t.node(n);return vi(r,e.node(n)),r}function Ze(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function wt(t,e,n,r){let u=(e||t).node(n),i=0,s=e?e.index(n):u.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Ze(t.nodeAfter,r),i++));for(let o=i;o<s;o++)Ze(u.child(o),r);e&&e.depth==n&&e.textOffset&&Ze(e.nodeBefore,r)}function Ge(t,e){return t.type.checkContent(e),t.copy(e)}function zi(t,e,n,r,u){let i=t.depth>u&&pr(t,e,u+1),s=r.depth>u&&pr(n,r,u+1),o=[];return wt(null,t,u,o),i&&s&&e.index(u)==n.index(u)?(vi(i,s),Ze(Ge(i,zi(t,e,n,r,u+1)),o)):(i&&Ze(Ge(i,mn(t,e,u+1)),o),wt(e,n,u,o),s&&Ze(Ge(s,mn(n,r,u+1)),o)),wt(r,null,u,o),new x(o)}function mn(t,e,n){let r=[];if(wt(null,t,n,r),t.depth>n){let u=pr(t,e,n+1);Ze(Ge(u,mn(t,e,n+1)),r)}return wt(e,null,n,r),new x(r)}function vo(t,e){let n=e.depth-t.openStart,u=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)u=e.node(i).copy(x.from(u));return{start:u.resolveNoCache(t.openStart+n),end:u.resolveNoCache(u.content.size-t.openEnd-n)}}class Rt{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],u=e.child(n);return r?e.child(n).cut(r):u}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],u=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)u+=r.child(i).nodeSize;return u}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return w.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),u=e.maybeChild(n);if(!r){let o=r;r=u,u=o}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!u||!i[s].isInSet(u.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,u=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!u||!r[i].isInSet(u.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Pi(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],u=0,i=n;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(i),a=i-l;if(r.push(s,o,u+l),!a||(s=s.child(o),s.isText))break;i=a-1,u+=l+1}return new Rt(n,r,i)}static resolveCached(e,n){let r=ou.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else ou.set(e,r=new zo);let u=r.elts[r.i]=Rt.resolve(e,n);return r.i=(r.i+1)%Po,u}}class zo{constructor(){this.elts=[],this.i=0}}const Po=12,ou=new WeakMap;class Pi{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Lo=Object.create(null);class xe{constructor(e,n,r,u=w.none){this.type=e,this.attrs=n,this.marks=u,this.content=r||x.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,u=0){this.content.nodesBetween(e,n,r,u,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,u){return this.content.textBetween(e,n,r,u)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&hn(this.attrs,n||e.defaultAttrs||Lo)&&w.sameSet(this.marks,r||w.none)}copy(e=null){return e==this.content?this:new xe(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new xe(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return C.empty;let u=this.resolve(e),i=this.resolve(n),s=r?0:u.sharedDepth(n),o=u.start(s),a=u.node(s).content.cut(u.pos-o,i.pos-o);return new C(a,u.depth-s,i.depth-s)}replace(e,n,r){return Bo(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:u}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(u==e||n.isText)return n;e-=u+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let u=this.content.child(n-1);return{node:u,index:n-1,offset:r-u.nodeSize}}resolve(e){return Rt.resolveCached(this,e)}resolveNoCache(e){return Rt.resolve(this,e)}rangeHasMark(e,n,r){let u=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(u=!0),!u)),u}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()+")"),Li(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=x.empty,u=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,u,i),o=s&&s.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let l=u;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,u){if(u&&!this.type.allowsMarks(u))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=w.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!w.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let u=x.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,u,r);return i.type.checkAttrs(i.attrs),i}}xe.prototype.text=void 0;class gn extends xe{constructor(e,n,r,u){if(super(e,n,null,u),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Li(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new gn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new gn(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Li(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class et{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new qo(e,n);if(r.next==null)return et.empty;let u=qi(r);r.next&&r.err("Unexpected trailing text");let i=Uo(jo(u));return Ko(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let u=this;for(let i=n;u&&i<r;i++)u=u.matchType(e.child(i).type);return u}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let u=[this];function i(s,o){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return x.from(o.map(a=>a.createAndFill()));for(let a=0;a<s.next.length;a++){let{type:c,next:f}=s.next[a];if(!(c.isText||c.hasRequiredAttrs())&&u.indexOf(f)==-1){u.push(f);let p=i(f,o.concat(c));if(p)return p}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let u=r.shift(),i=u.match;if(i.matchType(e)){let s=[];for(let o=u;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:o,next:l}=i.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!u.type||l.validEnd)&&(r.push({match:o.contentMatch,type:o,via:u}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let u=0;u<r.next.length;u++)e.indexOf(r.next[u].next)==-1&&n(r.next[u].next)}return n(this),e.map((r,u)=>{let i=u+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
2
- `)}}et.empty=new et(!0);class qo{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function qi(t){let e=[];do e.push(Vo(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Vo(t){let e=[];do e.push($o(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function $o(t){let e=Jo(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Wo(t,e);else break;return e}function lu(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Wo(t,e){let n=lu(t),r=n;return t.eat(",")&&(t.next!="}"?r=lu(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Ho(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let u=[];for(let i in n){let s=n[i];s.isInGroup(e)&&u.push(s)}return u.length==0&&t.err("No node type or group '"+e+"' found"),u}function Jo(t){if(t.eat("(")){let e=qi(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Ho(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function jo(t){let e=[[]];return u(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,o,l){let a={term:l,to:o};return e[s].push(a),a}function u(s,o){s.forEach(l=>l.to=o)}function i(s,o){if(s.type=="choice")return s.exprs.reduce((l,a)=>l.concat(i(a,o)),[]);if(s.type=="seq")for(let l=0;;l++){let a=i(s.exprs[l],o);if(l==s.exprs.length-1)return a;u(a,o=n())}else if(s.type=="star"){let l=n();return r(o,l),u(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return u(i(s.expr,o),l),u(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(o)].concat(i(s.expr,o));if(s.type=="range"){let l=o;for(let a=0;a<s.min;a++){let c=n();u(i(s.expr,l),c),l=c}if(s.max==-1)u(i(s.expr,l),l);else for(let a=s.min;a<s.max;a++){let c=n();r(l,c),u(i(s.expr,l),c),l=c}return[r(l)]}else{if(s.type=="name")return[r(o,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Vi(t,e){return e-t}function au(t,e){let n=[];return r(e),n.sort(Vi);function r(u){let i=t[u];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(u);for(let s=0;s<i.length;s++){let{term:o,to:l}=i[s];!o&&n.indexOf(l)==-1&&r(l)}}}function Uo(t){let e=Object.create(null);return n(au(t,0));function n(r){let u=[];r.forEach(s=>{t[s].forEach(({term:o,to:l})=>{if(!o)return;let a;for(let c=0;c<u.length;c++)u[c][0]==o&&(a=u[c][1]);au(t,l).forEach(c=>{a||u.push([o,a=[]]),a.indexOf(c)==-1&&a.push(c)})})});let i=e[r.join(",")]=new et(r.indexOf(t.length-1)>-1);for(let s=0;s<u.length;s++){let o=u[s][1].sort(Vi);i.next.push({type:u[s][0],next:e[o.join(",")]||n(o)})}return i}}function Ko(t,e){for(let n=0,r=[t];n<r.length;n++){let u=r[n],i=!u.validEnd,s=[];for(let o=0;o<u.next.length;o++){let{type:l,next:a}=u.next[o];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(a)==-1&&r.push(a)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function $i(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Wi(t,e){let n=Object.create(null);for(let r in t){let u=e&&e[r];if(u===void 0){let i=t[r];if(i.hasDefault)u=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=u}return n}function Hi(t,e,n,r){for(let u in e)if(!(u in t))throw new RangeError(`Unsupported attribute ${u} for ${n} of type ${u}`);for(let u in t){let i=t[u];i.validate&&i.validate(e[u])}}function Ji(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Go(t,r,e[r]);return n}let cu=class ji{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Ji(e,r.attrs),this.defaultAttrs=$i(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==et.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}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:Wi(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new xe(this,this.computeAttrs(e),x.from(n),w.setFrom(r))}createChecked(e=null,n,r){return n=x.from(n),this.checkContent(n),new xe(this,this.computeAttrs(e),n,w.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=x.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let u=this.contentMatch.matchFragment(n),i=u&&u.fillBefore(x.empty,!0);return i?new xe(this,e,n.append(i),w.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Hi(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:w.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new ji(i,n,s));let u=n.spec.topNode||"doc";if(!r[u])throw new RangeError("Schema is missing its top node type ('"+u+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Zo(t,e,n){let r=n.split("|");return u=>{let i=u===null?"null":typeof u;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class Go{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Zo(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Mn{constructor(e,n,r,u){this.name=e,this.rank=n,this.schema=r,this.spec=u,this.attrs=Ji(e,u.attrs),this.excluded=null;let i=$i(this.attrs);this.instance=i?new w(this,i):null}create(e=null){return!e&&this.instance?this.instance:new w(this,Wi(this.attrs,e))}static compile(e,n){let r=Object.create(null),u=0;return e.forEach((i,s)=>r[i]=new Mn(i,u++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Hi(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Br{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let u in e)n[u]=e[u];n.nodes=q.from(e.nodes),n.marks=q.from(e.marks||{}),this.nodes=cu.compile(this.spec.nodes,this),this.marks=Mn.compile(this.spec.marks,this);let r=Object.create(null);for(let u in this.nodes){if(u in this.marks)throw new RangeError(u+" can not be both a node and a mark");let i=this.nodes[u],s=i.spec.content||"",o=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=et.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=o=="_"?null:o?fu(this,o.split(" ")):o==""||!i.inlineContent?[]:null}for(let u in this.marks){let i=this.marks[u],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:fu(this,s.split(" "))}this.nodeFromJSON=u=>xe.fromJSON(this,u),this.markFromJSON=u=>w.fromJSON(this,u),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,u){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof cu){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,u)}text(e,n){let r=this.nodes.text;return new gn(r,r.defaultAttrs,e,w.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function fu(t,e){let n=[];for(let r=0;r<e.length;r++){let u=e[r],i=t.marks[u],s=i;if(i)n.push(i);else for(let o in t.marks){let l=t.marks[o];(u=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(u)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Yo(t){return t.tag!=null}function Xo(t){return t.style!=null}class Bt{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(u=>{if(Yo(u))this.tags.push(u);else if(Xo(u)){let i=/[^=]*/.exec(u.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(u)}}),this.normalizeLists=!this.tags.some(u=>{if(!/^(ul|ol)\b/.test(u.tag)||!u.node)return!1;let i=e.nodes[u.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new hu(this,n,!1);return r.addAll(e,w.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new hu(this,n,!0);return r.addAll(e,w.none,n.from,n.to),C.maxOpen(r.finish())}matchTag(e,n,r){for(let u=r?this.tags.indexOf(r)+1:0;u<this.tags.length;u++){let i=this.tags[u];if(tl(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,u){for(let i=u?this.styles.indexOf(u)+1:0;i<this.styles.length;i++){let s=this.styles[i],o=s.style;if(!(o.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||o.length>e.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(u){let i=u.priority==null?50:u.priority,s=0;for(;s<n.length;s++){let o=n[s];if((o.priority==null?50:o.priority)<i)break}n.splice(s,0,u)}for(let u in e.marks){let i=e.marks[u].spec.parseDOM;i&&i.forEach(s=>{r(s=pu(s)),s.mark||s.ignore||s.clearMark||(s.mark=u)})}for(let u in e.nodes){let i=e.nodes[u].spec.parseDOM;i&&i.forEach(s=>{r(s=pu(s)),s.node||s.ignore||s.mark||(s.node=u)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Bt(e,Bt.schemaRules(e)))}}const Ui={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},Qo={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ki={ol:!0,ul:!0},vt=1,mr=2,Tt=4;function du(t,e,n){return e!=null?(e?vt:0)|(e==="full"?mr:0):t&&t.whitespace=="pre"?vt|mr:n&~Tt}class nn{constructor(e,n,r,u,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=u,this.options=s,this.content=[],this.activeMarks=w.none,this.match=i||(s&Tt?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(x.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,u;return(u=r.findWrapping(e.type))?(this.match=r,u):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&vt)){let r=this.content[this.content.length-1],u;if(r&&r.isText&&(u=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==u[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-u[0].length))}}let n=x.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(x.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ui.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class hu{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let u=n.topNode,i,s=du(null,n.preserveWhitespace,0)|(r?Tt:0);u?i=new nn(u.type,u.attrs,w.none,!0,n.topMatch||u.type.contentMatch,s):r?i=new nn(null,null,w.none,!0,null,s):i=new nn(e.schema.topNodeType,null,w.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,u=this.top,i=u.options&mr?"full":this.localPreserveWS||(u.options&vt)>0,{schema:s}=this.parser;if(i==="full"||u.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
3
- `);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let o=r.split(/\r?\n|\r/);for(let l=0;l<o.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),o[l]&&this.insertNode(s.text(o[l]),n,!/\S/.test(o[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let o=u.content[u.content.length-1],l=e.previousSibling;(!o||l&&l.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let u=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),o;Ki.hasOwnProperty(s)&&this.parser.normalizeLists&&el(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));e:if(l?l.ignore:Qo.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let a,c=this.needsBlock;if(Ui.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),a=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=l&&l.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),a&&this.sync(i),this.needsBlock=c}else{let a=this.readStyles(e,n);a&&this.addElementByRule(e,l,a,l.consuming===!1?o:void 0)}this.localPreserveWS=u}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
- `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let u=0;u<this.parser.matchedStyles.length;u++){let i=this.parser.matchedStyles[u],s=r.getPropertyValue(i);if(s)for(let o=void 0;;){let l=this.parser.matchStyle(i,s,this,o);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(a=>!l.clearMark(a)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)o=l;else break}}return n}addElementByRule(e,n,r,u){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let o=this.top;if(s&&s.isLeaf)this.findInside(e);else if(u)this.addElement(e,r,u);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(o)&&this.open--}addAll(e,n,r,u){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,o=u==null?null:e.childNodes[u];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let u,i;for(let s=this.open,o=0;s>=0;s--){let l=this.nodes[s],a=l.findWrapping(e);if(a&&(!u||u.length>a.length+o)&&(u=a,i=l,!a.length))break;if(l.solid){if(r)break;o+=2}}if(!u)return null;this.sync(i);for(let s=0;s<u.length;s++)n=this.enterInner(u[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let u=this.findPlace(e,n,r);if(u){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=w.none;for(let o of u.concat(e.marks))(i.type?i.type.allowsMarkType(o.type):mu(o.type,e.type))&&(s=o.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,u){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,u)),i}enterInner(e,n,r,u=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let o=du(e,i,s.options);s.options&Tt&&s.content.length==0&&(o|=Tt);let l=w.none;return r=r.filter(a=>(s.type?s.type.allowsMarkType(a.type):mu(a.type,e))?(l=a.addToSet(l),!1):!0),this.nodes.push(new nn(e,n,l,u,null,o)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=vt)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let u=r.length-1;u>=0;u--)e+=r[u].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let u=0;u<this.find.length;u++)this.find[u].pos==null&&e.nodeType==1&&e.contains(this.find[u].node)&&n.compareDocumentPosition(this.find[u].node)&(r?2:4)&&(this.find[u].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,u=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(u?0:1),s=(o,l)=>{for(;o>=0;o--){let a=n[o];if(a==""){if(o==n.length-1||o==0)continue;for(;l>=i;l--)if(s(o-1,l))return!0;return!1}else{let c=l>0||l==0&&u?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!c||c.name!=a&&!c.isInGroup(a))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function el(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Ki.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function tl(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function pu(t){let e={};for(let n in t)e[n]=t[n];return e}function mu(t,e){let n=e.schema.nodes;for(let r in n){let u=n[r];if(!u.allowsMarkType(t))continue;let i=[],s=o=>{i.push(o);for(let l=0;l<o.edgeCount;l++){let{type:a,next:c}=o.edge(l);if(a==e||i.indexOf(c)<0&&s(c))return!0}};if(s(u.contentMatch))return!0}}class xt{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Ln(n).createDocumentFragment());let u=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let o=0,l=0;for(;o<i.length&&l<s.marks.length;){let a=s.marks[l];if(!this.marks[a.type.name]){l++;continue}if(!a.eq(i[o][0])||a.type.spec.spanning===!1)break;o++,l++}for(;o<i.length;)u=i.pop()[1];for(;l<s.marks.length;){let a=s.marks[l++],c=this.serializeMark(a,s.isInline,n);c&&(i.push([a,u]),u.appendChild(c.dom),u=c.contentDOM||c.dom)}}u.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:u}=ln(Ln(n),this.nodes[e.type.name](e),null,e.attrs);if(u){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,u)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let u=e.marks.length-1;u>=0;u--){let i=this.serializeMark(e.marks[u],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let u=this.marks[e.type.name];return u&&ln(Ln(r),u(e,n),null,e.attrs)}static renderSpec(e,n,r=null,u){return ln(e,n,r,u)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new xt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=gu(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return gu(e.marks)}}function gu(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ln(t){return t.document||window.document}const bu=new WeakMap;function nl(t){let e=bu.get(t);return e===void 0&&bu.set(t,e=rl(t)),e}function rl(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let u=0;u<r.length;u++)n(r[u]);else for(let u in r)n(r[u])}return n(t),e}function ln(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let u=e[0],i;if(typeof u!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=nl(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=u.indexOf(" ");s>0&&(n=u.slice(0,s),u=u.slice(s+1));let o,l=n?t.createElementNS(n,u):t.createElement(u),a=e[1],c=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){c=2;for(let f in a)if(a[f]!=null){let p=f.indexOf(" ");p>0?l.setAttributeNS(f.slice(0,p),f.slice(p+1),a[f]):f=="style"&&l.style?l.style.cssText=a[f]:l.setAttribute(f,a[f])}}for(let f=c;f<e.length;f++){let p=e[f];if(p===0){if(f<e.length-1||f>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:d}=ln(t,p,n,r);if(l.appendChild(h),d){if(o)throw new RangeError("Multiple content holes");o=d}}}return{dom:l,contentDOM:o}}const Zi=65535,Gi=Math.pow(2,16);function ul(t,e){return t+e*Gi}function xu(t){return t&Zi}function il(t){return(t-(t&Zi))/Gi}const Yi=1,Xi=2,an=4,Qi=8;class gr{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Qi)>0}get deletedBefore(){return(this.delInfo&(Yi|an))>0}get deletedAfter(){return(this.delInfo&(Xi|an))>0}get deletedAcross(){return(this.delInfo&an)>0}}class Q{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Q.empty)return Q.empty}recover(e){let n=0,r=xu(e);if(!this.inverted)for(let u=0;u<r;u++)n+=this.ranges[u*3+2]-this.ranges[u*3+1];return this.ranges[r*3]+n+il(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let u=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?u:0);if(l>e)break;let a=this.ranges[o+i],c=this.ranges[o+s],f=l+a;if(e<=f){let p=a?e==l?-1:e==f?1:n:n,h=l+u+(p<0?0:c);if(r)return h;let d=e==(n<0?l:f)?null:ul(o/3,e-l),m=e==l?Xi:e==f?Yi:an;return(n<0?e!=l:e!=f)&&(m|=Qi),new gr(h,m,d)}u+=c-a}return r?e+u:new gr(e+u,0,null)}touches(e,n){let r=0,u=xu(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?r:0);if(l>e)break;let a=this.ranges[o+i],c=l+a;if(e<=c&&o==u*3)return!0;r+=this.ranges[o+s]-a}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let u=0,i=0;u<this.ranges.length;u+=3){let s=this.ranges[u],o=s-(this.inverted?i:0),l=s+(this.inverted?0:i),a=this.ranges[u+n],c=this.ranges[u+r];e(o,o+a,l,l+c),i+=c-a}}invert(){return new Q(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Q.empty:new Q(e<0?[0,-e,0]:[0,0,e])}}Q.empty=new Q([]);class zt{constructor(e,n,r=0,u=e?e.length:0){this.mirror=n,this.from=r,this.to=u,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new zt(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let u=e.getMirror(n);this.appendMap(e._maps[n],u!=null&&u<n?r+u:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let u=e.getMirror(n);this.appendMap(e._maps[n].invert(),u!=null&&u>n?r-u-1:void 0)}}invert(){let e=new zt;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let u=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],o=s.mapResult(e,n);if(o.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(o.recover);continue}}u|=o.delInfo,e=o.pos}return r?e:new gr(e,u,null)}}const qn=Object.create(null);class j{getMap(){return Q.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=qn[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in qn)throw new RangeError("Duplicate use of step JSON ID "+e);return qn[e]=n,n.prototype.jsonID=e,n}}class B{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new B(e,null)}static fail(e){return new B(null,e)}static fromReplace(e,n,r,u){try{return B.ok(e.replace(n,r,u))}catch(i){if(i instanceof pn)return B.fail(i.message);throw i}}}function vr(t,e,n){let r=[];for(let u=0;u<t.childCount;u++){let i=t.child(u);i.content.size&&(i=i.copy(vr(i.content,e,i))),i.isInline&&(i=e(i,n,u)),r.push(i)}return x.fromArray(r)}class Be extends j{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),u=r.node(r.sharedDepth(this.to)),i=new C(vr(n.content,(s,o)=>!s.isAtom||!o.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),u),n.openStart,n.openEnd);return B.fromReplace(e,this.from,this.to,i)}invert(){return new me(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Be(n.pos,r.pos,this.mark)}merge(e){return e instanceof Be&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Be(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Be(n.from,n.to,e.markFromJSON(n.mark))}}j.jsonID("addMark",Be);class me extends j{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new C(vr(n.content,u=>u.mark(this.mark.removeFromSet(u.marks)),e),n.openStart,n.openEnd);return B.fromReplace(e,this.from,this.to,r)}invert(){return new Be(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new me(n.pos,r.pos,this.mark)}merge(e){return e instanceof me&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new me(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new me(n.from,n.to,e.markFromJSON(n.mark))}}j.jsonID("removeMark",me);class ve extends j{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return B.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return B.fromReplace(e,this.pos,this.pos+1,new C(x.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let u=0;u<n.marks.length;u++)if(!n.marks[u].isInSet(r))return new ve(this.pos,n.marks[u]);return new ve(this.pos,this.mark)}}return new tt(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ve(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ve(n.pos,e.markFromJSON(n.mark))}}j.jsonID("addNodeMark",ve);class tt extends j{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return B.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return B.fromReplace(e,this.pos,this.pos+1,new C(x.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ve(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new tt(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new tt(n.pos,e.markFromJSON(n.mark))}}j.jsonID("removeNodeMark",tt);class H extends j{constructor(e,n,r,u=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=u}apply(e){return this.structure&&br(e,this.from,this.to)?B.fail("Structure replace would overwrite content"):B.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Q([this.from,this.to-this.from,this.slice.size])}invert(e){return new H(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new H(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof H)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?C.empty:new C(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new H(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?C.empty:new C(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new H(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new H(n.from,n.to,C.fromJSON(e,n.slice),!!n.structure)}}j.jsonID("replace",H);class G extends j{constructor(e,n,r,u,i,s,o=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=u,this.slice=i,this.insert=s,this.structure=o}apply(e){if(this.structure&&(br(e,this.from,this.gapFrom)||br(e,this.gapTo,this.to)))return B.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return B.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?B.fromReplace(e,this.from,this.to,r):B.fail("Content does not fit in gap")}getMap(){return new Q([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new G(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),u=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||u<n.pos||i>r.pos?null:new G(n.pos,r.pos,u,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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new G(n.from,n.to,n.gapFrom,n.gapTo,C.fromJSON(e,n.slice),n.insert,!!n.structure)}}j.jsonID("replaceAround",G);function br(t,e,n){let r=t.resolve(e),u=n-e,i=r.depth;for(;u>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,u--;if(u>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;u>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,u--}}return!1}function sl(t,e,n,r){let u=[],i=[],s,o;t.doc.nodesBetween(e,n,(l,a,c)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let p=Math.max(a,e),h=Math.min(a+l.nodeSize,n),d=r.addToSet(f);for(let m=0;m<f.length;m++)f[m].isInSet(d)||(s&&s.to==p&&s.mark.eq(f[m])?s.to=h:u.push(s=new me(p,h,f[m])));o&&o.to==p?o.to=h:i.push(o=new Be(p,h,r))}}),u.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function ol(t,e,n,r){let u=[],i=0;t.doc.nodesBetween(e,n,(s,o)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof Mn){let a=s.marks,c;for(;c=r.isInSet(a);)(l||(l=[])).push(c),a=c.removeFromSet(a)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let a=Math.min(o+s.nodeSize,n);for(let c=0;c<l.length;c++){let f=l[c],p;for(let h=0;h<u.length;h++){let d=u[h];d.step==i-1&&f.eq(u[h].style)&&(p=d)}p?(p.to=a,p.step=i):u.push({style:f,from:Math.max(o,e),to:a,step:i})}}}),u.forEach(s=>t.step(new me(s.from,s.to,s.style)))}function zr(t,e,n,r=n.contentMatch,u=!0){let i=t.doc.nodeAt(e),s=[],o=e+1;for(let l=0;l<i.childCount;l++){let a=i.child(l),c=o+a.nodeSize,f=r.matchType(a.type);if(!f)s.push(new H(o,c,C.empty));else{r=f;for(let p=0;p<a.marks.length;p++)n.allowsMarkType(a.marks[p].type)||t.step(new me(o,c,a.marks[p]));if(u&&a.isText&&n.whitespace!="pre"){let p,h=/\r?\n|\r/g,d;for(;p=h.exec(a.text);)d||(d=new C(x.from(n.schema.text(" ",n.allowedMarks(a.marks))),0,0)),s.push(new H(o+p.index,o+p.index+p[0].length,d))}}o=c}if(!r.validEnd){let l=r.fillBefore(x.empty,!0);t.replace(o,o,new C(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function ll(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function jt(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let u=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&u.canReplace(i,s,n))return r;if(r==0||u.type.spec.isolating||!ll(u,i,s))break}return null}function al(t,e,n){let{$from:r,$to:u,depth:i}=e,s=r.before(i+1),o=u.after(i+1),l=s,a=o,c=x.empty,f=0;for(let d=i,m=!1;d>n;d--)m||r.index(d)>0?(m=!0,c=x.from(r.node(d).copy(c)),f++):l--;let p=x.empty,h=0;for(let d=i,m=!1;d>n;d--)m||u.after(d+1)<u.end(d)?(m=!0,p=x.from(u.node(d).copy(p)),h++):a++;t.step(new G(l,a,s,o,new C(c.append(p),f,h),c.size-f,!0))}function es(t,e,n=null,r=t){let u=cl(t,e),i=u&&fl(r,e);return i?u.map(ku).concat({type:e,attrs:n}).concat(i.map(ku)):null}function ku(t){return{type:t,attrs:null}}function cl(t,e){let{parent:n,startIndex:r,endIndex:u}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,u,s)?i:null}function fl(t,e){let{parent:n,startIndex:r,endIndex:u}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let a=r;l&&a<u;a++)l=l.matchType(n.child(a).type);return!l||!l.validEnd?null:s}function dl(t,e,n){let r=x.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let o=n[s].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=x.from(n[s].type.create(n[s].attrs,r))}let u=e.start,i=e.end;t.step(new G(u,i,u,i,new C(r,0,0),n.length,!0))}function hl(t,e,n,r,u){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,o)=>{let l=typeof u=="function"?u(s):u;if(s.isTextblock&&!s.hasMarkup(r,l)&&pl(t.doc,t.mapping.slice(i).map(o),r)){let a=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",d=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!d?a=!1:!h&&d&&(a=!0)}a===!1&&ns(t,s,o,i),zr(t,t.mapping.slice(i).map(o,1),r,void 0,a===null);let c=t.mapping.slice(i),f=c.map(o,1),p=c.map(o+s.nodeSize,1);return t.step(new G(f,p,f+1,p-1,new C(x.from(r.create(l,null,s.marks)),0,0),1,!0)),a===!0&&ts(t,s,o,i),!1}})}function ts(t,e,n,r){e.forEach((u,i)=>{if(u.isText){let s,o=/\r?\n|\r/g;for(;s=o.exec(u.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function ns(t,e,n,r){e.forEach((u,i)=>{if(u.type==u.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
5
- `))}})}function pl(t,e,n){let r=t.resolve(e),u=r.index();return r.parent.canReplaceWith(u,u+1,n)}function ml(t,e,n,r,u){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,u||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new G(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new C(x.from(s),0,0),1,!0))}function Ot(t,e,n=1,r){let u=t.resolve(e),i=u.depth-n,s=r&&r[r.length-1]||u.parent;if(i<0||u.parent.type.spec.isolating||!u.parent.canReplace(u.index(),u.parent.childCount)||!s.type.validContent(u.parent.content.cutByIndex(u.index(),u.parent.childCount)))return!1;for(let a=u.depth-1,c=n-2;a>i;a--,c--){let f=u.node(a),p=u.index(a);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),d=r&&r[c+1];d&&(h=h.replaceChild(0,d.type.create(d.attrs)));let m=r&&r[c]||f;if(!f.canReplace(p+1,f.childCount)||!m.type.validContent(h))return!1}let o=u.indexAfter(i),l=r&&r[0];return u.node(i).canReplaceWith(o,o,l?l.type:u.node(i+1).type)}function gl(t,e,n=1,r){let u=t.doc.resolve(e),i=x.empty,s=x.empty;for(let o=u.depth,l=u.depth-n,a=n-1;o>l;o--,a--){i=x.from(u.node(o).copy(i));let c=r&&r[a];s=x.from(c?c.type.create(c.attrs,s):u.node(o).copy(s))}t.step(new H(e,e,new C(i.append(s),n,n),!0))}function Pr(t,e){let n=t.resolve(e),r=n.index();return xl(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function bl(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let u=0;u<e.childCount;u++){let i=e.child(u),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function xl(t,e){return!!(t&&e&&!t.isLeaf&&bl(t,e))}function kl(t,e,n){let r=null,{linebreakReplacement:u}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(u&&s.inlineContent){let c=s.whitespace=="pre",f=!!s.contentMatch.matchType(u);c&&!f?r=!1:!c&&f&&(r=!0)}let o=t.steps.length;if(r===!1){let c=t.doc.resolve(e+n);ns(t,c.node(),c.before(),o)}s.inlineContent&&zr(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(o),a=l.map(e-n);if(t.step(new H(a,l.map(e+n,-1),C.empty,!0)),r===!0){let c=t.doc.resolve(a);ts(t,c.node(),c.before(),t.steps.length)}return t}function yl(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let u=r.depth-1;u>=0;u--){let i=r.index(u);if(r.node(u).canReplaceWith(i,i,n))return r.before(u+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let u=r.depth-1;u>=0;u--){let i=r.indexAfter(u);if(r.node(u).canReplaceWith(i,i,n))return r.after(u+1);if(i<r.node(u).childCount)return null}return null}function Cl(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let u=n.content;for(let i=0;i<n.openStart;i++)u=u.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let o=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(o>0?1:0),a=r.node(s),c=!1;if(i==1)c=a.canReplace(l,l,u);else{let f=a.contentMatchAt(l).findWrapping(u.firstChild.type);c=f&&a.canReplaceWith(l,l,f[0])}if(c)return o==0?r.pos:o<0?r.before(s+1):r.after(s+1)}return null}function Lr(t,e,n=e,r=C.empty){if(e==n&&!r.size)return null;let u=t.resolve(e),i=t.resolve(n);return rs(u,i,r)?new H(e,n,r):new Dl(u,i,r).fit()}function rs(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Dl{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=x.empty;for(let u=0;u<=e.depth;u++){let i=e.node(u);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(u))})}for(let u=e.depth;u>0;u--)this.placed=x.from(e.node(u).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let a=this.findFittable();a?this.placeNodes(a):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,u=this.close(e<0?this.$to:r.doc.resolve(e));if(!u)return null;let i=this.placed,s=r.depth,o=u.depth;for(;s&&o&&i.childCount==1;)i=i.firstChild.content,s--,o--;let l=new C(i,s,o);return e>-1?new G(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new H(r.pos,u.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,u=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(u=0),i.type.spec.isolating&&u<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let u,i=null;r?(i=Vn(this.unplaced.content,r-1).firstChild,u=i.content):u=this.unplaced.content;let s=u.firstChild;for(let o=this.depth;o>=0;o--){let{type:l,match:a}=this.frontier[o],c,f=null;if(n==1&&(s?a.matchType(s.type)||(f=a.fillBefore(x.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:o,parent:i,inject:f};if(n==2&&s&&(c=a.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:o,parent:i,wrap:c};if(i&&a.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,u=Vn(e,n);return!u.childCount||u.firstChild.isLeaf?!1:(this.unplaced=new C(e,n+1,Math.max(r,u.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,u=Vn(e,n);if(u.childCount<=1&&n>0){let i=e.size-n<=n+u.size;this.unplaced=new C(St(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new C(St(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:u,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let s=this.unplaced,o=r?r.content:s.content,l=s.openStart-e,a=0,c=[],{match:f,type:p}=this.frontier[n];if(u){for(let m=0;m<u.childCount;m++)c.push(u.child(m));f=f.matchFragment(u)}let h=o.size+e-(s.content.size-s.openEnd);for(;a<o.childCount;){let m=o.child(a),g=f.matchType(m.type);if(!g)break;a++,(a>1||l==0||m.content.size)&&(f=g,c.push(us(m.mark(p.allowedMarks(m.marks)),a==1?l:0,a==o.childCount?h:-1)))}let d=a==o.childCount;d||(h=-1),this.placed=At(this.placed,n,x.from(c)),this.frontier[n].match=f,d&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=o;m<h;m++){let b=g.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),g=b.content}this.unplaced=d?e==0?C.empty:new C(St(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new C(St(s.content,e,a),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!$n(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,u=this.$to.after(r);for(;r>1&&u==this.$to.end(--r);)++u;return u}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:u}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=$n(e,n,u,r,i);if(s){for(let o=n-1;o>=0;o--){let{match:l,type:a}=this.frontier[o],c=$n(e,o,a,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=At(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let u=e.node(r),i=u.type.contentMatch.fillBefore(u.content,!0,e.index(r));this.openFrontierNode(u.type,u.attrs,i)}return e}openFrontierNode(e,n=null,r){let u=this.frontier[this.depth];u.match=u.match.matchType(e),this.placed=At(this.placed,this.depth,x.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(x.empty,!0);n.childCount&&(this.placed=At(this.placed,this.frontier.length,n))}}function St(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(St(t.firstChild.content,e-1,n)))}function At(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(At(t.lastChild.content,e-1,n)))}function Vn(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function us(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,us(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(x.empty,!0)))),t.copy(r)}function $n(t,e,n,r,u){let i=t.node(e),s=u?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let o=r.fillBefore(i.content,!0,s);return o&&!_l(n,i.content,s)?o:null}function _l(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function El(t){return t.spec.defining||t.spec.definingForContent}function Sl(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let u=t.doc.resolve(e),i=t.doc.resolve(n);if(rs(u,i,r))return t.step(new H(e,n,r));let s=ss(u,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let o=-(u.depth+1);s.unshift(o);for(let p=u.depth,h=u.pos-1;p>0;p--,h--){let d=u.node(p).type.spec;if(d.defining||d.definingAsContext||d.isolating)break;s.indexOf(p)>-1?o=p:u.before(p)==h&&s.splice(1,0,-p)}let l=s.indexOf(o),a=[],c=r.openStart;for(let p=r.content,h=0;;h++){let d=p.firstChild;if(a.push(d),h==r.openStart)break;p=d.content}for(let p=c-1;p>=0;p--){let h=a[p],d=El(h.type);if(d&&!h.sameMarkup(u.node(Math.abs(o)-1)))c=p;else if(d||!h.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let h=(p+c+1)%(r.openStart+1),d=a[h];if(d)for(let m=0;m<s.length;m++){let g=s[(m+l)%s.length],b=!0;g<0&&(b=!1,g=-g);let k=u.node(g-1),y=u.index(g-1);if(k.canReplaceWith(y,y,d.type,d.marks))return t.replace(u.before(g),b?i.after(g):n,new C(is(r.content,0,r.openStart,h),h,r.openEnd))}}let f=t.steps.length;for(let p=s.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>f));p--){let h=s[p];h<0||(e=u.before(h),n=i.after(h))}}function is(t,e,n,r,u){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(is(i.content,e+1,n,r,i)))}if(e>r){let i=u.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(x.empty,!0))}return t}function Al(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let u=yl(t.doc,e,r.type);u!=null&&(e=n=u)}t.replaceRange(e,n,new C(x.from(r),0,0))}function Ml(t,e,n){let r=t.doc.resolve(e),u=t.doc.resolve(n),i=ss(r,u);for(let s=0;s<i.length;s++){let o=i[s],l=s==i.length-1;if(l&&o==0||r.node(o).type.contentMatch.validEnd)return t.delete(r.start(o),u.end(o));if(o>0&&(l||r.node(o-1).canReplace(r.index(o-1),u.indexAfter(o-1))))return t.delete(r.before(o),u.after(o))}for(let s=1;s<=r.depth&&s<=u.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&u.end(s)-n!=u.depth-s&&r.start(s-1)==u.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),u.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function ss(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let u=r;u>=0;u--){let i=t.start(u);if(i<t.pos-(t.depth-u)||e.end(u)>e.pos+(e.depth-u)||t.node(u).type.spec.isolating||e.node(u).type.spec.isolating)break;(i==e.start(u)||u==t.depth&&u==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&u&&e.start(u-1)==i-1)&&n.push(u)}return n}class at extends j{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return B.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let u=n.type.create(r,null,n.marks);return B.fromReplace(e,this.pos,this.pos+1,new C(x.from(u),0,n.isLeaf?0:1))}getMap(){return Q.empty}invert(e){return new at(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new at(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new at(n.pos,n.attr,n.value)}}j.jsonID("attr",at);class Pt extends j{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let u in e.attrs)n[u]=e.attrs[u];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return B.ok(r)}getMap(){return Q.empty}invert(e){return new Pt(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Pt(n.attr,n.value)}}j.jsonID("docAttr",Pt);let dt=class extends Error{};dt=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};dt.prototype=Object.create(Error.prototype);dt.prototype.constructor=dt;dt.prototype.name="TransformError";class wl{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new zt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new dt(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=C.empty){let u=Lr(this.doc,e,n,r);return u&&this.step(u),this}replaceWith(e,n,r){return this.replace(e,n,new C(x.from(r),0,0))}delete(e,n){return this.replace(e,n,C.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Sl(this,e,n,r),this}replaceRangeWith(e,n,r){return Al(this,e,n,r),this}deleteRange(e,n){return Ml(this,e,n),this}lift(e,n){return al(this,e,n),this}join(e,n=1){return kl(this,e,n),this}wrap(e,n){return dl(this,e,n),this}setBlockType(e,n=e,r,u=null){return hl(this,e,n,r,u),this}setNodeMarkup(e,n,r=null,u){return ml(this,e,n,r,u),this}setNodeAttribute(e,n,r){return this.step(new at(e,n,r)),this}setDocAttribute(e,n){return this.step(new Pt(e,n)),this}addNodeMark(e,n){return this.step(new ve(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof w)n.isInSet(r.marks)&&this.step(new tt(e,n));else{let u=r.marks,i,s=[];for(;i=n.isInSet(u);)s.push(new tt(e,i)),u=i.removeFromSet(u);for(let o=s.length-1;o>=0;o--)this.step(s[o])}return this}split(e,n=1,r){return gl(this,e,n,r),this}addMark(e,n,r){return sl(this,e,n,r),this}removeMark(e,n,r){return ol(this,e,n,r),this}clearIncompatible(e,n,r){return zr(this,e,n,r),this}}const Wn=Object.create(null);class F{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Tl(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=C.empty){let r=n.content.lastChild,u=null;for(let o=0;o<n.openEnd;o++)u=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:l,$to:a}=s[o],c=e.mapping.slice(i);e.replaceRange(c.map(l.pos),c.map(a.pos),o?C.empty:n),o==0&&Du(e,i,(r?r.isInline:u&&u.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,u=this.ranges;for(let i=0;i<u.length;i++){let{$from:s,$to:o}=u[i],l=e.mapping.slice(r),a=l.map(s.pos),c=l.map(o.pos);i?e.deleteRange(a,c):(e.replaceRangeWith(a,c,n),Du(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let u=e.parent.inlineContent?new N(e):ot(e.node(0),e.parent,e.pos,e.index(),n,r);if(u)return u;for(let i=e.depth-1;i>=0;i--){let s=n<0?ot(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):ot(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new ee(e.node(0))}static atStart(e){return ot(e,e,0,0,1)||new ee(e)}static atEnd(e){return ot(e,e,e.content.size,e.childCount,-1)||new ee(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Wn[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Wn)throw new RangeError("Duplicate use of selection JSON ID "+e);return Wn[e]=n,n.prototype.jsonID=e,n}getBookmark(){return N.between(this.$anchor,this.$head).getBookmark()}}F.prototype.visible=!0;class Tl{constructor(e,n){this.$from=e,this.$to=n}}let yu=!1;function Cu(t){!yu&&!t.parent.inlineContent&&(yu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class N extends F{constructor(e,n=e){Cu(e),Cu(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return F.near(r);let u=e.resolve(n.map(this.anchor));return new N(u.parent.inlineContent?u:r,r)}replace(e,n=C.empty){if(super.replace(e,n),n==C.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof N&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new wn(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new N(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let u=e.resolve(n);return new this(u,r==n?u:e.resolve(r))}static between(e,n,r){let u=e.pos-n.pos;if((!r||u)&&(r=u>=0?1:-1),!n.parent.inlineContent){let i=F.findFrom(n,r,!0)||F.findFrom(n,-r,!0);if(i)n=i.$head;else return F.near(n,r)}return e.parent.inlineContent||(u==0?e=n:(e=(F.findFrom(e,-r,!0)||F.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=u<0&&(e=n))),new N(e,n)}}F.jsonID("text",N);class wn{constructor(e,n){this.anchor=e,this.head=n}map(e){return new wn(e.map(this.anchor),e.map(this.head))}resolve(e){return N.between(e.resolve(this.anchor),e.resolve(this.head))}}class M extends F{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:u}=n.mapResult(this.anchor),i=e.resolve(u);return r?F.near(i):new M(i)}content(){return new C(x.from(this.node),0,0)}eq(e){return e instanceof M&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new qr(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new M(e.resolve(n.anchor))}static create(e,n){return new M(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}M.prototype.visible=!1;F.jsonID("node",M);class qr{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new wn(r,r):new qr(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&M.isSelectable(r)?new M(n):F.near(n)}}class ee extends F{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=C.empty){if(n==C.empty){e.delete(0,e.doc.content.size);let r=F.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new ee(e)}map(e){return new ee(e)}eq(e){return e instanceof ee}getBookmark(){return Ol}}F.jsonID("all",ee);const Ol={map(){return this},resolve(t){return new ee(t)}};function ot(t,e,n,r,u,i=!1){if(e.inlineContent)return N.create(t,n);for(let s=r-(u>0?0:1);u>0?s<e.childCount:s>=0;s+=u){let o=e.child(s);if(o.isAtom){if(!i&&M.isSelectable(o))return M.create(t,n-(u<0?o.nodeSize:0))}else{let l=ot(t,o,n+u,u<0?o.childCount:0,u,i);if(l)return l}n+=o.nodeSize*u}return null}function Du(t,e,n){let r=t.steps.length-1;if(r<e)return;let u=t.steps[r];if(!(u instanceof H||u instanceof G))return;let i=t.mapping.maps[r],s;i.forEach((o,l,a,c)=>{s==null&&(s=c)}),t.setSelection(F.near(t.doc.resolve(s),n))}const _u=1,rn=2,Eu=4;class Fl extends wl{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|_u)&~rn,this.storedMarks=null,this}get selectionSet(){return(this.updated&_u)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=rn,this}ensureMarks(e){return w.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&rn)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~rn,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||w.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let u=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(u.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,u.text(e,i)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(F.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Eu,this}get scrolledIntoView(){return(this.updated&Eu)>0}}function Su(t,e){return!e||!t?t:t.bind(e)}class Mt{constructor(e,n,r){this.name=e,this.init=Su(n.init,r),this.apply=Su(n.apply,r)}}const Nl=[new Mt("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Mt("selection",{init(t,e){return t.selection||F.atStart(e.doc)},apply(t){return t.selection}}),new Mt("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Mt("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Hn{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Nl.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Mt(r.key,r.spec.state,r))})}}class je{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let u=this.config.plugins[r];if(u.spec.filterTransaction&&!u.spec.filterTransaction.call(u,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),u=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=u?u[s].n:0,a=u?u[s].state:this,c=l<n.length&&o.spec.appendTransaction.call(o,l?n.slice(l):n,a,r);if(c&&r.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!u){u=[];for(let f=0;f<this.config.plugins.length;f++)u.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(c),r=r.applyInner(c),i=!0}u&&(u[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new je(this.config),r=this.config.fields;for(let u=0;u<r.length;u++){let i=r[u];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new Fl(this)}static create(e){let n=new Hn(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new je(n);for(let u=0;u<n.fields.length;u++)r[n.fields[u].name]=n.fields[u].init(e,r);return r}reconfigure(e){let n=new Hn(this.schema,e.plugins),r=n.fields,u=new je(n);for(let i=0;i<r.length;i++){let s=r[i].name;u[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,u)}return u}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let u=e[r],i=u.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(u,this[u.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let u=new Hn(e.schema,e.plugins),i=new je(u);return u.fields.forEach(s=>{if(s.name=="doc")i.doc=xe.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=F.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let o in r){let l=r[o],a=l.spec.state;if(l.key==s.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(n,o)){i[s.name]=a.fromJSON.call(l,e,n[o],i);return}}i[s.name]=s.init(e,i)}}),i}}function ls(t,e,n){for(let r in t){let u=t[r];u instanceof Function?u=u.bind(e):r=="handleDOMEvents"&&(u=ls(u,e,{})),n[r]=u}return n}class Vr{constructor(e){this.spec=e,this.props={},e.props&&ls(e.props,this,this.props),this.key=e.key?e.key.key:as("plugin")}getState(e){return e[this.key]}}const Jn=Object.create(null);function as(t){return t in Jn?t+"$"+ ++Jn[t]:(Jn[t]=0,t+"$")}class cs{constructor(e="key"){this.key=as(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const fs=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Il(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Rl=(t,e,n)=>{let r=Il(t,n);if(!r)return!1;let u=ds(r);if(!u){let s=r.blockRange(),o=s&&jt(s);return o==null?!1:(e&&e(t.tr.lift(s,o).scrollIntoView()),!0)}let i=u.nodeBefore;if(ps(t,u,e,-1))return!0;if(r.parent.content.size==0&&(ht(i,"end")||M.isSelectable(i)))for(let s=r.depth;;s--){let o=Lr(t.doc,r.before(s),r.after(s),C.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=t.tr.step(o);l.setSelection(ht(i,"end")?F.findFrom(l.doc.resolve(l.mapping.map(u.pos,-1)),-1):M.create(l.doc,u.pos-i.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&u.depth==r.depth-1?(e&&e(t.tr.delete(u.pos-i.nodeSize,u.pos).scrollIntoView()),!0):!1};function ht(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Bl=(t,e,n)=>{let{$head:r,empty:u}=t.selection,i=r;if(!u)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=ds(r)}let s=i&&i.nodeBefore;return!s||!M.isSelectable(s)?!1:(e&&e(t.tr.setSelection(M.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function ds(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function vl(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const zl=(t,e,n)=>{let r=vl(t,n);if(!r)return!1;let u=hs(r);if(!u)return!1;let i=u.nodeAfter;if(ps(t,u,e,1))return!0;if(r.parent.content.size==0&&(ht(i,"start")||M.isSelectable(i))){let s=Lr(t.doc,r.before(),r.after(),C.empty);if(s&&s.slice.size<s.to-s.from){if(e){let o=t.tr.step(s);o.setSelection(ht(i,"start")?F.findFrom(o.doc.resolve(o.mapping.map(u.pos)),1):M.create(o.doc,o.mapping.map(u.pos))),e(o.scrollIntoView())}return!0}}return i.isAtom&&u.depth==r.depth-1?(e&&e(t.tr.delete(u.pos,u.pos+i.nodeSize).scrollIntoView()),!0):!1},Pl=(t,e,n)=>{let{$head:r,empty:u}=t.selection,i=r;if(!u)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=hs(r)}let s=i&&i.nodeAfter;return!s||!M.isSelectable(s)?!1:(e&&e(t.tr.setSelection(M.create(t.doc,i.pos)).scrollIntoView()),!0)};function hs(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const Ll=(t,e)=>{let{$from:n,$to:r}=t.selection,u=n.blockRange(r),i=u&&jt(u);return i==null?!1:(e&&e(t.tr.lift(u,i).scrollIntoView()),!0)},ql=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
6
- `).scrollIntoView()),!0)};function $r(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Vl=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let u=n.node(-1),i=n.indexAfter(-1),s=$r(u.contentMatchAt(i));if(!s||!u.canReplaceWith(i,i,s))return!1;if(e){let o=n.after(),l=t.tr.replaceWith(o,o,s.createAndFill());l.setSelection(F.near(l.doc.resolve(o),1)),e(l.scrollIntoView())}return!0},$l=(t,e)=>{let n=t.selection,{$from:r,$to:u}=n;if(n instanceof ee||r.parent.inlineContent||u.parent.inlineContent)return!1;let i=$r(u.parent.contentMatchAt(u.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&u.index()<u.parent.childCount?r:u).pos,o=t.tr.insert(s,i.createAndFill());o.setSelection(N.create(o.doc,s+1)),e(o.scrollIntoView())}return!0},Wl=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Ot(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),u=r&&jt(r);return u==null?!1:(e&&e(t.tr.lift(r,u).scrollIntoView()),!0)};function Hl(t){return(e,n)=>{let{$from:r,$to:u}=e.selection;if(e.selection instanceof M&&e.selection.node.isBlock)return!r.parentOffset||!Ot(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,o,l=!1,a=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){l=r.end(h)==r.pos+(r.depth-h),a=r.start(h)==r.pos-(r.depth-h),o=$r(r.node(h-1).contentMatchAt(r.indexAfter(h-1))),i.unshift(l&&o?{type:o}:null),s=h;break}else{if(h==1)return!1;i.unshift(null)}let c=e.tr;(e.selection instanceof N||e.selection instanceof ee)&&c.deleteSelection();let f=c.mapping.map(r.pos),p=Ot(c.doc,f,i.length,i);if(p||(i[0]=o?{type:o}:null,p=Ot(c.doc,f,i.length,i)),!p)return!1;if(c.split(f,i.length,i),!l&&a&&r.node(s).type!=o){let h=c.mapping.map(r.before(s)),d=c.doc.resolve(h);o&&r.node(s-1).canReplaceWith(d.index(),d.index()+1,o)&&c.setNodeMarkup(c.mapping.map(r.before(s)),o)}return n&&n(c.scrollIntoView()),!0}}const Jl=Hl(),jl=(t,e)=>(e&&e(t.tr.setSelection(new ee(t.doc))),!0);function Ul(t,e,n){let r=e.nodeBefore,u=e.nodeAfter,i=e.index();return!r||!u||!r.type.compatibleContent(u.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(u.isTextblock||Pr(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function ps(t,e,n,r){let u=e.nodeBefore,i=e.nodeAfter,s,o,l=u.type.spec.isolating||i.type.spec.isolating;if(!l&&Ul(t,e,n))return!0;let a=!l&&e.parent.canReplace(e.index(),e.index()+1);if(a&&(s=(o=u.contentMatchAt(u.childCount)).findWrapping(i.type))&&o.matchType(s[0]||i.type).validEnd){if(n){let h=e.pos+i.nodeSize,d=x.empty;for(let b=s.length-1;b>=0;b--)d=x.from(s[b].create(null,d));d=x.from(u.copy(d));let m=t.tr.step(new G(e.pos-1,h,e.pos,h,new C(d,1,0),s.length,!0)),g=m.doc.resolve(h+2*s.length);g.nodeAfter&&g.nodeAfter.type==u.type&&Pr(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let c=i.type.spec.isolating||r>0&&l?null:F.findFrom(e,1),f=c&&c.$from.blockRange(c.$to),p=f&&jt(f);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(f,p).scrollIntoView()),!0;if(a&&ht(i,"start",!0)&&ht(u,"end")){let h=u,d=[];for(;d.push(h),!h.isTextblock;)h=h.lastChild;let m=i,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(n){let b=x.empty;for(let y=d.length-1;y>=0;y--)b=x.from(d[y].copy(b));let k=t.tr.step(new G(e.pos-d.length,e.pos+i.nodeSize,e.pos+g,e.pos+i.nodeSize-g,new C(b,d.length,0),0,!0));n(k.scrollIntoView())}return!0}}return!1}function ms(t){return function(e,n){let r=e.selection,u=t<0?r.$from:r.$to,i=u.depth;for(;u.node(i).isInline;){if(!i)return!1;i--}return u.node(i).isTextblock?(n&&n(e.tr.setSelection(N.create(e.doc,t<0?u.start(i):u.end(i)))),!0):!1}}const Kl=ms(-1),Zl=ms(1);function Gl(t,e=null){return function(n,r){let{$from:u,$to:i}=n.selection,s=u.blockRange(i),o=s&&es(s,t,e);return o?(r&&r(n.tr.wrap(s,o).scrollIntoView()),!0):!1}}function xr(t,e=null){return function(n,r){let u=!1;for(let i=0;i<n.selection.ranges.length&&!u;i++){let{$from:{pos:s},$to:{pos:o}}=n.selection.ranges[i];n.doc.nodesBetween(s,o,(l,a)=>{if(u)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)u=!0;else{let c=n.doc.resolve(a),f=c.index();u=c.parent.canReplaceWith(f,f+1,t)}})}if(!u)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:o},$to:{pos:l}}=n.selection.ranges[s];i.setBlockType(o,l,t,e)}r(i.scrollIntoView())}return!0}}function Yl(t,e,n,r){for(let u=0;u<e.length;u++){let{$from:i,$to:s}=e[u],o=i.depth==0?t.inlineContent&&t.type.allowsMarkType(n):!1;if(t.nodesBetween(i.pos,s.pos,(l,a)=>{if(o)return!1;o=l.inlineContent&&l.type.allowsMarkType(n)}),o)return!0}return!1}function cn(t,e=null,n){return function(r,u){let{empty:i,$cursor:s,ranges:o}=r.selection;if(i&&!s||!Yl(r.doc,o,t))return!1;if(u)if(s)t.isInSet(r.storedMarks||s.marks())?u(r.tr.removeStoredMark(t)):u(r.tr.addStoredMark(t.create(e)));else{let l,a=r.tr;l=!o.some(c=>r.doc.rangeHasMark(c.$from.pos,c.$to.pos,t));for(let c=0;c<o.length;c++){let{$from:f,$to:p}=o[c];if(!l)a.removeMark(f.pos,p.pos,t);else{let h=f.pos,d=p.pos,m=f.nodeAfter,g=p.nodeBefore,b=m&&m.isText?/^\s*/.exec(m.text)[0].length:0,k=g&&g.isText?/\s*$/.exec(g.text)[0].length:0;h+b<d&&(h+=b,d-=k),a.addMark(h,d,t.create(e))}}u(a.scrollIntoView())}return!0}}function Wr(...t){return function(e,n,r){for(let u=0;u<t.length;u++)if(t[u](e,n,r))return!0;return!1}}let jn=Wr(fs,Rl,Bl),Au=Wr(fs,zl,Pl);const Se={Enter:Wr(ql,$l,Wl,Jl),"Mod-Enter":Vl,Backspace:jn,"Mod-Backspace":jn,"Shift-Backspace":jn,Delete:Au,"Mod-Delete":Au,"Mod-a":jl},gs={"Ctrl-h":Se.Backspace,"Alt-Backspace":Se["Mod-Backspace"],"Ctrl-d":Se.Delete,"Ctrl-Alt-Backspace":Se["Mod-Delete"],"Alt-Delete":Se["Mod-Delete"],"Alt-d":Se["Mod-Delete"],"Ctrl-a":Kl,"Ctrl-e":Zl};for(let t in Se)gs[t]=Se[t];const Xl=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,Ql=Xl?gs:Se;function bs(t,e){return xs(t,e)!=null}function xs(t,e){const{from:n,$from:r,to:u,empty:i}=t.selection;if(!e)return null;if(i){if(t.storedMarks){const c=t.storedMarks.find(f=>f.type.name===e.name);if(c!=null)return c}const l=r.marks().find(c=>c.type.name===e.name);if(l!=null)return l;const a=r.nodeAfter;if(a&&a.marks){const c=a.marks.find(f=>f.type.name===e.name);if(c!=null)return c}return null}let s=null;return t.doc.nodesBetween(n,u,o=>{if(s!=null)return!1;if(o.marks){const l=o.marks.find(a=>a.type.name===e.name);if(l!=null)return s=l,!1}}),s}function fn(t,e,n){return t.map(()=>{const r=e.value,u=r.state.schema.marks[n];return bs(r.state,u)})}function ea(t,e,n){const{$from:r}=t.selection;for(let i=r.depth;i>0;i--){const s=r.node(i);if(s.type.name===e.name)return n!=null?Object.keys(n).every(o=>s.attrs[o]===n[o]):!0}const u=t.doc.nodeAt(r.pos);return u&&u.type.name===e.name?n!=null?Object.keys(n).every(i=>u.attrs[i]===n[i]):!0:!1}function Dt(t,e,n,r){return t.map(()=>{const u=e.value,i=u.state.schema.nodes[n];return i?ea(u.state,i,r):!1})}function he({active:t,display:e,onClick:n,disabled:r,label:u,icon:i,size:s}){return A.When(e,()=>It.ToolbarButton({onClick:n,disabled:r,variant:t.map(o=>o?"filled":"light"),size:s},A.attr.title(u),Rr.Icon({icon:i,size:s})))}function ta(t,e){const n=t.state.schema.marks.link;if(n==null)return;const{from:r,to:u}=t.state.selection,i=t.state.tr.addMark(r,u,n.create({href:e,title:null}));t.dispatch(i),t.focus()}function ks(t){const{state:e}=t,{$from:n,$to:r}=e.selection;if(!ys(e))return null;let u=n.pos,i=r.pos;const s=e.doc;for(;u>0&&s.resolve(u-1).nodeAfter?.marks?.some(a=>a.type.name==="link");)u--;for(;i<s.content.size&&s.resolve(i).nodeAfter?.marks?.some(a=>a.type.name==="link");)i++;return{start:u,end:i}}function na(t,e){const n=t.state.schema.marks.link;if(n==null)return;const r=ks(t);if(r==null)return;const{start:u,end:i}=r,s=t.state.tr.removeMark(u,i,n).addMark(u,i,n.create({href:e,title:null}));t.dispatch(s)}function ra(t){const e=t.state.schema.marks.link;if(e==null)return;const n=ks(t);if(n==null)return;const{start:r,end:u}=n,i=t.state.tr.removeMark(r,u,e);t.dispatch(i),t.focus()}function ys(t){return bs(t,t.schema.marks.link)}function ua({stateUpdate:t,view:e,isReadOnly:n,label:r,linkUrlPlaceholder:u,size:i}){const s=A.prop(null);s.on(l=>{l!=null&&na(e.value,l)});const o=t.on(()=>{const l=xs(e.value.state,e.value.state.schema.marks.link);l!=null?s.set(l.attrs.href??""):s.set(null)});return A.Fragment(A.OnDispose(o),It.ToolbarGroup(he({display:A.signal(!0),active:fn(t,e,"link"),disabled:n,label:r,icon:"mdi:link-variant",size:i,onClick:()=>{const l=e.value.state;if(ys(l))ra(e.value),s.set(null);else{const a="";ta(e.value,a),s.set(a)}}}),A.Ensure(s,l=>Rr.TextInput({value:l,autofocus:!0,onInput:s.set,placeholder:u,size:i}))),A.Ensure(s,l=>It.ToolbarButton({disabled:l.map(a=>a.trim()===""),variant:"text",onClick:()=>{const a=s.value;a&&window.open(a,"_blank")},size:i},"go")))}function un({display:t},...e){return A.When(A.computedOf(...t)((...n)=>n.some(Boolean)),()=>It.ToolbarGroup(...e))}function Cs({view:t,stateUpdate:e,features:n,readOnly:r=A.signal(!1),size:u="sm"}){return A.Ensure(t,i=>A.Use(Rr.BeatUII18n,s=>{const o=s.$.prosemirror,l=i;return It.Toolbar(un({display:[n.$.bold,n.$.italic,n.$.code]},he({active:fn(e,l,"strong"),display:n.$.bold,onClick:()=>Un(l.value,"strong"),disabled:r,label:o.$.bold,icon:"mdi:format-bold",size:u}),he({active:fn(e,l,"em"),display:n.$.italic,onClick:()=>Un(l.value,"em"),disabled:r,label:o.$.italic,icon:"mdi:format-italic",size:u}),he({active:fn(e,l,"code"),display:n.$.code,onClick:()=>Un(l.value,"code"),disabled:r,label:o.$.code,icon:"mdi:code-tags",size:u})),un({display:[n.$.headings]},A.Repeat(n.$.headerLevels.map(a=>Math.min(Math.max(a,1),6)),({counter:a})=>he({active:Dt(e,l,"heading",{level:a}),display:n.$.headings,onClick:()=>ia(l.value,a),disabled:r,label:o.map(c=>c.heading(a)),icon:`mdi:format-header-${a}`,size:u}))),un({display:[n.$.bulletList,n.$.orderedList]},he({active:Dt(e,l,"bullet_list"),display:n.$.bulletList,onClick:()=>Mu(l.value,"bullet_list"),disabled:r,label:o.$.bulletList,icon:"mdi:format-list-bulleted",size:u}),he({active:Dt(e,l,"ordered_list"),display:n.$.orderedList,onClick:()=>Mu(l.value,"ordered_list"),disabled:r,label:o.$.orderedList,icon:"mdi:format-list-numbered",size:u})),un({display:[n.$.blockquote,n.$.codeBlock,n.$.horizontalRule]},he({active:Dt(e,l,"blockquote"),display:n.$.blockquote,onClick:()=>sa(l.value),disabled:r,label:o.$.blockquote,icon:"mdi:format-quote-close",size:u}),he({active:Dt(e,l,"code_block"),display:n.$.codeBlock,onClick:()=>oa(l.value),disabled:r,label:o.$.codeBlock,icon:"mdi:code-braces",size:u}),he({active:A.signal(!1),display:n.$.horizontalRule,onClick:()=>la(l.value),disabled:r,label:o.$.horizontalRule,icon:"mdi:minus",size:u})),A.When(n.$.links,()=>ua({stateUpdate:e,view:l,isReadOnly:r,label:o.$.link,linkUrlPlaceholder:o.$.linkUrlPlaceholder,size:u})))}))}function Un(t,e){const n=t.state.schema.marks[e];n!=null&&(cn(n)(t.state,t.dispatch),t.focus())}function ia(t,e){const n=t.state.schema.nodes.heading;n!=null&&(xr(n,{level:e})(t.state,t.dispatch),t.focus())}async function Mu(t,e){const{wrapInList:n,liftListItem:r}=await Promise.resolve().then(()=>require("./index-DufUQsGn.cjs")),u=t.state.schema.nodes[e],i=t.state.schema.nodes.list_item;if(u==null||i==null)return;const{state:s}=t,{$from:o}=s.selection;let l=null;for(let a=o.depth;a>0;a--){const c=o.node(a);if(c.type.name==="bullet_list"||c.type.name==="ordered_list"){l=c.type.name;break}}l===e?r(i)(s,t.dispatch):l!=null?r(i)(t.state,t.dispatch)&&n(u)(t.state,t.dispatch):n(u)(s,t.dispatch),t.focus()}function sa(t){const e=t.state.schema.nodes.blockquote;if(e==null)return;const{state:n}=t,{$from:r}=n.selection;let u=!1;for(let i=r.depth;i>0;i--)if(r.node(i).type.name==="blockquote"){u=!0;break}u?Ll(n,t.dispatch):Gl(e)(n,t.dispatch),t.focus()}function oa(t){const e=t.state.schema.nodes.code_block,n=t.state.schema.nodes.paragraph;if(e==null||n==null)return;const{state:r}=t,{$from:u}=r.selection;let i=!1;for(let s=u.depth;s>0;s--)if(u.node(s).type.name==="code_block"){i=!0;break}i?xr(n)(r,t.dispatch):xr(e)(r,t.dispatch),t.focus()}function la(t){const e=t.state.schema.nodes.horizontal_rule;if(e!=null){const n=t.state.tr.replaceSelectionWith(e.create());t.dispatch(n),t.focus()}}const V=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},pt=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let kr=null;const Ee=function(t,e,n){let r=kr||(kr=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},aa=function(){kr=null},nt=function(t,e,n,r){return n&&(wu(t,e,n,r,-1)||wu(t,e,n,r,1))},ca=/^(img|br|input|textarea|hr)$/i;function wu(t,e,n,r,u){for(var i;;){if(t==n&&e==r)return!0;if(e==(u<0?0:re(t))){let s=t.parentNode;if(!s||s.nodeType!=1||Ut(t)||ca.test(t.nodeName)||t.contentEditable=="false")return!1;e=V(t)+(u<0?0:1),t=s}else if(t.nodeType==1){let s=t.childNodes[e+(u<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((i=s.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=u;else return!1;else t=s,e=u<0?re(t):0}else return!1}}function re(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function fa(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=re(t)}else if(t.parentNode&&!Ut(t))e=V(t),t=t.parentNode;else return null}}function da(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Ut(t))e=V(t)+1,t=t.parentNode;else return null}}function ha(t,e,n){for(let r=e==0,u=e==re(t);r||u;){if(t==n)return!0;let i=V(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,u=u&&i==re(t)}}function Ut(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Tn=function(t){return t.focusNode&&nt(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Je(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function pa(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function ma(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(re(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(re(r.startContainer),r.startOffset)}}}const ke=typeof navigator<"u"?navigator:null,Tu=typeof document<"u"?document:null,He=ke&&ke.userAgent||"",yr=/Edge\/(\d+)/.exec(He),Ds=/MSIE \d/.exec(He),Cr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(He),Y=!!(Ds||Cr||yr),Le=Ds?document.documentMode:Cr?+Cr[1]:yr?+yr[1]:0,ue=!Y&&/gecko\/(\d+)/i.test(He);ue&&+(/Firefox\/(\d+)/.exec(He)||[0,0])[1];const Dr=!Y&&/Chrome\/(\d+)/.exec(He),J=!!Dr,_s=Dr?+Dr[1]:0,U=!Y&&!!ke&&/Apple Computer/.test(ke.vendor),mt=U&&(/Mobile\/\w+/.test(He)||!!ke&&ke.maxTouchPoints>2),ne=mt||(ke?/Mac/.test(ke.platform):!1),ga=ke?/Win/.test(ke.platform):!1,Ae=/Android \d/.test(He),Kt=!!Tu&&"webkitFontSmoothing"in Tu.documentElement.style,ba=Kt?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function xa(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function _e(t,e){return typeof t=="number"?t:t[e]}function ka(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Ou(t,e,n){let r=t.someProp("scrollThreshold")||0,u=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=pt(s);continue}let o=s,l=o==i.body,a=l?xa(i):ka(o),c=0,f=0;if(e.top<a.top+_e(r,"top")?f=-(a.top-e.top+_e(u,"top")):e.bottom>a.bottom-_e(r,"bottom")&&(f=e.bottom-e.top>a.bottom-a.top?e.top+_e(u,"top")-a.top:e.bottom-a.bottom+_e(u,"bottom")),e.left<a.left+_e(r,"left")?c=-(a.left-e.left+_e(u,"left")):e.right>a.right-_e(r,"right")&&(c=e.right-a.right+_e(u,"right")),c||f)if(l)i.defaultView.scrollBy(c,f);else{let h=o.scrollLeft,d=o.scrollTop;f&&(o.scrollTop+=f),c&&(o.scrollLeft+=c);let m=o.scrollLeft-h,g=o.scrollTop-d;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}let p=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(p))break;s=p=="absolute"?s.offsetParent:pt(s)}}function ya(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,u;for(let i=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let o=t.root.elementFromPoint(i,s);if(!o||o==t.dom||!t.dom.contains(o))continue;let l=o.getBoundingClientRect();if(l.top>=n-20){r=o,u=l.top;break}}return{refDOM:r,refTop:u,stack:Es(t.dom)}}function Es(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=pt(r));return e}function Ca({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Ss(n,r==0?0:r-e)}function Ss(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:u,left:i}=t[n];r.scrollTop!=u+e&&(r.scrollTop=u+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let ut=null;function Da(t){if(t.setActive)return t.setActive();if(ut)return t.focus(ut);let e=Es(t);t.focus(ut==null?{get preventScroll(){return ut={preventScroll:!0},!0}}:void 0),ut||(ut=!1,Ss(e,0))}function As(t,e){let n,r=2e8,u,i=0,s=e.top,o=e.top,l,a;for(let c=t.firstChild,f=0;c;c=c.nextSibling,f++){let p;if(c.nodeType==1)p=c.getClientRects();else if(c.nodeType==3)p=Ee(c).getClientRects();else continue;for(let h=0;h<p.length;h++){let d=p[h];if(d.top<=s&&d.bottom>=o){s=Math.max(d.bottom,s),o=Math.min(d.top,o);let m=d.left>e.left?d.left-e.left:d.right<e.left?e.left-d.right:0;if(m<r){n=c,r=m,u=m&&n.nodeType==3?{left:d.right<e.left?d.right:d.left,top:e.top}:e,c.nodeType==1&&m&&(i=f+(e.left>=(d.left+d.right)/2?1:0));continue}}else d.top>e.top&&!l&&d.left<=e.left&&d.right>=e.left&&(l=c,a={left:Math.max(d.left,Math.min(d.right,e.left)),top:d.top});!n&&(e.left>=d.right&&e.top>=d.top||e.left>=d.left&&e.top>=d.bottom)&&(i=f+1)}}return!n&&l&&(n=l,u=a,r=0),n&&n.nodeType==3?_a(n,u):!n||r&&n.nodeType==1?{node:t,offset:i}:As(n,u)}function _a(t,e){let n=t.nodeValue.length,r=document.createRange();for(let u=0;u<n;u++){r.setEnd(t,u+1),r.setStart(t,u);let i=Te(r,1);if(i.top!=i.bottom&&Hr(e,i))return{node:t,offset:u+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function Hr(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Ea(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Sa(t,e,n){let{node:r,offset:u}=As(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,u,i)}function Aa(t,e,n,r){let u=-1;for(let i=e,s=!1;i!=t.dom;){let o=t.docView.nearestDesc(i,!0),l;if(!o)return null;if(o.dom.nodeType==1&&(o.node.isBlock&&o.parent||!o.contentDOM)&&((l=o.dom.getBoundingClientRect()).width||l.height)&&(o.node.isBlock&&o.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(o.dom.nodeName)&&(!s&&l.left>r.left||l.top>r.top?u=o.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(u=o.posAfter),s=!0),!o.contentDOM&&u<0&&!o.node.isText))return(o.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?o.posBefore:o.posAfter;i=o.dom.parentNode}return u>-1?u:t.docView.posFromDOM(e,n,-1)}function Ms(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let u=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=u;;){let s=t.childNodes[i];if(s.nodeType==1){let o=s.getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(Hr(e,a))return Ms(s,e,a)}}if((i=(i+1)%r)==u)break}return t}function Ma(t,e){let n=t.dom.ownerDocument,r,u=0,i=ma(n,e.left,e.top);i&&({node:r,offset:u}=i);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),o;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let a=t.dom.getBoundingClientRect();if(!Hr(e,a)||(s=Ms(t.dom,e,a),!s))return null}if(U)for(let a=s;r&&a;a=pt(a))a.draggable&&(r=void 0);if(s=Ea(s,e),r){if(ue&&r.nodeType==1&&(u=Math.min(u,r.childNodes.length),u<r.childNodes.length)){let c=r.childNodes[u],f;c.nodeName=="IMG"&&(f=c.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&u++}let a;Kt&&u&&r.nodeType==1&&(a=r.childNodes[u-1]).nodeType==1&&a.contentEditable=="false"&&a.getBoundingClientRect().top>=e.top&&u--,r==t.dom&&u==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?o=t.state.doc.content.size:(u==0||r.nodeType!=1||r.childNodes[u-1].nodeName!="BR")&&(o=Aa(t,r,u,e))}o==null&&(o=Sa(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:o,inside:l?l.posAtStart-l.border:-1}}function Fu(t){return t.top<t.bottom||t.left<t.right}function Te(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Fu(r))return r}return Array.prototype.find.call(n,Fu)||t.getBoundingClientRect()}const wa=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ws(t,e,n){let{node:r,offset:u,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=Kt||ue;if(r.nodeType==3)if(s&&(wa.test(r.nodeValue)||(n<0?!u:u==r.nodeValue.length))){let l=Te(Ee(r,u,u),n);if(ue&&u&&/\s/.test(r.nodeValue[u-1])&&u<r.nodeValue.length){let a=Te(Ee(r,u-1,u-1),-1);if(a.top==l.top){let c=Te(Ee(r,u,u+1),-1);if(c.top!=l.top)return _t(c,c.left<a.left)}}return l}else{let l=u,a=u,c=n<0?1:-1;return n<0&&!u?(a++,c=-1):n>=0&&u==r.nodeValue.length?(l--,c=1):n<0?l--:a++,_t(Te(Ee(r,l,a),c),c<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&u&&(n<0||u==re(r))){let l=r.childNodes[u-1];if(l.nodeType==1)return Kn(l.getBoundingClientRect(),!1)}if(i==null&&u<re(r)){let l=r.childNodes[u];if(l.nodeType==1)return Kn(l.getBoundingClientRect(),!0)}return Kn(r.getBoundingClientRect(),n>=0)}if(i==null&&u&&(n<0||u==re(r))){let l=r.childNodes[u-1],a=l.nodeType==3?Ee(l,re(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(a)return _t(Te(a,1),!1)}if(i==null&&u<re(r)){let l=r.childNodes[u];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let a=l?l.nodeType==3?Ee(l,0,s?0:1):l.nodeType==1?l:null:null;if(a)return _t(Te(a,-1),!0)}return _t(Te(r.nodeType==3?Ee(r):r,-n),n>=0)}function _t(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Kn(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Ts(t,e,n){let r=t.state,u=t.root.activeElement;r!=e&&t.updateState(e),u!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),u!=t.dom&&u&&u.focus()}}function Ta(t,e,n){let r=e.selection,u=n=="up"?r.$from:r.$to;return Ts(t,e,()=>{let{node:i}=t.docView.domFromPos(u.pos,n=="up"?-1:1);for(;;){let o=t.docView.nearestDesc(i,!0);if(!o)break;if(o.node.isBlock){i=o.contentDOM||o.dom;break}i=o.dom.parentNode}let s=ws(t,u.pos,1);for(let o=i.firstChild;o;o=o.nextSibling){let l;if(o.nodeType==1)l=o.getClientRects();else if(o.nodeType==3)l=Ee(o,0,o.nodeValue.length).getClientRects();else continue;for(let a=0;a<l.length;a++){let c=l[a];if(c.bottom>c.top+1&&(n=="up"?s.top-c.top>(c.bottom-s.top)*2:c.bottom-s.bottom>(s.bottom-c.top)*2))return!1}}return!0})}const Oa=/[\u0590-\u08ac]/;function Fa(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let u=r.parentOffset,i=!u,s=u==r.parent.content.size,o=t.domSelection();return o?!Oa.test(r.parent.textContent)||!o.modify?n=="left"||n=="backward"?i:s:Ts(t,e,()=>{let{focusNode:l,focusOffset:a,anchorNode:c,anchorOffset:f}=t.domSelectionRange(),p=o.caretBidiLevel;o.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:d,focusOffset:m}=t.domSelectionRange(),g=d&&!h.contains(d.nodeType==1?d:d.parentNode)||l==d&&a==m;try{o.collapse(c,f),l&&(l!=c||a!=f)&&o.extend&&o.extend(l,a)}catch{}return p!=null&&(o.caretBidiLevel=p),g}):r.pos==r.start()||r.pos==r.end()}let Nu=null,Iu=null,Ru=!1;function Na(t,e,n){return Nu==e&&Iu==n?Ru:(Nu=e,Iu=n,Ru=n=="up"||n=="down"?Ta(t,e,n):Fa(t,e,n))}const ie=0,Bu=1,Ue=2,ye=3;class Zt{constructor(e,n,r,u){this.parent=e,this.children=n,this.dom=r,this.contentDOM=u,this.dirty=ie,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let u=this.children[n];if(u==e)return r;r+=u.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let u;if(e==this.dom&&this.contentDOM)u=n>V(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))u=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){u=!1;break}if(i.previousSibling)break}if(u==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){u=!0;break}if(i.nextSibling)break}}return u??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,u=e;u;u=u.parentNode){let i=this.getDesc(u),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let u=e;u;u=u.parentNode){let i=this.getDesc(u);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let u=this.children[n],i=r+u.size;if(r==e&&i!=r){for(;!u.border&&u.children.length;)for(let s=0;s<u.children.length;s++){let o=u.children[s];if(o.size){u=o;break}}return u}if(e<i)return u.descAt(e-r-u.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,u=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],o=i+s.size;if(o>e||s instanceof Fs){u=e-i;break}i=o}if(u)return this.children[r].domFromPos(u-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Os&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?V(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?V(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let u=-1,i=-1;for(let s=r,o=0;;o++){let l=this.children[o],a=s+l.size;if(u==-1&&e<=a){let c=s+l.border;if(e>=c&&n<=a-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,c);e=s;for(let f=o;f>0;f--){let p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){u=V(p.dom)+1;break}e-=p.size}u==-1&&(u=0)}if(u>-1&&(a>n||o==this.children.length-1)){n=a;for(let c=o+1;c<this.children.length;c++){let f=this.children[c];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){i=V(f.dom);break}n+=f.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=a}return{node:this.contentDOM,from:e,to:n,fromOffset:u,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,u=!1){let i=Math.min(e,n),s=Math.max(e,n);for(let h=0,d=0;h<this.children.length;h++){let m=this.children[h],g=d+m.size;if(i>d&&s<g)return m.setSelection(e-d-m.border,n-d-m.border,r,u);d=g}let o=this.domFromPos(e,e?-1:1),l=n==e?o:this.domFromPos(n,n?-1:1),a=r.root.getSelection(),c=r.domSelectionRange(),f=!1;if((ue||U)&&e==n){let{node:h,offset:d}=o;if(h.nodeType==3){if(f=!!(d&&h.nodeValue[d-1]==`
7
- `),f&&d==h.nodeValue.length)for(let m=h,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(o=l={node:g.parentNode,offset:V(g)+1});break}let b=m.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let m=h.childNodes[d-1];f=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(ue&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let h=c.focusNode.childNodes[c.focusOffset];h&&h.contentEditable=="false"&&(u=!0)}if(!(u||f&&U)&&nt(o.node,o.offset,c.anchorNode,c.anchorOffset)&&nt(l.node,l.offset,c.focusNode,c.focusOffset))return;let p=!1;if((a.extend||e==n)&&!(f&&ue)){a.collapse(o.node,o.offset);try{e!=n&&a.extend(l.node,l.offset),p=!0}catch{}}if(!p){if(e>n){let d=o;o=l,l=d}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(o.node,o.offset),a.removeAllRanges(),a.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,u=0;u<this.children.length;u++){let i=this.children[u],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let o=r+i.border,l=s-i.border;if(e>=o&&n<=l){this.dirty=e==r||n==s?Ue:Bu,e==o&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=ye:i.markDirty(e-o,n-o);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Ue:ye}r=s}this.dirty=Ue}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Ue:Bu;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Os extends Zt{constructor(e,n,r,u){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return u;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let o=document.createElement("span");o.appendChild(s),s=o}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==ie&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Ia extends Zt{constructor(e,n,r,u){super(e,[],n,null),this.textDOM=r,this.text=u}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class rt extends Zt{constructor(e,n,r,u,i){super(e,[],r,u),this.mark=n,this.spec=i}static create(e,n,r,u){let i=u.nodeViews[n.type.name],s=i&&i(n,u,r);return(!s||!s.dom)&&(s=xt.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new rt(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&ye||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=ye&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=ie){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=ie}}slice(e,n,r){let u=rt.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=Er(i,n,s,r)),e>0&&(i=Er(i,0,e,r));for(let o=0;o<i.length;o++)i[o].parent=u;return u.children=i,u}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class qe extends Zt{constructor(e,n,r,u,i,s,o,l,a){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=u,this.nodeDOM=o}static create(e,n,r,u,i,s){let o=i.nodeViews[n.type.name],l,a=o&&o(n,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,u),c=a&&a.dom,f=a&&a.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=xt.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let p=c;return c=Rs(c,r,n),a?l=new Ra(e,n,r,u,c,f||null,p,a,i,s+1):n.isText?new On(e,n,r,u,c,p,i):new qe(e,n,r,u,c,f||null,p,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>x.empty)}return e}matchesNode(e,n,r){return this.dirty==ie&&e.eq(this.node)&&bn(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,u=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,o=i&&i.pos<0,l=new va(this,s&&s.node,e);La(this.node,this.innerDeco,(a,c,f)=>{a.spec.marks?l.syncToMarks(a.spec.marks,r,e):a.type.side>=0&&!f&&l.syncToMarks(c==this.node.childCount?w.none:this.node.child(c).marks,r,e),l.placeWidget(a,e,u)},(a,c,f,p)=>{l.syncToMarks(a.marks,r,e);let h;l.findNodeMatch(a,c,f,p)||o&&e.state.selection.from>u&&e.state.selection.to<u+a.nodeSize&&(h=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(a,c,f,h,e)||l.updateNextNode(a,c,f,e,p,u)||l.addNode(a,c,f,e,u),u+=a.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Ue)&&(s&&this.protectLocalComposition(e,s),Ns(this.contentDOM,this.children,e),mt&&qa(this.dom))}localCompositionInfo(e,n){let{from:r,to:u}=e.state.selection;if(!(e.state.selection instanceof N)||r<n||u>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,o=Va(this.node.content,s,r-n,u-n);return o<0?null:{node:i,pos:o,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:u}){if(this.getDesc(n))return;let i=n;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 Ia(this,i,n,u);e.input.compositionNodes.push(s),this.children=Er(this.children,r,r+u.length,e,s)}update(e,n,r,u){return this.dirty==ye||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,u),!0)}updateInner(e,n,r,u){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(u,this.posAtStart),this.dirty=ie}updateOuterDeco(e){if(bn(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Is(this.dom,this.nodeDOM,_r(this.outerDeco,this.node,n),_r(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function vu(t,e,n,r,u){Rs(r,e,t);let i=new qe(void 0,t,e,n,r,r,r,u,0);return i.contentDOM&&i.updateChildren(u,0),i}class On extends qe{constructor(e,n,r,u,i,s,o){super(e,n,r,u,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,n,r,u){return this.dirty==ye||this.dirty!=ie&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=ie||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,u.trackWrites==this.nodeDOM&&(u.trackWrites=null)),this.node=e,this.dirty=ie,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let u=this.node.cut(e,n),i=document.createTextNode(u.text);return new On(this.parent,u,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=ye)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Fs extends Zt{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ie&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Ra extends qe{constructor(e,n,r,u,i,s,o,l,a,c){super(e,n,r,u,i,s,o,a,c),this.spec=l}update(e,n,r,u){if(this.dirty==ye)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,u),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,u)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,u){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,u)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Ns(t,e,n){let r=t.firstChild,u=!1;for(let i=0;i<e.length;i++){let s=e[i],o=s.dom;if(o.parentNode==t){for(;o!=r;)r=zu(r),u=!0;r=r.nextSibling}else u=!0,t.insertBefore(o,r);if(s instanceof rt){let l=r?r.previousSibling:t.lastChild;Ns(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=zu(r),u=!0;u&&n.trackWrites==t&&(n.trackWrites=null)}const Ft=function(t){t&&(this.nodeName=t)};Ft.prototype=Object.create(null);const Ke=[new Ft];function _r(t,e,n){if(t.length==0)return Ke;let r=n?Ke[0]:new Ft,u=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&u.push(r=new Ft(s.nodeName));for(let o in s){let l=s[o];l!=null&&(n&&u.length==1&&u.push(r=new Ft(e.isInline?"span":"div")),o=="class"?r.class=(r.class?r.class+" ":"")+l:o=="style"?r.style=(r.style?r.style+";":"")+l:o!="nodeName"&&(r[o]=l))}}}return u}function Is(t,e,n,r){if(n==Ke&&r==Ke)return e;let u=e;for(let i=0;i<r.length;i++){let s=r[i],o=n[i];if(i){let l;o&&o.nodeName==s.nodeName&&u!=t&&(l=u.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(u),o=Ke[0]),u=l}Ba(u,o||Ke[0],s)}return u}function Ba(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],u=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)u.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<u.length;i++)r.indexOf(u[i])==-1&&t.classList.add(u[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,u;for(;u=r.exec(e.style);)t.style.removeProperty(u[1])}n.style&&(t.style.cssText+=n.style)}}function Rs(t,e,n){return Is(t,t,Ke,_r(e,n,t.nodeType!=1))}function bn(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function zu(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class va{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=za(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let u=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;u<s&&(u==i-1?this.top:this.stack[u+1<<1]).matchesMark(e[u])&&e[u].type.spec.spanning!==!1;)u++;for(;u<i;)this.destroyRest(),this.top.dirty=ie,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let o=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let a=this.top.children[l];if(a.matchesMark(e[i])&&!this.isLocked(a.dom)){o=l;break}}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let l=rt.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,u){let i=-1,s;if(u>=this.preMatch.index&&(s=this.preMatch.matches[u-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=this.top.children.indexOf(s,this.index);else for(let o=this.index,l=Math.min(this.top.children.length,o+5);o<l;o++){let a=this.top.children[o];if(a.matchesNode(e,n,r)&&!this.preMatch.matched.has(a)){i=o;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,u,i){let s=this.top.children[u];return s.dirty==ye&&s.dom==s.contentDOM&&(s.dirty=Ue),s.update(e,n,r,i)?(this.destroyBetween(this.index,u),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let u=this.index;u<this.top.children.length;u++)if(this.top.children[u]==r)return u}return-1}e=n}}updateNextNode(e,n,r,u,i,s){for(let o=this.index;o<this.top.children.length;o++){let l=this.top.children[o];if(l instanceof qe){let a=this.preMatch.matched.get(l);if(a!=null&&a!=i)return!1;let c=l.dom,f,p=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=ye&&bn(n,l.outerDeco));if(!p&&l.update(e,n,r,u))return this.destroyBetween(this.index,o),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!p&&(f=this.recreateWrapper(l,e,n,r,u,s)))return this.destroyBetween(this.index,o),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Ue,f.updateChildren(u,s+1),f.dirty=ie),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,u,i,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!bn(r,e.outerDeco)||!u.eq(e.innerDeco))return null;let o=qe.create(this.top,n,r,u,i,s);if(o.contentDOM){o.children=e.children,e.children=[];for(let l of o.children)l.parent=o}return e.destroy(),o}addNode(e,n,r,u,i){let s=qe.create(this.top,e,n,r,u,i);s.contentDOM&&s.updateChildren(u,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let u=this.index<this.top.children.length?this.top.children[this.index]:null;if(u&&u.matchesWidget(e)&&(e==u.widget||!u.widget.type.toDOM.parentNode))this.index++;else{let i=new Os(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof rt;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof On)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((U||J)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let u=new Fs(this.top,[],r,null);n!=this.top?n.children.push(u):n.children.splice(this.index++,0,u),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function za(t,e){let n=e,r=n.children.length,u=t.childCount,i=new Map,s=[];e:for(;u>0;){let o;for(;;)if(r){let a=n.children[r-1];if(a instanceof rt)n=a,r=a.children.length;else{o=a,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=o.node;if(l){if(l!=t.child(u-1))break;--u,i.set(o,u),s.push(o)}}return{index:u,matched:i,matches:s.reverse()}}function Pa(t,e){return t.type.side-e.type.side}function La(t,e,n,r){let u=e.locals(t),i=0;if(u.length==0){for(let a=0;a<t.childCount;a++){let c=t.child(a);r(c,u,e.forChild(i,c),a),i+=c.nodeSize}return}let s=0,o=[],l=null;for(let a=0;;){let c,f;for(;s<u.length&&u[s].to==i;){let g=u[s++];g.widget&&(c?(f||(f=[c])).push(g):c=g)}if(c)if(f){f.sort(Pa);for(let g=0;g<f.length;g++)n(f[g],a,!!l)}else n(c,a,!!l);let p,h;if(l)h=-1,p=l,l=null;else if(a<t.childCount)h=a,p=t.child(a++);else break;for(let g=0;g<o.length;g++)o[g].to<=i&&o.splice(g--,1);for(;s<u.length&&u[s].from<=i&&u[s].to>i;)o.push(u[s++]);let d=i+p.nodeSize;if(p.isText){let g=d;s<u.length&&u[s].from<g&&(g=u[s].from);for(let b=0;b<o.length;b++)o[b].to<g&&(g=o[b].to);g<d&&(l=p.cut(g-i),p=p.cut(0,g-i),d=g,h=-1)}else for(;s<u.length&&u[s].to<d;)s++;let m=p.isInline&&!p.isLeaf?o.filter(g=>!g.inline):o.slice();r(p,m,e.forChild(i,p),h),i=d}}function qa(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function Va(t,e,n,r){for(let u=0,i=0;u<t.childCount&&i<=r;){let s=t.child(u++),o=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;u<t.childCount;){let a=t.child(u++);if(i+=a.nodeSize,!a.isText)break;l+=a.text}if(i>=n){if(i>=r&&l.slice(r-e.length-o,r-o)==e)return r-e.length;let a=o<r?l.lastIndexOf(e,r-o-1):-1;if(a>=0&&a+e.length+o>=n)return o+a;if(n==r&&l.length>=r+e.length-o&&l.slice(r-o,r-o+e.length)==e)return r}}return-1}function Er(t,e,n,r,u){let i=[];for(let s=0,o=0;s<t.length;s++){let l=t[s],a=o,c=o+=l.size;a>=n||c<=e?i.push(l):(a<e&&i.push(l.slice(0,e-a,r)),u&&(i.push(u),u=void 0),c>n&&i.push(l.slice(n-a,l.size,r)))}return i}function Jr(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let u=t.docView.nearestDesc(n.focusNode),i=u&&u.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let o=r.resolve(s),l,a;if(Tn(n)){for(l=s;u&&!u.node;)u=u.parent;let f=u.node;if(u&&f.isAtom&&M.isSelectable(f)&&u.parent&&!(f.isInline&&ha(n.focusNode,n.focusOffset,u.dom))){let p=u.posBefore;a=new M(s==p?o:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,p=s;for(let h=0;h<n.rangeCount;h++){let d=n.getRangeAt(h);f=Math.min(f,t.docView.posFromDOM(d.startContainer,d.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(d.endContainer,d.endOffset,-1))}if(f<0)return null;[l,s]=p==t.state.selection.anchor?[p,f]:[f,p],o=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let c=r.resolve(l);if(!a){let f=e=="pointer"||t.state.selection.head<o.pos&&!i?1:-1;a=jr(t,c,o,f)}return a}function Bs(t){return t.editable?t.hasFocus():zs(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Me(t,e=!1){let n=t.state.selection;if(vs(t,n),!!Bs(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&J){let r=t.domSelectionRange(),u=t.domObserver.currentSelection;if(r.anchorNode&&u.anchorNode&&nt(r.anchorNode,r.anchorOffset,u.anchorNode,u.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)Wa(t);else{let{anchor:r,head:u}=n,i,s;Pu&&!(n instanceof N)&&(n.$from.parent.inlineContent||(i=Lu(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=Lu(t,n.to))),t.docView.setSelection(r,u,t,e),Pu&&(i&&qu(i),s&&qu(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&$a(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Pu=U||J&&_s<63;function Lu(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),u=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(U&&u&&u.contentEditable=="false")return Zn(u);if((!u||u.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(u)return Zn(u);if(i)return Zn(i)}}function Zn(t){return t.contentEditable="true",U&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function qu(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function $a(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,u=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=u)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Bs(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Wa(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,V(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Y&&Le<=11&&(n.disabled=!0,n.disabled=!1)}function vs(t,e){if(e instanceof M){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Vu(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Vu(t)}function Vu(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function jr(t,e,n,r){return t.someProp("createSelectionBetween",u=>u(t,e,n))||N.between(e,n,r)}function $u(t){return t.editable&&!t.hasFocus()?!1:zs(t)}function zs(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Ha(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return nt(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Sr(t,e){let{$anchor:n,$head:r}=t.selection,u=e>0?n.max(r):n.min(r),i=u.parent.inlineContent?u.depth?t.doc.resolve(e>0?u.after():u.before()):null:u;return i&&F.findFrom(i,e)}function Oe(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Wu(t,e,n){let r=t.state.selection;if(r instanceof N)if(n.indexOf("s")>-1){let{$head:u}=r,i=u.textOffset?null:e<0?u.nodeBefore:u.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(u.pos+i.nodeSize*(e<0?-1:1));return Oe(t,new N(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let u=Sr(t.state,e);return u&&u instanceof M?Oe(t,u):!1}else if(!(ne&&n.indexOf("m")>-1)){let u=r.$head,i=u.textOffset?null:e<0?u.nodeBefore:u.nodeAfter,s;if(!i||i.isText)return!1;let o=e<0?u.pos-i.nodeSize:u.pos;return i.isAtom||(s=t.docView.descAt(o))&&!s.contentDOM?M.isSelectable(i)?Oe(t,new M(e<0?t.state.doc.resolve(u.pos-i.nodeSize):u)):Kt?Oe(t,new N(t.state.doc.resolve(e<0?o:o+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof M&&r.node.isInline)return Oe(t,new N(e>0?r.$to:r.$from));{let u=Sr(t.state,e);return u?Oe(t,u):!1}}}function xn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Nt(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function it(t,e){return e<0?Ja(t):ja(t)}function Ja(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let u,i,s=!1;for(ue&&n.nodeType==1&&r<xn(n)&&Nt(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let o=n.childNodes[r-1];if(Nt(o,-1))u=n,i=--r;else if(o.nodeType==3)n=o,r=n.nodeValue.length;else break}}else{if(Ps(n))break;{let o=n.previousSibling;for(;o&&Nt(o,-1);)u=n.parentNode,i=V(o),o=o.previousSibling;if(o)n=o,r=xn(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Ar(t,n,r):u&&Ar(t,u,i)}function ja(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let u=xn(n),i,s;for(;;)if(r<u){if(n.nodeType!=1)break;let o=n.childNodes[r];if(Nt(o,1))i=n,s=++r;else break}else{if(Ps(n))break;{let o=n.nextSibling;for(;o&&Nt(o,1);)i=o.parentNode,s=V(o)+1,o=o.nextSibling;if(o)n=o,r=0,u=xn(n);else{if(n=n.parentNode,n==t.dom)break;r=u=0}}}i&&Ar(t,i,s)}function Ps(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Ua(t,e){for(;t&&e==t.childNodes.length&&!Ut(t);)e=V(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function Ka(t,e){for(;t&&!e&&!Ut(t);)e=V(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Ar(t,e,n){if(e.nodeType!=3){let i,s;(s=Ua(e,n))?(e=s,n=0):(i=Ka(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Tn(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:u}=t;setTimeout(()=>{t.state==u&&Me(t)},50)}function Hu(t,e){let n=t.state.doc.resolve(e);if(!(J||ga)&&n.parent.inlineContent){let u=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>u.top&&s<u.bottom&&Math.abs(i.left-u.left)>1)return i.left<u.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>u.top&&s<u.bottom&&Math.abs(i.left-u.left)>1)return i.left>u.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Ju(t,e,n){let r=t.state.selection;if(r instanceof N&&!r.empty||n.indexOf("s")>-1||ne&&n.indexOf("m")>-1)return!1;let{$from:u,$to:i}=r;if(!u.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Sr(t.state,e);if(s&&s instanceof M)return Oe(t,s)}if(!u.parent.inlineContent){let s=e<0?u:i,o=r instanceof ee?F.near(s,e):F.findFrom(s,e);return o?Oe(t,o):!1}return!1}function ju(t,e){if(!(t.state.selection instanceof N))return!0;let{$head:n,$anchor:r,empty:u}=t.state.selection;if(!n.sameParent(r))return!0;if(!u)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function Uu(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Za(t){if(!U||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Uu(t,r,"true"),setTimeout(()=>Uu(t,r,"false"),20)}return!1}function Ga(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Ya(t,e){let n=e.keyCode,r=Ga(e);if(n==8||ne&&n==72&&r=="c")return ju(t,-1)||it(t,-1);if(n==46&&!e.shiftKey||ne&&n==68&&r=="c")return ju(t,1)||it(t,1);if(n==13||n==27)return!0;if(n==37||ne&&n==66&&r=="c"){let u=n==37?Hu(t,t.state.selection.from)=="ltr"?-1:1:-1;return Wu(t,u,r)||it(t,u)}else if(n==39||ne&&n==70&&r=="c"){let u=n==39?Hu(t,t.state.selection.from)=="ltr"?1:-1:1;return Wu(t,u,r)||it(t,u)}else{if(n==38||ne&&n==80&&r=="c")return Ju(t,-1,r)||it(t,-1);if(n==40||ne&&n==78&&r=="c")return Za(t)||Ju(t,1,r)||it(t,1);if(r==(ne?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Ur(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:u,openEnd:i}=e;for(;u>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){u--,i--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=t.someProp("clipboardSerializer")||xt.fromSchema(t.state.schema),o=Hs(),l=o.createElement("div");l.appendChild(s.serializeFragment(r,{document:o}));let a=l.firstChild,c,f=0;for(;a&&a.nodeType==1&&(c=Ws[a.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let d=o.createElement(c[h]);for(;l.firstChild;)d.appendChild(l.firstChild);l.appendChild(d),f++}a=l.firstChild}a&&a.nodeType==1&&a.setAttribute("data-pm-slice",`${u} ${i}${f?` -${f}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
1
+ "use strict";const S=require("@tempots/dom"),It=require("./toolbar-wEm8iNet.cjs"),Br=require("./translations-hMQlZmD4.cjs"),Bo=require("./link-portal-_tiDFZqh.cjs"),vo=require("@tempots/ui"),zo=require("./theme-Dt6lCAvY.cjs");function q(t){this.content=t}q.prototype={constructor:q,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,u=r.find(t),i=r.content.slice();return u==-1?i.push(n||t,e):(i[u+1]=e,n&&(i[u]=n)),new q(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new q(n)},addToStart:function(t,e){return new q([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new q(n)},addBefore:function(t,e,n){var r=this.remove(e),u=r.content.slice(),i=r.find(t);return u.splice(i==-1?u.length:i,0,e,n),new q(u)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=q.from(t),t.size?new q(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=q.from(t),t.size?new q(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=q.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};q.from=function(t){if(t instanceof q)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new q(e)};function Ni(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let u=t.child(r),i=e.child(r);if(u==i){n+=u.nodeSize;continue}if(!u.sameMarkup(i))return n;if(u.isText&&u.text!=i.text){for(let s=0;u.text[s]==i.text[s];s++)n++;return n}if(u.content.size||i.content.size){let s=Ni(u.content,i.content,n+1);if(s!=null)return s}n+=u.nodeSize}}function Ii(t,e,n,r){for(let u=t.childCount,i=e.childCount;;){if(u==0||i==0)return u==i?null:{a:n,b:r};let s=t.child(--u),o=e.child(--i),l=s.nodeSize;if(s==o){n-=l,r-=l;continue}if(!s.sameMarkup(o))return{a:n,b:r};if(s.isText&&s.text!=o.text){let a=0,c=Math.min(s.text.length,o.text.length);for(;a<c&&s.text[s.text.length-a-1]==o.text[o.text.length-a-1];)a++,n--,r--;return{a:n,b:r}}if(s.content.size||o.content.size){let a=Ii(s.content,o.content,n-1,r-1);if(a)return a}n-=l,r-=l}}class x{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,u=0,i){for(let s=0,o=0;o<n;s++){let l=this.content[s],a=o+l.nodeSize;if(a>e&&r(l,u+o,i||null,s)!==!1&&l.content.size){let c=o+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,u+c)}o=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,u){let i="",s=!0;return this.nodesBetween(e,n,(o,l)=>{let a=o.isText?o.text.slice(Math.max(e,l)-l,n-l):o.isLeaf?u?typeof u=="function"?u(o):u:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&a||o.isTextblock)&&r&&(s?s=!1:i+=r),i+=a},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,u=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(u[u.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)u.push(e.content[i]);return new x(u,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],u=0;if(n>e)for(let i=0,s=0;s<n;i++){let o=this.content[i],l=s+o.nodeSize;l>e&&((s<e||l>n)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,n-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,n-s-1))),r.push(o),u+=o.nodeSize),s=l}return new x(r,u)}cutByIndex(e,n){return e==n?x.empty:e==0&&n==this.content.length?this:new x(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let u=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return u[e]=n,new x(u,i)}addToStart(e){return new x([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new x(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let u=this.content[n];e(u,r,n),r+=u.nodeSize}}findDiffStart(e,n=0){return Ni(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ii(this,e,n,r)}findIndex(e){if(e==0)return en(0,e);if(e==this.size)return en(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 u=this.child(n),i=r+u.nodeSize;if(i>=e)return i==e?en(n+1,i):en(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,n){if(!n)return x.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new x(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return x.empty;let n,r=0;for(let u=0;u<e.length;u++){let i=e[u];r+=i.nodeSize,u&&i.isText&&e[u-1].sameMarkup(i)?(n||(n=e.slice(0,u)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new x(n||e,r)}static from(e){if(!e)return x.empty;if(e instanceof x)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new x([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}x.empty=new x([],0);const Pn={index:0,offset:0};function en(t,e){return Pn.index=t,Pn.offset=e,Pn}function dn(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!dn(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!dn(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}class T{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let u=0;u<e.length;u++){let i=e[u];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,u));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,u)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&dn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let u=r.create(n.attrs);return r.checkAttrs(u.attrs),u}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return T.none;if(e instanceof T)return[e];let n=e.slice();return n.sort((r,u)=>r.type.rank-u.type.rank),n}}T.none=[];class hn extends Error{}class D{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Bi(this.content,e+this.openStart,n);return r&&new D(r,this.openStart,this.openEnd)}removeBetween(e,n){return new D(Ri(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return D.empty;let r=n.openStart||0,u=n.openEnd||0;if(typeof r!="number"||typeof u!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new D(x.fromJSON(e,n.content),r,u)}static maxOpen(e,n=!0){let r=0,u=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)u++;return new D(e,r,u)}}D.empty=new D(x.empty,0,0);function Ri(t,e,n){let{index:r,offset:u}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:o}=t.findIndex(n);if(u==e||i.isText){if(o!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Ri(i.content,e-u-1,n-u-1)))}function Bi(t,e,n,r){let{index:u,offset:i}=t.findIndex(e),s=t.maybeChild(u);if(i==e||s.isText)return r&&!r.canReplace(u,u,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=Bi(s.content,e-i-1,n,s);return o&&t.replaceChild(u,s.copy(o))}function Po(t,e,n){if(n.openStart>t.depth)throw new hn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new hn("Inconsistent open depths");return vi(t,e,n,0)}function vi(t,e,n,r){let u=t.index(r),i=t.node(r);if(u==e.index(r)&&r<t.depth-n.openStart){let s=vi(t,e,n,r+1);return i.copy(i.content.replaceChild(u,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,o=s.content;return Ye(s,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}else{let{start:s,end:o}=Lo(n,t);return Ye(i,Pi(t,s,o,e,r))}else return Ye(i,pn(t,e,r))}function zi(t,e){if(!e.type.compatibleContent(t.type))throw new hn("Cannot join "+e.type.name+" onto "+t.type.name)}function pr(t,e,n){let r=t.node(n);return zi(r,e.node(n)),r}function Ge(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function wt(t,e,n,r){let u=(e||t).node(n),i=0,s=e?e.index(n):u.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Ge(t.nodeAfter,r),i++));for(let o=i;o<s;o++)Ge(u.child(o),r);e&&e.depth==n&&e.textOffset&&Ge(e.nodeBefore,r)}function Ye(t,e){return t.type.checkContent(e),t.copy(e)}function Pi(t,e,n,r,u){let i=t.depth>u&&pr(t,e,u+1),s=r.depth>u&&pr(n,r,u+1),o=[];return wt(null,t,u,o),i&&s&&e.index(u)==n.index(u)?(zi(i,s),Ge(Ye(i,Pi(t,e,n,r,u+1)),o)):(i&&Ge(Ye(i,pn(t,e,u+1)),o),wt(e,n,u,o),s&&Ge(Ye(s,pn(n,r,u+1)),o)),wt(r,null,u,o),new x(o)}function pn(t,e,n){let r=[];if(wt(null,t,n,r),t.depth>n){let u=pr(t,e,n+1);Ge(Ye(u,pn(t,e,n+1)),r)}return wt(e,null,n,r),new x(r)}function Lo(t,e){let n=e.depth-t.openStart,u=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)u=e.node(i).copy(x.from(u));return{start:u.resolveNoCache(t.openStart+n),end:u.resolveNoCache(u.content.size-t.openEnd-n)}}class Rt{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],u=e.child(n);return r?e.child(n).cut(r):u}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],u=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)u+=r.child(i).nodeSize;return u}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return T.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),u=e.maybeChild(n);if(!r){let o=r;r=u,u=o}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!u||!i[s].isInSet(u.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,u=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!u||!r[i].isInSet(u.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Li(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],u=0,i=n;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(i),a=i-l;if(r.push(s,o,u+l),!a||(s=s.child(o),s.isText))break;i=a-1,u+=l+1}return new Rt(n,r,i)}static resolveCached(e,n){let r=lu.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else lu.set(e,r=new qo);let u=r.elts[r.i]=Rt.resolve(e,n);return r.i=(r.i+1)%Vo,u}}class qo{constructor(){this.elts=[],this.i=0}}const Vo=12,lu=new WeakMap;class Li{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const $o=Object.create(null);class xe{constructor(e,n,r,u=T.none){this.type=e,this.attrs=n,this.marks=u,this.content=r||x.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,u=0){this.content.nodesBetween(e,n,r,u,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,u){return this.content.textBetween(e,n,r,u)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&dn(this.attrs,n||e.defaultAttrs||$o)&&T.sameSet(this.marks,r||T.none)}copy(e=null){return e==this.content?this:new xe(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new xe(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return D.empty;let u=this.resolve(e),i=this.resolve(n),s=r?0:u.sharedDepth(n),o=u.start(s),a=u.node(s).content.cut(u.pos-o,i.pos-o);return new D(a,u.depth-s,i.depth-s)}replace(e,n,r){return Po(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:u}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(u==e||n.isText)return n;e-=u+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let u=this.content.child(n-1);return{node:u,index:n-1,offset:r-u.nodeSize}}resolve(e){return Rt.resolveCached(this,e)}resolveNoCache(e){return Rt.resolve(this,e)}rangeHasMark(e,n,r){let u=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(u=!0),!u)),u}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()+")"),qi(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=x.empty,u=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,u,i),o=s&&s.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let l=u;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,u){if(u&&!this.type.allowsMarks(u))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=T.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!T.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let u=x.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,u,r);return i.type.checkAttrs(i.attrs),i}}xe.prototype.text=void 0;class mn extends xe{constructor(e,n,r,u){if(super(e,n,null,u),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):qi(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new mn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new mn(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function qi(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class tt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Wo(e,n);if(r.next==null)return tt.empty;let u=Vi(r);r.next&&r.err("Unexpected trailing text");let i=Go(Zo(u));return Yo(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let u=this;for(let i=n;u&&i<r;i++)u=u.matchType(e.child(i).type);return u}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let u=[this];function i(s,o){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return x.from(o.map(a=>a.createAndFill()));for(let a=0;a<s.next.length;a++){let{type:c,next:f}=s.next[a];if(!(c.isText||c.hasRequiredAttrs())&&u.indexOf(f)==-1){u.push(f);let p=i(f,o.concat(c));if(p)return p}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let u=r.shift(),i=u.match;if(i.matchType(e)){let s=[];for(let o=u;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:o,next:l}=i.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!u.type||l.validEnd)&&(r.push({match:o.contentMatch,type:o,via:u}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let u=0;u<r.next.length;u++)e.indexOf(r.next[u].next)==-1&&n(r.next[u].next)}return n(this),e.map((r,u)=>{let i=u+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
2
+ `)}}tt.empty=new tt(!0);class Wo{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Vi(t){let e=[];do e.push(Ho(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Ho(t){let e=[];do e.push(Jo(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Jo(t){let e=Ko(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=jo(t,e);else break;return e}function au(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function jo(t,e){let n=au(t),r=n;return t.eat(",")&&(t.next!="}"?r=au(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Uo(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let u=[];for(let i in n){let s=n[i];s.isInGroup(e)&&u.push(s)}return u.length==0&&t.err("No node type or group '"+e+"' found"),u}function Ko(t){if(t.eat("(")){let e=Vi(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Uo(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Zo(t){let e=[[]];return u(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,o,l){let a={term:l,to:o};return e[s].push(a),a}function u(s,o){s.forEach(l=>l.to=o)}function i(s,o){if(s.type=="choice")return s.exprs.reduce((l,a)=>l.concat(i(a,o)),[]);if(s.type=="seq")for(let l=0;;l++){let a=i(s.exprs[l],o);if(l==s.exprs.length-1)return a;u(a,o=n())}else if(s.type=="star"){let l=n();return r(o,l),u(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return u(i(s.expr,o),l),u(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(o)].concat(i(s.expr,o));if(s.type=="range"){let l=o;for(let a=0;a<s.min;a++){let c=n();u(i(s.expr,l),c),l=c}if(s.max==-1)u(i(s.expr,l),l);else for(let a=s.min;a<s.max;a++){let c=n();r(l,c),u(i(s.expr,l),c),l=c}return[r(l)]}else{if(s.type=="name")return[r(o,void 0,s.value)];throw new Error("Unknown expr type")}}}}function $i(t,e){return e-t}function cu(t,e){let n=[];return r(e),n.sort($i);function r(u){let i=t[u];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(u);for(let s=0;s<i.length;s++){let{term:o,to:l}=i[s];!o&&n.indexOf(l)==-1&&r(l)}}}function Go(t){let e=Object.create(null);return n(cu(t,0));function n(r){let u=[];r.forEach(s=>{t[s].forEach(({term:o,to:l})=>{if(!o)return;let a;for(let c=0;c<u.length;c++)u[c][0]==o&&(a=u[c][1]);cu(t,l).forEach(c=>{a||u.push([o,a=[]]),a.indexOf(c)==-1&&a.push(c)})})});let i=e[r.join(",")]=new tt(r.indexOf(t.length-1)>-1);for(let s=0;s<u.length;s++){let o=u[s][1].sort($i);i.next.push({type:u[s][0],next:e[o.join(",")]||n(o)})}return i}}function Yo(t,e){for(let n=0,r=[t];n<r.length;n++){let u=r[n],i=!u.validEnd,s=[];for(let o=0;o<u.next.length;o++){let{type:l,next:a}=u.next[o];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(a)==-1&&r.push(a)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Wi(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Hi(t,e){let n=Object.create(null);for(let r in t){let u=e&&e[r];if(u===void 0){let i=t[r];if(i.hasDefault)u=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=u}return n}function Ji(t,e,n,r){for(let u in e)if(!(u in t))throw new RangeError(`Unsupported attribute ${u} for ${n} of type ${u}`);for(let u in t){let i=t[u];i.validate&&i.validate(e[u])}}function ji(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Qo(t,r,e[r]);return n}let fu=class Ui{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ji(e,r.attrs),this.defaultAttrs=Wi(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==tt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}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:Hi(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new xe(this,this.computeAttrs(e),x.from(n),T.setFrom(r))}createChecked(e=null,n,r){return n=x.from(n),this.checkContent(n),new xe(this,this.computeAttrs(e),n,T.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=x.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let u=this.contentMatch.matchFragment(n),i=u&&u.fillBefore(x.empty,!0);return i?new xe(this,e,n.append(i),T.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Ji(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:T.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new Ui(i,n,s));let u=n.spec.topNode||"doc";if(!r[u])throw new RangeError("Schema is missing its top node type ('"+u+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Xo(t,e,n){let r=n.split("|");return u=>{let i=u===null?"null":typeof u;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class Qo{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Xo(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class An{constructor(e,n,r,u){this.name=e,this.rank=n,this.schema=r,this.spec=u,this.attrs=ji(e,u.attrs),this.excluded=null;let i=Wi(this.attrs);this.instance=i?new T(this,i):null}create(e=null){return!e&&this.instance?this.instance:new T(this,Hi(this.attrs,e))}static compile(e,n){let r=Object.create(null),u=0;return e.forEach((i,s)=>r[i]=new An(i,u++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Ji(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class vr{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let u in e)n[u]=e[u];n.nodes=q.from(e.nodes),n.marks=q.from(e.marks||{}),this.nodes=fu.compile(this.spec.nodes,this),this.marks=An.compile(this.spec.marks,this);let r=Object.create(null);for(let u in this.nodes){if(u in this.marks)throw new RangeError(u+" can not be both a node and a mark");let i=this.nodes[u],s=i.spec.content||"",o=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=tt.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=o=="_"?null:o?du(this,o.split(" ")):o==""||!i.inlineContent?[]:null}for(let u in this.marks){let i=this.marks[u],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:du(this,s.split(" "))}this.nodeFromJSON=u=>xe.fromJSON(this,u),this.markFromJSON=u=>T.fromJSON(this,u),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,u){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof fu){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,u)}text(e,n){let r=this.nodes.text;return new mn(r,r.defaultAttrs,e,T.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function du(t,e){let n=[];for(let r=0;r<e.length;r++){let u=e[r],i=t.marks[u],s=i;if(i)n.push(i);else for(let o in t.marks){let l=t.marks[o];(u=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(u)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function el(t){return t.tag!=null}function tl(t){return t.style!=null}class Bt{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(u=>{if(el(u))this.tags.push(u);else if(tl(u)){let i=/[^=]*/.exec(u.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(u)}}),this.normalizeLists=!this.tags.some(u=>{if(!/^(ul|ol)\b/.test(u.tag)||!u.node)return!1;let i=e.nodes[u.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new pu(this,n,!1);return r.addAll(e,T.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new pu(this,n,!0);return r.addAll(e,T.none,n.from,n.to),D.maxOpen(r.finish())}matchTag(e,n,r){for(let u=r?this.tags.indexOf(r)+1:0;u<this.tags.length;u++){let i=this.tags[u];if(ul(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,u){for(let i=u?this.styles.indexOf(u)+1:0;i<this.styles.length;i++){let s=this.styles[i],o=s.style;if(!(o.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||o.length>e.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(u){let i=u.priority==null?50:u.priority,s=0;for(;s<n.length;s++){let o=n[s];if((o.priority==null?50:o.priority)<i)break}n.splice(s,0,u)}for(let u in e.marks){let i=e.marks[u].spec.parseDOM;i&&i.forEach(s=>{r(s=mu(s)),s.mark||s.ignore||s.clearMark||(s.mark=u)})}for(let u in e.nodes){let i=e.nodes[u].spec.parseDOM;i&&i.forEach(s=>{r(s=mu(s)),s.node||s.ignore||s.mark||(s.node=u)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Bt(e,Bt.schemaRules(e)))}}const Ki={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},nl={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Zi={ol:!0,ul:!0},vt=1,mr=2,Tt=4;function hu(t,e,n){return e!=null?(e?vt:0)|(e==="full"?mr:0):t&&t.whitespace=="pre"?vt|mr:n&~Tt}class tn{constructor(e,n,r,u,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=u,this.options=s,this.content=[],this.activeMarks=T.none,this.match=i||(s&Tt?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(x.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,u;return(u=r.findWrapping(e.type))?(this.match=r,u):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&vt)){let r=this.content[this.content.length-1],u;if(r&&r.isText&&(u=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==u[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-u[0].length))}}let n=x.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(x.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ki.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class pu{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let u=n.topNode,i,s=hu(null,n.preserveWhitespace,0)|(r?Tt:0);u?i=new tn(u.type,u.attrs,T.none,!0,n.topMatch||u.type.contentMatch,s):r?i=new tn(null,null,T.none,!0,null,s):i=new tn(e.schema.topNodeType,null,T.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,u=this.top,i=u.options&mr?"full":this.localPreserveWS||(u.options&vt)>0,{schema:s}=this.parser;if(i==="full"||u.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
3
+ `);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let o=r.split(/\r?\n|\r/);for(let l=0;l<o.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),o[l]&&this.insertNode(s.text(o[l]),n,!/\S/.test(o[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let o=u.content[u.content.length-1],l=e.previousSibling;(!o||l&&l.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let u=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),o;Zi.hasOwnProperty(s)&&this.parser.normalizeLists&&rl(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));e:if(l?l.ignore:nl.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let a,c=this.needsBlock;if(Ki.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),a=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=l&&l.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),a&&this.sync(i),this.needsBlock=c}else{let a=this.readStyles(e,n);a&&this.addElementByRule(e,l,a,l.consuming===!1?o:void 0)}this.localPreserveWS=u}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
+ `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let u=0;u<this.parser.matchedStyles.length;u++){let i=this.parser.matchedStyles[u],s=r.getPropertyValue(i);if(s)for(let o=void 0;;){let l=this.parser.matchStyle(i,s,this,o);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(a=>!l.clearMark(a)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)o=l;else break}}return n}addElementByRule(e,n,r,u){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let o=this.top;if(s&&s.isLeaf)this.findInside(e);else if(u)this.addElement(e,r,u);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(o)&&this.open--}addAll(e,n,r,u){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,o=u==null?null:e.childNodes[u];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let u,i;for(let s=this.open,o=0;s>=0;s--){let l=this.nodes[s],a=l.findWrapping(e);if(a&&(!u||u.length>a.length+o)&&(u=a,i=l,!a.length))break;if(l.solid){if(r)break;o+=2}}if(!u)return null;this.sync(i);for(let s=0;s<u.length;s++)n=this.enterInner(u[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let u=this.findPlace(e,n,r);if(u){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=T.none;for(let o of u.concat(e.marks))(i.type?i.type.allowsMarkType(o.type):gu(o.type,e.type))&&(s=o.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,u){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,u)),i}enterInner(e,n,r,u=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let o=hu(e,i,s.options);s.options&Tt&&s.content.length==0&&(o|=Tt);let l=T.none;return r=r.filter(a=>(s.type?s.type.allowsMarkType(a.type):gu(a.type,e))?(l=a.addToSet(l),!1):!0),this.nodes.push(new tn(e,n,l,u,null,o)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=vt)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let u=r.length-1;u>=0;u--)e+=r[u].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let u=0;u<this.find.length;u++)this.find[u].pos==null&&e.nodeType==1&&e.contains(this.find[u].node)&&n.compareDocumentPosition(this.find[u].node)&(r?2:4)&&(this.find[u].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,u=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(u?0:1),s=(o,l)=>{for(;o>=0;o--){let a=n[o];if(a==""){if(o==n.length-1||o==0)continue;for(;l>=i;l--)if(s(o-1,l))return!0;return!1}else{let c=l>0||l==0&&u?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!c||c.name!=a&&!c.isInGroup(a))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function rl(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Zi.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function ul(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function mu(t){let e={};for(let n in t)e[n]=t[n];return e}function gu(t,e){let n=e.schema.nodes;for(let r in n){let u=n[r];if(!u.allowsMarkType(t))continue;let i=[],s=o=>{i.push(o);for(let l=0;l<o.edgeCount;l++){let{type:a,next:c}=o.edge(l);if(a==e||i.indexOf(c)<0&&s(c))return!0}};if(s(u.contentMatch))return!0}}class yt{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Ln(n).createDocumentFragment());let u=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let o=0,l=0;for(;o<i.length&&l<s.marks.length;){let a=s.marks[l];if(!this.marks[a.type.name]){l++;continue}if(!a.eq(i[o][0])||a.type.spec.spanning===!1)break;o++,l++}for(;o<i.length;)u=i.pop()[1];for(;l<s.marks.length;){let a=s.marks[l++],c=this.serializeMark(a,s.isInline,n);c&&(i.push([a,u]),u.appendChild(c.dom),u=c.contentDOM||c.dom)}}u.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:u}=on(Ln(n),this.nodes[e.type.name](e),null,e.attrs);if(u){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,u)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let u=e.marks.length-1;u>=0;u--){let i=this.serializeMark(e.marks[u],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let u=this.marks[e.type.name];return u&&on(Ln(r),u(e,n),null,e.attrs)}static renderSpec(e,n,r=null,u){return on(e,n,r,u)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new yt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=bu(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return bu(e.marks)}}function bu(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ln(t){return t.document||window.document}const xu=new WeakMap;function il(t){let e=xu.get(t);return e===void 0&&xu.set(t,e=sl(t)),e}function sl(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let u=0;u<r.length;u++)n(r[u]);else for(let u in r)n(r[u])}return n(t),e}function on(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let u=e[0],i;if(typeof u!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=il(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=u.indexOf(" ");s>0&&(n=u.slice(0,s),u=u.slice(s+1));let o,l=n?t.createElementNS(n,u):t.createElement(u),a=e[1],c=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){c=2;for(let f in a)if(a[f]!=null){let p=f.indexOf(" ");p>0?l.setAttributeNS(f.slice(0,p),f.slice(p+1),a[f]):f=="style"&&l.style?l.style.cssText=a[f]:l.setAttribute(f,a[f])}}for(let f=c;f<e.length;f++){let p=e[f];if(p===0){if(f<e.length-1||f>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:d}=on(t,p,n,r);if(l.appendChild(h),d){if(o)throw new RangeError("Multiple content holes");o=d}}}return{dom:l,contentDOM:o}}const Gi=65535,Yi=Math.pow(2,16);function ol(t,e){return t+e*Yi}function ku(t){return t&Gi}function ll(t){return(t-(t&Gi))/Yi}const Xi=1,Qi=2,ln=4,es=8;class gr{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&es)>0}get deletedBefore(){return(this.delInfo&(Xi|ln))>0}get deletedAfter(){return(this.delInfo&(Qi|ln))>0}get deletedAcross(){return(this.delInfo&ln)>0}}class ee{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&ee.empty)return ee.empty}recover(e){let n=0,r=ku(e);if(!this.inverted)for(let u=0;u<r;u++)n+=this.ranges[u*3+2]-this.ranges[u*3+1];return this.ranges[r*3]+n+ll(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let u=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?u:0);if(l>e)break;let a=this.ranges[o+i],c=this.ranges[o+s],f=l+a;if(e<=f){let p=a?e==l?-1:e==f?1:n:n,h=l+u+(p<0?0:c);if(r)return h;let d=e==(n<0?l:f)?null:ol(o/3,e-l),m=e==l?Qi:e==f?Xi:ln;return(n<0?e!=l:e!=f)&&(m|=es),new gr(h,m,d)}u+=c-a}return r?e+u:new gr(e+u,0,null)}touches(e,n){let r=0,u=ku(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?r:0);if(l>e)break;let a=this.ranges[o+i],c=l+a;if(e<=c&&o==u*3)return!0;r+=this.ranges[o+s]-a}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let u=0,i=0;u<this.ranges.length;u+=3){let s=this.ranges[u],o=s-(this.inverted?i:0),l=s+(this.inverted?0:i),a=this.ranges[u+n],c=this.ranges[u+r];e(o,o+a,l,l+c),i+=c-a}}invert(){return new ee(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ee.empty:new ee(e<0?[0,-e,0]:[0,0,e])}}ee.empty=new ee([]);class zt{constructor(e,n,r=0,u=e?e.length:0){this.mirror=n,this.from=r,this.to=u,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new zt(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let u=e.getMirror(n);this.appendMap(e._maps[n],u!=null&&u<n?r+u:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let u=e.getMirror(n);this.appendMap(e._maps[n].invert(),u!=null&&u>n?r-u-1:void 0)}}invert(){let e=new zt;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let u=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],o=s.mapResult(e,n);if(o.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(o.recover);continue}}u|=o.delInfo,e=o.pos}return r?e:new gr(e,u,null)}}const qn=Object.create(null);class j{getMap(){return ee.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=qn[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in qn)throw new RangeError("Duplicate use of step JSON ID "+e);return qn[e]=n,n.prototype.jsonID=e,n}}class B{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new B(e,null)}static fail(e){return new B(null,e)}static fromReplace(e,n,r,u){try{return B.ok(e.replace(n,r,u))}catch(i){if(i instanceof hn)return B.fail(i.message);throw i}}}function zr(t,e,n){let r=[];for(let u=0;u<t.childCount;u++){let i=t.child(u);i.content.size&&(i=i.copy(zr(i.content,e,i))),i.isInline&&(i=e(i,n,u)),r.push(i)}return x.fromArray(r)}class Be extends j{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),u=r.node(r.sharedDepth(this.to)),i=new D(zr(n.content,(s,o)=>!s.isAtom||!o.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),u),n.openStart,n.openEnd);return B.fromReplace(e,this.from,this.to,i)}invert(){return new me(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Be(n.pos,r.pos,this.mark)}merge(e){return e instanceof Be&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Be(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Be(n.from,n.to,e.markFromJSON(n.mark))}}j.jsonID("addMark",Be);class me extends j{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new D(zr(n.content,u=>u.mark(this.mark.removeFromSet(u.marks)),e),n.openStart,n.openEnd);return B.fromReplace(e,this.from,this.to,r)}invert(){return new Be(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new me(n.pos,r.pos,this.mark)}merge(e){return e instanceof me&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new me(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new me(n.from,n.to,e.markFromJSON(n.mark))}}j.jsonID("removeMark",me);class ve extends j{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return B.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return B.fromReplace(e,this.pos,this.pos+1,new D(x.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let u=0;u<n.marks.length;u++)if(!n.marks[u].isInSet(r))return new ve(this.pos,n.marks[u]);return new ve(this.pos,this.mark)}}return new nt(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ve(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ve(n.pos,e.markFromJSON(n.mark))}}j.jsonID("addNodeMark",ve);class nt extends j{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return B.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return B.fromReplace(e,this.pos,this.pos+1,new D(x.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ve(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new nt(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new nt(n.pos,e.markFromJSON(n.mark))}}j.jsonID("removeNodeMark",nt);class H extends j{constructor(e,n,r,u=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=u}apply(e){return this.structure&&br(e,this.from,this.to)?B.fail("Structure replace would overwrite content"):B.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ee([this.from,this.to-this.from,this.slice.size])}invert(e){return new H(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new H(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof H)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?D.empty:new D(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new H(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?D.empty:new D(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new H(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new H(n.from,n.to,D.fromJSON(e,n.slice),!!n.structure)}}j.jsonID("replace",H);class G extends j{constructor(e,n,r,u,i,s,o=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=u,this.slice=i,this.insert=s,this.structure=o}apply(e){if(this.structure&&(br(e,this.from,this.gapFrom)||br(e,this.gapTo,this.to)))return B.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return B.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?B.fromReplace(e,this.from,this.to,r):B.fail("Content does not fit in gap")}getMap(){return new ee([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new G(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),u=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||u<n.pos||i>r.pos?null:new G(n.pos,r.pos,u,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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new G(n.from,n.to,n.gapFrom,n.gapTo,D.fromJSON(e,n.slice),n.insert,!!n.structure)}}j.jsonID("replaceAround",G);function br(t,e,n){let r=t.resolve(e),u=n-e,i=r.depth;for(;u>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,u--;if(u>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;u>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,u--}}return!1}function al(t,e,n,r){let u=[],i=[],s,o;t.doc.nodesBetween(e,n,(l,a,c)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let p=Math.max(a,e),h=Math.min(a+l.nodeSize,n),d=r.addToSet(f);for(let m=0;m<f.length;m++)f[m].isInSet(d)||(s&&s.to==p&&s.mark.eq(f[m])?s.to=h:u.push(s=new me(p,h,f[m])));o&&o.to==p?o.to=h:i.push(o=new Be(p,h,r))}}),u.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function cl(t,e,n,r){let u=[],i=0;t.doc.nodesBetween(e,n,(s,o)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof An){let a=s.marks,c;for(;c=r.isInSet(a);)(l||(l=[])).push(c),a=c.removeFromSet(a)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let a=Math.min(o+s.nodeSize,n);for(let c=0;c<l.length;c++){let f=l[c],p;for(let h=0;h<u.length;h++){let d=u[h];d.step==i-1&&f.eq(u[h].style)&&(p=d)}p?(p.to=a,p.step=i):u.push({style:f,from:Math.max(o,e),to:a,step:i})}}}),u.forEach(s=>t.step(new me(s.from,s.to,s.style)))}function Pr(t,e,n,r=n.contentMatch,u=!0){let i=t.doc.nodeAt(e),s=[],o=e+1;for(let l=0;l<i.childCount;l++){let a=i.child(l),c=o+a.nodeSize,f=r.matchType(a.type);if(!f)s.push(new H(o,c,D.empty));else{r=f;for(let p=0;p<a.marks.length;p++)n.allowsMarkType(a.marks[p].type)||t.step(new me(o,c,a.marks[p]));if(u&&a.isText&&n.whitespace!="pre"){let p,h=/\r?\n|\r/g,d;for(;p=h.exec(a.text);)d||(d=new D(x.from(n.schema.text(" ",n.allowedMarks(a.marks))),0,0)),s.push(new H(o+p.index,o+p.index+p[0].length,d))}}o=c}if(!r.validEnd){let l=r.fillBefore(x.empty,!0);t.replace(o,o,new D(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function fl(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function jt(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let u=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&u.canReplace(i,s,n))return r;if(r==0||u.type.spec.isolating||!fl(u,i,s))break}return null}function dl(t,e,n){let{$from:r,$to:u,depth:i}=e,s=r.before(i+1),o=u.after(i+1),l=s,a=o,c=x.empty,f=0;for(let d=i,m=!1;d>n;d--)m||r.index(d)>0?(m=!0,c=x.from(r.node(d).copy(c)),f++):l--;let p=x.empty,h=0;for(let d=i,m=!1;d>n;d--)m||u.after(d+1)<u.end(d)?(m=!0,p=x.from(u.node(d).copy(p)),h++):a++;t.step(new G(l,a,s,o,new D(c.append(p),f,h),c.size-f,!0))}function ts(t,e,n=null,r=t){let u=hl(t,e),i=u&&pl(r,e);return i?u.map(yu).concat({type:e,attrs:n}).concat(i.map(yu)):null}function yu(t){return{type:t,attrs:null}}function hl(t,e){let{parent:n,startIndex:r,endIndex:u}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,u,s)?i:null}function pl(t,e){let{parent:n,startIndex:r,endIndex:u}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let a=r;l&&a<u;a++)l=l.matchType(n.child(a).type);return!l||!l.validEnd?null:s}function ml(t,e,n){let r=x.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let o=n[s].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=x.from(n[s].type.create(n[s].attrs,r))}let u=e.start,i=e.end;t.step(new G(u,i,u,i,new D(r,0,0),n.length,!0))}function gl(t,e,n,r,u){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,o)=>{let l=typeof u=="function"?u(s):u;if(s.isTextblock&&!s.hasMarkup(r,l)&&bl(t.doc,t.mapping.slice(i).map(o),r)){let a=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",d=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!d?a=!1:!h&&d&&(a=!0)}a===!1&&rs(t,s,o,i),Pr(t,t.mapping.slice(i).map(o,1),r,void 0,a===null);let c=t.mapping.slice(i),f=c.map(o,1),p=c.map(o+s.nodeSize,1);return t.step(new G(f,p,f+1,p-1,new D(x.from(r.create(l,null,s.marks)),0,0),1,!0)),a===!0&&ns(t,s,o,i),!1}})}function ns(t,e,n,r){e.forEach((u,i)=>{if(u.isText){let s,o=/\r?\n|\r/g;for(;s=o.exec(u.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function rs(t,e,n,r){e.forEach((u,i)=>{if(u.type==u.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
5
+ `))}})}function bl(t,e,n){let r=t.resolve(e),u=r.index();return r.parent.canReplaceWith(u,u+1,n)}function xl(t,e,n,r,u){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,u||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new G(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new D(x.from(s),0,0),1,!0))}function Ot(t,e,n=1,r){let u=t.resolve(e),i=u.depth-n,s=r&&r[r.length-1]||u.parent;if(i<0||u.parent.type.spec.isolating||!u.parent.canReplace(u.index(),u.parent.childCount)||!s.type.validContent(u.parent.content.cutByIndex(u.index(),u.parent.childCount)))return!1;for(let a=u.depth-1,c=n-2;a>i;a--,c--){let f=u.node(a),p=u.index(a);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),d=r&&r[c+1];d&&(h=h.replaceChild(0,d.type.create(d.attrs)));let m=r&&r[c]||f;if(!f.canReplace(p+1,f.childCount)||!m.type.validContent(h))return!1}let o=u.indexAfter(i),l=r&&r[0];return u.node(i).canReplaceWith(o,o,l?l.type:u.node(i+1).type)}function kl(t,e,n=1,r){let u=t.doc.resolve(e),i=x.empty,s=x.empty;for(let o=u.depth,l=u.depth-n,a=n-1;o>l;o--,a--){i=x.from(u.node(o).copy(i));let c=r&&r[a];s=x.from(c?c.type.create(c.attrs,s):u.node(o).copy(s))}t.step(new H(e,e,new D(i.append(s),n,n),!0))}function Lr(t,e){let n=t.resolve(e),r=n.index();return Cl(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function yl(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let u=0;u<e.childCount;u++){let i=e.child(u),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function Cl(t,e){return!!(t&&e&&!t.isLeaf&&yl(t,e))}function Dl(t,e,n){let r=null,{linebreakReplacement:u}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(u&&s.inlineContent){let c=s.whitespace=="pre",f=!!s.contentMatch.matchType(u);c&&!f?r=!1:!c&&f&&(r=!0)}let o=t.steps.length;if(r===!1){let c=t.doc.resolve(e+n);rs(t,c.node(),c.before(),o)}s.inlineContent&&Pr(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(o),a=l.map(e-n);if(t.step(new H(a,l.map(e+n,-1),D.empty,!0)),r===!0){let c=t.doc.resolve(a);ns(t,c.node(),c.before(),t.steps.length)}return t}function _l(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let u=r.depth-1;u>=0;u--){let i=r.index(u);if(r.node(u).canReplaceWith(i,i,n))return r.before(u+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let u=r.depth-1;u>=0;u--){let i=r.indexAfter(u);if(r.node(u).canReplaceWith(i,i,n))return r.after(u+1);if(i<r.node(u).childCount)return null}return null}function El(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let u=n.content;for(let i=0;i<n.openStart;i++)u=u.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let o=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(o>0?1:0),a=r.node(s),c=!1;if(i==1)c=a.canReplace(l,l,u);else{let f=a.contentMatchAt(l).findWrapping(u.firstChild.type);c=f&&a.canReplaceWith(l,l,f[0])}if(c)return o==0?r.pos:o<0?r.before(s+1):r.after(s+1)}return null}function qr(t,e,n=e,r=D.empty){if(e==n&&!r.size)return null;let u=t.resolve(e),i=t.resolve(n);return us(u,i,r)?new H(e,n,r):new Sl(u,i,r).fit()}function us(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Sl{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=x.empty;for(let u=0;u<=e.depth;u++){let i=e.node(u);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(u))})}for(let u=e.depth;u>0;u--)this.placed=x.from(e.node(u).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let a=this.findFittable();a?this.placeNodes(a):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,u=this.close(e<0?this.$to:r.doc.resolve(e));if(!u)return null;let i=this.placed,s=r.depth,o=u.depth;for(;s&&o&&i.childCount==1;)i=i.firstChild.content,s--,o--;let l=new D(i,s,o);return e>-1?new G(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new H(r.pos,u.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,u=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(u=0),i.type.spec.isolating&&u<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let u,i=null;r?(i=Vn(this.unplaced.content,r-1).firstChild,u=i.content):u=this.unplaced.content;let s=u.firstChild;for(let o=this.depth;o>=0;o--){let{type:l,match:a}=this.frontier[o],c,f=null;if(n==1&&(s?a.matchType(s.type)||(f=a.fillBefore(x.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:o,parent:i,inject:f};if(n==2&&s&&(c=a.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:o,parent:i,wrap:c};if(i&&a.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,u=Vn(e,n);return!u.childCount||u.firstChild.isLeaf?!1:(this.unplaced=new D(e,n+1,Math.max(r,u.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,u=Vn(e,n);if(u.childCount<=1&&n>0){let i=e.size-n<=n+u.size;this.unplaced=new D(St(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new D(St(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:u,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let s=this.unplaced,o=r?r.content:s.content,l=s.openStart-e,a=0,c=[],{match:f,type:p}=this.frontier[n];if(u){for(let m=0;m<u.childCount;m++)c.push(u.child(m));f=f.matchFragment(u)}let h=o.size+e-(s.content.size-s.openEnd);for(;a<o.childCount;){let m=o.child(a),g=f.matchType(m.type);if(!g)break;a++,(a>1||l==0||m.content.size)&&(f=g,c.push(is(m.mark(p.allowedMarks(m.marks)),a==1?l:0,a==o.childCount?h:-1)))}let d=a==o.childCount;d||(h=-1),this.placed=At(this.placed,n,x.from(c)),this.frontier[n].match=f,d&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=o;m<h;m++){let b=g.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),g=b.content}this.unplaced=d?e==0?D.empty:new D(St(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new D(St(s.content,e,a),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!$n(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,u=this.$to.after(r);for(;r>1&&u==this.$to.end(--r);)++u;return u}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:u}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=$n(e,n,u,r,i);if(s){for(let o=n-1;o>=0;o--){let{match:l,type:a}=this.frontier[o],c=$n(e,o,a,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=At(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let u=e.node(r),i=u.type.contentMatch.fillBefore(u.content,!0,e.index(r));this.openFrontierNode(u.type,u.attrs,i)}return e}openFrontierNode(e,n=null,r){let u=this.frontier[this.depth];u.match=u.match.matchType(e),this.placed=At(this.placed,this.depth,x.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(x.empty,!0);n.childCount&&(this.placed=At(this.placed,this.frontier.length,n))}}function St(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(St(t.firstChild.content,e-1,n)))}function At(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(At(t.lastChild.content,e-1,n)))}function Vn(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function is(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,is(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(x.empty,!0)))),t.copy(r)}function $n(t,e,n,r,u){let i=t.node(e),s=u?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let o=r.fillBefore(i.content,!0,s);return o&&!Al(n,i.content,s)?o:null}function Al(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function Ml(t){return t.spec.defining||t.spec.definingForContent}function wl(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let u=t.doc.resolve(e),i=t.doc.resolve(n);if(us(u,i,r))return t.step(new H(e,n,r));let s=ls(u,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let o=-(u.depth+1);s.unshift(o);for(let p=u.depth,h=u.pos-1;p>0;p--,h--){let d=u.node(p).type.spec;if(d.defining||d.definingAsContext||d.isolating)break;s.indexOf(p)>-1?o=p:u.before(p)==h&&s.splice(1,0,-p)}let l=s.indexOf(o),a=[],c=r.openStart;for(let p=r.content,h=0;;h++){let d=p.firstChild;if(a.push(d),h==r.openStart)break;p=d.content}for(let p=c-1;p>=0;p--){let h=a[p],d=Ml(h.type);if(d&&!h.sameMarkup(u.node(Math.abs(o)-1)))c=p;else if(d||!h.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let h=(p+c+1)%(r.openStart+1),d=a[h];if(d)for(let m=0;m<s.length;m++){let g=s[(m+l)%s.length],b=!0;g<0&&(b=!1,g=-g);let k=u.node(g-1),y=u.index(g-1);if(k.canReplaceWith(y,y,d.type,d.marks))return t.replace(u.before(g),b?i.after(g):n,new D(ss(r.content,0,r.openStart,h),h,r.openEnd))}}let f=t.steps.length;for(let p=s.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>f));p--){let h=s[p];h<0||(e=u.before(h),n=i.after(h))}}function ss(t,e,n,r,u){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(ss(i.content,e+1,n,r,i)))}if(e>r){let i=u.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(x.empty,!0))}return t}function Tl(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let u=_l(t.doc,e,r.type);u!=null&&(e=n=u)}t.replaceRange(e,n,new D(x.from(r),0,0))}function Ol(t,e,n){let r=t.doc.resolve(e),u=t.doc.resolve(n),i=ls(r,u);for(let s=0;s<i.length;s++){let o=i[s],l=s==i.length-1;if(l&&o==0||r.node(o).type.contentMatch.validEnd)return t.delete(r.start(o),u.end(o));if(o>0&&(l||r.node(o-1).canReplace(r.index(o-1),u.indexAfter(o-1))))return t.delete(r.before(o),u.after(o))}for(let s=1;s<=r.depth&&s<=u.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&u.end(s)-n!=u.depth-s&&r.start(s-1)==u.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),u.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function ls(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let u=r;u>=0;u--){let i=t.start(u);if(i<t.pos-(t.depth-u)||e.end(u)>e.pos+(e.depth-u)||t.node(u).type.spec.isolating||e.node(u).type.spec.isolating)break;(i==e.start(u)||u==t.depth&&u==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&u&&e.start(u-1)==i-1)&&n.push(u)}return n}class ft extends j{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return B.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let u=n.type.create(r,null,n.marks);return B.fromReplace(e,this.pos,this.pos+1,new D(x.from(u),0,n.isLeaf?0:1))}getMap(){return ee.empty}invert(e){return new ft(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ft(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ft(n.pos,n.attr,n.value)}}j.jsonID("attr",ft);class Pt extends j{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let u in e.attrs)n[u]=e.attrs[u];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return B.ok(r)}getMap(){return ee.empty}invert(e){return new Pt(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Pt(n.attr,n.value)}}j.jsonID("docAttr",Pt);let pt=class extends Error{};pt=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};pt.prototype=Object.create(Error.prototype);pt.prototype.constructor=pt;pt.prototype.name="TransformError";class Fl{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new zt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new pt(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=D.empty){let u=qr(this.doc,e,n,r);return u&&this.step(u),this}replaceWith(e,n,r){return this.replace(e,n,new D(x.from(r),0,0))}delete(e,n){return this.replace(e,n,D.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return wl(this,e,n,r),this}replaceRangeWith(e,n,r){return Tl(this,e,n,r),this}deleteRange(e,n){return Ol(this,e,n),this}lift(e,n){return dl(this,e,n),this}join(e,n=1){return Dl(this,e,n),this}wrap(e,n){return ml(this,e,n),this}setBlockType(e,n=e,r,u=null){return gl(this,e,n,r,u),this}setNodeMarkup(e,n,r=null,u){return xl(this,e,n,r,u),this}setNodeAttribute(e,n,r){return this.step(new ft(e,n,r)),this}setDocAttribute(e,n){return this.step(new Pt(e,n)),this}addNodeMark(e,n){return this.step(new ve(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof T)n.isInSet(r.marks)&&this.step(new nt(e,n));else{let u=r.marks,i,s=[];for(;i=n.isInSet(u);)s.push(new nt(e,i)),u=i.removeFromSet(u);for(let o=s.length-1;o>=0;o--)this.step(s[o])}return this}split(e,n=1,r){return kl(this,e,n,r),this}addMark(e,n,r){return al(this,e,n,r),this}removeMark(e,n,r){return cl(this,e,n,r),this}clearIncompatible(e,n,r){return Pr(this,e,n,r),this}}const Wn=Object.create(null);class O{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Nl(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=D.empty){let r=n.content.lastChild,u=null;for(let o=0;o<n.openEnd;o++)u=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:l,$to:a}=s[o],c=e.mapping.slice(i);e.replaceRange(c.map(l.pos),c.map(a.pos),o?D.empty:n),o==0&&_u(e,i,(r?r.isInline:u&&u.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,u=this.ranges;for(let i=0;i<u.length;i++){let{$from:s,$to:o}=u[i],l=e.mapping.slice(r),a=l.map(s.pos),c=l.map(o.pos);i?e.deleteRange(a,c):(e.replaceRangeWith(a,c,n),_u(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let u=e.parent.inlineContent?new F(e):at(e.node(0),e.parent,e.pos,e.index(),n,r);if(u)return u;for(let i=e.depth-1;i>=0;i--){let s=n<0?at(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):at(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new te(e.node(0))}static atStart(e){return at(e,e,0,0,1)||new te(e)}static atEnd(e){return at(e,e,e.content.size,e.childCount,-1)||new te(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Wn[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Wn)throw new RangeError("Duplicate use of selection JSON ID "+e);return Wn[e]=n,n.prototype.jsonID=e,n}getBookmark(){return F.between(this.$anchor,this.$head).getBookmark()}}O.prototype.visible=!0;class Nl{constructor(e,n){this.$from=e,this.$to=n}}let Cu=!1;function Du(t){!Cu&&!t.parent.inlineContent&&(Cu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class F extends O{constructor(e,n=e){Du(e),Du(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return O.near(r);let u=e.resolve(n.map(this.anchor));return new F(u.parent.inlineContent?u:r,r)}replace(e,n=D.empty){if(super.replace(e,n),n==D.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof F&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Mn(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new F(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let u=e.resolve(n);return new this(u,r==n?u:e.resolve(r))}static between(e,n,r){let u=e.pos-n.pos;if((!r||u)&&(r=u>=0?1:-1),!n.parent.inlineContent){let i=O.findFrom(n,r,!0)||O.findFrom(n,-r,!0);if(i)n=i.$head;else return O.near(n,r)}return e.parent.inlineContent||(u==0?e=n:(e=(O.findFrom(e,-r,!0)||O.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=u<0&&(e=n))),new F(e,n)}}O.jsonID("text",F);class Mn{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Mn(e.map(this.anchor),e.map(this.head))}resolve(e){return F.between(e.resolve(this.anchor),e.resolve(this.head))}}class A extends O{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:u}=n.mapResult(this.anchor),i=e.resolve(u);return r?O.near(i):new A(i)}content(){return new D(x.from(this.node),0,0)}eq(e){return e instanceof A&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Vr(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new A(e.resolve(n.anchor))}static create(e,n){return new A(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}A.prototype.visible=!1;O.jsonID("node",A);class Vr{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Mn(r,r):new Vr(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&A.isSelectable(r)?new A(n):O.near(n)}}class te extends O{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=D.empty){if(n==D.empty){e.delete(0,e.doc.content.size);let r=O.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new te(e)}map(e){return new te(e)}eq(e){return e instanceof te}getBookmark(){return Il}}O.jsonID("all",te);const Il={map(){return this},resolve(t){return new te(t)}};function at(t,e,n,r,u,i=!1){if(e.inlineContent)return F.create(t,n);for(let s=r-(u>0?0:1);u>0?s<e.childCount:s>=0;s+=u){let o=e.child(s);if(o.isAtom){if(!i&&A.isSelectable(o))return A.create(t,n-(u<0?o.nodeSize:0))}else{let l=at(t,o,n+u,u<0?o.childCount:0,u,i);if(l)return l}n+=o.nodeSize*u}return null}function _u(t,e,n){let r=t.steps.length-1;if(r<e)return;let u=t.steps[r];if(!(u instanceof H||u instanceof G))return;let i=t.mapping.maps[r],s;i.forEach((o,l,a,c)=>{s==null&&(s=c)}),t.setSelection(O.near(t.doc.resolve(s),n))}const Eu=1,nn=2,Su=4;class Rl extends Fl{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|Eu)&~nn,this.storedMarks=null,this}get selectionSet(){return(this.updated&Eu)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=nn,this}ensureMarks(e){return T.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&nn)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~nn,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||T.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let u=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(u.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,u.text(e,i)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(O.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Su,this}get scrolledIntoView(){return(this.updated&Su)>0}}function Au(t,e){return!e||!t?t:t.bind(e)}class Mt{constructor(e,n,r){this.name=e,this.init=Au(n.init,r),this.apply=Au(n.apply,r)}}const Bl=[new Mt("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Mt("selection",{init(t,e){return t.selection||O.atStart(e.doc)},apply(t){return t.selection}}),new Mt("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Mt("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Hn{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Bl.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Mt(r.key,r.spec.state,r))})}}class Ue{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let u=this.config.plugins[r];if(u.spec.filterTransaction&&!u.spec.filterTransaction.call(u,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),u=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=u?u[s].n:0,a=u?u[s].state:this,c=l<n.length&&o.spec.appendTransaction.call(o,l?n.slice(l):n,a,r);if(c&&r.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!u){u=[];for(let f=0;f<this.config.plugins.length;f++)u.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(c),r=r.applyInner(c),i=!0}u&&(u[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ue(this.config),r=this.config.fields;for(let u=0;u<r.length;u++){let i=r[u];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new Rl(this)}static create(e){let n=new Hn(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ue(n);for(let u=0;u<n.fields.length;u++)r[n.fields[u].name]=n.fields[u].init(e,r);return r}reconfigure(e){let n=new Hn(this.schema,e.plugins),r=n.fields,u=new Ue(n);for(let i=0;i<r.length;i++){let s=r[i].name;u[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,u)}return u}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let u=e[r],i=u.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(u,this[u.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let u=new Hn(e.schema,e.plugins),i=new Ue(u);return u.fields.forEach(s=>{if(s.name=="doc")i.doc=xe.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=O.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let o in r){let l=r[o],a=l.spec.state;if(l.key==s.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(n,o)){i[s.name]=a.fromJSON.call(l,e,n[o],i);return}}i[s.name]=s.init(e,i)}}),i}}function as(t,e,n){for(let r in t){let u=t[r];u instanceof Function?u=u.bind(e):r=="handleDOMEvents"&&(u=as(u,e,{})),n[r]=u}return n}class $r{constructor(e){this.spec=e,this.props={},e.props&&as(e.props,this,this.props),this.key=e.key?e.key.key:cs("plugin")}getState(e){return e[this.key]}}const Jn=Object.create(null);function cs(t){return t in Jn?t+"$"+ ++Jn[t]:(Jn[t]=0,t+"$")}class fs{constructor(e="key"){this.key=cs(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ds=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function vl(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const zl=(t,e,n)=>{let r=vl(t,n);if(!r)return!1;let u=hs(r);if(!u){let s=r.blockRange(),o=s&&jt(s);return o==null?!1:(e&&e(t.tr.lift(s,o).scrollIntoView()),!0)}let i=u.nodeBefore;if(ms(t,u,e,-1))return!0;if(r.parent.content.size==0&&(mt(i,"end")||A.isSelectable(i)))for(let s=r.depth;;s--){let o=qr(t.doc,r.before(s),r.after(s),D.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=t.tr.step(o);l.setSelection(mt(i,"end")?O.findFrom(l.doc.resolve(l.mapping.map(u.pos,-1)),-1):A.create(l.doc,u.pos-i.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&u.depth==r.depth-1?(e&&e(t.tr.delete(u.pos-i.nodeSize,u.pos).scrollIntoView()),!0):!1};function mt(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Pl=(t,e,n)=>{let{$head:r,empty:u}=t.selection,i=r;if(!u)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=hs(r)}let s=i&&i.nodeBefore;return!s||!A.isSelectable(s)?!1:(e&&e(t.tr.setSelection(A.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function hs(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Ll(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const ql=(t,e,n)=>{let r=Ll(t,n);if(!r)return!1;let u=ps(r);if(!u)return!1;let i=u.nodeAfter;if(ms(t,u,e,1))return!0;if(r.parent.content.size==0&&(mt(i,"start")||A.isSelectable(i))){let s=qr(t.doc,r.before(),r.after(),D.empty);if(s&&s.slice.size<s.to-s.from){if(e){let o=t.tr.step(s);o.setSelection(mt(i,"start")?O.findFrom(o.doc.resolve(o.mapping.map(u.pos)),1):A.create(o.doc,o.mapping.map(u.pos))),e(o.scrollIntoView())}return!0}}return i.isAtom&&u.depth==r.depth-1?(e&&e(t.tr.delete(u.pos,u.pos+i.nodeSize).scrollIntoView()),!0):!1},Vl=(t,e,n)=>{let{$head:r,empty:u}=t.selection,i=r;if(!u)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=ps(r)}let s=i&&i.nodeAfter;return!s||!A.isSelectable(s)?!1:(e&&e(t.tr.setSelection(A.create(t.doc,i.pos)).scrollIntoView()),!0)};function ps(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const $l=(t,e)=>{let{$from:n,$to:r}=t.selection,u=n.blockRange(r),i=u&&jt(u);return i==null?!1:(e&&e(t.tr.lift(u,i).scrollIntoView()),!0)},Wl=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
6
+ `).scrollIntoView()),!0)};function Wr(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Hl=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let u=n.node(-1),i=n.indexAfter(-1),s=Wr(u.contentMatchAt(i));if(!s||!u.canReplaceWith(i,i,s))return!1;if(e){let o=n.after(),l=t.tr.replaceWith(o,o,s.createAndFill());l.setSelection(O.near(l.doc.resolve(o),1)),e(l.scrollIntoView())}return!0},Jl=(t,e)=>{let n=t.selection,{$from:r,$to:u}=n;if(n instanceof te||r.parent.inlineContent||u.parent.inlineContent)return!1;let i=Wr(u.parent.contentMatchAt(u.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&u.index()<u.parent.childCount?r:u).pos,o=t.tr.insert(s,i.createAndFill());o.setSelection(F.create(o.doc,s+1)),e(o.scrollIntoView())}return!0},jl=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Ot(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),u=r&&jt(r);return u==null?!1:(e&&e(t.tr.lift(r,u).scrollIntoView()),!0)};function Ul(t){return(e,n)=>{let{$from:r,$to:u}=e.selection;if(e.selection instanceof A&&e.selection.node.isBlock)return!r.parentOffset||!Ot(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,o,l=!1,a=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){l=r.end(h)==r.pos+(r.depth-h),a=r.start(h)==r.pos-(r.depth-h),o=Wr(r.node(h-1).contentMatchAt(r.indexAfter(h-1))),i.unshift(l&&o?{type:o}:null),s=h;break}else{if(h==1)return!1;i.unshift(null)}let c=e.tr;(e.selection instanceof F||e.selection instanceof te)&&c.deleteSelection();let f=c.mapping.map(r.pos),p=Ot(c.doc,f,i.length,i);if(p||(i[0]=o?{type:o}:null,p=Ot(c.doc,f,i.length,i)),!p)return!1;if(c.split(f,i.length,i),!l&&a&&r.node(s).type!=o){let h=c.mapping.map(r.before(s)),d=c.doc.resolve(h);o&&r.node(s-1).canReplaceWith(d.index(),d.index()+1,o)&&c.setNodeMarkup(c.mapping.map(r.before(s)),o)}return n&&n(c.scrollIntoView()),!0}}const Kl=Ul(),Zl=(t,e)=>(e&&e(t.tr.setSelection(new te(t.doc))),!0);function Gl(t,e,n){let r=e.nodeBefore,u=e.nodeAfter,i=e.index();return!r||!u||!r.type.compatibleContent(u.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(u.isTextblock||Lr(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function ms(t,e,n,r){let u=e.nodeBefore,i=e.nodeAfter,s,o,l=u.type.spec.isolating||i.type.spec.isolating;if(!l&&Gl(t,e,n))return!0;let a=!l&&e.parent.canReplace(e.index(),e.index()+1);if(a&&(s=(o=u.contentMatchAt(u.childCount)).findWrapping(i.type))&&o.matchType(s[0]||i.type).validEnd){if(n){let h=e.pos+i.nodeSize,d=x.empty;for(let b=s.length-1;b>=0;b--)d=x.from(s[b].create(null,d));d=x.from(u.copy(d));let m=t.tr.step(new G(e.pos-1,h,e.pos,h,new D(d,1,0),s.length,!0)),g=m.doc.resolve(h+2*s.length);g.nodeAfter&&g.nodeAfter.type==u.type&&Lr(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let c=i.type.spec.isolating||r>0&&l?null:O.findFrom(e,1),f=c&&c.$from.blockRange(c.$to),p=f&&jt(f);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(f,p).scrollIntoView()),!0;if(a&&mt(i,"start",!0)&&mt(u,"end")){let h=u,d=[];for(;d.push(h),!h.isTextblock;)h=h.lastChild;let m=i,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(n){let b=x.empty;for(let y=d.length-1;y>=0;y--)b=x.from(d[y].copy(b));let k=t.tr.step(new G(e.pos-d.length,e.pos+i.nodeSize,e.pos+g,e.pos+i.nodeSize-g,new D(b,d.length,0),0,!0));n(k.scrollIntoView())}return!0}}return!1}function gs(t){return function(e,n){let r=e.selection,u=t<0?r.$from:r.$to,i=u.depth;for(;u.node(i).isInline;){if(!i)return!1;i--}return u.node(i).isTextblock?(n&&n(e.tr.setSelection(F.create(e.doc,t<0?u.start(i):u.end(i)))),!0):!1}}const Yl=gs(-1),Xl=gs(1);function Ql(t,e=null){return function(n,r){let{$from:u,$to:i}=n.selection,s=u.blockRange(i),o=s&&ts(s,t,e);return o?(r&&r(n.tr.wrap(s,o).scrollIntoView()),!0):!1}}function xr(t,e=null){return function(n,r){let u=!1;for(let i=0;i<n.selection.ranges.length&&!u;i++){let{$from:{pos:s},$to:{pos:o}}=n.selection.ranges[i];n.doc.nodesBetween(s,o,(l,a)=>{if(u)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)u=!0;else{let c=n.doc.resolve(a),f=c.index();u=c.parent.canReplaceWith(f,f+1,t)}})}if(!u)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:o},$to:{pos:l}}=n.selection.ranges[s];i.setBlockType(o,l,t,e)}r(i.scrollIntoView())}return!0}}function ea(t,e,n,r){for(let u=0;u<e.length;u++){let{$from:i,$to:s}=e[u],o=i.depth==0?t.inlineContent&&t.type.allowsMarkType(n):!1;if(t.nodesBetween(i.pos,s.pos,(l,a)=>{if(o)return!1;o=l.inlineContent&&l.type.allowsMarkType(n)}),o)return!0}return!1}function an(t,e=null,n){return function(r,u){let{empty:i,$cursor:s,ranges:o}=r.selection;if(i&&!s||!ea(r.doc,o,t))return!1;if(u)if(s)t.isInSet(r.storedMarks||s.marks())?u(r.tr.removeStoredMark(t)):u(r.tr.addStoredMark(t.create(e)));else{let l,a=r.tr;l=!o.some(c=>r.doc.rangeHasMark(c.$from.pos,c.$to.pos,t));for(let c=0;c<o.length;c++){let{$from:f,$to:p}=o[c];if(!l)a.removeMark(f.pos,p.pos,t);else{let h=f.pos,d=p.pos,m=f.nodeAfter,g=p.nodeBefore,b=m&&m.isText?/^\s*/.exec(m.text)[0].length:0,k=g&&g.isText?/\s*$/.exec(g.text)[0].length:0;h+b<d&&(h+=b,d-=k),a.addMark(h,d,t.create(e))}}u(a.scrollIntoView())}return!0}}function Hr(...t){return function(e,n,r){for(let u=0;u<t.length;u++)if(t[u](e,n,r))return!0;return!1}}let jn=Hr(ds,zl,Pl),Mu=Hr(ds,ql,Vl);const Se={Enter:Hr(Wl,Jl,jl,Kl),"Mod-Enter":Hl,Backspace:jn,"Mod-Backspace":jn,"Shift-Backspace":jn,Delete:Mu,"Mod-Delete":Mu,"Mod-a":Zl},bs={"Ctrl-h":Se.Backspace,"Alt-Backspace":Se["Mod-Backspace"],"Ctrl-d":Se.Delete,"Ctrl-Alt-Backspace":Se["Mod-Delete"],"Alt-Delete":Se["Mod-Delete"],"Alt-d":Se["Mod-Delete"],"Ctrl-a":Yl,"Ctrl-e":Xl};for(let t in Se)bs[t]=Se[t];const ta=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,na=ta?bs:Se;function xs(t,e){return ks(t,e)!=null}function ks(t,e){const{from:n,$from:r,to:u,empty:i}=t.selection;if(!e)return null;if(i){if(t.storedMarks){const c=t.storedMarks.find(f=>f.type.name===e.name);if(c!=null)return c}const l=r.marks().find(c=>c.type.name===e.name);if(l!=null)return l;const a=r.nodeAfter;if(a&&a.marks){const c=a.marks.find(f=>f.type.name===e.name);if(c!=null)return c}return null}let s=null;return t.doc.nodesBetween(n,u,o=>{if(s!=null)return!1;if(o.marks){const l=o.marks.find(a=>a.type.name===e.name);if(l!=null)return s=l,!1}}),s}function cn(t,e,n){return t.map(()=>{const r=e.value,u=r.state.schema.marks[n];return xs(r.state,u)})}function ra(t,e,n){const{$from:r}=t.selection;for(let i=r.depth;i>0;i--){const s=r.node(i);if(s.type.name===e.name)return n!=null?Object.keys(n).every(o=>s.attrs[o]===n[o]):!0}const u=t.doc.nodeAt(r.pos);return u&&u.type.name===e.name?n!=null?Object.keys(n).every(i=>u.attrs[i]===n[i]):!0:!1}function Dt(t,e,n,r){return t.map(()=>{const u=e.value,i=u.state.schema.nodes[n];return i?ra(u.state,i,r):!1})}function he({active:t,display:e,onClick:n,disabled:r,label:u,icon:i,size:s}){return S.When(e,()=>It.ToolbarButton({onClick:n,disabled:r,variant:t.map(o=>o?"filled":"light"),size:s},S.attr.title(u),Br.Icon({icon:i,size:s})))}function ua(t,e){const n=t.state.schema.marks.link;if(n==null)return;const{from:r,to:u}=t.state.selection,i=t.state.tr.addMark(r,u,n.create({href:e,title:null}));t.dispatch(i),t.focus()}function ys(t){const{state:e}=t,{$from:n,$to:r}=e.selection;if(!Cs(e))return null;let u=n.pos,i=r.pos;const s=e.doc;for(;u>0&&s.resolve(u-1).nodeAfter?.marks?.some(a=>a.type.name==="link");)u--;for(;i<s.content.size&&s.resolve(i).nodeAfter?.marks?.some(a=>a.type.name==="link");)i++;return{start:u,end:i}}function ia(t,e){const n=t.state.schema.marks.link;if(n==null)return;const r=ys(t);if(r==null)return;const{start:u,end:i}=r,s=t.state.tr.removeMark(u,i,n).addMark(u,i,n.create({href:e,title:null}));t.dispatch(s)}function sa(t){const e=t.state.schema.marks.link;if(e==null)return;const n=ys(t);if(n==null)return;const{start:r,end:u}=n,i=t.state.tr.removeMark(r,u,e);t.dispatch(i),t.focus()}function Cs(t){return xs(t,t.schema.marks.link)}function oa({stateUpdate:t,view:e,isReadOnly:n,label:r,linkUrlPlaceholder:u,size:i}){const s=S.prop(null);s.on(l=>{l!=null&&ia(e.value,l)});const o=t.on(()=>{const l=ks(e.value.state,e.value.state.schema.marks.link);l!=null?s.set(l.attrs.href??""):s.set(null)});return S.Fragment(S.OnDispose(o),It.ToolbarGroup(he({display:S.signal(!0),active:cn(t,e,"link"),disabled:n,label:r,icon:"mdi:link-variant",size:i,onClick:()=>{const l=e.value.state;if(Cs(l))sa(e.value),s.set(null);else{const a="";ua(e.value,a),s.set(a)}}}),S.Ensure(s,l=>Br.TextInput({value:l,autofocus:!0,onInput:s.set,placeholder:u,size:i}))),S.Ensure(s,l=>It.ToolbarButton({disabled:l.map(a=>a.trim()===""),variant:"text",onClick:()=>{const a=s.value;a&&window.open(a,"_blank")},size:i},"go")))}function rn({display:t},...e){return S.When(S.computedOf(...t)((...n)=>n.some(Boolean)),()=>It.ToolbarGroup(...e))}function Ds({view:t,stateUpdate:e,features:n,readOnly:r=S.signal(!1),size:u="sm"}){return S.Ensure(t,i=>S.Use(Br.BeatUII18n,s=>{const o=s.$.prosemirror,l=i;return It.Toolbar(rn({display:[n.$.bold,n.$.italic,n.$.code]},he({active:cn(e,l,"strong"),display:n.$.bold,onClick:()=>Un(l.value,"strong"),disabled:r,label:o.$.bold,icon:"mdi:format-bold",size:u}),he({active:cn(e,l,"em"),display:n.$.italic,onClick:()=>Un(l.value,"em"),disabled:r,label:o.$.italic,icon:"mdi:format-italic",size:u}),he({active:cn(e,l,"code"),display:n.$.code,onClick:()=>Un(l.value,"code"),disabled:r,label:o.$.code,icon:"mdi:code-tags",size:u})),rn({display:[n.$.headings]},S.Repeat(n.$.headerLevels.map(a=>Math.min(Math.max(a,1),6)),({counter:a})=>he({active:Dt(e,l,"heading",{level:a}),display:n.$.headings,onClick:()=>la(l.value,a),disabled:r,label:o.map(c=>c.heading(a)),icon:`mdi:format-header-${a}`,size:u}))),rn({display:[n.$.bulletList,n.$.orderedList]},he({active:Dt(e,l,"bullet_list"),display:n.$.bulletList,onClick:()=>wu(l.value,"bullet_list"),disabled:r,label:o.$.bulletList,icon:"mdi:format-list-bulleted",size:u}),he({active:Dt(e,l,"ordered_list"),display:n.$.orderedList,onClick:()=>wu(l.value,"ordered_list"),disabled:r,label:o.$.orderedList,icon:"mdi:format-list-numbered",size:u})),rn({display:[n.$.blockquote,n.$.codeBlock,n.$.horizontalRule]},he({active:Dt(e,l,"blockquote"),display:n.$.blockquote,onClick:()=>aa(l.value),disabled:r,label:o.$.blockquote,icon:"mdi:format-quote-close",size:u}),he({active:Dt(e,l,"code_block"),display:n.$.codeBlock,onClick:()=>ca(l.value),disabled:r,label:o.$.codeBlock,icon:"mdi:code-braces",size:u}),he({active:S.signal(!1),display:n.$.horizontalRule,onClick:()=>fa(l.value),disabled:r,label:o.$.horizontalRule,icon:"mdi:minus",size:u})),S.When(n.$.links,()=>oa({stateUpdate:e,view:l,isReadOnly:r,label:o.$.link,linkUrlPlaceholder:o.$.linkUrlPlaceholder,size:u})))}))}function Un(t,e){const n=t.state.schema.marks[e];n!=null&&(an(n)(t.state,t.dispatch),t.focus())}function la(t,e){const n=t.state.schema.nodes.heading;n!=null&&(xr(n,{level:e})(t.state,t.dispatch),t.focus())}async function wu(t,e){const{wrapInList:n,liftListItem:r}=await Promise.resolve().then(()=>require("./index-CmNppgrA.cjs")),u=t.state.schema.nodes[e],i=t.state.schema.nodes.list_item;if(u==null||i==null)return;const{state:s}=t,{$from:o}=s.selection;let l=null;for(let a=o.depth;a>0;a--){const c=o.node(a);if(c.type.name==="bullet_list"||c.type.name==="ordered_list"){l=c.type.name;break}}l===e?r(i)(s,t.dispatch):l!=null?r(i)(t.state,t.dispatch)&&n(u)(t.state,t.dispatch):n(u)(s,t.dispatch),t.focus()}function aa(t){const e=t.state.schema.nodes.blockquote;if(e==null)return;const{state:n}=t,{$from:r}=n.selection;let u=!1;for(let i=r.depth;i>0;i--)if(r.node(i).type.name==="blockquote"){u=!0;break}u?$l(n,t.dispatch):Ql(e)(n,t.dispatch),t.focus()}function ca(t){const e=t.state.schema.nodes.code_block,n=t.state.schema.nodes.paragraph;if(e==null||n==null)return;const{state:r}=t,{$from:u}=r.selection;let i=!1;for(let s=u.depth;s>0;s--)if(u.node(s).type.name==="code_block"){i=!0;break}i?xr(n)(r,t.dispatch):xr(e)(r,t.dispatch),t.focus()}function fa(t){const e=t.state.schema.nodes.horizontal_rule;if(e!=null){const n=t.state.tr.replaceSelectionWith(e.create());t.dispatch(n),t.focus()}}const V=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},gt=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let kr=null;const Ee=function(t,e,n){let r=kr||(kr=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},da=function(){kr=null},rt=function(t,e,n,r){return n&&(Tu(t,e,n,r,-1)||Tu(t,e,n,r,1))},ha=/^(img|br|input|textarea|hr)$/i;function Tu(t,e,n,r,u){for(var i;;){if(t==n&&e==r)return!0;if(e==(u<0?0:ie(t))){let s=t.parentNode;if(!s||s.nodeType!=1||Ut(t)||ha.test(t.nodeName)||t.contentEditable=="false")return!1;e=V(t)+(u<0?0:1),t=s}else if(t.nodeType==1){let s=t.childNodes[e+(u<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((i=s.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=u;else return!1;else t=s,e=u<0?ie(t):0}else return!1}}function ie(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function pa(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=ie(t)}else if(t.parentNode&&!Ut(t))e=V(t),t=t.parentNode;else return null}}function ma(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Ut(t))e=V(t)+1,t=t.parentNode;else return null}}function ga(t,e,n){for(let r=e==0,u=e==ie(t);r||u;){if(t==n)return!0;let i=V(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,u=u&&i==ie(t)}}function Ut(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const wn=function(t){return t.focusNode&&rt(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function je(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function ba(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function xa(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(ie(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(ie(r.startContainer),r.startOffset)}}}const ke=typeof navigator<"u"?navigator:null,Ou=typeof document<"u"?document:null,He=ke&&ke.userAgent||"",yr=/Edge\/(\d+)/.exec(He),_s=/MSIE \d/.exec(He),Cr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(He),Y=!!(_s||Cr||yr),Le=_s?document.documentMode:Cr?+Cr[1]:yr?+yr[1]:0,se=!Y&&/gecko\/(\d+)/i.test(He);se&&+(/Firefox\/(\d+)/.exec(He)||[0,0])[1];const Dr=!Y&&/Chrome\/(\d+)/.exec(He),J=!!Dr,Es=Dr?+Dr[1]:0,U=!Y&&!!ke&&/Apple Computer/.test(ke.vendor),bt=U&&(/Mobile\/\w+/.test(He)||!!ke&&ke.maxTouchPoints>2),ue=bt||(ke?/Mac/.test(ke.platform):!1),ka=ke?/Win/.test(ke.platform):!1,Ae=/Android \d/.test(He),Kt=!!Ou&&"webkitFontSmoothing"in Ou.documentElement.style,ya=Kt?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Ca(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function _e(t,e){return typeof t=="number"?t:t[e]}function Da(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Fu(t,e,n){let r=t.someProp("scrollThreshold")||0,u=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=gt(s);continue}let o=s,l=o==i.body,a=l?Ca(i):Da(o),c=0,f=0;if(e.top<a.top+_e(r,"top")?f=-(a.top-e.top+_e(u,"top")):e.bottom>a.bottom-_e(r,"bottom")&&(f=e.bottom-e.top>a.bottom-a.top?e.top+_e(u,"top")-a.top:e.bottom-a.bottom+_e(u,"bottom")),e.left<a.left+_e(r,"left")?c=-(a.left-e.left+_e(u,"left")):e.right>a.right-_e(r,"right")&&(c=e.right-a.right+_e(u,"right")),c||f)if(l)i.defaultView.scrollBy(c,f);else{let h=o.scrollLeft,d=o.scrollTop;f&&(o.scrollTop+=f),c&&(o.scrollLeft+=c);let m=o.scrollLeft-h,g=o.scrollTop-d;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}let p=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(p))break;s=p=="absolute"?s.offsetParent:gt(s)}}function _a(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,u;for(let i=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let o=t.root.elementFromPoint(i,s);if(!o||o==t.dom||!t.dom.contains(o))continue;let l=o.getBoundingClientRect();if(l.top>=n-20){r=o,u=l.top;break}}return{refDOM:r,refTop:u,stack:Ss(t.dom)}}function Ss(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=gt(r));return e}function Ea({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;As(n,r==0?0:r-e)}function As(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:u,left:i}=t[n];r.scrollTop!=u+e&&(r.scrollTop=u+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let st=null;function Sa(t){if(t.setActive)return t.setActive();if(st)return t.focus(st);let e=Ss(t);t.focus(st==null?{get preventScroll(){return st={preventScroll:!0},!0}}:void 0),st||(st=!1,As(e,0))}function Ms(t,e){let n,r=2e8,u,i=0,s=e.top,o=e.top,l,a;for(let c=t.firstChild,f=0;c;c=c.nextSibling,f++){let p;if(c.nodeType==1)p=c.getClientRects();else if(c.nodeType==3)p=Ee(c).getClientRects();else continue;for(let h=0;h<p.length;h++){let d=p[h];if(d.top<=s&&d.bottom>=o){s=Math.max(d.bottom,s),o=Math.min(d.top,o);let m=d.left>e.left?d.left-e.left:d.right<e.left?e.left-d.right:0;if(m<r){n=c,r=m,u=m&&n.nodeType==3?{left:d.right<e.left?d.right:d.left,top:e.top}:e,c.nodeType==1&&m&&(i=f+(e.left>=(d.left+d.right)/2?1:0));continue}}else d.top>e.top&&!l&&d.left<=e.left&&d.right>=e.left&&(l=c,a={left:Math.max(d.left,Math.min(d.right,e.left)),top:d.top});!n&&(e.left>=d.right&&e.top>=d.top||e.left>=d.left&&e.top>=d.bottom)&&(i=f+1)}}return!n&&l&&(n=l,u=a,r=0),n&&n.nodeType==3?Aa(n,u):!n||r&&n.nodeType==1?{node:t,offset:i}:Ms(n,u)}function Aa(t,e){let n=t.nodeValue.length,r=document.createRange();for(let u=0;u<n;u++){r.setEnd(t,u+1),r.setStart(t,u);let i=Te(r,1);if(i.top!=i.bottom&&Jr(e,i))return{node:t,offset:u+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function Jr(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Ma(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function wa(t,e,n){let{node:r,offset:u}=Ms(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,u,i)}function Ta(t,e,n,r){let u=-1;for(let i=e,s=!1;i!=t.dom;){let o=t.docView.nearestDesc(i,!0),l;if(!o)return null;if(o.dom.nodeType==1&&(o.node.isBlock&&o.parent||!o.contentDOM)&&((l=o.dom.getBoundingClientRect()).width||l.height)&&(o.node.isBlock&&o.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(o.dom.nodeName)&&(!s&&l.left>r.left||l.top>r.top?u=o.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(u=o.posAfter),s=!0),!o.contentDOM&&u<0&&!o.node.isText))return(o.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?o.posBefore:o.posAfter;i=o.dom.parentNode}return u>-1?u:t.docView.posFromDOM(e,n,-1)}function ws(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let u=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=u;;){let s=t.childNodes[i];if(s.nodeType==1){let o=s.getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(Jr(e,a))return ws(s,e,a)}}if((i=(i+1)%r)==u)break}return t}function Oa(t,e){let n=t.dom.ownerDocument,r,u=0,i=xa(n,e.left,e.top);i&&({node:r,offset:u}=i);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),o;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let a=t.dom.getBoundingClientRect();if(!Jr(e,a)||(s=ws(t.dom,e,a),!s))return null}if(U)for(let a=s;r&&a;a=gt(a))a.draggable&&(r=void 0);if(s=Ma(s,e),r){if(se&&r.nodeType==1&&(u=Math.min(u,r.childNodes.length),u<r.childNodes.length)){let c=r.childNodes[u],f;c.nodeName=="IMG"&&(f=c.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&u++}let a;Kt&&u&&r.nodeType==1&&(a=r.childNodes[u-1]).nodeType==1&&a.contentEditable=="false"&&a.getBoundingClientRect().top>=e.top&&u--,r==t.dom&&u==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?o=t.state.doc.content.size:(u==0||r.nodeType!=1||r.childNodes[u-1].nodeName!="BR")&&(o=Ta(t,r,u,e))}o==null&&(o=wa(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:o,inside:l?l.posAtStart-l.border:-1}}function Nu(t){return t.top<t.bottom||t.left<t.right}function Te(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Nu(r))return r}return Array.prototype.find.call(n,Nu)||t.getBoundingClientRect()}const Fa=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ts(t,e,n){let{node:r,offset:u,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=Kt||se;if(r.nodeType==3)if(s&&(Fa.test(r.nodeValue)||(n<0?!u:u==r.nodeValue.length))){let l=Te(Ee(r,u,u),n);if(se&&u&&/\s/.test(r.nodeValue[u-1])&&u<r.nodeValue.length){let a=Te(Ee(r,u-1,u-1),-1);if(a.top==l.top){let c=Te(Ee(r,u,u+1),-1);if(c.top!=l.top)return _t(c,c.left<a.left)}}return l}else{let l=u,a=u,c=n<0?1:-1;return n<0&&!u?(a++,c=-1):n>=0&&u==r.nodeValue.length?(l--,c=1):n<0?l--:a++,_t(Te(Ee(r,l,a),c),c<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&u&&(n<0||u==ie(r))){let l=r.childNodes[u-1];if(l.nodeType==1)return Kn(l.getBoundingClientRect(),!1)}if(i==null&&u<ie(r)){let l=r.childNodes[u];if(l.nodeType==1)return Kn(l.getBoundingClientRect(),!0)}return Kn(r.getBoundingClientRect(),n>=0)}if(i==null&&u&&(n<0||u==ie(r))){let l=r.childNodes[u-1],a=l.nodeType==3?Ee(l,ie(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(a)return _t(Te(a,1),!1)}if(i==null&&u<ie(r)){let l=r.childNodes[u];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let a=l?l.nodeType==3?Ee(l,0,s?0:1):l.nodeType==1?l:null:null;if(a)return _t(Te(a,-1),!0)}return _t(Te(r.nodeType==3?Ee(r):r,-n),n>=0)}function _t(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Kn(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Os(t,e,n){let r=t.state,u=t.root.activeElement;r!=e&&t.updateState(e),u!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),u!=t.dom&&u&&u.focus()}}function Na(t,e,n){let r=e.selection,u=n=="up"?r.$from:r.$to;return Os(t,e,()=>{let{node:i}=t.docView.domFromPos(u.pos,n=="up"?-1:1);for(;;){let o=t.docView.nearestDesc(i,!0);if(!o)break;if(o.node.isBlock){i=o.contentDOM||o.dom;break}i=o.dom.parentNode}let s=Ts(t,u.pos,1);for(let o=i.firstChild;o;o=o.nextSibling){let l;if(o.nodeType==1)l=o.getClientRects();else if(o.nodeType==3)l=Ee(o,0,o.nodeValue.length).getClientRects();else continue;for(let a=0;a<l.length;a++){let c=l[a];if(c.bottom>c.top+1&&(n=="up"?s.top-c.top>(c.bottom-s.top)*2:c.bottom-s.bottom>(s.bottom-c.top)*2))return!1}}return!0})}const Ia=/[\u0590-\u08ac]/;function Ra(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let u=r.parentOffset,i=!u,s=u==r.parent.content.size,o=t.domSelection();return o?!Ia.test(r.parent.textContent)||!o.modify?n=="left"||n=="backward"?i:s:Os(t,e,()=>{let{focusNode:l,focusOffset:a,anchorNode:c,anchorOffset:f}=t.domSelectionRange(),p=o.caretBidiLevel;o.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:d,focusOffset:m}=t.domSelectionRange(),g=d&&!h.contains(d.nodeType==1?d:d.parentNode)||l==d&&a==m;try{o.collapse(c,f),l&&(l!=c||a!=f)&&o.extend&&o.extend(l,a)}catch{}return p!=null&&(o.caretBidiLevel=p),g}):r.pos==r.start()||r.pos==r.end()}let Iu=null,Ru=null,Bu=!1;function Ba(t,e,n){return Iu==e&&Ru==n?Bu:(Iu=e,Ru=n,Bu=n=="up"||n=="down"?Na(t,e,n):Ra(t,e,n))}const oe=0,vu=1,Ke=2,ye=3;class Zt{constructor(e,n,r,u){this.parent=e,this.children=n,this.dom=r,this.contentDOM=u,this.dirty=oe,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let u=this.children[n];if(u==e)return r;r+=u.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let u;if(e==this.dom&&this.contentDOM)u=n>V(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))u=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){u=!1;break}if(i.previousSibling)break}if(u==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){u=!0;break}if(i.nextSibling)break}}return u??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,u=e;u;u=u.parentNode){let i=this.getDesc(u),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let u=e;u;u=u.parentNode){let i=this.getDesc(u);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let u=this.children[n],i=r+u.size;if(r==e&&i!=r){for(;!u.border&&u.children.length;)for(let s=0;s<u.children.length;s++){let o=u.children[s];if(o.size){u=o;break}}return u}if(e<i)return u.descAt(e-r-u.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,u=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],o=i+s.size;if(o>e||s instanceof Ns){u=e-i;break}i=o}if(u)return this.children[r].domFromPos(u-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Fs&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?V(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?V(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let u=-1,i=-1;for(let s=r,o=0;;o++){let l=this.children[o],a=s+l.size;if(u==-1&&e<=a){let c=s+l.border;if(e>=c&&n<=a-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,c);e=s;for(let f=o;f>0;f--){let p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){u=V(p.dom)+1;break}e-=p.size}u==-1&&(u=0)}if(u>-1&&(a>n||o==this.children.length-1)){n=a;for(let c=o+1;c<this.children.length;c++){let f=this.children[c];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){i=V(f.dom);break}n+=f.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=a}return{node:this.contentDOM,from:e,to:n,fromOffset:u,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,u=!1){let i=Math.min(e,n),s=Math.max(e,n);for(let h=0,d=0;h<this.children.length;h++){let m=this.children[h],g=d+m.size;if(i>d&&s<g)return m.setSelection(e-d-m.border,n-d-m.border,r,u);d=g}let o=this.domFromPos(e,e?-1:1),l=n==e?o:this.domFromPos(n,n?-1:1),a=r.root.getSelection(),c=r.domSelectionRange(),f=!1;if((se||U)&&e==n){let{node:h,offset:d}=o;if(h.nodeType==3){if(f=!!(d&&h.nodeValue[d-1]==`
7
+ `),f&&d==h.nodeValue.length)for(let m=h,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(o=l={node:g.parentNode,offset:V(g)+1});break}let b=m.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let m=h.childNodes[d-1];f=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(se&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let h=c.focusNode.childNodes[c.focusOffset];h&&h.contentEditable=="false"&&(u=!0)}if(!(u||f&&U)&&rt(o.node,o.offset,c.anchorNode,c.anchorOffset)&&rt(l.node,l.offset,c.focusNode,c.focusOffset))return;let p=!1;if((a.extend||e==n)&&!(f&&se)){a.collapse(o.node,o.offset);try{e!=n&&a.extend(l.node,l.offset),p=!0}catch{}}if(!p){if(e>n){let d=o;o=l,l=d}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(o.node,o.offset),a.removeAllRanges(),a.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,u=0;u<this.children.length;u++){let i=this.children[u],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let o=r+i.border,l=s-i.border;if(e>=o&&n<=l){this.dirty=e==r||n==s?Ke:vu,e==o&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=ye:i.markDirty(e-o,n-o);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Ke:ye}r=s}this.dirty=Ke}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Ke:vu;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Fs extends Zt{constructor(e,n,r,u){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return u;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let o=document.createElement("span");o.appendChild(s),s=o}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==oe&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class va extends Zt{constructor(e,n,r,u){super(e,[],n,null),this.textDOM=r,this.text=u}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class ut extends Zt{constructor(e,n,r,u,i){super(e,[],r,u),this.mark=n,this.spec=i}static create(e,n,r,u){let i=u.nodeViews[n.type.name],s=i&&i(n,u,r);return(!s||!s.dom)&&(s=yt.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ut(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&ye||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=ye&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=oe){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=oe}}slice(e,n,r){let u=ut.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=Er(i,n,s,r)),e>0&&(i=Er(i,0,e,r));for(let o=0;o<i.length;o++)i[o].parent=u;return u.children=i,u}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class qe extends Zt{constructor(e,n,r,u,i,s,o,l,a){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=u,this.nodeDOM=o}static create(e,n,r,u,i,s){let o=i.nodeViews[n.type.name],l,a=o&&o(n,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,u),c=a&&a.dom,f=a&&a.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=yt.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let p=c;return c=Bs(c,r,n),a?l=new za(e,n,r,u,c,f||null,p,a,i,s+1):n.isText?new Tn(e,n,r,u,c,p,i):new qe(e,n,r,u,c,f||null,p,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>x.empty)}return e}matchesNode(e,n,r){return this.dirty==oe&&e.eq(this.node)&&gn(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,u=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,o=i&&i.pos<0,l=new La(this,s&&s.node,e);$a(this.node,this.innerDeco,(a,c,f)=>{a.spec.marks?l.syncToMarks(a.spec.marks,r,e):a.type.side>=0&&!f&&l.syncToMarks(c==this.node.childCount?T.none:this.node.child(c).marks,r,e),l.placeWidget(a,e,u)},(a,c,f,p)=>{l.syncToMarks(a.marks,r,e);let h;l.findNodeMatch(a,c,f,p)||o&&e.state.selection.from>u&&e.state.selection.to<u+a.nodeSize&&(h=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(a,c,f,h,e)||l.updateNextNode(a,c,f,e,p,u)||l.addNode(a,c,f,e,u),u+=a.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Ke)&&(s&&this.protectLocalComposition(e,s),Is(this.contentDOM,this.children,e),bt&&Wa(this.dom))}localCompositionInfo(e,n){let{from:r,to:u}=e.state.selection;if(!(e.state.selection instanceof F)||r<n||u>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,o=Ha(this.node.content,s,r-n,u-n);return o<0?null:{node:i,pos:o,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:u}){if(this.getDesc(n))return;let i=n;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 va(this,i,n,u);e.input.compositionNodes.push(s),this.children=Er(this.children,r,r+u.length,e,s)}update(e,n,r,u){return this.dirty==ye||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,u),!0)}updateInner(e,n,r,u){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(u,this.posAtStart),this.dirty=oe}updateOuterDeco(e){if(gn(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Rs(this.dom,this.nodeDOM,_r(this.outerDeco,this.node,n),_r(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function zu(t,e,n,r,u){Bs(r,e,t);let i=new qe(void 0,t,e,n,r,r,r,u,0);return i.contentDOM&&i.updateChildren(u,0),i}class Tn extends qe{constructor(e,n,r,u,i,s,o){super(e,n,r,u,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,n,r,u){return this.dirty==ye||this.dirty!=oe&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=oe||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,u.trackWrites==this.nodeDOM&&(u.trackWrites=null)),this.node=e,this.dirty=oe,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let u=this.node.cut(e,n),i=document.createTextNode(u.text);return new Tn(this.parent,u,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=ye)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Ns extends Zt{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==oe&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class za extends qe{constructor(e,n,r,u,i,s,o,l,a,c){super(e,n,r,u,i,s,o,a,c),this.spec=l}update(e,n,r,u){if(this.dirty==ye)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,u),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,u)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,u){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,u)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Is(t,e,n){let r=t.firstChild,u=!1;for(let i=0;i<e.length;i++){let s=e[i],o=s.dom;if(o.parentNode==t){for(;o!=r;)r=Pu(r),u=!0;r=r.nextSibling}else u=!0,t.insertBefore(o,r);if(s instanceof ut){let l=r?r.previousSibling:t.lastChild;Is(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=Pu(r),u=!0;u&&n.trackWrites==t&&(n.trackWrites=null)}const Ft=function(t){t&&(this.nodeName=t)};Ft.prototype=Object.create(null);const Ze=[new Ft];function _r(t,e,n){if(t.length==0)return Ze;let r=n?Ze[0]:new Ft,u=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&u.push(r=new Ft(s.nodeName));for(let o in s){let l=s[o];l!=null&&(n&&u.length==1&&u.push(r=new Ft(e.isInline?"span":"div")),o=="class"?r.class=(r.class?r.class+" ":"")+l:o=="style"?r.style=(r.style?r.style+";":"")+l:o!="nodeName"&&(r[o]=l))}}}return u}function Rs(t,e,n,r){if(n==Ze&&r==Ze)return e;let u=e;for(let i=0;i<r.length;i++){let s=r[i],o=n[i];if(i){let l;o&&o.nodeName==s.nodeName&&u!=t&&(l=u.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(u),o=Ze[0]),u=l}Pa(u,o||Ze[0],s)}return u}function Pa(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],u=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)u.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<u.length;i++)r.indexOf(u[i])==-1&&t.classList.add(u[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,u;for(;u=r.exec(e.style);)t.style.removeProperty(u[1])}n.style&&(t.style.cssText+=n.style)}}function Bs(t,e,n){return Rs(t,t,Ze,_r(e,n,t.nodeType!=1))}function gn(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Pu(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class La{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=qa(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let u=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;u<s&&(u==i-1?this.top:this.stack[u+1<<1]).matchesMark(e[u])&&e[u].type.spec.spanning!==!1;)u++;for(;u<i;)this.destroyRest(),this.top.dirty=oe,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let o=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let a=this.top.children[l];if(a.matchesMark(e[i])&&!this.isLocked(a.dom)){o=l;break}}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let l=ut.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,u){let i=-1,s;if(u>=this.preMatch.index&&(s=this.preMatch.matches[u-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=this.top.children.indexOf(s,this.index);else for(let o=this.index,l=Math.min(this.top.children.length,o+5);o<l;o++){let a=this.top.children[o];if(a.matchesNode(e,n,r)&&!this.preMatch.matched.has(a)){i=o;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,u,i){let s=this.top.children[u];return s.dirty==ye&&s.dom==s.contentDOM&&(s.dirty=Ke),s.update(e,n,r,i)?(this.destroyBetween(this.index,u),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let u=this.index;u<this.top.children.length;u++)if(this.top.children[u]==r)return u}return-1}e=n}}updateNextNode(e,n,r,u,i,s){for(let o=this.index;o<this.top.children.length;o++){let l=this.top.children[o];if(l instanceof qe){let a=this.preMatch.matched.get(l);if(a!=null&&a!=i)return!1;let c=l.dom,f,p=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=ye&&gn(n,l.outerDeco));if(!p&&l.update(e,n,r,u))return this.destroyBetween(this.index,o),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!p&&(f=this.recreateWrapper(l,e,n,r,u,s)))return this.destroyBetween(this.index,o),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Ke,f.updateChildren(u,s+1),f.dirty=oe),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,u,i,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!gn(r,e.outerDeco)||!u.eq(e.innerDeco))return null;let o=qe.create(this.top,n,r,u,i,s);if(o.contentDOM){o.children=e.children,e.children=[];for(let l of o.children)l.parent=o}return e.destroy(),o}addNode(e,n,r,u,i){let s=qe.create(this.top,e,n,r,u,i);s.contentDOM&&s.updateChildren(u,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let u=this.index<this.top.children.length?this.top.children[this.index]:null;if(u&&u.matchesWidget(e)&&(e==u.widget||!u.widget.type.toDOM.parentNode))this.index++;else{let i=new Fs(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof ut;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Tn)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((U||J)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let u=new Ns(this.top,[],r,null);n!=this.top?n.children.push(u):n.children.splice(this.index++,0,u),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function qa(t,e){let n=e,r=n.children.length,u=t.childCount,i=new Map,s=[];e:for(;u>0;){let o;for(;;)if(r){let a=n.children[r-1];if(a instanceof ut)n=a,r=a.children.length;else{o=a,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=o.node;if(l){if(l!=t.child(u-1))break;--u,i.set(o,u),s.push(o)}}return{index:u,matched:i,matches:s.reverse()}}function Va(t,e){return t.type.side-e.type.side}function $a(t,e,n,r){let u=e.locals(t),i=0;if(u.length==0){for(let a=0;a<t.childCount;a++){let c=t.child(a);r(c,u,e.forChild(i,c),a),i+=c.nodeSize}return}let s=0,o=[],l=null;for(let a=0;;){let c,f;for(;s<u.length&&u[s].to==i;){let g=u[s++];g.widget&&(c?(f||(f=[c])).push(g):c=g)}if(c)if(f){f.sort(Va);for(let g=0;g<f.length;g++)n(f[g],a,!!l)}else n(c,a,!!l);let p,h;if(l)h=-1,p=l,l=null;else if(a<t.childCount)h=a,p=t.child(a++);else break;for(let g=0;g<o.length;g++)o[g].to<=i&&o.splice(g--,1);for(;s<u.length&&u[s].from<=i&&u[s].to>i;)o.push(u[s++]);let d=i+p.nodeSize;if(p.isText){let g=d;s<u.length&&u[s].from<g&&(g=u[s].from);for(let b=0;b<o.length;b++)o[b].to<g&&(g=o[b].to);g<d&&(l=p.cut(g-i),p=p.cut(0,g-i),d=g,h=-1)}else for(;s<u.length&&u[s].to<d;)s++;let m=p.isInline&&!p.isLeaf?o.filter(g=>!g.inline):o.slice();r(p,m,e.forChild(i,p),h),i=d}}function Wa(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function Ha(t,e,n,r){for(let u=0,i=0;u<t.childCount&&i<=r;){let s=t.child(u++),o=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;u<t.childCount;){let a=t.child(u++);if(i+=a.nodeSize,!a.isText)break;l+=a.text}if(i>=n){if(i>=r&&l.slice(r-e.length-o,r-o)==e)return r-e.length;let a=o<r?l.lastIndexOf(e,r-o-1):-1;if(a>=0&&a+e.length+o>=n)return o+a;if(n==r&&l.length>=r+e.length-o&&l.slice(r-o,r-o+e.length)==e)return r}}return-1}function Er(t,e,n,r,u){let i=[];for(let s=0,o=0;s<t.length;s++){let l=t[s],a=o,c=o+=l.size;a>=n||c<=e?i.push(l):(a<e&&i.push(l.slice(0,e-a,r)),u&&(i.push(u),u=void 0),c>n&&i.push(l.slice(n-a,l.size,r)))}return i}function jr(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let u=t.docView.nearestDesc(n.focusNode),i=u&&u.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let o=r.resolve(s),l,a;if(wn(n)){for(l=s;u&&!u.node;)u=u.parent;let f=u.node;if(u&&f.isAtom&&A.isSelectable(f)&&u.parent&&!(f.isInline&&ga(n.focusNode,n.focusOffset,u.dom))){let p=u.posBefore;a=new A(s==p?o:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,p=s;for(let h=0;h<n.rangeCount;h++){let d=n.getRangeAt(h);f=Math.min(f,t.docView.posFromDOM(d.startContainer,d.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(d.endContainer,d.endOffset,-1))}if(f<0)return null;[l,s]=p==t.state.selection.anchor?[p,f]:[f,p],o=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let c=r.resolve(l);if(!a){let f=e=="pointer"||t.state.selection.head<o.pos&&!i?1:-1;a=Ur(t,c,o,f)}return a}function vs(t){return t.editable?t.hasFocus():Ps(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Me(t,e=!1){let n=t.state.selection;if(zs(t,n),!!vs(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&J){let r=t.domSelectionRange(),u=t.domObserver.currentSelection;if(r.anchorNode&&u.anchorNode&&rt(r.anchorNode,r.anchorOffset,u.anchorNode,u.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)ja(t);else{let{anchor:r,head:u}=n,i,s;Lu&&!(n instanceof F)&&(n.$from.parent.inlineContent||(i=qu(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=qu(t,n.to))),t.docView.setSelection(r,u,t,e),Lu&&(i&&Vu(i),s&&Vu(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Ja(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Lu=U||J&&Es<63;function qu(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),u=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(U&&u&&u.contentEditable=="false")return Zn(u);if((!u||u.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(u)return Zn(u);if(i)return Zn(i)}}function Zn(t){return t.contentEditable="true",U&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Vu(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Ja(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,u=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=u)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!vs(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function ja(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,V(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Y&&Le<=11&&(n.disabled=!0,n.disabled=!1)}function zs(t,e){if(e instanceof A){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&($u(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else $u(t)}function $u(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Ur(t,e,n,r){return t.someProp("createSelectionBetween",u=>u(t,e,n))||F.between(e,n,r)}function Wu(t){return t.editable&&!t.hasFocus()?!1:Ps(t)}function Ps(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Ua(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return rt(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Sr(t,e){let{$anchor:n,$head:r}=t.selection,u=e>0?n.max(r):n.min(r),i=u.parent.inlineContent?u.depth?t.doc.resolve(e>0?u.after():u.before()):null:u;return i&&O.findFrom(i,e)}function Oe(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Hu(t,e,n){let r=t.state.selection;if(r instanceof F)if(n.indexOf("s")>-1){let{$head:u}=r,i=u.textOffset?null:e<0?u.nodeBefore:u.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(u.pos+i.nodeSize*(e<0?-1:1));return Oe(t,new F(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let u=Sr(t.state,e);return u&&u instanceof A?Oe(t,u):!1}else if(!(ue&&n.indexOf("m")>-1)){let u=r.$head,i=u.textOffset?null:e<0?u.nodeBefore:u.nodeAfter,s;if(!i||i.isText)return!1;let o=e<0?u.pos-i.nodeSize:u.pos;return i.isAtom||(s=t.docView.descAt(o))&&!s.contentDOM?A.isSelectable(i)?Oe(t,new A(e<0?t.state.doc.resolve(u.pos-i.nodeSize):u)):Kt?Oe(t,new F(t.state.doc.resolve(e<0?o:o+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof A&&r.node.isInline)return Oe(t,new F(e>0?r.$to:r.$from));{let u=Sr(t.state,e);return u?Oe(t,u):!1}}}function bn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Nt(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ot(t,e){return e<0?Ka(t):Za(t)}function Ka(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let u,i,s=!1;for(se&&n.nodeType==1&&r<bn(n)&&Nt(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let o=n.childNodes[r-1];if(Nt(o,-1))u=n,i=--r;else if(o.nodeType==3)n=o,r=n.nodeValue.length;else break}}else{if(Ls(n))break;{let o=n.previousSibling;for(;o&&Nt(o,-1);)u=n.parentNode,i=V(o),o=o.previousSibling;if(o)n=o,r=bn(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Ar(t,n,r):u&&Ar(t,u,i)}function Za(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let u=bn(n),i,s;for(;;)if(r<u){if(n.nodeType!=1)break;let o=n.childNodes[r];if(Nt(o,1))i=n,s=++r;else break}else{if(Ls(n))break;{let o=n.nextSibling;for(;o&&Nt(o,1);)i=o.parentNode,s=V(o)+1,o=o.nextSibling;if(o)n=o,r=0,u=bn(n);else{if(n=n.parentNode,n==t.dom)break;r=u=0}}}i&&Ar(t,i,s)}function Ls(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Ga(t,e){for(;t&&e==t.childNodes.length&&!Ut(t);)e=V(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function Ya(t,e){for(;t&&!e&&!Ut(t);)e=V(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Ar(t,e,n){if(e.nodeType!=3){let i,s;(s=Ga(e,n))?(e=s,n=0):(i=Ya(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(wn(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:u}=t;setTimeout(()=>{t.state==u&&Me(t)},50)}function Ju(t,e){let n=t.state.doc.resolve(e);if(!(J||ka)&&n.parent.inlineContent){let u=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>u.top&&s<u.bottom&&Math.abs(i.left-u.left)>1)return i.left<u.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>u.top&&s<u.bottom&&Math.abs(i.left-u.left)>1)return i.left>u.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function ju(t,e,n){let r=t.state.selection;if(r instanceof F&&!r.empty||n.indexOf("s")>-1||ue&&n.indexOf("m")>-1)return!1;let{$from:u,$to:i}=r;if(!u.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Sr(t.state,e);if(s&&s instanceof A)return Oe(t,s)}if(!u.parent.inlineContent){let s=e<0?u:i,o=r instanceof te?O.near(s,e):O.findFrom(s,e);return o?Oe(t,o):!1}return!1}function Uu(t,e){if(!(t.state.selection instanceof F))return!0;let{$head:n,$anchor:r,empty:u}=t.state.selection;if(!n.sameParent(r))return!0;if(!u)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function Ku(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Xa(t){if(!U||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Ku(t,r,"true"),setTimeout(()=>Ku(t,r,"false"),20)}return!1}function Qa(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function ec(t,e){let n=e.keyCode,r=Qa(e);if(n==8||ue&&n==72&&r=="c")return Uu(t,-1)||ot(t,-1);if(n==46&&!e.shiftKey||ue&&n==68&&r=="c")return Uu(t,1)||ot(t,1);if(n==13||n==27)return!0;if(n==37||ue&&n==66&&r=="c"){let u=n==37?Ju(t,t.state.selection.from)=="ltr"?-1:1:-1;return Hu(t,u,r)||ot(t,u)}else if(n==39||ue&&n==70&&r=="c"){let u=n==39?Ju(t,t.state.selection.from)=="ltr"?1:-1:1;return Hu(t,u,r)||ot(t,u)}else{if(n==38||ue&&n==80&&r=="c")return ju(t,-1,r)||ot(t,-1);if(n==40||ue&&n==78&&r=="c")return Xa(t)||ju(t,1,r)||ot(t,1);if(r==(ue?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Kr(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:r,openStart:u,openEnd:i}=e;for(;u>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){u--,i--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=t.someProp("clipboardSerializer")||yt.fromSchema(t.state.schema),o=Js(),l=o.createElement("div");l.appendChild(s.serializeFragment(r,{document:o}));let a=l.firstChild,c,f=0;for(;a&&a.nodeType==1&&(c=Hs[a.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let d=o.createElement(c[h]);for(;l.firstChild;)d.appendChild(l.firstChild);l.appendChild(d),f++}a=l.firstChild}a&&a.nodeType==1&&a.setAttribute("data-pm-slice",`${u} ${i}${f?` -${f}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
8
8
 
9
- `);return{dom:l,text:p,slice:e}}function Ls(t,e,n,r,u){let i=u.parent.type.spec.code,s,o;if(!n&&!e)return null;let l=!!e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",p=>{e=p(e,i||r,t)}),i)return o=new C(x.from(t.state.schema.text(e.replace(/\r\n?/g,`
10
- `))),0,0),t.someProp("transformPasted",p=>{o=p(o,t,!0)}),o;let f=t.someProp("clipboardTextParser",p=>p(e,u,r,t));if(f)o=f;else{let p=u.marks(),{schema:h}=t.state,d=xt.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(d.serializeNode(h.text(m,p)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=tc(n),Kt&&nc(s);let a=s&&s.querySelector("[data-pm-slice]"),c=a&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(a.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let p=s.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;s=p}if(o||(o=(t.someProp("clipboardParser")||t.someProp("domParser")||Bt.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||c),context:u,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!Xa.test(p.parentNode.nodeName)?{ignore:!0}:null}})),c)o=rc(Ku(o,+c[1],+c[2]),c[4]);else if(o=C.maxOpen(Qa(o.content,u),!0),o.openStart||o.openEnd){let f=0,p=0;for(let h=o.content.firstChild;f<o.openStart&&!h.type.spec.isolating;f++,h=h.firstChild);for(let h=o.content.lastChild;p<o.openEnd&&!h.type.spec.isolating;p++,h=h.lastChild);o=Ku(o,f,p)}return t.someProp("transformPasted",f=>{o=f(o,t,l)}),o}const Xa=/^(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 Qa(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let u=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(o=>{if(!s)return;let l=u.findWrapping(o.type),a;if(!l)return s=null;if(a=s.length&&i.length&&Vs(l,i,o,s[s.length-1],0))s[s.length-1]=a;else{s.length&&(s[s.length-1]=$s(s[s.length-1],i.length));let c=qs(o,l);s.push(c),u=u.matchType(c.type),i=l}}),s)return x.from(s)}return t}function qs(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,x.from(t));return t}function Vs(t,e,n,r,u){if(u<t.length&&u<e.length&&t[u]==e[u]){let i=Vs(t,e,n,r.lastChild,u+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(u==t.length-1?n.type:t[u+1]))return r.copy(r.content.append(x.from(qs(n,t,u+1))))}}function $s(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,$s(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(x.empty,!0);return t.copy(n.append(r))}function Mr(t,e,n,r,u,i){let s=e<0?t.firstChild:t.lastChild,o=s.content;return t.childCount>1&&(i=0),u<r-1&&(o=Mr(o,e,n,r,u+1,i)),u>=n&&(o=e<0?s.contentMatchAt(0).fillBefore(o,i<=u).append(o):o.append(s.contentMatchAt(s.childCount).fillBefore(x.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(o))}function Ku(t,e,n){return e<t.openStart&&(t=new C(Mr(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new C(Mr(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Ws={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 Zu=null;function Hs(){return Zu||(Zu=document.implementation.createHTMLDocument("title"))}let Gn=null;function ec(t){let e=window.trustedTypes;return e?(Gn||(Gn=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Gn.createHTML(t)):t}function tc(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Hs().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),u;if((u=r&&Ws[r[1].toLowerCase()])&&(t=u.map(i=>"<"+i+">").join("")+t+u.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=ec(t),u)for(let i=0;i<u.length;i++)n=n.querySelector(u[i])||n;return n}function nc(t){let e=t.querySelectorAll(J?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function rc(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:u,openStart:i,openEnd:s}=t;for(let o=r.length-2;o>=0;o-=2){let l=n.nodes[r[o]];if(!l||l.hasRequiredAttrs())break;u=x.from(l.create(r[o+1],u)),i++,s++}return new C(u,i,s)}const K={},Z={},uc={touchstart:!0,touchmove:!0};class ic{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function sc(t){for(let e in K){let n=K[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{lc(t,r)&&!Kr(t,r)&&(t.editable||!(r.type in Z))&&n(t,r)},uc[e]?{passive:!0}:void 0)}U&&t.dom.addEventListener("input",()=>null),wr(t)}function ze(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function oc(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function wr(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Kr(t,r))})}function Kr(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function lc(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function ac(t,e){!Kr(t,e)&&K[e.type]&&(t.editable||!(e.type in Z))&&K[e.type](t,e)}Z.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!js(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Ae&&J&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),mt&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",u=>u(t,Je(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||Ya(t,n)?n.preventDefault():ze(t,"key")};Z.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Z.keypress=(t,e)=>{let n=e;if(js(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||ne&&n.metaKey)return;if(t.someProp("handleKeyPress",u=>u(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof N)||!r.$from.sameParent(r.$to)){let u=String.fromCharCode(n.charCode),i=()=>t.state.tr.insertText(u).scrollIntoView();!/[\r\n]/.test(u)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,u,i))&&t.dispatch(i()),n.preventDefault()}};function Fn(t){return{left:t.clientX,top:t.clientY}}function cc(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Zr(t,e,n,r,u){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,o=>s>i.depth?o(t,n,i.nodeAfter,i.before(s),u,!0):o(t,n,i.node(s),i.before(s),u,!1)))return!0;return!1}function ct(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function fc(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&M.isSelectable(r)?(ct(t,new M(n)),!0):!1}function dc(t,e){if(e==-1)return!1;let n=t.state.selection,r,u;n instanceof M&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s);if(M.isSelectable(o)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?u=i.before(n.$from.depth):u=i.before(s);break}}return u!=null?(ct(t,M.create(t.state.doc,u)),!0):!1}function hc(t,e,n,r,u){return Zr(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(u?dc(t,n):fc(t,n))}function pc(t,e,n,r){return Zr(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",u=>u(t,e,r))}function mc(t,e,n,r){return Zr(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",u=>u(t,e,r))||gc(t,n,r)}function gc(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ct(t,N.create(r,0,r.content.size)),!0):!1;let u=r.resolve(e);for(let i=u.depth+1;i>0;i--){let s=i>u.depth?u.nodeAfter:u.node(i),o=u.before(i);if(s.inlineContent)ct(t,N.create(r,o+1,o+1+s.content.size));else if(M.isSelectable(s))ct(t,M.create(r,o));else continue;return!0}}function Gr(t){return kn(t)}const Js=ne?"metaKey":"ctrlKey";K.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Gr(t),u=Date.now(),i="singleClick";u-t.input.lastClick.time<500&&cc(n,t.input.lastClick)&&!n[Js]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:u,x:n.clientX,y:n.clientY,type:i,button:n.button};let s=t.posAtCoords(Fn(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new bc(t,s,n,!!r)):(i=="doubleClick"?pc:mc)(t,s.pos,s.inside,n)?n.preventDefault():ze(t,"pointer"))};class bc{constructor(e,n,r,u){this.view=e,this.pos=n,this.event=r,this.flushed=u,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Js],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let c=e.state.doc.resolve(n.pos);i=c.parent,s=c.depth?c.before():0}const o=u?null:r.target,l=o?e.docView.nearestDesc(o,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:a}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||a instanceof M&&a.from<=s&&a.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ue&&!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)),ze(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(()=>Me(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Fn(e))),this.updateAllowDefault(e),this.allowDefault||!n?ze(this.view,"pointer"):hc(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||U&&this.mightDrag&&!this.mightDrag.node.isAtom||J&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(ct(this.view,F.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):ze(this.view,"pointer")}move(e){this.updateAllowDefault(e),ze(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}K.touchstart=t=>{t.input.lastTouch=Date.now(),Gr(t),ze(t,"pointer")};K.touchmove=t=>{t.input.lastTouch=Date.now(),ze(t,"pointer")};K.contextmenu=t=>Gr(t);function js(t,e){return t.composing?!0:U&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const xc=Ae?5e3:-1;Z.compositionstart=Z.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof N&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),kn(t,!0),t.markCursor=null;else if(kn(t,!e.selection.empty),ue&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let u=r.focusNode,i=r.focusOffset;u&&u.nodeType==1&&i!=0;){let s=i<0?u.lastChild:u.childNodes[i-1];if(!s)break;if(s.nodeType==3){let o=t.domSelection();o&&o.collapse(s,s.nodeValue.length);break}else u=s,i=-1}}t.input.composing=!0}Us(t,xc)};Z.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Us(t,20))};function Us(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>kn(t),e))}function Ks(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=yc());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function kc(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=fa(e.focusNode,e.focusOffset),r=da(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let u=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!u||!u.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function yc(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function kn(t,e=!1){if(!(Ae&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Ks(t),e||t.docView&&t.docView.dirty){let n=Jr(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function Cc(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),u=document.createRange();u.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(u),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Lt=Y&&Le<15||mt&&ba<604;K.copy=Z.cut=(t,e)=>{let n=e,r=t.state.selection,u=n.type=="cut";if(r.empty)return;let i=Lt?null:n.clipboardData,s=r.content(),{dom:o,text:l}=Ur(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",o.innerHTML),i.setData("text/plain",l)):Cc(t,o),u&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Dc(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function _c(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let u=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?qt(t,r.value,null,u,e):qt(t,r.textContent,r.innerHTML,u,e)},50)}function qt(t,e,n,r,u){let i=Ls(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,u,i||C.empty)))return!0;if(!i)return!1;let s=Dc(i),o=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Zs(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Z.paste=(t,e)=>{let n=e;if(t.composing&&!Ae)return;let r=Lt?null:n.clipboardData,u=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&qt(t,Zs(r),r.getData("text/html"),u,n)?n.preventDefault():_c(t,n)};class Gs{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Ec=ne?"altKey":"ctrlKey";function Ys(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[Ec]}K.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let u=t.state.selection,i=u.empty?null:t.posAtCoords(Fn(n)),s;if(!(i&&i.pos>=u.from&&i.pos<=(u instanceof M?u.to-1:u.to))){if(r&&r.mightDrag)s=M.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=M.create(t.state.doc,f.posBefore))}}let o=(s||t.state.selection).content(),{dom:l,text:a,slice:c}=Ur(t,o);(!n.dataTransfer.files.length||!J||_s>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Lt?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Lt||n.dataTransfer.setData("text/plain",a),t.dragging=new Gs(c,Ys(t,n),s)};K.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Z.dragover=Z.dragenter=(t,e)=>e.preventDefault();Z.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let u=t.posAtCoords(Fn(n));if(!u)return;let i=t.state.doc.resolve(u.pos),s=r&&r.slice;s?t.someProp("transformPasted",d=>{s=d(s,t,!1)}):s=Ls(t,Zs(n.dataTransfer),Lt?null:n.dataTransfer.getData("text/html"),!1,i);let o=!!(r&&Ys(t,n));if(t.someProp("handleDrop",d=>d(t,n,s||C.empty,o))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?Cl(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let a=t.state.tr;if(o){let{node:d}=r;d?d.replace(a):a.deleteSelection()}let c=a.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=a.doc;if(f?a.replaceRangeWith(c,c,s.content.firstChild):a.replaceRange(c,c,s),a.doc.eq(p))return;let h=a.doc.resolve(c);if(f&&M.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))a.setSelection(new M(h));else{let d=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((m,g,b,k)=>d=k),a.setSelection(jr(t,h,a.doc.resolve(d)))}t.focus(),t.dispatch(a.setMeta("uiEvent","drop"))};K.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Me(t)},20))};K.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};K.beforeinput=(t,e)=>{if(J&&Ae&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,Je(8,"Backspace")))))return;let{$cursor:u}=t.state.selection;u&&u.pos>0&&t.dispatch(t.state.tr.delete(u.pos-1,u.pos).scrollIntoView())},50)}};for(let t in Z)K[t]=Z[t];function Vt(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class yn{constructor(e,n){this.toDOM=e,this.spec=n||Ye,this.side=this.spec.side||0}map(e,n,r,u){let{pos:i,deleted:s}=e.mapResult(n.from+u,this.side<0?-1:1);return s?null:new ce(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof yn&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Vt(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ve{constructor(e,n){this.attrs=e,this.spec=n||Ye}map(e,n,r,u){let i=e.map(n.from+u,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+u,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new ce(i,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Ve&&Vt(this.attrs,e.attrs)&&Vt(this.spec,e.spec)}static is(e){return e.type instanceof Ve}destroy(){}}class Yr{constructor(e,n){this.attrs=e,this.spec=n||Ye}map(e,n,r,u){let i=e.mapResult(n.from+u,1);if(i.deleted)return null;let s=e.mapResult(n.to+u,-1);return s.deleted||s.pos<=i.pos?null:new ce(i.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:u}=e.content.findIndex(n.from),i;return u==n.from&&!(i=e.child(r)).isText&&u+i.nodeSize==n.to}eq(e){return this==e||e instanceof Yr&&Vt(this.attrs,e.attrs)&&Vt(this.spec,e.spec)}destroy(){}}class ce{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new ce(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new ce(e,e,new yn(n,r))}static inline(e,n,r,u){return new ce(e,n,new Ve(r,u))}static node(e,n,r,u){return new ce(e,n,new Yr(r,u))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ve}get widget(){return this.type instanceof yn}}const lt=[],Ye={};class z{constructor(e,n){this.local=e.length?e:lt,this.children=n.length?n:lt}static create(e,n){return n.length?Cn(n,e,0,Ye):W}find(e,n,r){let u=[];return this.findInner(e??0,n??1e9,u,0,r),u}findInner(e,n,r,u,i){for(let s=0;s<this.local.length;s++){let o=this.local[s];o.from<=n&&o.to>=e&&(!i||i(o.spec))&&r.push(o.copy(o.from+u,o.to+u))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let o=this.children[s]+1;this.children[s+2].findInner(e-o,n-o,r,u+o,i)}}map(e,n,r){return this==W||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Ye)}mapInner(e,n,r,u,i){let s;for(let o=0;o<this.local.length;o++){let l=this.local[o].map(e,r,u);l&&l.type.valid(n,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[o].spec)}return this.children.length?Sc(this.children,s||[],e,n,r,u,i):s?new z(s.sort(Xe),lt):W}add(e,n){return n.length?this==W?z.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let u,i=0;e.forEach((o,l)=>{let a=l+r,c;if(c=Qs(n,o,a)){for(u||(u=this.children.slice());i<u.length&&u[i]<l;)i+=3;u[i]==l?u[i+2]=u[i+2].addInner(o,c,a+1):u.splice(i,0,l,l+o.nodeSize,Cn(c,o,a+1,Ye)),i+=3}});let s=Xs(i?eo(n):n,-r);for(let o=0;o<s.length;o++)s[o].type.valid(e,s[o])||s.splice(o--,1);return new z(s.length?this.local.concat(s).sort(Xe):this.local,u||this.children)}remove(e){return e.length==0||this==W?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,u=this.local;for(let i=0;i<r.length;i+=3){let s,o=r[i]+n,l=r[i+1]+n;for(let c=0,f;c<e.length;c++)(f=e[c])&&f.from>o&&f.to<l&&(e[c]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let a=r[i+2].removeInner(s,o+1);a!=W?r[i+2]=a:(r.splice(i,3),i-=3)}if(u.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let o=0;o<u.length;o++)u[o].eq(s,n)&&(u==this.local&&(u=this.local.slice()),u.splice(o--,1))}return r==this.children&&u==this.local?this:u.length||r.length?new z(u,r):W}forChild(e,n){if(this==W)return this;if(n.isLeaf)return z.empty;let r,u;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=e){this.children[o]==e&&(r=this.children[o+2]);break}let i=e+1,s=i+n.content.size;for(let o=0;o<this.local.length;o++){let l=this.local[o];if(l.from<s&&l.to>i&&l.type instanceof Ve){let a=Math.max(i,l.from)-i,c=Math.min(s,l.to)-i;a<c&&(u||(u=[])).push(l.copy(a,c))}}if(u){let o=new z(u.sort(Xe),lt);return r?new Ie([o,r]):o}return r||W}eq(e){if(this==e)return!0;if(!(e instanceof z)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Xr(this.localsInner(e))}localsInner(e){if(this==W)return lt;if(e.inlineContent||!this.local.some(Ve.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Ve||n.push(this.local[r]);return n}forEachSet(e){e(this)}}z.empty=new z([],[]);z.removeOverlap=Xr;const W=z.empty;class Ie{constructor(e){this.members=e}map(e,n){const r=this.members.map(u=>u.map(e,n,Ye));return Ie.from(r)}forChild(e,n){if(n.isLeaf)return z.empty;let r=[];for(let u=0;u<this.members.length;u++){let i=this.members[u].forChild(e,n);i!=W&&(i instanceof Ie?r=r.concat(i.members):r.push(i))}return Ie.from(r)}eq(e){if(!(e instanceof Ie)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let u=0;u<this.members.length;u++){let i=this.members[u].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?Xr(r?n:n.sort(Xe)):lt}static from(e){switch(e.length){case 0:return W;case 1:return e[0];default:return new Ie(e.every(n=>n instanceof z)?e:e.reduce((n,r)=>n.concat(r instanceof z?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function Sc(t,e,n,r,u,i,s){let o=t.slice();for(let a=0,c=i;a<n.maps.length;a++){let f=0;n.maps[a].forEach((p,h,d,m)=>{let g=m-d-(h-p);for(let b=0;b<o.length;b+=3){let k=o[b+1];if(k<0||p>k+c-f)continue;let y=o[b]+c-f;h>=y?o[b+1]=p<=y?-2:-1:p>=c&&g&&(o[b]+=g,o[b+1]+=g)}f+=g}),c=n.maps[a].map(c,-1)}let l=!1;for(let a=0;a<o.length;a+=3)if(o[a+1]<0){if(o[a+1]==-2){l=!0,o[a+1]=-1;continue}let c=n.map(t[a]+i),f=c-u;if(f<0||f>=r.content.size){l=!0;continue}let p=n.map(t[a+1]+i,-1),h=p-u,{index:d,offset:m}=r.content.findIndex(f),g=r.maybeChild(d);if(g&&m==f&&m+g.nodeSize==h){let b=o[a+2].mapInner(n,g,c+1,t[a]+i+1,s);b!=W?(o[a]=f,o[a+1]=h,o[a+2]=b):(o[a+1]=-2,l=!0)}else l=!0}if(l){let a=Ac(o,t,e,n,u,i,s),c=Cn(a,r,0,s);e=c.local;for(let f=0;f<o.length;f+=3)o[f+1]<0&&(o.splice(f,3),f-=3);for(let f=0,p=0;f<c.children.length;f+=3){let h=c.children[f];for(;p<o.length&&o[p]<h;)p+=3;o.splice(p,0,c.children[f],c.children[f+1],c.children[f+2])}}return new z(e.sort(Xe),o)}function Xs(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let u=t[r];n.push(new ce(u.from+e,u.to+e,u.type))}return n}function Ac(t,e,n,r,u,i,s){function o(l,a){for(let c=0;c<l.local.length;c++){let f=l.local[c].map(r,u,a);f?n.push(f):s.onRemove&&s.onRemove(l.local[c].spec)}for(let c=0;c<l.children.length;c+=3)o(l.children[c+2],l.children[c]+a+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&o(t[l+2],e[l]+i+1);return n}function Qs(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,u=null;for(let i=0,s;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((u||(u=[])).push(s),t[i]=null);return u}function eo(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Cn(t,e,n,r){let u=[],i=!1;e.forEach((o,l)=>{let a=Qs(t,o,l+n);if(a){i=!0;let c=Cn(a,o,n+l+1,r);c!=W&&u.push(l,l+o.nodeSize,c)}});let s=Xs(i?eo(t):t,-n).sort(Xe);for(let o=0;o<s.length;o++)s[o].type.valid(e,s[o])||(r.onRemove&&r.onRemove(s[o].spec),s.splice(o--,1));return s.length||u.length?new z(s,u):W}function Xe(t,e){return t.from-e.from||t.to-e.to}function Xr(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let u=n+1;u<e.length;u++){let i=e[u];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[u]=i.copy(i.from,r.to),Gu(e,u+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),Gu(e,u,r.copy(i.from,r.to)));break}}}return e}function Gu(t,e,n){for(;e<t.length&&Xe(n,t[e])>0;)e++;t.splice(e,0,n)}function Yn(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=W&&e.push(r)}),t.cursorWrapper&&e.push(z.create(t.state.doc,[t.cursorWrapper.deco])),Ie.from(e)}const Mc={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},wc=Y&&Le<=11;class Tc{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 Oc{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Tc,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let u=0;u<r.length;u++)this.queue.push(r[u]);Y&&Le<=11&&r.some(u=>u.type=="childList"&&u.removedNodes.length||u.type=="characterData"&&u.oldValue.length>u.target.nodeValue.length)?this.flushSoon():this.flush()}),wc&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Mc)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if($u(this.view)){if(this.suppressingSelectionUpdates)return Me(this.view);if(Y&&Le<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&nt(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=pt(i))n.add(i);for(let i=e.anchorNode;i;i=pt(i))if(n.has(i)){r=i;break}let u=r&&this.view.docView.nearestDesc(r);if(u&&u.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),u=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&$u(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,o=!1,l=[];if(e.editable)for(let c=0;c<n.length;c++){let f=this.registerMutation(n[c],l);f&&(i=i<0?f.from:Math.min(f.from,i),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(o=!0))}if(ue&&l.length){let c=l.filter(f=>f.nodeName=="BR");if(c.length==2){let[f,p]=c;f.parentNode&&f.parentNode.parentNode==p.parentNode?p.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let p of c){let h=p.parentNode;h&&h.nodeName=="LI"&&(!f||Ic(e,f)!=h)&&p.remove()}}}let a=null;i<0&&u&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Tn(r)&&(a=Jr(e))&&a.eq(F.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Me(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||u)&&(i>-1&&(e.docView.markDirty(i,s),Fc(e)),this.handleDOMChange(i,s,o,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Me(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;c<e.addedNodes.length;c++){let f=e.addedNodes[c];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let u=e.previousSibling,i=e.nextSibling;if(Y&&Le<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:f,nextSibling:p}=e.addedNodes[c];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(u=f),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(i=p)}let s=u&&u.parentNode==e.target?V(u)+1:0,o=r.localPosFromDOM(e.target,s,-1),l=i&&i.parentNode==e.target?V(i):e.target.childNodes.length,a=r.localPosFromDOM(e.target,l,1);return{from:o,to:a}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Yu=new WeakMap,Xu=!1;function Fc(t){if(!Yu.has(t)&&(Yu.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=ue,Xu)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Xu=!0}}function Qu(t,e){let n=e.startContainer,r=e.startOffset,u=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return nt(s.node,s.offset,u,i)&&([n,r,u,i]=[u,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:u,focusOffset:i}}function Nc(t,e){if(e.getComposedRanges){let u=e.getComposedRanges(t.root)[0];if(u)return Qu(t,u)}let n;function r(u){u.preventDefault(),u.stopImmediatePropagation(),n=u.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Qu(t,n):null}function Ic(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function Rc(t,e,n){let{node:r,fromOffset:u,toOffset:i,from:s,to:o}=t.docView.parseRange(e,n),l=t.domSelectionRange(),a,c=l.anchorNode;if(c&&t.dom.contains(c.nodeType==1?c:c.parentNode)&&(a=[{node:c,offset:l.anchorOffset}],Tn(l)||a.push({node:l.focusNode,offset:l.focusOffset})),J&&t.input.lastKeyCode===8)for(let g=i;g>u;g--){let b=r.childNodes[g-1],k=b.pmViewDesc;if(b.nodeName=="BR"&&!k){i=g;break}if(!k||k.size)break}let f=t.state.doc,p=t.someProp("domParser")||Bt.fromSchema(t.state.schema),h=f.resolve(s),d=null,m=p.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:u,to:i,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:a,ruleFromNode:Bc,context:h});if(a&&a[0].pos!=null){let g=a[0].pos,b=a[1]&&a[1].pos;b==null&&(b=g),d={anchor:g+s,head:b+s}}return{doc:m,sel:d,from:s,to:o}}function Bc(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(U&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||U&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const vc=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function zc(t,e,n,r,u){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let D=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,T=Jr(t,D);if(T&&!t.state.selection.eq(T)){if(J&&Ae&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",oe=>oe(t,Je(13,"Enter"))))return;let O=t.state.tr.setSelection(T);D=="pointer"?O.setMeta("pointer",!0):D=="key"&&O.scrollIntoView(),i&&O.setMeta("composition",i),t.dispatch(O)}return}let s=t.state.doc.resolve(e),o=s.sharedDepth(n);e=s.before(o+1),n=t.state.doc.resolve(n).after(o+1);let l=t.state.selection,a=Rc(t,e,n),c=t.state.doc,f=c.slice(a.from,a.to),p,h;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,h="end"):(p=t.state.selection.from,h="start"),t.input.lastKeyCode=null;let d=qc(f.content,a.doc.content,a.from,p,h);if(d&&t.input.domChangeCount++,(mt&&t.input.lastIOSEnter>Date.now()-225||Ae)&&u.some(D=>D.nodeType==1&&!vc.test(D.nodeName))&&(!d||d.endA>=d.endB)&&t.someProp("handleKeyDown",D=>D(t,Je(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!d)if(r&&l instanceof N&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(a.sel&&a.sel.anchor!=a.sel.head))d={start:l.from,endA:l.to,endB:l.to};else{if(a.sel){let D=ei(t,t.state.doc,a.sel);if(D&&!D.eq(t.state.selection)){let T=t.state.tr.setSelection(D);i&&T.setMeta("composition",i),t.dispatch(T)}}return}t.state.selection.from<t.state.selection.to&&d.start==d.endB&&t.state.selection instanceof N&&(d.start>t.state.selection.from&&d.start<=t.state.selection.from+2&&t.state.selection.from>=a.from?d.start=t.state.selection.from:d.endA<t.state.selection.to&&d.endA>=t.state.selection.to-2&&t.state.selection.to<=a.to&&(d.endB+=t.state.selection.to-d.endA,d.endA=t.state.selection.to)),Y&&Le<=11&&d.endB==d.start+1&&d.endA==d.start&&d.start>a.from&&a.doc.textBetween(d.start-a.from-1,d.start-a.from+1)=="  "&&(d.start--,d.endA--,d.endB--);let m=a.doc.resolveNoCache(d.start-a.from),g=a.doc.resolveNoCache(d.endB-a.from),b=c.resolve(d.start),k=m.sameParent(g)&&m.parent.inlineContent&&b.end()>=d.endA;if((mt&&t.input.lastIOSEnter>Date.now()-225&&(!k||u.some(D=>D.nodeName=="DIV"||D.nodeName=="P"))||!k&&m.pos<a.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(a.doc.textBetween(m.pos,g.pos,"","")))&&t.someProp("handleKeyDown",D=>D(t,Je(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>d.start&&Lc(c,d.start,d.endA,m,g)&&t.someProp("handleKeyDown",D=>D(t,Je(8,"Backspace")))){Ae&&J&&t.domObserver.suppressSelectionUpdates();return}J&&d.endB==d.start&&(t.input.lastChromeDelete=Date.now()),Ae&&!k&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&a.sel&&a.sel.anchor==a.sel.head&&a.sel.head==d.endA&&(d.endB-=2,g=a.doc.resolveNoCache(d.endB-a.from),setTimeout(()=>{t.someProp("handleKeyDown",function(D){return D(t,Je(13,"Enter"))})},20));let y=d.start,_=d.endA,S=D=>{let T=D||t.state.tr.replace(y,_,a.doc.slice(d.start-a.from,d.endB-a.from));if(a.sel){let O=ei(t,T.doc,a.sel);O&&!(J&&t.composing&&O.empty&&(d.start!=d.endB||t.input.lastChromeDelete<Date.now()-100)&&(O.head==y||O.head==T.mapping.map(_)-1)||Y&&O.empty&&O.head==y)&&T.setSelection(O)}return i&&T.setMeta("composition",i),T.scrollIntoView()},E;if(k)if(m.pos==g.pos){Y&&Le<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Me(t),20));let D=S(t.state.tr.delete(y,_)),T=c.resolve(d.start).marksAcross(c.resolve(d.endA));T&&D.ensureMarks(T),t.dispatch(D)}else if(d.endA==d.endB&&(E=Pc(m.parent.content.cut(m.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,d.endA-b.start())))){let D=S(t.state.tr);E.type=="add"?D.addMark(y,_,E.mark):D.removeMark(y,_,E.mark),t.dispatch(D)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let D=m.parent.textBetween(m.parentOffset,g.parentOffset),T=()=>S(t.state.tr.insertText(D,y,_));t.someProp("handleTextInput",O=>O(t,y,_,D,T))||t.dispatch(T())}else t.dispatch(S());else t.dispatch(S())}function ei(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:jr(t,e.resolve(n.anchor),e.resolve(n.head))}function Pc(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,u=n,i=r,s,o,l;for(let c=0;c<r.length;c++)u=r[c].removeFromSet(u);for(let c=0;c<n.length;c++)i=n[c].removeFromSet(i);if(u.length==1&&i.length==0)o=u[0],s="add",l=c=>c.mark(o.addToSet(c.marks));else if(u.length==0&&i.length==1)o=i[0],s="remove",l=c=>c.mark(o.removeFromSet(c.marks));else return null;let a=[];for(let c=0;c<e.childCount;c++)a.push(l(e.child(c)));if(x.from(a).eq(t))return{mark:o,type:s}}function Lc(t,e,n,r,u){if(n-e<=u.pos-r.pos||Xn(r,!0,!1)<u.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let o=i.nodeAfter;return o!=null&&n==e+o.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(Xn(i,!0,!0));return!s.parent.isTextblock||s.pos>n||Xn(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Xn(t,e,n){let r=t.depth,u=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,u++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,u++}return u}function qc(t,e,n,r,u){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:o}=t.findDiffEnd(e,n+t.size,n+e.size);if(u=="end"){let l=Math.max(0,i-Math.min(s,o));r-=s+l-i}if(s<i&&t.size<e.size){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<e.size&&ti(e.textBetween(i-1,i+1))&&(i+=l?1:-1),o=i+(o-s),s=i}else if(o<i){let l=r<=i&&r>=o?i-r:0;i-=l,i&&i<t.size&&ti(t.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-o),o=i}return{start:i,endA:s,endB:o}}function ti(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class to{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ic,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(si),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=ui(this),ri(this),this.nodeViews=ii(this),this.docView=vu(this.state.doc,ni(this),Yn(this),this.dom,this),this.domObserver=new Oc(this,(r,u,i,s)=>zc(this,r,u,i,s)),this.domObserver.start(),sc(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&wr(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(si),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let u=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(Ks(this),s=!0),this.state=e;let o=u.plugins!=e.plugins||this._props.plugins!=n.plugins;if(o||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=ii(this);$c(h,this.nodeViews)&&(this.nodeViews=h,i=!0)}(o||n.handleDOMEvents!=this._props.handleDOMEvents)&&wr(this),this.editable=ui(this),ri(this);let l=Yn(this),a=ni(this),c=u.plugins!=e.plugins&&!u.doc.eq(e.doc)?"reset":e.scrollToSelection>u.scrollToSelection?"to selection":"preserve",f=i||!this.docView.matchesNode(e.doc,a,l);(f||!e.selection.eq(u.selection))&&(s=!0);let p=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&ya(this);if(s){this.domObserver.stop();let h=f&&(Y||J)&&!this.composing&&!u.selection.empty&&!e.selection.empty&&Vc(u.selection,e.selection);if(f){let d=J?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=kc(this)),(i||!this.docView.update(e.doc,a,l,this))&&(this.docView.updateOuterDeco(a),this.docView.destroy(),this.docView=vu(e.doc,a,l,this.dom,this)),d&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Ha(this))?Me(this,h):(vs(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(u),!((r=this.dragging)===null||r===void 0)&&r.node&&!u.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,u),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():p&&Ca(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof M){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Ou(this,n.getBoundingClientRect(),e)}else Ou(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,u=-1;if(this.state.doc.nodeAt(r.from)==r.node)u=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(u=i)}this.dragging=new Gs(e.slice,e.move,u<0?void 0:M.create(this.state.doc,u))}someProp(e,n){let r=this._props&&this._props[e],u;if(r!=null&&(u=n?n(r):r))return u;for(let s=0;s<this.directPlugins.length;s++){let o=this.directPlugins[s].props[e];if(o!=null&&(u=n?n(o):o))return u}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let o=i[s].props[e];if(o!=null&&(u=n?n(o):o))return u}}hasFocus(){if(Y){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Da(this.dom),Me(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Ma(this,e)}coordsAtPos(e,n=1){return ws(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let u=this.docView.posFromDOM(e,n,r);if(u==null)throw new RangeError("DOM position not inside the editor");return u}endOfTextblock(e,n){return Na(this,n||this.state,e)}pasteHTML(e,n){return qt(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return qt(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Ur(this,e)}destroy(){this.docView&&(oc(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Yn(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,aa())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return ac(this,e)}domSelectionRange(){let e=this.domSelection();return e?U&&this.root.nodeType===11&&pa(this.dom.ownerDocument)==this.dom&&Nc(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}to.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function ni(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[ce.node(0,t.state.doc.content.size,e)]}function ri(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:ce.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function ui(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Vc(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function ii(t){let e=Object.create(null);function n(r){for(let u in r)Object.prototype.hasOwnProperty.call(e,u)||(e[u]=r[u])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function $c(t,e){let n=0,r=0;for(let u in t){if(t[u]!=e[u])return!0;n++}for(let u in e)r++;return n!=r}function si(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}const Wc=["p",0],Hc=["blockquote",0],Jc=["hr"],jc=["pre",["code",0]],Uc=["br"],Kc={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return Wc}},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM(){return Hc}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return Jc}},heading:{attrs:{level:{default:1,validate:"number"}},content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM(){return jc}},text:{group:"inline"},image:{inline:!0,attrs:{src:{validate:"string"},alt:{default:null,validate:"string|null"},title:{default:null,validate:"string|null"}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){let{src:e,alt:n,title:r}=t.attrs;return["img",{src:e,alt:n,title:r}]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return Uc}}},Zc=["em",0],Gc=["strong",0],Yc=["code",0],Xc={link:{attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){let{href:e,title:n}=t.attrs;return["a",{href:e,title:n},0]}},em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return Zc}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return Gc}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return Yc}}},Qc=new Br({nodes:Kc,marks:Xc}),oi={};function e0(t){let e=oi[t];if(e)return e;e=oi[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return e}function gt(t,e){typeof e!="string"&&(e=gt.defaultChars);const n=e0(e);return t.replace(/(%[a-f0-9]{2})+/gi,function(r){let u="";for(let i=0,s=r.length;i<s;i+=3){const o=parseInt(r.slice(i+1,i+3),16);if(o<128){u+=n[o];continue}if((o&224)===192&&i+3<s){const l=parseInt(r.slice(i+4,i+6),16);if((l&192)===128){const a=o<<6&1984|l&63;a<128?u+="��":u+=String.fromCharCode(a),i+=3;continue}}if((o&240)===224&&i+6<s){const l=parseInt(r.slice(i+4,i+6),16),a=parseInt(r.slice(i+7,i+9),16);if((l&192)===128&&(a&192)===128){const c=o<<12&61440|l<<6&4032|a&63;c<2048||c>=55296&&c<=57343?u+="���":u+=String.fromCharCode(c),i+=6;continue}}if((o&248)===240&&i+9<s){const l=parseInt(r.slice(i+4,i+6),16),a=parseInt(r.slice(i+7,i+9),16),c=parseInt(r.slice(i+10,i+12),16);if((l&192)===128&&(a&192)===128&&(c&192)===128){let f=o<<18&1835008|l<<12&258048|a<<6&4032|c&63;f<65536||f>1114111?u+="����":(f-=65536,u+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),i+=9;continue}}u+="�"}return u})}gt.defaultChars=";/?:@&=+$,#";gt.componentChars="";const li={};function t0(t){let e=li[t];if(e)return e;e=li[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)e[t.charCodeAt(n)]=t[n];return e}function Gt(t,e,n){typeof e!="string"&&(n=e,e=Gt.defaultChars),typeof n>"u"&&(n=!0);const r=t0(e);let u="";for(let i=0,s=t.length;i<s;i++){const o=t.charCodeAt(i);if(n&&o===37&&i+2<s&&/^[0-9a-f]{2}$/i.test(t.slice(i+1,i+3))){u+=t.slice(i,i+3),i+=2;continue}if(o<128){u+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&i+1<s){const l=t.charCodeAt(i+1);if(l>=56320&&l<=57343){u+=encodeURIComponent(t[i]+t[i+1]),i++;continue}}u+="%EF%BF%BD";continue}u+=encodeURIComponent(t[i])}return u}Gt.defaultChars=";/?:@&=+$,-_.!~*'()#";Gt.componentChars="-_.!~*'()";function Qr(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function Dn(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const n0=/^([a-z0-9.+-]+:)/i,r0=/:[0-9]*$/,u0=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,i0=["<",">",'"',"`"," ","\r",`
11
- `," "],s0=["{","}","|","\\","^","`"].concat(i0),o0=["'"].concat(s0),ai=["%","/","?",";","#"].concat(o0),ci=["/","?","#"],l0=255,fi=/^[+a-z0-9A-Z_-]{0,63}$/,a0=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,di={javascript:!0,"javascript:":!0},hi={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function eu(t,e){if(t&&t instanceof Dn)return t;const n=new Dn;return n.parse(t,e),n}Dn.prototype.parse=function(t,e){let n,r,u,i=t;if(i=i.trim(),!e&&t.split("#").length===1){const a=u0.exec(i);if(a)return this.pathname=a[1],a[2]&&(this.search=a[2]),this}let s=n0.exec(i);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,i=i.substr(s.length)),(e||s||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(u=i.substr(0,2)==="//",u&&!(s&&di[s])&&(i=i.substr(2),this.slashes=!0)),!di[s]&&(u||s&&!hi[s])){let a=-1;for(let d=0;d<ci.length;d++)r=i.indexOf(ci[d]),r!==-1&&(a===-1||r<a)&&(a=r);let c,f;a===-1?f=i.lastIndexOf("@"):f=i.lastIndexOf("@",a),f!==-1&&(c=i.slice(0,f),i=i.slice(f+1),this.auth=c),a=-1;for(let d=0;d<ai.length;d++)r=i.indexOf(ai[d]),r!==-1&&(a===-1||r<a)&&(a=r);a===-1&&(a=i.length),i[a-1]===":"&&a--;const p=i.slice(0,a);i=i.slice(a),this.parseHost(p),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const d=this.hostname.split(/\./);for(let m=0,g=d.length;m<g;m++){const b=d[m];if(b&&!b.match(fi)){let k="";for(let y=0,_=b.length;y<_;y++)b.charCodeAt(y)>127?k+="x":k+=b[y];if(!k.match(fi)){const y=d.slice(0,m),_=d.slice(m+1),S=b.match(a0);S&&(y.push(S[1]),_.unshift(S[2])),_.length&&(i=_.join(".")+i),this.hostname=y.join(".");break}}}}this.hostname.length>l0&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const o=i.indexOf("#");o!==-1&&(this.hash=i.substr(o),i=i.slice(0,o));const l=i.indexOf("?");return l!==-1&&(this.search=i.substr(l),i=i.slice(0,l)),i&&(this.pathname=i),hi[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Dn.prototype.parseHost=function(t){let e=r0.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const c0=Object.freeze(Object.defineProperty({__proto__:null,decode:gt,encode:Gt,format:Qr,parse:eu},Symbol.toStringTag,{value:"Module"})),no=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ro=/[\0-\x1F\x7F-\x9F]/,f0=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,tu=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,uo=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,io=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,d0=Object.freeze(Object.defineProperty({__proto__:null,Any:no,Cc:ro,Cf:f0,P:tu,S:uo,Z:io},Symbol.toStringTag,{value:"Module"})),h0=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),p0=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Qn;const m0=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),g0=(Qn=String.fromCodePoint)!==null&&Qn!==void 0?Qn:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function b0(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=m0.get(t))!==null&&e!==void 0?e:t}var P;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(P||(P={}));const x0=32;var Pe;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Pe||(Pe={}));function Tr(t){return t>=P.ZERO&&t<=P.NINE}function k0(t){return t>=P.UPPER_A&&t<=P.UPPER_F||t>=P.LOWER_A&&t<=P.LOWER_F}function y0(t){return t>=P.UPPER_A&&t<=P.UPPER_Z||t>=P.LOWER_A&&t<=P.LOWER_Z||Tr(t)}function C0(t){return t===P.EQUALS||y0(t)}var v;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(v||(v={}));var Re;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Re||(Re={}));class D0{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=v.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Re.Strict}startEntity(e){this.decodeMode=e,this.state=v.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case v.EntityStart:return e.charCodeAt(n)===P.NUM?(this.state=v.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=v.NamedEntity,this.stateNamedEntity(e,n));case v.NumericStart:return this.stateNumericStart(e,n);case v.NumericDecimal:return this.stateNumericDecimal(e,n);case v.NumericHex:return this.stateNumericHex(e,n);case v.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|x0)===P.LOWER_X?(this.state=v.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=v.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,u){if(n!==r){const i=r-n;this.result=this.result*Math.pow(u,i)+parseInt(e.substr(n,i),u),this.consumed+=i}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const u=e.charCodeAt(n);if(Tr(u)||k0(u))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(u,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const u=e.charCodeAt(n);if(Tr(u))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(u,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===P.SEMI)this.consumed+=1;else if(this.decodeMode===Re.Strict)return 0;return this.emitCodePoint(b0(this.result),this.consumed),this.errors&&(e!==P.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let u=r[this.treeIndex],i=(u&Pe.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const s=e.charCodeAt(n);if(this.treeIndex=_0(r,u,this.treeIndex+Math.max(1,i),s),this.treeIndex<0)return this.result===0||this.decodeMode===Re.Attribute&&(i===0||C0(s))?0:this.emitNotTerminatedNamedEntity();if(u=r[this.treeIndex],i=(u&Pe.VALUE_LENGTH)>>14,i!==0){if(s===P.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Re.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,u=(r[n]&Pe.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,u,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:u}=this;return this.emitCodePoint(n===1?u[e]&~Pe.VALUE_LENGTH:u[e+1],r),n===3&&this.emitCodePoint(u[e+2],r),r}end(){var e;switch(this.state){case v.NamedEntity:return this.result!==0&&(this.decodeMode!==Re.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case v.NumericDecimal:return this.emitNumericEntity(0,2);case v.NumericHex:return this.emitNumericEntity(0,3);case v.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case v.EntityStart:return 0}}}function so(t){let e="";const n=new D0(t,r=>e+=g0(r));return function(u,i){let s=0,o=0;for(;(o=u.indexOf("&",o))>=0;){e+=u.slice(s,o),n.startEntity(i);const a=n.write(u,o+1);if(a<0){s=o+n.end();break}s=o+a,o=a===0?s+1:s}const l=e+u.slice(s);return e="",l}}function _0(t,e,n,r){const u=(e&Pe.BRANCH_LENGTH)>>7,i=e&Pe.JUMP_TABLE;if(u===0)return i!==0&&r===i?n:-1;if(i){const l=r-i;return l<0||l>=u?-1:t[n+l]-1}let s=n,o=s+u-1;for(;s<=o;){const l=s+o>>>1,a=t[l];if(a<r)s=l+1;else if(a>r)o=l-1;else return t[l+u]}return-1}const E0=so(h0);so(p0);function oo(t,e=Re.Legacy){return E0(t,e)}function S0(t){return Object.prototype.toString.call(t)}function nu(t){return S0(t)==="[object String]"}const A0=Object.prototype.hasOwnProperty;function M0(t,e){return A0.call(t,e)}function Nn(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}function lo(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function ru(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function _n(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const ao=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,w0=/&([a-z#][a-z0-9]{1,31});/gi,T0=new RegExp(ao.source+"|"+w0.source,"gi"),O0=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function F0(t,e){if(e.charCodeAt(0)===35&&O0.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return ru(r)?_n(r):t}const n=oo(t);return n!==t?n:t}function N0(t){return t.indexOf("\\")<0?t:t.replace(ao,"$1")}function bt(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(T0,function(e,n,r){return n||F0(e,r)})}const I0=/[&<>"]/,R0=/[&<>"]/g,B0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function v0(t){return B0[t]}function $e(t){return I0.test(t)?t.replace(R0,v0):t}const z0=/[.?*+^$[\]\\(){}|-]/g;function P0(t){return t.replace(z0,"\\$&")}function I(t){switch(t){case 9:case 32:return!0}return!1}function $t(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Wt(t){return tu.test(t)||uo.test(t)}function Ht(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function In(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const L0={mdurl:c0,ucmicro:d0},q0=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:lo,assign:Nn,escapeHtml:$e,escapeRE:P0,fromCodePoint:_n,has:M0,isMdAsciiPunct:Ht,isPunctChar:Wt,isSpace:I,isString:nu,isValidEntityCode:ru,isWhiteSpace:$t,lib:L0,normalizeReference:In,unescapeAll:bt,unescapeMd:N0},Symbol.toStringTag,{value:"Module"}));function V0(t,e,n){let r,u,i,s;const o=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos<o;){if(i=t.src.charCodeAt(t.pos),i===93&&(r--,r===0)){u=!0;break}if(s=t.pos,t.md.inline.skipToken(t),i===91){if(s===t.pos-1)r++;else if(n)return t.pos=l,-1}}let a=-1;return u&&(a=t.pos),t.pos=l,a}function $0(t,e,n){let r,u=e;const i={ok:!1,pos:0,str:""};if(t.charCodeAt(u)===60){for(u++;u<n;){if(r=t.charCodeAt(u),r===10||r===60)return i;if(r===62)return i.pos=u+1,i.str=bt(t.slice(e+1,u)),i.ok=!0,i;if(r===92&&u+1<n){u+=2;continue}u++}return i}let s=0;for(;u<n&&(r=t.charCodeAt(u),!(r===32||r<32||r===127));){if(r===92&&u+1<n){if(t.charCodeAt(u+1)===32)break;u+=2;continue}if(r===40&&(s++,s>32))return i;if(r===41){if(s===0)break;s--}u++}return e===u||s!==0||(i.str=bt(t.slice(e,u)),i.pos=u,i.ok=!0),i}function W0(t,e,n,r){let u,i=e;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(i>=n)return s;let o=t.charCodeAt(i);if(o!==34&&o!==39&&o!==40)return s;e++,i++,o===40&&(o=41),s.marker=o}for(;i<n;){if(u=t.charCodeAt(i),u===s.marker)return s.pos=i+1,s.str+=bt(t.slice(e,i)),s.ok=!0,s;if(u===40&&s.marker===41)return s;u===92&&i+1<n&&i++,i++}return s.can_continue=!0,s.str+=bt(t.slice(e,i)),s}const H0=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:$0,parseLinkLabel:V0,parseLinkTitle:W0},Symbol.toStringTag,{value:"Module"})),Ce={};Ce.code_inline=function(t,e,n,r,u){const i=t[e];return"<code"+u.renderAttrs(i)+">"+$e(i.content)+"</code>"};Ce.code_block=function(t,e,n,r,u){const i=t[e];return"<pre"+u.renderAttrs(i)+"><code>"+$e(t[e].content)+`</code></pre>
12
- `};Ce.fence=function(t,e,n,r,u){const i=t[e],s=i.info?bt(i.info).trim():"";let o="",l="";if(s){const c=s.split(/(\s+)/g);o=c[0],l=c.slice(2).join("")}let a;if(n.highlight?a=n.highlight(i.content,o,l)||$e(i.content):a=$e(i.content),a.indexOf("<pre")===0)return a+`
9
+ `);return{dom:l,text:p,slice:e}}function qs(t,e,n,r,u){let i=u.parent.type.spec.code,s,o;if(!n&&!e)return null;let l=!!e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",p=>{e=p(e,i||r,t)}),i)return o=new D(x.from(t.state.schema.text(e.replace(/\r\n?/g,`
10
+ `))),0,0),t.someProp("transformPasted",p=>{o=p(o,t,!0)}),o;let f=t.someProp("clipboardTextParser",p=>p(e,u,r,t));if(f)o=f;else{let p=u.marks(),{schema:h}=t.state,d=yt.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(d.serializeNode(h.text(m,p)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=uc(n),Kt&&ic(s);let a=s&&s.querySelector("[data-pm-slice]"),c=a&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(a.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let p=s.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;s=p}if(o||(o=(t.someProp("clipboardParser")||t.someProp("domParser")||Bt.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||c),context:u,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!tc.test(p.parentNode.nodeName)?{ignore:!0}:null}})),c)o=sc(Zu(o,+c[1],+c[2]),c[4]);else if(o=D.maxOpen(nc(o.content,u),!0),o.openStart||o.openEnd){let f=0,p=0;for(let h=o.content.firstChild;f<o.openStart&&!h.type.spec.isolating;f++,h=h.firstChild);for(let h=o.content.lastChild;p<o.openEnd&&!h.type.spec.isolating;p++,h=h.lastChild);o=Zu(o,f,p)}return t.someProp("transformPasted",f=>{o=f(o,t,l)}),o}const tc=/^(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 nc(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let u=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(o=>{if(!s)return;let l=u.findWrapping(o.type),a;if(!l)return s=null;if(a=s.length&&i.length&&$s(l,i,o,s[s.length-1],0))s[s.length-1]=a;else{s.length&&(s[s.length-1]=Ws(s[s.length-1],i.length));let c=Vs(o,l);s.push(c),u=u.matchType(c.type),i=l}}),s)return x.from(s)}return t}function Vs(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,x.from(t));return t}function $s(t,e,n,r,u){if(u<t.length&&u<e.length&&t[u]==e[u]){let i=$s(t,e,n,r.lastChild,u+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(u==t.length-1?n.type:t[u+1]))return r.copy(r.content.append(x.from(Vs(n,t,u+1))))}}function Ws(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Ws(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(x.empty,!0);return t.copy(n.append(r))}function Mr(t,e,n,r,u,i){let s=e<0?t.firstChild:t.lastChild,o=s.content;return t.childCount>1&&(i=0),u<r-1&&(o=Mr(o,e,n,r,u+1,i)),u>=n&&(o=e<0?s.contentMatchAt(0).fillBefore(o,i<=u).append(o):o.append(s.contentMatchAt(s.childCount).fillBefore(x.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(o))}function Zu(t,e,n){return e<t.openStart&&(t=new D(Mr(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new D(Mr(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Hs={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 Gu=null;function Js(){return Gu||(Gu=document.implementation.createHTMLDocument("title"))}let Gn=null;function rc(t){let e=window.trustedTypes;return e?(Gn||(Gn=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Gn.createHTML(t)):t}function uc(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Js().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),u;if((u=r&&Hs[r[1].toLowerCase()])&&(t=u.map(i=>"<"+i+">").join("")+t+u.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=rc(t),u)for(let i=0;i<u.length;i++)n=n.querySelector(u[i])||n;return n}function ic(t){let e=t.querySelectorAll(J?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function sc(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:u,openStart:i,openEnd:s}=t;for(let o=r.length-2;o>=0;o-=2){let l=n.nodes[r[o]];if(!l||l.hasRequiredAttrs())break;u=x.from(l.create(r[o+1],u)),i++,s++}return new D(u,i,s)}const K={},Z={},oc={touchstart:!0,touchmove:!0};class lc{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function ac(t){for(let e in K){let n=K[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{fc(t,r)&&!Zr(t,r)&&(t.editable||!(r.type in Z))&&n(t,r)},oc[e]?{passive:!0}:void 0)}U&&t.dom.addEventListener("input",()=>null),wr(t)}function ze(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function cc(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function wr(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Zr(t,r))})}function Zr(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function fc(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function dc(t,e){!Zr(t,e)&&K[e.type]&&(t.editable||!(e.type in Z))&&K[e.type](t,e)}Z.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Us(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Ae&&J&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),bt&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",u=>u(t,je(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||ec(t,n)?n.preventDefault():ze(t,"key")};Z.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Z.keypress=(t,e)=>{let n=e;if(Us(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||ue&&n.metaKey)return;if(t.someProp("handleKeyPress",u=>u(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof F)||!r.$from.sameParent(r.$to)){let u=String.fromCharCode(n.charCode),i=()=>t.state.tr.insertText(u).scrollIntoView();!/[\r\n]/.test(u)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,u,i))&&t.dispatch(i()),n.preventDefault()}};function On(t){return{left:t.clientX,top:t.clientY}}function hc(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Gr(t,e,n,r,u){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,o=>s>i.depth?o(t,n,i.nodeAfter,i.before(s),u,!0):o(t,n,i.node(s),i.before(s),u,!1)))return!0;return!1}function dt(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function pc(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&A.isSelectable(r)?(dt(t,new A(n)),!0):!1}function mc(t,e){if(e==-1)return!1;let n=t.state.selection,r,u;n instanceof A&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s);if(A.isSelectable(o)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?u=i.before(n.$from.depth):u=i.before(s);break}}return u!=null?(dt(t,A.create(t.state.doc,u)),!0):!1}function gc(t,e,n,r,u){return Gr(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(u?mc(t,n):pc(t,n))}function bc(t,e,n,r){return Gr(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",u=>u(t,e,r))}function xc(t,e,n,r){return Gr(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",u=>u(t,e,r))||kc(t,n,r)}function kc(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(dt(t,F.create(r,0,r.content.size)),!0):!1;let u=r.resolve(e);for(let i=u.depth+1;i>0;i--){let s=i>u.depth?u.nodeAfter:u.node(i),o=u.before(i);if(s.inlineContent)dt(t,F.create(r,o+1,o+1+s.content.size));else if(A.isSelectable(s))dt(t,A.create(r,o));else continue;return!0}}function Yr(t){return xn(t)}const js=ue?"metaKey":"ctrlKey";K.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Yr(t),u=Date.now(),i="singleClick";u-t.input.lastClick.time<500&&hc(n,t.input.lastClick)&&!n[js]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:u,x:n.clientX,y:n.clientY,type:i,button:n.button};let s=t.posAtCoords(On(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new yc(t,s,n,!!r)):(i=="doubleClick"?bc:xc)(t,s.pos,s.inside,n)?n.preventDefault():ze(t,"pointer"))};class yc{constructor(e,n,r,u){this.view=e,this.pos=n,this.event=r,this.flushed=u,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[js],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let c=e.state.doc.resolve(n.pos);i=c.parent,s=c.depth?c.before():0}const o=u?null:r.target,l=o?e.docView.nearestDesc(o,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:a}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||a instanceof A&&a.from<=s&&a.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&se&&!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)),ze(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(()=>Me(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(On(e))),this.updateAllowDefault(e),this.allowDefault||!n?ze(this.view,"pointer"):gc(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||U&&this.mightDrag&&!this.mightDrag.node.isAtom||J&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(dt(this.view,O.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):ze(this.view,"pointer")}move(e){this.updateAllowDefault(e),ze(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}K.touchstart=t=>{t.input.lastTouch=Date.now(),Yr(t),ze(t,"pointer")};K.touchmove=t=>{t.input.lastTouch=Date.now(),ze(t,"pointer")};K.contextmenu=t=>Yr(t);function Us(t,e){return t.composing?!0:U&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Cc=Ae?5e3:-1;Z.compositionstart=Z.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof F&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),xn(t,!0),t.markCursor=null;else if(xn(t,!e.selection.empty),se&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let u=r.focusNode,i=r.focusOffset;u&&u.nodeType==1&&i!=0;){let s=i<0?u.lastChild:u.childNodes[i-1];if(!s)break;if(s.nodeType==3){let o=t.domSelection();o&&o.collapse(s,s.nodeValue.length);break}else u=s,i=-1}}t.input.composing=!0}Ks(t,Cc)};Z.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Ks(t,20))};function Ks(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>xn(t),e))}function Zs(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=_c());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Dc(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=pa(e.focusNode,e.focusOffset),r=ma(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let u=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!u||!u.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function _c(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function xn(t,e=!1){if(!(Ae&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Zs(t),e||t.docView&&t.docView.dirty){let n=jr(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function Ec(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),u=document.createRange();u.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(u),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Lt=Y&&Le<15||bt&&ya<604;K.copy=Z.cut=(t,e)=>{let n=e,r=t.state.selection,u=n.type=="cut";if(r.empty)return;let i=Lt?null:n.clipboardData,s=r.content(),{dom:o,text:l}=Kr(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",o.innerHTML),i.setData("text/plain",l)):Ec(t,o),u&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Sc(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Ac(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let u=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?qt(t,r.value,null,u,e):qt(t,r.textContent,r.innerHTML,u,e)},50)}function qt(t,e,n,r,u){let i=qs(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,u,i||D.empty)))return!0;if(!i)return!1;let s=Sc(i),o=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Gs(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Z.paste=(t,e)=>{let n=e;if(t.composing&&!Ae)return;let r=Lt?null:n.clipboardData,u=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&qt(t,Gs(r),r.getData("text/html"),u,n)?n.preventDefault():Ac(t,n)};class Ys{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Mc=ue?"altKey":"ctrlKey";function Xs(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[Mc]}K.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let u=t.state.selection,i=u.empty?null:t.posAtCoords(On(n)),s;if(!(i&&i.pos>=u.from&&i.pos<=(u instanceof A?u.to-1:u.to))){if(r&&r.mightDrag)s=A.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=A.create(t.state.doc,f.posBefore))}}let o=(s||t.state.selection).content(),{dom:l,text:a,slice:c}=Kr(t,o);(!n.dataTransfer.files.length||!J||Es>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Lt?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Lt||n.dataTransfer.setData("text/plain",a),t.dragging=new Ys(c,Xs(t,n),s)};K.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Z.dragover=Z.dragenter=(t,e)=>e.preventDefault();Z.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let u=t.posAtCoords(On(n));if(!u)return;let i=t.state.doc.resolve(u.pos),s=r&&r.slice;s?t.someProp("transformPasted",d=>{s=d(s,t,!1)}):s=qs(t,Gs(n.dataTransfer),Lt?null:n.dataTransfer.getData("text/html"),!1,i);let o=!!(r&&Xs(t,n));if(t.someProp("handleDrop",d=>d(t,n,s||D.empty,o))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?El(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let a=t.state.tr;if(o){let{node:d}=r;d?d.replace(a):a.deleteSelection()}let c=a.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=a.doc;if(f?a.replaceRangeWith(c,c,s.content.firstChild):a.replaceRange(c,c,s),a.doc.eq(p))return;let h=a.doc.resolve(c);if(f&&A.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))a.setSelection(new A(h));else{let d=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((m,g,b,k)=>d=k),a.setSelection(Ur(t,h,a.doc.resolve(d)))}t.focus(),t.dispatch(a.setMeta("uiEvent","drop"))};K.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Me(t)},20))};K.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};K.beforeinput=(t,e)=>{if(J&&Ae&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,je(8,"Backspace")))))return;let{$cursor:u}=t.state.selection;u&&u.pos>0&&t.dispatch(t.state.tr.delete(u.pos-1,u.pos).scrollIntoView())},50)}};for(let t in Z)K[t]=Z[t];function Vt(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class kn{constructor(e,n){this.toDOM=e,this.spec=n||Xe,this.side=this.spec.side||0}map(e,n,r,u){let{pos:i,deleted:s}=e.mapResult(n.from+u,this.side<0?-1:1);return s?null:new ce(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof kn&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Vt(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ve{constructor(e,n){this.attrs=e,this.spec=n||Xe}map(e,n,r,u){let i=e.map(n.from+u,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+u,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new ce(i,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Ve&&Vt(this.attrs,e.attrs)&&Vt(this.spec,e.spec)}static is(e){return e.type instanceof Ve}destroy(){}}class Xr{constructor(e,n){this.attrs=e,this.spec=n||Xe}map(e,n,r,u){let i=e.mapResult(n.from+u,1);if(i.deleted)return null;let s=e.mapResult(n.to+u,-1);return s.deleted||s.pos<=i.pos?null:new ce(i.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:u}=e.content.findIndex(n.from),i;return u==n.from&&!(i=e.child(r)).isText&&u+i.nodeSize==n.to}eq(e){return this==e||e instanceof Xr&&Vt(this.attrs,e.attrs)&&Vt(this.spec,e.spec)}destroy(){}}class ce{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new ce(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new ce(e,e,new kn(n,r))}static inline(e,n,r,u){return new ce(e,n,new Ve(r,u))}static node(e,n,r,u){return new ce(e,n,new Xr(r,u))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ve}get widget(){return this.type instanceof kn}}const ct=[],Xe={};class z{constructor(e,n){this.local=e.length?e:ct,this.children=n.length?n:ct}static create(e,n){return n.length?yn(n,e,0,Xe):W}find(e,n,r){let u=[];return this.findInner(e??0,n??1e9,u,0,r),u}findInner(e,n,r,u,i){for(let s=0;s<this.local.length;s++){let o=this.local[s];o.from<=n&&o.to>=e&&(!i||i(o.spec))&&r.push(o.copy(o.from+u,o.to+u))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let o=this.children[s]+1;this.children[s+2].findInner(e-o,n-o,r,u+o,i)}}map(e,n,r){return this==W||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Xe)}mapInner(e,n,r,u,i){let s;for(let o=0;o<this.local.length;o++){let l=this.local[o].map(e,r,u);l&&l.type.valid(n,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[o].spec)}return this.children.length?wc(this.children,s||[],e,n,r,u,i):s?new z(s.sort(Qe),ct):W}add(e,n){return n.length?this==W?z.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let u,i=0;e.forEach((o,l)=>{let a=l+r,c;if(c=eo(n,o,a)){for(u||(u=this.children.slice());i<u.length&&u[i]<l;)i+=3;u[i]==l?u[i+2]=u[i+2].addInner(o,c,a+1):u.splice(i,0,l,l+o.nodeSize,yn(c,o,a+1,Xe)),i+=3}});let s=Qs(i?to(n):n,-r);for(let o=0;o<s.length;o++)s[o].type.valid(e,s[o])||s.splice(o--,1);return new z(s.length?this.local.concat(s).sort(Qe):this.local,u||this.children)}remove(e){return e.length==0||this==W?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,u=this.local;for(let i=0;i<r.length;i+=3){let s,o=r[i]+n,l=r[i+1]+n;for(let c=0,f;c<e.length;c++)(f=e[c])&&f.from>o&&f.to<l&&(e[c]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let a=r[i+2].removeInner(s,o+1);a!=W?r[i+2]=a:(r.splice(i,3),i-=3)}if(u.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let o=0;o<u.length;o++)u[o].eq(s,n)&&(u==this.local&&(u=this.local.slice()),u.splice(o--,1))}return r==this.children&&u==this.local?this:u.length||r.length?new z(u,r):W}forChild(e,n){if(this==W)return this;if(n.isLeaf)return z.empty;let r,u;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=e){this.children[o]==e&&(r=this.children[o+2]);break}let i=e+1,s=i+n.content.size;for(let o=0;o<this.local.length;o++){let l=this.local[o];if(l.from<s&&l.to>i&&l.type instanceof Ve){let a=Math.max(i,l.from)-i,c=Math.min(s,l.to)-i;a<c&&(u||(u=[])).push(l.copy(a,c))}}if(u){let o=new z(u.sort(Qe),ct);return r?new Ie([o,r]):o}return r||W}eq(e){if(this==e)return!0;if(!(e instanceof z)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Qr(this.localsInner(e))}localsInner(e){if(this==W)return ct;if(e.inlineContent||!this.local.some(Ve.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Ve||n.push(this.local[r]);return n}forEachSet(e){e(this)}}z.empty=new z([],[]);z.removeOverlap=Qr;const W=z.empty;class Ie{constructor(e){this.members=e}map(e,n){const r=this.members.map(u=>u.map(e,n,Xe));return Ie.from(r)}forChild(e,n){if(n.isLeaf)return z.empty;let r=[];for(let u=0;u<this.members.length;u++){let i=this.members[u].forChild(e,n);i!=W&&(i instanceof Ie?r=r.concat(i.members):r.push(i))}return Ie.from(r)}eq(e){if(!(e instanceof Ie)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let u=0;u<this.members.length;u++){let i=this.members[u].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?Qr(r?n:n.sort(Qe)):ct}static from(e){switch(e.length){case 0:return W;case 1:return e[0];default:return new Ie(e.every(n=>n instanceof z)?e:e.reduce((n,r)=>n.concat(r instanceof z?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function wc(t,e,n,r,u,i,s){let o=t.slice();for(let a=0,c=i;a<n.maps.length;a++){let f=0;n.maps[a].forEach((p,h,d,m)=>{let g=m-d-(h-p);for(let b=0;b<o.length;b+=3){let k=o[b+1];if(k<0||p>k+c-f)continue;let y=o[b]+c-f;h>=y?o[b+1]=p<=y?-2:-1:p>=c&&g&&(o[b]+=g,o[b+1]+=g)}f+=g}),c=n.maps[a].map(c,-1)}let l=!1;for(let a=0;a<o.length;a+=3)if(o[a+1]<0){if(o[a+1]==-2){l=!0,o[a+1]=-1;continue}let c=n.map(t[a]+i),f=c-u;if(f<0||f>=r.content.size){l=!0;continue}let p=n.map(t[a+1]+i,-1),h=p-u,{index:d,offset:m}=r.content.findIndex(f),g=r.maybeChild(d);if(g&&m==f&&m+g.nodeSize==h){let b=o[a+2].mapInner(n,g,c+1,t[a]+i+1,s);b!=W?(o[a]=f,o[a+1]=h,o[a+2]=b):(o[a+1]=-2,l=!0)}else l=!0}if(l){let a=Tc(o,t,e,n,u,i,s),c=yn(a,r,0,s);e=c.local;for(let f=0;f<o.length;f+=3)o[f+1]<0&&(o.splice(f,3),f-=3);for(let f=0,p=0;f<c.children.length;f+=3){let h=c.children[f];for(;p<o.length&&o[p]<h;)p+=3;o.splice(p,0,c.children[f],c.children[f+1],c.children[f+2])}}return new z(e.sort(Qe),o)}function Qs(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let u=t[r];n.push(new ce(u.from+e,u.to+e,u.type))}return n}function Tc(t,e,n,r,u,i,s){function o(l,a){for(let c=0;c<l.local.length;c++){let f=l.local[c].map(r,u,a);f?n.push(f):s.onRemove&&s.onRemove(l.local[c].spec)}for(let c=0;c<l.children.length;c+=3)o(l.children[c+2],l.children[c]+a+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&o(t[l+2],e[l]+i+1);return n}function eo(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,u=null;for(let i=0,s;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((u||(u=[])).push(s),t[i]=null);return u}function to(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function yn(t,e,n,r){let u=[],i=!1;e.forEach((o,l)=>{let a=eo(t,o,l+n);if(a){i=!0;let c=yn(a,o,n+l+1,r);c!=W&&u.push(l,l+o.nodeSize,c)}});let s=Qs(i?to(t):t,-n).sort(Qe);for(let o=0;o<s.length;o++)s[o].type.valid(e,s[o])||(r.onRemove&&r.onRemove(s[o].spec),s.splice(o--,1));return s.length||u.length?new z(s,u):W}function Qe(t,e){return t.from-e.from||t.to-e.to}function Qr(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let u=n+1;u<e.length;u++){let i=e[u];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[u]=i.copy(i.from,r.to),Yu(e,u+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),Yu(e,u,r.copy(i.from,r.to)));break}}}return e}function Yu(t,e,n){for(;e<t.length&&Qe(n,t[e])>0;)e++;t.splice(e,0,n)}function Yn(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=W&&e.push(r)}),t.cursorWrapper&&e.push(z.create(t.state.doc,[t.cursorWrapper.deco])),Ie.from(e)}const Oc={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Fc=Y&&Le<=11;class Nc{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 Ic{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Nc,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let u=0;u<r.length;u++)this.queue.push(r[u]);Y&&Le<=11&&r.some(u=>u.type=="childList"&&u.removedNodes.length||u.type=="characterData"&&u.oldValue.length>u.target.nodeValue.length)?this.flushSoon():this.flush()}),Fc&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Oc)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Wu(this.view)){if(this.suppressingSelectionUpdates)return Me(this.view);if(Y&&Le<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&rt(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=gt(i))n.add(i);for(let i=e.anchorNode;i;i=gt(i))if(n.has(i)){r=i;break}let u=r&&this.view.docView.nearestDesc(r);if(u&&u.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),u=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Wu(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,o=!1,l=[];if(e.editable)for(let c=0;c<n.length;c++){let f=this.registerMutation(n[c],l);f&&(i=i<0?f.from:Math.min(f.from,i),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(o=!0))}if(se&&l.length){let c=l.filter(f=>f.nodeName=="BR");if(c.length==2){let[f,p]=c;f.parentNode&&f.parentNode.parentNode==p.parentNode?p.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let p of c){let h=p.parentNode;h&&h.nodeName=="LI"&&(!f||vc(e,f)!=h)&&p.remove()}}}let a=null;i<0&&u&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&wn(r)&&(a=jr(e))&&a.eq(O.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Me(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||u)&&(i>-1&&(e.docView.markDirty(i,s),Rc(e)),this.handleDOMChange(i,s,o,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Me(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;c<e.addedNodes.length;c++){let f=e.addedNodes[c];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let u=e.previousSibling,i=e.nextSibling;if(Y&&Le<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:f,nextSibling:p}=e.addedNodes[c];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(u=f),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(i=p)}let s=u&&u.parentNode==e.target?V(u)+1:0,o=r.localPosFromDOM(e.target,s,-1),l=i&&i.parentNode==e.target?V(i):e.target.childNodes.length,a=r.localPosFromDOM(e.target,l,1);return{from:o,to:a}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Xu=new WeakMap,Qu=!1;function Rc(t){if(!Xu.has(t)&&(Xu.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=se,Qu)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Qu=!0}}function ei(t,e){let n=e.startContainer,r=e.startOffset,u=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return rt(s.node,s.offset,u,i)&&([n,r,u,i]=[u,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:u,focusOffset:i}}function Bc(t,e){if(e.getComposedRanges){let u=e.getComposedRanges(t.root)[0];if(u)return ei(t,u)}let n;function r(u){u.preventDefault(),u.stopImmediatePropagation(),n=u.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?ei(t,n):null}function vc(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function zc(t,e,n){let{node:r,fromOffset:u,toOffset:i,from:s,to:o}=t.docView.parseRange(e,n),l=t.domSelectionRange(),a,c=l.anchorNode;if(c&&t.dom.contains(c.nodeType==1?c:c.parentNode)&&(a=[{node:c,offset:l.anchorOffset}],wn(l)||a.push({node:l.focusNode,offset:l.focusOffset})),J&&t.input.lastKeyCode===8)for(let g=i;g>u;g--){let b=r.childNodes[g-1],k=b.pmViewDesc;if(b.nodeName=="BR"&&!k){i=g;break}if(!k||k.size)break}let f=t.state.doc,p=t.someProp("domParser")||Bt.fromSchema(t.state.schema),h=f.resolve(s),d=null,m=p.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:u,to:i,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:a,ruleFromNode:Pc,context:h});if(a&&a[0].pos!=null){let g=a[0].pos,b=a[1]&&a[1].pos;b==null&&(b=g),d={anchor:g+s,head:b+s}}return{doc:m,sel:d,from:s,to:o}}function Pc(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(U&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||U&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Lc=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function qc(t,e,n,r,u){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let C=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,w=jr(t,C);if(w&&!t.state.selection.eq(w)){if(J&&Ae&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",Q=>Q(t,je(13,"Enter"))))return;let I=t.state.tr.setSelection(w);C=="pointer"?I.setMeta("pointer",!0):C=="key"&&I.scrollIntoView(),i&&I.setMeta("composition",i),t.dispatch(I)}return}let s=t.state.doc.resolve(e),o=s.sharedDepth(n);e=s.before(o+1),n=t.state.doc.resolve(n).after(o+1);let l=t.state.selection,a=zc(t,e,n),c=t.state.doc,f=c.slice(a.from,a.to),p,h;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,h="end"):(p=t.state.selection.from,h="start"),t.input.lastKeyCode=null;let d=Wc(f.content,a.doc.content,a.from,p,h);if(d&&t.input.domChangeCount++,(bt&&t.input.lastIOSEnter>Date.now()-225||Ae)&&u.some(C=>C.nodeType==1&&!Lc.test(C.nodeName))&&(!d||d.endA>=d.endB)&&t.someProp("handleKeyDown",C=>C(t,je(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!d)if(r&&l instanceof F&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(a.sel&&a.sel.anchor!=a.sel.head))d={start:l.from,endA:l.to,endB:l.to};else{if(a.sel){let C=ti(t,t.state.doc,a.sel);if(C&&!C.eq(t.state.selection)){let w=t.state.tr.setSelection(C);i&&w.setMeta("composition",i),t.dispatch(w)}}return}t.state.selection.from<t.state.selection.to&&d.start==d.endB&&t.state.selection instanceof F&&(d.start>t.state.selection.from&&d.start<=t.state.selection.from+2&&t.state.selection.from>=a.from?d.start=t.state.selection.from:d.endA<t.state.selection.to&&d.endA>=t.state.selection.to-2&&t.state.selection.to<=a.to&&(d.endB+=t.state.selection.to-d.endA,d.endA=t.state.selection.to)),Y&&Le<=11&&d.endB==d.start+1&&d.endA==d.start&&d.start>a.from&&a.doc.textBetween(d.start-a.from-1,d.start-a.from+1)=="  "&&(d.start--,d.endA--,d.endB--);let m=a.doc.resolveNoCache(d.start-a.from),g=a.doc.resolveNoCache(d.endB-a.from),b=c.resolve(d.start),k=m.sameParent(g)&&m.parent.inlineContent&&b.end()>=d.endA;if((bt&&t.input.lastIOSEnter>Date.now()-225&&(!k||u.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!k&&m.pos<a.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(a.doc.textBetween(m.pos,g.pos,"","")))&&t.someProp("handleKeyDown",C=>C(t,je(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>d.start&&$c(c,d.start,d.endA,m,g)&&t.someProp("handleKeyDown",C=>C(t,je(8,"Backspace")))){Ae&&J&&t.domObserver.suppressSelectionUpdates();return}J&&d.endB==d.start&&(t.input.lastChromeDelete=Date.now()),Ae&&!k&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&a.sel&&a.sel.anchor==a.sel.head&&a.sel.head==d.endA&&(d.endB-=2,g=a.doc.resolveNoCache(d.endB-a.from),setTimeout(()=>{t.someProp("handleKeyDown",function(C){return C(t,je(13,"Enter"))})},20));let y=d.start,_=d.endA,E=C=>{let w=C||t.state.tr.replace(y,_,a.doc.slice(d.start-a.from,d.endB-a.from));if(a.sel){let I=ti(t,w.doc,a.sel);I&&!(J&&t.composing&&I.empty&&(d.start!=d.endB||t.input.lastChromeDelete<Date.now()-100)&&(I.head==y||I.head==w.mapping.map(_)-1)||Y&&I.empty&&I.head==y)&&w.setSelection(I)}return i&&w.setMeta("composition",i),w.scrollIntoView()},M;if(k)if(m.pos==g.pos){Y&&Le<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Me(t),20));let C=E(t.state.tr.delete(y,_)),w=c.resolve(d.start).marksAcross(c.resolve(d.endA));w&&C.ensureMarks(w),t.dispatch(C)}else if(d.endA==d.endB&&(M=Vc(m.parent.content.cut(m.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,d.endA-b.start())))){let C=E(t.state.tr);M.type=="add"?C.addMark(y,_,M.mark):C.removeMark(y,_,M.mark),t.dispatch(C)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let C=m.parent.textBetween(m.parentOffset,g.parentOffset),w=()=>E(t.state.tr.insertText(C,y,_));t.someProp("handleTextInput",I=>I(t,y,_,C,w))||t.dispatch(w())}else t.dispatch(E());else t.dispatch(E())}function ti(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Ur(t,e.resolve(n.anchor),e.resolve(n.head))}function Vc(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,u=n,i=r,s,o,l;for(let c=0;c<r.length;c++)u=r[c].removeFromSet(u);for(let c=0;c<n.length;c++)i=n[c].removeFromSet(i);if(u.length==1&&i.length==0)o=u[0],s="add",l=c=>c.mark(o.addToSet(c.marks));else if(u.length==0&&i.length==1)o=i[0],s="remove",l=c=>c.mark(o.removeFromSet(c.marks));else return null;let a=[];for(let c=0;c<e.childCount;c++)a.push(l(e.child(c)));if(x.from(a).eq(t))return{mark:o,type:s}}function $c(t,e,n,r,u){if(n-e<=u.pos-r.pos||Xn(r,!0,!1)<u.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let o=i.nodeAfter;return o!=null&&n==e+o.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(Xn(i,!0,!0));return!s.parent.isTextblock||s.pos>n||Xn(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Xn(t,e,n){let r=t.depth,u=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,u++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,u++}return u}function Wc(t,e,n,r,u){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:o}=t.findDiffEnd(e,n+t.size,n+e.size);if(u=="end"){let l=Math.max(0,i-Math.min(s,o));r-=s+l-i}if(s<i&&t.size<e.size){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<e.size&&ni(e.textBetween(i-1,i+1))&&(i+=l?1:-1),o=i+(o-s),s=i}else if(o<i){let l=r<=i&&r>=o?i-r:0;i-=l,i&&i<t.size&&ni(t.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-o),o=i}return{start:i,endA:s,endB:o}}function ni(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class no{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new lc,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(oi),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=ii(this),ui(this),this.nodeViews=si(this),this.docView=zu(this.state.doc,ri(this),Yn(this),this.dom,this),this.domObserver=new Ic(this,(r,u,i,s)=>qc(this,r,u,i,s)),this.domObserver.start(),ac(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&wr(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(oi),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let u=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(Zs(this),s=!0),this.state=e;let o=u.plugins!=e.plugins||this._props.plugins!=n.plugins;if(o||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=si(this);Jc(h,this.nodeViews)&&(this.nodeViews=h,i=!0)}(o||n.handleDOMEvents!=this._props.handleDOMEvents)&&wr(this),this.editable=ii(this),ui(this);let l=Yn(this),a=ri(this),c=u.plugins!=e.plugins&&!u.doc.eq(e.doc)?"reset":e.scrollToSelection>u.scrollToSelection?"to selection":"preserve",f=i||!this.docView.matchesNode(e.doc,a,l);(f||!e.selection.eq(u.selection))&&(s=!0);let p=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&_a(this);if(s){this.domObserver.stop();let h=f&&(Y||J)&&!this.composing&&!u.selection.empty&&!e.selection.empty&&Hc(u.selection,e.selection);if(f){let d=J?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Dc(this)),(i||!this.docView.update(e.doc,a,l,this))&&(this.docView.updateOuterDeco(a),this.docView.destroy(),this.docView=zu(e.doc,a,l,this.dom,this)),d&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Ua(this))?Me(this,h):(zs(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(u),!((r=this.dragging)===null||r===void 0)&&r.node&&!u.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,u),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():p&&Ea(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof A){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Fu(this,n.getBoundingClientRect(),e)}else Fu(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,u=-1;if(this.state.doc.nodeAt(r.from)==r.node)u=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(u=i)}this.dragging=new Ys(e.slice,e.move,u<0?void 0:A.create(this.state.doc,u))}someProp(e,n){let r=this._props&&this._props[e],u;if(r!=null&&(u=n?n(r):r))return u;for(let s=0;s<this.directPlugins.length;s++){let o=this.directPlugins[s].props[e];if(o!=null&&(u=n?n(o):o))return u}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let o=i[s].props[e];if(o!=null&&(u=n?n(o):o))return u}}hasFocus(){if(Y){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Sa(this.dom),Me(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Oa(this,e)}coordsAtPos(e,n=1){return Ts(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let u=this.docView.posFromDOM(e,n,r);if(u==null)throw new RangeError("DOM position not inside the editor");return u}endOfTextblock(e,n){return Ba(this,n||this.state,e)}pasteHTML(e,n){return qt(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return qt(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Kr(this,e)}destroy(){this.docView&&(cc(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Yn(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,da())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return dc(this,e)}domSelectionRange(){let e=this.domSelection();return e?U&&this.root.nodeType===11&&ba(this.dom.ownerDocument)==this.dom&&Bc(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}no.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function ri(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[ce.node(0,t.state.doc.content.size,e)]}function ui(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:ce.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function ii(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Hc(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function si(t){let e=Object.create(null);function n(r){for(let u in r)Object.prototype.hasOwnProperty.call(e,u)||(e[u]=r[u])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Jc(t,e){let n=0,r=0;for(let u in t){if(t[u]!=e[u])return!0;n++}for(let u in e)r++;return n!=r}function oi(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}const jc=["p",0],Uc=["blockquote",0],Kc=["hr"],Zc=["pre",["code",0]],Gc=["br"],Yc={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return jc}},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM(){return Uc}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return Kc}},heading:{attrs:{level:{default:1,validate:"number"}},content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM(){return Zc}},text:{group:"inline"},image:{inline:!0,attrs:{src:{validate:"string"},alt:{default:null,validate:"string|null"},title:{default:null,validate:"string|null"}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){let{src:e,alt:n,title:r}=t.attrs;return["img",{src:e,alt:n,title:r}]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return Gc}}},Xc=["em",0],Qc=["strong",0],e0=["code",0],t0={link:{attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){let{href:e,title:n}=t.attrs;return["a",{href:e,title:n},0]}},em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return Xc}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return Qc}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return e0}}},n0=new vr({nodes:Yc,marks:t0}),li={};function r0(t){let e=li[t];if(e)return e;e=li[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return e}function xt(t,e){typeof e!="string"&&(e=xt.defaultChars);const n=r0(e);return t.replace(/(%[a-f0-9]{2})+/gi,function(r){let u="";for(let i=0,s=r.length;i<s;i+=3){const o=parseInt(r.slice(i+1,i+3),16);if(o<128){u+=n[o];continue}if((o&224)===192&&i+3<s){const l=parseInt(r.slice(i+4,i+6),16);if((l&192)===128){const a=o<<6&1984|l&63;a<128?u+="��":u+=String.fromCharCode(a),i+=3;continue}}if((o&240)===224&&i+6<s){const l=parseInt(r.slice(i+4,i+6),16),a=parseInt(r.slice(i+7,i+9),16);if((l&192)===128&&(a&192)===128){const c=o<<12&61440|l<<6&4032|a&63;c<2048||c>=55296&&c<=57343?u+="���":u+=String.fromCharCode(c),i+=6;continue}}if((o&248)===240&&i+9<s){const l=parseInt(r.slice(i+4,i+6),16),a=parseInt(r.slice(i+7,i+9),16),c=parseInt(r.slice(i+10,i+12),16);if((l&192)===128&&(a&192)===128&&(c&192)===128){let f=o<<18&1835008|l<<12&258048|a<<6&4032|c&63;f<65536||f>1114111?u+="����":(f-=65536,u+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),i+=9;continue}}u+="�"}return u})}xt.defaultChars=";/?:@&=+$,#";xt.componentChars="";const ai={};function u0(t){let e=ai[t];if(e)return e;e=ai[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)e[t.charCodeAt(n)]=t[n];return e}function Gt(t,e,n){typeof e!="string"&&(n=e,e=Gt.defaultChars),typeof n>"u"&&(n=!0);const r=u0(e);let u="";for(let i=0,s=t.length;i<s;i++){const o=t.charCodeAt(i);if(n&&o===37&&i+2<s&&/^[0-9a-f]{2}$/i.test(t.slice(i+1,i+3))){u+=t.slice(i,i+3),i+=2;continue}if(o<128){u+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&i+1<s){const l=t.charCodeAt(i+1);if(l>=56320&&l<=57343){u+=encodeURIComponent(t[i]+t[i+1]),i++;continue}}u+="%EF%BF%BD";continue}u+=encodeURIComponent(t[i])}return u}Gt.defaultChars=";/?:@&=+$,-_.!~*'()#";Gt.componentChars="-_.!~*'()";function eu(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function Cn(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const i0=/^([a-z0-9.+-]+:)/i,s0=/:[0-9]*$/,o0=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l0=["<",">",'"',"`"," ","\r",`
11
+ `," "],a0=["{","}","|","\\","^","`"].concat(l0),c0=["'"].concat(a0),ci=["%","/","?",";","#"].concat(c0),fi=["/","?","#"],f0=255,di=/^[+a-z0-9A-Z_-]{0,63}$/,d0=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,hi={javascript:!0,"javascript:":!0},pi={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function tu(t,e){if(t&&t instanceof Cn)return t;const n=new Cn;return n.parse(t,e),n}Cn.prototype.parse=function(t,e){let n,r,u,i=t;if(i=i.trim(),!e&&t.split("#").length===1){const a=o0.exec(i);if(a)return this.pathname=a[1],a[2]&&(this.search=a[2]),this}let s=i0.exec(i);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,i=i.substr(s.length)),(e||s||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(u=i.substr(0,2)==="//",u&&!(s&&hi[s])&&(i=i.substr(2),this.slashes=!0)),!hi[s]&&(u||s&&!pi[s])){let a=-1;for(let d=0;d<fi.length;d++)r=i.indexOf(fi[d]),r!==-1&&(a===-1||r<a)&&(a=r);let c,f;a===-1?f=i.lastIndexOf("@"):f=i.lastIndexOf("@",a),f!==-1&&(c=i.slice(0,f),i=i.slice(f+1),this.auth=c),a=-1;for(let d=0;d<ci.length;d++)r=i.indexOf(ci[d]),r!==-1&&(a===-1||r<a)&&(a=r);a===-1&&(a=i.length),i[a-1]===":"&&a--;const p=i.slice(0,a);i=i.slice(a),this.parseHost(p),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const d=this.hostname.split(/\./);for(let m=0,g=d.length;m<g;m++){const b=d[m];if(b&&!b.match(di)){let k="";for(let y=0,_=b.length;y<_;y++)b.charCodeAt(y)>127?k+="x":k+=b[y];if(!k.match(di)){const y=d.slice(0,m),_=d.slice(m+1),E=b.match(d0);E&&(y.push(E[1]),_.unshift(E[2])),_.length&&(i=_.join(".")+i),this.hostname=y.join(".");break}}}}this.hostname.length>f0&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const o=i.indexOf("#");o!==-1&&(this.hash=i.substr(o),i=i.slice(0,o));const l=i.indexOf("?");return l!==-1&&(this.search=i.substr(l),i=i.slice(0,l)),i&&(this.pathname=i),pi[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Cn.prototype.parseHost=function(t){let e=s0.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const h0=Object.freeze(Object.defineProperty({__proto__:null,decode:xt,encode:Gt,format:eu,parse:tu},Symbol.toStringTag,{value:"Module"})),ro=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,uo=/[\0-\x1F\x7F-\x9F]/,p0=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,nu=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,io=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,so=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,m0=Object.freeze(Object.defineProperty({__proto__:null,Any:ro,Cc:uo,Cf:p0,P:nu,S:io,Z:so},Symbol.toStringTag,{value:"Module"})),g0=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),b0=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Qn;const x0=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),k0=(Qn=String.fromCodePoint)!==null&&Qn!==void 0?Qn:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function y0(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=x0.get(t))!==null&&e!==void 0?e:t}var P;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(P||(P={}));const C0=32;var Pe;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Pe||(Pe={}));function Tr(t){return t>=P.ZERO&&t<=P.NINE}function D0(t){return t>=P.UPPER_A&&t<=P.UPPER_F||t>=P.LOWER_A&&t<=P.LOWER_F}function _0(t){return t>=P.UPPER_A&&t<=P.UPPER_Z||t>=P.LOWER_A&&t<=P.LOWER_Z||Tr(t)}function E0(t){return t===P.EQUALS||_0(t)}var v;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(v||(v={}));var Re;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Re||(Re={}));class S0{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=v.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Re.Strict}startEntity(e){this.decodeMode=e,this.state=v.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case v.EntityStart:return e.charCodeAt(n)===P.NUM?(this.state=v.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=v.NamedEntity,this.stateNamedEntity(e,n));case v.NumericStart:return this.stateNumericStart(e,n);case v.NumericDecimal:return this.stateNumericDecimal(e,n);case v.NumericHex:return this.stateNumericHex(e,n);case v.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|C0)===P.LOWER_X?(this.state=v.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=v.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,u){if(n!==r){const i=r-n;this.result=this.result*Math.pow(u,i)+parseInt(e.substr(n,i),u),this.consumed+=i}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const u=e.charCodeAt(n);if(Tr(u)||D0(u))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(u,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const u=e.charCodeAt(n);if(Tr(u))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(u,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===P.SEMI)this.consumed+=1;else if(this.decodeMode===Re.Strict)return 0;return this.emitCodePoint(y0(this.result),this.consumed),this.errors&&(e!==P.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let u=r[this.treeIndex],i=(u&Pe.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const s=e.charCodeAt(n);if(this.treeIndex=A0(r,u,this.treeIndex+Math.max(1,i),s),this.treeIndex<0)return this.result===0||this.decodeMode===Re.Attribute&&(i===0||E0(s))?0:this.emitNotTerminatedNamedEntity();if(u=r[this.treeIndex],i=(u&Pe.VALUE_LENGTH)>>14,i!==0){if(s===P.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Re.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,u=(r[n]&Pe.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,u,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:u}=this;return this.emitCodePoint(n===1?u[e]&~Pe.VALUE_LENGTH:u[e+1],r),n===3&&this.emitCodePoint(u[e+2],r),r}end(){var e;switch(this.state){case v.NamedEntity:return this.result!==0&&(this.decodeMode!==Re.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case v.NumericDecimal:return this.emitNumericEntity(0,2);case v.NumericHex:return this.emitNumericEntity(0,3);case v.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case v.EntityStart:return 0}}}function oo(t){let e="";const n=new S0(t,r=>e+=k0(r));return function(u,i){let s=0,o=0;for(;(o=u.indexOf("&",o))>=0;){e+=u.slice(s,o),n.startEntity(i);const a=n.write(u,o+1);if(a<0){s=o+n.end();break}s=o+a,o=a===0?s+1:s}const l=e+u.slice(s);return e="",l}}function A0(t,e,n,r){const u=(e&Pe.BRANCH_LENGTH)>>7,i=e&Pe.JUMP_TABLE;if(u===0)return i!==0&&r===i?n:-1;if(i){const l=r-i;return l<0||l>=u?-1:t[n+l]-1}let s=n,o=s+u-1;for(;s<=o;){const l=s+o>>>1,a=t[l];if(a<r)s=l+1;else if(a>r)o=l-1;else return t[l+u]}return-1}const M0=oo(g0);oo(b0);function lo(t,e=Re.Legacy){return M0(t,e)}function w0(t){return Object.prototype.toString.call(t)}function ru(t){return w0(t)==="[object String]"}const T0=Object.prototype.hasOwnProperty;function O0(t,e){return T0.call(t,e)}function Fn(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}function ao(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function uu(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function Dn(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const co=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,F0=/&([a-z#][a-z0-9]{1,31});/gi,N0=new RegExp(co.source+"|"+F0.source,"gi"),I0=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function R0(t,e){if(e.charCodeAt(0)===35&&I0.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return uu(r)?Dn(r):t}const n=lo(t);return n!==t?n:t}function B0(t){return t.indexOf("\\")<0?t:t.replace(co,"$1")}function kt(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(N0,function(e,n,r){return n||R0(e,r)})}const v0=/[&<>"]/,z0=/[&<>"]/g,P0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function L0(t){return P0[t]}function $e(t){return v0.test(t)?t.replace(z0,L0):t}const q0=/[.?*+^$[\]\\(){}|-]/g;function V0(t){return t.replace(q0,"\\$&")}function N(t){switch(t){case 9:case 32:return!0}return!1}function $t(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Wt(t){return nu.test(t)||io.test(t)}function Ht(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Nn(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const $0={mdurl:h0,ucmicro:m0},W0=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:ao,assign:Fn,escapeHtml:$e,escapeRE:V0,fromCodePoint:Dn,has:O0,isMdAsciiPunct:Ht,isPunctChar:Wt,isSpace:N,isString:ru,isValidEntityCode:uu,isWhiteSpace:$t,lib:$0,normalizeReference:Nn,unescapeAll:kt,unescapeMd:B0},Symbol.toStringTag,{value:"Module"}));function H0(t,e,n){let r,u,i,s;const o=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos<o;){if(i=t.src.charCodeAt(t.pos),i===93&&(r--,r===0)){u=!0;break}if(s=t.pos,t.md.inline.skipToken(t),i===91){if(s===t.pos-1)r++;else if(n)return t.pos=l,-1}}let a=-1;return u&&(a=t.pos),t.pos=l,a}function J0(t,e,n){let r,u=e;const i={ok:!1,pos:0,str:""};if(t.charCodeAt(u)===60){for(u++;u<n;){if(r=t.charCodeAt(u),r===10||r===60)return i;if(r===62)return i.pos=u+1,i.str=kt(t.slice(e+1,u)),i.ok=!0,i;if(r===92&&u+1<n){u+=2;continue}u++}return i}let s=0;for(;u<n&&(r=t.charCodeAt(u),!(r===32||r<32||r===127));){if(r===92&&u+1<n){if(t.charCodeAt(u+1)===32)break;u+=2;continue}if(r===40&&(s++,s>32))return i;if(r===41){if(s===0)break;s--}u++}return e===u||s!==0||(i.str=kt(t.slice(e,u)),i.pos=u,i.ok=!0),i}function j0(t,e,n,r){let u,i=e;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(i>=n)return s;let o=t.charCodeAt(i);if(o!==34&&o!==39&&o!==40)return s;e++,i++,o===40&&(o=41),s.marker=o}for(;i<n;){if(u=t.charCodeAt(i),u===s.marker)return s.pos=i+1,s.str+=kt(t.slice(e,i)),s.ok=!0,s;if(u===40&&s.marker===41)return s;u===92&&i+1<n&&i++,i++}return s.can_continue=!0,s.str+=kt(t.slice(e,i)),s}const U0=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:J0,parseLinkLabel:H0,parseLinkTitle:j0},Symbol.toStringTag,{value:"Module"})),Ce={};Ce.code_inline=function(t,e,n,r,u){const i=t[e];return"<code"+u.renderAttrs(i)+">"+$e(i.content)+"</code>"};Ce.code_block=function(t,e,n,r,u){const i=t[e];return"<pre"+u.renderAttrs(i)+"><code>"+$e(t[e].content)+`</code></pre>
12
+ `};Ce.fence=function(t,e,n,r,u){const i=t[e],s=i.info?kt(i.info).trim():"";let o="",l="";if(s){const c=s.split(/(\s+)/g);o=c[0],l=c.slice(2).join("")}let a;if(n.highlight?a=n.highlight(i.content,o,l)||$e(i.content):a=$e(i.content),a.indexOf("<pre")===0)return a+`
13
13
  `;if(s){const c=i.attrIndex("class"),f=i.attrs?i.attrs.slice():[];c<0?f.push(["class",n.langPrefix+o]):(f[c]=f[c].slice(),f[c][1]+=" "+n.langPrefix+o);const p={attrs:f};return`<pre><code${u.renderAttrs(p)}>${a}</code></pre>
14
14
  `}return`<pre><code${u.renderAttrs(i)}>${a}</code></pre>
15
15
  `};Ce.image=function(t,e,n,r,u){const i=t[e];return i.attrs[i.attrIndex("alt")][1]=u.renderInlineAsText(i.children,n,r),u.renderToken(t,e,n)};Ce.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
@@ -17,18 +17,18 @@
17
17
  `};Ce.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
18
18
  `:`<br>
19
19
  `:`
20
- `};Ce.text=function(t,e){return $e(t[e].content)};Ce.html_block=function(t,e){return t[e].content};Ce.html_inline=function(t,e){return t[e].content};function kt(){this.rules=Nn({},Ce)}kt.prototype.renderAttrs=function(e){let n,r,u;if(!e.attrs)return"";for(u="",n=0,r=e.attrs.length;n<r;n++)u+=" "+$e(e.attrs[n][0])+'="'+$e(e.attrs[n][1])+'"';return u};kt.prototype.renderToken=function(e,n,r){const u=e[n];let i="";if(u.hidden)return"";u.block&&u.nesting!==-1&&n&&e[n-1].hidden&&(i+=`
20
+ `};Ce.text=function(t,e){return $e(t[e].content)};Ce.html_block=function(t,e){return t[e].content};Ce.html_inline=function(t,e){return t[e].content};function Ct(){this.rules=Fn({},Ce)}Ct.prototype.renderAttrs=function(e){let n,r,u;if(!e.attrs)return"";for(u="",n=0,r=e.attrs.length;n<r;n++)u+=" "+$e(e.attrs[n][0])+'="'+$e(e.attrs[n][1])+'"';return u};Ct.prototype.renderToken=function(e,n,r){const u=e[n];let i="";if(u.hidden)return"";u.block&&u.nesting!==-1&&n&&e[n-1].hidden&&(i+=`
21
21
  `),i+=(u.nesting===-1?"</":"<")+u.tag,i+=this.renderAttrs(u),u.nesting===0&&r.xhtmlOut&&(i+=" /");let s=!1;if(u.block&&(s=!0,u.nesting===1&&n+1<e.length)){const o=e[n+1];(o.type==="inline"||o.hidden||o.nesting===-1&&o.tag===u.tag)&&(s=!1)}return i+=s?`>
22
- `:">",i};kt.prototype.renderInline=function(t,e,n){let r="";const u=this.rules;for(let i=0,s=t.length;i<s;i++){const o=t[i].type;typeof u[o]<"u"?r+=u[o](t,i,e,n,this):r+=this.renderToken(t,i,e)}return r};kt.prototype.renderInlineAsText=function(t,e,n){let r="";for(let u=0,i=t.length;u<i;u++)switch(t[u].type){case"text":r+=t[u].content;break;case"image":r+=this.renderInlineAsText(t[u].children,e,n);break;case"html_inline":case"html_block":r+=t[u].content;break;case"softbreak":case"hardbreak":r+=`
23
- `;break}return r};kt.prototype.render=function(t,e,n){let r="";const u=this.rules;for(let i=0,s=t.length;i<s;i++){const o=t[i].type;o==="inline"?r+=this.renderInline(t[i].children,e,n):typeof u[o]<"u"?r+=u[o](t,i,e,n,this):r+=this.renderToken(t,i,e,n)}return r};function X(){this.__rules__=[],this.__cache__=null}X.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};X.prototype.__compile__=function(){const t=this,e=[""];t.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){e.indexOf(r)<0&&e.push(r)})}),t.__cache__={},e.forEach(function(n){t.__cache__[n]=[],t.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||t.__cache__[n].push(r.fn))})})};X.prototype.at=function(t,e,n){const r=this.__find__(t),u=n||{};if(r===-1)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=u.alt||[],this.__cache__=null};X.prototype.before=function(t,e,n,r){const u=this.__find__(t),i=r||{};if(u===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(u,0,{name:e,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null};X.prototype.after=function(t,e,n,r){const u=this.__find__(t),i=r||{};if(u===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(u+1,0,{name:e,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null};X.prototype.push=function(t,e,n){const r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};X.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const u=this.__find__(r);if(u<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[u].enabled=!0,n.push(r)},this),this.__cache__=null,n};X.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};X.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const u=this.__find__(r);if(u<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[u].enabled=!1,n.push(r)},this),this.__cache__=null,n};X.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function fe(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}fe.prototype.attrIndex=function(e){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,u=n.length;r<u;r++)if(n[r][0]===e)return r;return-1};fe.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};fe.prototype.attrSet=function(e,n){const r=this.attrIndex(e),u=[e,n];r<0?this.attrPush(u):this.attrs[r]=u};fe.prototype.attrGet=function(e){const n=this.attrIndex(e);let r=null;return n>=0&&(r=this.attrs[n][1]),r};fe.prototype.attrJoin=function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function co(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}co.prototype.Token=fe;const J0=/\r\n?|\n/g,j0=/\0/g;function U0(t){let e;e=t.src.replace(J0,`
24
- `),e=e.replace(j0,"�"),t.src=e}function K0(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function Z0(t){const e=t.tokens;for(let n=0,r=e.length;n<r;n++){const u=e[n];u.type==="inline"&&t.md.inline.parse(u.content,t.md,t.env,u.children)}}function G0(t){return/^<a[>\s]/i.test(t)}function Y0(t){return/^<\/a\s*>/i.test(t)}function X0(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n<r;n++){if(e[n].type!=="inline"||!t.md.linkify.pretest(e[n].content))continue;let u=e[n].children,i=0;for(let s=u.length-1;s>=0;s--){const o=u[s];if(o.type==="link_close"){for(s--;u[s].level!==o.level&&u[s].type!=="link_open";)s--;continue}if(o.type==="html_inline"&&(G0(o.content)&&i>0&&i--,Y0(o.content)&&i++),!(i>0)&&o.type==="text"&&t.md.linkify.test(o.content)){const l=o.content;let a=t.md.linkify.match(l);const c=[];let f=o.level,p=0;a.length>0&&a[0].index===0&&s>0&&u[s-1].type==="text_special"&&(a=a.slice(1));for(let h=0;h<a.length;h++){const d=a[h].url,m=t.md.normalizeLink(d);if(!t.md.validateLink(m))continue;let g=a[h].text;a[h].schema?a[h].schema==="mailto:"&&!/^mailto:/i.test(g)?g=t.md.normalizeLinkText("mailto:"+g).replace(/^mailto:/,""):g=t.md.normalizeLinkText(g):g=t.md.normalizeLinkText("http://"+g).replace(/^http:\/\//,"");const b=a[h].index;if(b>p){const S=new t.Token("text","",0);S.content=l.slice(p,b),S.level=f,c.push(S)}const k=new t.Token("link_open","a",1);k.attrs=[["href",m]],k.level=f++,k.markup="linkify",k.info="auto",c.push(k);const y=new t.Token("text","",0);y.content=g,y.level=f,c.push(y);const _=new t.Token("link_close","a",-1);_.level=--f,_.markup="linkify",_.info="auto",c.push(_),p=a[h].lastIndex}if(p<l.length){const h=new t.Token("text","",0);h.content=l.slice(p),h.level=f,c.push(h)}e[n].children=u=lo(u,s,c)}}}}const fo=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Q0=/\((c|tm|r)\)/i,ef=/\((c|tm|r)\)/ig,tf={c:"©",r:"®",tm:"™"};function nf(t,e){return tf[e.toLowerCase()]}function rf(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(ef,nf)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function uf(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&fo.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function sf(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(Q0.test(t.tokens[e].content)&&rf(t.tokens[e].children),fo.test(t.tokens[e].content)&&uf(t.tokens[e].children))}const of=/['"]/,pi=/['"]/g,mi="’";function sn(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function lf(t,e){let n;const r=[];for(let u=0;u<t.length;u++){const i=t[u],s=t[u].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,i.type!=="text")continue;let o=i.content,l=0,a=o.length;e:for(;l<a;){pi.lastIndex=l;const c=pi.exec(o);if(!c)break;let f=!0,p=!0;l=c.index+1;const h=c[0]==="'";let d=32;if(c.index-1>=0)d=o.charCodeAt(c.index-1);else for(n=u-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){d=t[n].content.charCodeAt(t[n].content.length-1);break}let m=32;if(l<a)m=o.charCodeAt(l);else for(n=u+1;n<t.length&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n++)if(t[n].content){m=t[n].content.charCodeAt(0);break}const g=Ht(d)||Wt(String.fromCharCode(d)),b=Ht(m)||Wt(String.fromCharCode(m)),k=$t(d),y=$t(m);if(y?f=!1:b&&(k||g||(f=!1)),k?p=!1:g&&(y||b||(p=!1)),m===34&&c[0]==='"'&&d>=48&&d<=57&&(p=f=!1),f&&p&&(f=g,p=b),!f&&!p){h&&(i.content=sn(i.content,c.index,mi));continue}if(p)for(n=r.length-1;n>=0;n--){let _=r[n];if(r[n].level<s)break;if(_.single===h&&r[n].level===s){_=r[n];let S,E;h?(S=e.md.options.quotes[2],E=e.md.options.quotes[3]):(S=e.md.options.quotes[0],E=e.md.options.quotes[1]),i.content=sn(i.content,c.index,E),t[_.token].content=sn(t[_.token].content,_.pos,S),l+=E.length-1,_.token===u&&(l+=S.length-1),o=i.content,a=o.length,r.length=n;continue e}}f?r.push({token:u,pos:c.index,single:h,level:s}):p&&h&&(i.content=sn(i.content,c.index,mi))}}}function af(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)t.tokens[e].type!=="inline"||!of.test(t.tokens[e].content)||lf(t.tokens[e].children,t)}function cf(t){let e,n;const r=t.tokens,u=r.length;for(let i=0;i<u;i++){if(r[i].type!=="inline")continue;const s=r[i].children,o=s.length;for(e=0;e<o;e++)s[e].type==="text_special"&&(s[e].type="text");for(e=n=0;e<o;e++)s[e].type==="text"&&e+1<o&&s[e+1].type==="text"?s[e+1].content=s[e].content+s[e+1].content:(e!==n&&(s[n]=s[e]),n++);e!==n&&(s.length=n)}}const er=[["normalize",U0],["block",K0],["inline",Z0],["linkify",X0],["replacements",sf],["smartquotes",af],["text_join",cf]];function uu(){this.ruler=new X;for(let t=0;t<er.length;t++)this.ruler.push(er[t][0],er[t][1])}uu.prototype.process=function(t){const e=this.ruler.getRules("");for(let n=0,r=e.length;n<r;n++)e[n](t)};uu.prototype.State=co;function De(t,e,n,r){this.src=t,this.md=e,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const u=this.src;for(let i=0,s=0,o=0,l=0,a=u.length,c=!1;s<a;s++){const f=u.charCodeAt(s);if(!c)if(I(f)){o++,f===9?l+=4-l%4:l++;continue}else c=!0;(f===10||s===a-1)&&(f!==10&&s++,this.bMarks.push(i),this.eMarks.push(s),this.tShift.push(o),this.sCount.push(l),this.bsCount.push(0),c=!1,o=0,l=0,i=s+1)}this.bMarks.push(u.length),this.eMarks.push(u.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}De.prototype.push=function(t,e,n){const r=new fe(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};De.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};De.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;e<n&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e};De.prototype.skipSpaces=function(e){for(let n=this.src.length;e<n;e++){const r=this.src.charCodeAt(e);if(!I(r))break}return e};De.prototype.skipSpacesBack=function(e,n){if(e<=n)return e;for(;e>n;)if(!I(this.src.charCodeAt(--e)))return e+1;return e};De.prototype.skipChars=function(e,n){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===n;e++);return e};De.prototype.skipCharsBack=function(e,n,r){if(e<=r)return e;for(;e>r;)if(n!==this.src.charCodeAt(--e))return e+1;return e};De.prototype.getLines=function(e,n,r,u){if(e>=n)return"";const i=new Array(n-e);for(let s=0,o=e;o<n;o++,s++){let l=0;const a=this.bMarks[o];let c=a,f;for(o+1<n||u?f=this.eMarks[o]+1:f=this.eMarks[o];c<f&&l<r;){const p=this.src.charCodeAt(c);if(I(p))p===9?l+=4-(l+this.bsCount[o])%4:l++;else if(c-a<this.tShift[o])l++;else break;c++}l>r?i[s]=new Array(l-r+1).join(" ")+this.src.slice(c,f):i[s]=this.src.slice(c,f)}return i.join("")};De.prototype.Token=fe;const ff=65536;function tr(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function gi(t){const e=[],n=t.length;let r=0,u=t.charCodeAt(r),i=!1,s=0,o="";for(;r<n;)u===124&&(i?(o+=t.substring(s,r-1),s=r):(e.push(o+t.substring(s,r)),o="",s=r+1)),i=u===92,r++,u=t.charCodeAt(r);return e.push(o+t.substring(s)),e}function df(t,e,n,r){if(e+2>n)return!1;let u=e+1;if(t.sCount[u]<t.blkIndent||t.sCount[u]-t.blkIndent>=4)return!1;let i=t.bMarks[u]+t.tShift[u];if(i>=t.eMarks[u])return!1;const s=t.src.charCodeAt(i++);if(s!==124&&s!==45&&s!==58||i>=t.eMarks[u])return!1;const o=t.src.charCodeAt(i++);if(o!==124&&o!==45&&o!==58&&!I(o)||s===45&&I(o))return!1;for(;i<t.eMarks[u];){const _=t.src.charCodeAt(i);if(_!==124&&_!==45&&_!==58&&!I(_))return!1;i++}let l=tr(t,e+1),a=l.split("|");const c=[];for(let _=0;_<a.length;_++){const S=a[_].trim();if(!S){if(_===0||_===a.length-1)continue;return!1}if(!/^:?-+:?$/.test(S))return!1;S.charCodeAt(S.length-1)===58?c.push(S.charCodeAt(0)===58?"center":"right"):S.charCodeAt(0)===58?c.push("left"):c.push("")}if(l=tr(t,e).trim(),l.indexOf("|")===-1||t.sCount[e]-t.blkIndent>=4)return!1;a=gi(l),a.length&&a[0]===""&&a.shift(),a.length&&a[a.length-1]===""&&a.pop();const f=a.length;if(f===0||f!==c.length)return!1;if(r)return!0;const p=t.parentType;t.parentType="table";const h=t.md.block.ruler.getRules("blockquote"),d=t.push("table_open","table",1),m=[e,0];d.map=m;const g=t.push("thead_open","thead",1);g.map=[e,e+1];const b=t.push("tr_open","tr",1);b.map=[e,e+1];for(let _=0;_<a.length;_++){const S=t.push("th_open","th",1);c[_]&&(S.attrs=[["style","text-align:"+c[_]]]);const E=t.push("inline","",0);E.content=a[_].trim(),E.children=[],t.push("th_close","th",-1)}t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let k,y=0;for(u=e+2;u<n&&!(t.sCount[u]<t.blkIndent);u++){let _=!1;for(let E=0,D=h.length;E<D;E++)if(h[E](t,u,n,!0)){_=!0;break}if(_||(l=tr(t,u).trim(),!l)||t.sCount[u]-t.blkIndent>=4||(a=gi(l),a.length&&a[0]===""&&a.shift(),a.length&&a[a.length-1]===""&&a.pop(),y+=f-a.length,y>ff))break;if(u===e+2){const E=t.push("tbody_open","tbody",1);E.map=k=[e+2,0]}const S=t.push("tr_open","tr",1);S.map=[u,u+1];for(let E=0;E<f;E++){const D=t.push("td_open","td",1);c[E]&&(D.attrs=[["style","text-align:"+c[E]]]);const T=t.push("inline","",0);T.content=a[E]?a[E].trim():"",T.children=[],t.push("td_close","td",-1)}t.push("tr_close","tr",-1)}return k&&(t.push("tbody_close","tbody",-1),k[1]=u),t.push("table_close","table",-1),m[1]=u,t.parentType=p,t.line=u,!0}function hf(t,e,n){if(t.sCount[e]-t.blkIndent<4)return!1;let r=e+1,u=r;for(;r<n;){if(t.isEmpty(r)){r++;continue}if(t.sCount[r]-t.blkIndent>=4){r++,u=r;continue}break}t.line=u;const i=t.push("code_block","code",0);return i.content=t.getLines(e,u,4+t.blkIndent,!1)+`
25
- `,i.map=[e,t.line],!0}function pf(t,e,n,r){let u=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||u+3>i)return!1;const s=t.src.charCodeAt(u);if(s!==126&&s!==96)return!1;let o=u;u=t.skipChars(u,s);let l=u-o;if(l<3)return!1;const a=t.src.slice(o,u),c=t.src.slice(u,i);if(s===96&&c.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let f=e,p=!1;for(;f++,!(f>=n||(u=o=t.bMarks[f]+t.tShift[f],i=t.eMarks[f],u<i&&t.sCount[f]<t.blkIndent));)if(t.src.charCodeAt(u)===s&&!(t.sCount[f]-t.blkIndent>=4)&&(u=t.skipChars(u,s),!(u-o<l)&&(u=t.skipSpaces(u),!(u<i)))){p=!0;break}l=t.sCount[e],t.line=f+(p?1:0);const h=t.push("fence","code",0);return h.info=c,h.content=t.getLines(e+1,f,l,!0),h.markup=a,h.map=[e,t.line],!0}function mf(t,e,n,r){let u=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];const s=t.lineMax;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(u)!==62)return!1;if(r)return!0;const o=[],l=[],a=[],c=[],f=t.md.block.ruler.getRules("blockquote"),p=t.parentType;t.parentType="blockquote";let h=!1,d;for(d=e;d<n;d++){const y=t.sCount[d]<t.blkIndent;if(u=t.bMarks[d]+t.tShift[d],i=t.eMarks[d],u>=i)break;if(t.src.charCodeAt(u++)===62&&!y){let S=t.sCount[d]+1,E,D;t.src.charCodeAt(u)===32?(u++,S++,D=!1,E=!0):t.src.charCodeAt(u)===9?(E=!0,(t.bsCount[d]+S)%4===3?(u++,S++,D=!1):D=!0):E=!1;let T=S;for(o.push(t.bMarks[d]),t.bMarks[d]=u;u<i;){const O=t.src.charCodeAt(u);if(I(O))O===9?T+=4-(T+t.bsCount[d]+(D?1:0))%4:T++;else break;u++}h=u>=i,l.push(t.bsCount[d]),t.bsCount[d]=t.sCount[d]+1+(E?1:0),a.push(t.sCount[d]),t.sCount[d]=T-S,c.push(t.tShift[d]),t.tShift[d]=u-t.bMarks[d];continue}if(h)break;let _=!1;for(let S=0,E=f.length;S<E;S++)if(f[S](t,d,n,!0)){_=!0;break}if(_){t.lineMax=d,t.blkIndent!==0&&(o.push(t.bMarks[d]),l.push(t.bsCount[d]),c.push(t.tShift[d]),a.push(t.sCount[d]),t.sCount[d]-=t.blkIndent);break}o.push(t.bMarks[d]),l.push(t.bsCount[d]),c.push(t.tShift[d]),a.push(t.sCount[d]),t.sCount[d]=-1}const m=t.blkIndent;t.blkIndent=0;const g=t.push("blockquote_open","blockquote",1);g.markup=">";const b=[e,0];g.map=b,t.md.block.tokenize(t,e,d);const k=t.push("blockquote_close","blockquote",-1);k.markup=">",t.lineMax=s,t.parentType=p,b[1]=t.line;for(let y=0;y<c.length;y++)t.bMarks[y+e]=o[y],t.tShift[y+e]=c[y],t.sCount[y+e]=a[y],t.bsCount[y+e]=l[y];return t.blkIndent=m,!0}function gf(t,e,n,r){const u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let i=t.bMarks[e]+t.tShift[e];const s=t.src.charCodeAt(i++);if(s!==42&&s!==45&&s!==95)return!1;let o=1;for(;i<u;){const a=t.src.charCodeAt(i++);if(a!==s&&!I(a))return!1;a===s&&o++}if(o<3)return!1;if(r)return!0;t.line=e+1;const l=t.push("hr","hr",0);return l.map=[e,t.line],l.markup=Array(o+1).join(String.fromCharCode(s)),!0}function bi(t,e){const n=t.eMarks[e];let r=t.bMarks[e]+t.tShift[e];const u=t.src.charCodeAt(r++);if(u!==42&&u!==45&&u!==43)return-1;if(r<n){const i=t.src.charCodeAt(r);if(!I(i))return-1}return r}function xi(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];let u=n;if(u+1>=r)return-1;let i=t.src.charCodeAt(u++);if(i<48||i>57)return-1;for(;;){if(u>=r)return-1;if(i=t.src.charCodeAt(u++),i>=48&&i<=57){if(u-n>=10)return-1;continue}if(i===41||i===46)break;return-1}return u<r&&(i=t.src.charCodeAt(u),!I(i))?-1:u}function bf(t,e){const n=t.level+2;for(let r=e+2,u=t.tokens.length-2;r<u;r++)t.tokens[r].level===n&&t.tokens[r].type==="paragraph_open"&&(t.tokens[r+2].hidden=!0,t.tokens[r].hidden=!0,r+=2)}function xf(t,e,n,r){let u,i,s,o,l=e,a=!0;if(t.sCount[l]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]<t.blkIndent)return!1;let c=!1;r&&t.parentType==="paragraph"&&t.sCount[l]>=t.blkIndent&&(c=!0);let f,p,h;if((h=xi(t,l))>=0){if(f=!0,s=t.bMarks[l]+t.tShift[l],p=Number(t.src.slice(s,h-1)),c&&p!==1)return!1}else if((h=bi(t,l))>=0)f=!1;else return!1;if(c&&t.skipSpaces(h)>=t.eMarks[l])return!1;if(r)return!0;const d=t.src.charCodeAt(h-1),m=t.tokens.length;f?(o=t.push("ordered_list_open","ol",1),p!==1&&(o.attrs=[["start",p]])):o=t.push("bullet_list_open","ul",1);const g=[l,0];o.map=g,o.markup=String.fromCharCode(d);let b=!1;const k=t.md.block.ruler.getRules("list"),y=t.parentType;for(t.parentType="list";l<n;){i=h,u=t.eMarks[l];const _=t.sCount[l]+h-(t.bMarks[l]+t.tShift[l]);let S=_;for(;i<u;){const we=t.src.charCodeAt(i);if(we===9)S+=4-(S+t.bsCount[l])%4;else if(we===32)S++;else break;i++}const E=i;let D;E>=u?D=1:D=S-_,D>4&&(D=1);const T=_+D;o=t.push("list_item_open","li",1),o.markup=String.fromCharCode(d);const O=[l,0];o.map=O,f&&(o.info=t.src.slice(s,h-1));const oe=t.tight,yt=t.tShift[l],vn=t.sCount[l],Ct=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=T,t.tight=!0,t.tShift[l]=E-t.bMarks[l],t.sCount[l]=S,E>=u&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,l,n,!0),(!t.tight||b)&&(a=!1),b=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=Ct,t.tShift[l]=yt,t.sCount[l]=vn,t.tight=oe,o=t.push("list_item_close","li",-1),o.markup=String.fromCharCode(d),l=t.line,O[1]=l,l>=n||t.sCount[l]<t.blkIndent||t.sCount[l]-t.blkIndent>=4)break;let Qt=!1;for(let we=0,zn=k.length;we<zn;we++)if(k[we](t,l,n,!0)){Qt=!0;break}if(Qt)break;if(f){if(h=xi(t,l),h<0)break;s=t.bMarks[l]+t.tShift[l]}else if(h=bi(t,l),h<0)break;if(d!==t.src.charCodeAt(h-1))break}return f?o=t.push("ordered_list_close","ol",-1):o=t.push("bullet_list_close","ul",-1),o.markup=String.fromCharCode(d),g[1]=l,t.line=l,t.parentType=y,a&&bf(t,m),!0}function kf(t,e,n,r){let u=t.bMarks[e]+t.tShift[e],i=t.eMarks[e],s=e+1;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(u)!==91)return!1;function o(k){const y=t.lineMax;if(k>=y||t.isEmpty(k))return null;let _=!1;if(t.sCount[k]-t.blkIndent>3&&(_=!0),t.sCount[k]<0&&(_=!0),!_){const D=t.md.block.ruler.getRules("reference"),T=t.parentType;t.parentType="reference";let O=!1;for(let oe=0,yt=D.length;oe<yt;oe++)if(D[oe](t,k,y,!0)){O=!0;break}if(t.parentType=T,O)return null}const S=t.bMarks[k]+t.tShift[k],E=t.eMarks[k];return t.src.slice(S,E+1)}let l=t.src.slice(u,i+1);i=l.length;let a=-1;for(u=1;u<i;u++){const k=l.charCodeAt(u);if(k===91)return!1;if(k===93){a=u;break}else if(k===10){const y=o(s);y!==null&&(l+=y,i=l.length,s++)}else if(k===92&&(u++,u<i&&l.charCodeAt(u)===10)){const y=o(s);y!==null&&(l+=y,i=l.length,s++)}}if(a<0||l.charCodeAt(a+1)!==58)return!1;for(u=a+2;u<i;u++){const k=l.charCodeAt(u);if(k===10){const y=o(s);y!==null&&(l+=y,i=l.length,s++)}else if(!I(k))break}const c=t.md.helpers.parseLinkDestination(l,u,i);if(!c.ok)return!1;const f=t.md.normalizeLink(c.str);if(!t.md.validateLink(f))return!1;u=c.pos;const p=u,h=s,d=u;for(;u<i;u++){const k=l.charCodeAt(u);if(k===10){const y=o(s);y!==null&&(l+=y,i=l.length,s++)}else if(!I(k))break}let m=t.md.helpers.parseLinkTitle(l,u,i);for(;m.can_continue;){const k=o(s);if(k===null)break;l+=k,u=i,i=l.length,s++,m=t.md.helpers.parseLinkTitle(l,u,i,m)}let g;for(u<i&&d!==u&&m.ok?(g=m.str,u=m.pos):(g="",u=p,s=h);u<i;){const k=l.charCodeAt(u);if(!I(k))break;u++}if(u<i&&l.charCodeAt(u)!==10&&g)for(g="",u=p,s=h;u<i;){const k=l.charCodeAt(u);if(!I(k))break;u++}if(u<i&&l.charCodeAt(u)!==10)return!1;const b=In(l.slice(1,a));return b?(r||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[b]>"u"&&(t.env.references[b]={title:g,href:f}),t.line=s),!0):!1}const yf=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Cf="[a-zA-Z_:][a-zA-Z0-9:._-]*",Df="[^\"'=<>`\\x00-\\x20]+",_f="'[^']*'",Ef='"[^"]*"',Sf="(?:"+Df+"|"+_f+"|"+Ef+")",Af="(?:\\s+"+Cf+"(?:\\s*=\\s*"+Sf+")?)",ho="<[A-Za-z][A-Za-z0-9\\-]*"+Af+"*\\s*\\/?>",po="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Mf="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",wf="<[?][\\s\\S]*?[?]>",Tf="<![A-Za-z][^>]*>",Of="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",Ff=new RegExp("^(?:"+ho+"|"+po+"|"+Mf+"|"+wf+"|"+Tf+"|"+Of+")"),Nf=new RegExp("^(?:"+ho+"|"+po+")"),st=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+yf.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Nf.source+"\\s*$"),/^$/,!1]];function If(t,e,n,r){let u=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(u)!==60)return!1;let s=t.src.slice(u,i),o=0;for(;o<st.length&&!st[o][0].test(s);o++);if(o===st.length)return!1;if(r)return st[o][2];let l=e+1;if(!st[o][1].test(s)){for(;l<n&&!(t.sCount[l]<t.blkIndent);l++)if(u=t.bMarks[l]+t.tShift[l],i=t.eMarks[l],s=t.src.slice(u,i),st[o][1].test(s)){s.length!==0&&l++;break}}t.line=l;const a=t.push("html_block","",0);return a.map=[e,l],a.content=t.getLines(e,l,t.blkIndent,!0),!0}function Rf(t,e,n,r){let u=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let s=t.src.charCodeAt(u);if(s!==35||u>=i)return!1;let o=1;for(s=t.src.charCodeAt(++u);s===35&&u<i&&o<=6;)o++,s=t.src.charCodeAt(++u);if(o>6||u<i&&!I(s))return!1;if(r)return!0;i=t.skipSpacesBack(i,u);const l=t.skipCharsBack(i,35,u);l>u&&I(t.src.charCodeAt(l-1))&&(i=l),t.line=e+1;const a=t.push("heading_open","h"+String(o),1);a.markup="########".slice(0,o),a.map=[e,t.line];const c=t.push("inline","",0);c.content=t.src.slice(u,i).trim(),c.map=[e,t.line],c.children=[];const f=t.push("heading_close","h"+String(o),-1);return f.markup="########".slice(0,o),!0}function Bf(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const u=t.parentType;t.parentType="paragraph";let i=0,s,o=e+1;for(;o<n&&!t.isEmpty(o);o++){if(t.sCount[o]-t.blkIndent>3)continue;if(t.sCount[o]>=t.blkIndent){let h=t.bMarks[o]+t.tShift[o];const d=t.eMarks[o];if(h<d&&(s=t.src.charCodeAt(h),(s===45||s===61)&&(h=t.skipChars(h,s),h=t.skipSpaces(h),h>=d))){i=s===61?1:2;break}}if(t.sCount[o]<0)continue;let p=!1;for(let h=0,d=r.length;h<d;h++)if(r[h](t,o,n,!0)){p=!0;break}if(p)break}if(!i)return!1;const l=t.getLines(e,o,t.blkIndent,!1).trim();t.line=o+1;const a=t.push("heading_open","h"+String(i),1);a.markup=String.fromCharCode(s),a.map=[e,t.line];const c=t.push("inline","",0);c.content=l,c.map=[e,t.line-1],c.children=[];const f=t.push("heading_close","h"+String(i),-1);return f.markup=String.fromCharCode(s),t.parentType=u,!0}function vf(t,e,n){const r=t.md.block.ruler.getRules("paragraph"),u=t.parentType;let i=e+1;for(t.parentType="paragraph";i<n&&!t.isEmpty(i);i++){if(t.sCount[i]-t.blkIndent>3||t.sCount[i]<0)continue;let a=!1;for(let c=0,f=r.length;c<f;c++)if(r[c](t,i,n,!0)){a=!0;break}if(a)break}const s=t.getLines(e,i,t.blkIndent,!1).trim();t.line=i;const o=t.push("paragraph_open","p",1);o.map=[e,t.line];const l=t.push("inline","",0);return l.content=s,l.map=[e,t.line],l.children=[],t.push("paragraph_close","p",-1),t.parentType=u,!0}const on=[["table",df,["paragraph","reference"]],["code",hf],["fence",pf,["paragraph","reference","blockquote","list"]],["blockquote",mf,["paragraph","reference","blockquote","list"]],["hr",gf,["paragraph","reference","blockquote","list"]],["list",xf,["paragraph","reference","blockquote"]],["reference",kf],["html_block",If,["paragraph","reference","blockquote"]],["heading",Rf,["paragraph","reference","blockquote"]],["lheading",Bf],["paragraph",vf]];function Rn(){this.ruler=new X;for(let t=0;t<on.length;t++)this.ruler.push(on[t][0],on[t][1],{alt:(on[t][2]||[]).slice()})}Rn.prototype.tokenize=function(t,e,n){const r=this.ruler.getRules(""),u=r.length,i=t.md.options.maxNesting;let s=e,o=!1;for(;s<n&&(t.line=s=t.skipEmptyLines(s),!(s>=n||t.sCount[s]<t.blkIndent));){if(t.level>=i){t.line=n;break}const l=t.line;let a=!1;for(let c=0;c<u;c++)if(a=r[c](t,s,n,!1),a){if(l>=t.line)throw new Error("block rule didn't increment state.line");break}if(!a)throw new Error("none of the block rules matched");t.tight=!o,t.isEmpty(t.line-1)&&(o=!0),s=t.line,s<n&&t.isEmpty(s)&&(o=!0,s++,t.line=s)}};Rn.prototype.parse=function(t,e,n,r){if(!t)return;const u=new this.State(t,e,n,r);this.tokenize(u,u.line,u.lineMax)};Rn.prototype.State=De;function Yt(t,e,n,r){this.src=t,this.env=n,this.md=e,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Yt.prototype.pushPending=function(){const t=new fe("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t};Yt.prototype.push=function(t,e,n){this.pending&&this.pushPending();const r=new fe(t,e,n);let u=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],u={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(u),r};Yt.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t),u=t>0?this.src.charCodeAt(t-1):32;let i=t;for(;i<n&&this.src.charCodeAt(i)===r;)i++;const s=i-t,o=i<n?this.src.charCodeAt(i):32,l=Ht(u)||Wt(String.fromCharCode(u)),a=Ht(o)||Wt(String.fromCharCode(o)),c=$t(u),f=$t(o),p=!f&&(!a||c||l),h=!c&&(!l||f||a);return{can_open:p&&(e||!h||l),can_close:h&&(e||!p||a),length:s}};Yt.prototype.Token=fe;function zf(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Pf(t,e){let n=t.pos;for(;n<t.posMax&&!zf(t.src.charCodeAt(n));)n++;return n===t.pos?!1:(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}const Lf=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function qf(t,e){if(!t.md.options.linkify||t.linkLevel>0)return!1;const n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const u=t.pending.match(Lf);if(!u)return!1;const i=u[1],s=t.md.linkify.matchAtStart(t.src.slice(n-i.length));if(!s)return!1;let o=s.url;if(o.length<=i.length)return!1;o=o.replace(/\*+$/,"");const l=t.md.normalizeLink(o);if(!t.md.validateLink(l))return!1;if(!e){t.pending=t.pending.slice(0,-i.length);const a=t.push("link_open","a",1);a.attrs=[["href",l]],a.markup="linkify",a.info="auto";const c=t.push("text","",0);c.content=t.md.normalizeLinkText(o);const f=t.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return t.pos+=o.length-i.length,!0}function Vf(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,u=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let i=r-1;for(;i>=1&&t.pending.charCodeAt(i-1)===32;)i--;t.pending=t.pending.slice(0,i),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n<u&&I(t.src.charCodeAt(n));)n++;return t.pos=n,!0}const iu=[];for(let t=0;t<256;t++)iu.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){iu[t.charCodeAt(0)]=1});function $f(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let u=t.src.charCodeAt(n);if(u===10){for(e||t.push("hardbreak","br",0),n++;n<r&&(u=t.src.charCodeAt(n),!!I(u));)n++;return t.pos=n,!0}let i=t.src[n];if(u>=55296&&u<=56319&&n+1<r){const o=t.src.charCodeAt(n+1);o>=56320&&o<=57343&&(i+=t.src[n+1],n++)}const s="\\"+i;if(!e){const o=t.push("text_special","",0);u<256&&iu[u]!==0?o.content=i:o.content=s,o.markup=s,o.info="escape"}return t.pos=n+1,!0}function Wf(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const u=n;n++;const i=t.posMax;for(;n<i&&t.src.charCodeAt(n)===96;)n++;const s=t.src.slice(u,n),o=s.length;if(t.backticksScanned&&(t.backticks[o]||0)<=u)return e||(t.pending+=s),t.pos+=o,!0;let l=n,a;for(;(a=t.src.indexOf("`",l))!==-1;){for(l=a+1;l<i&&t.src.charCodeAt(l)===96;)l++;const c=l-a;if(c===o){if(!e){const f=t.push("code_inline","code",0);f.markup=s,f.content=t.src.slice(n,a).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=l,!0}t.backticks[c]=a}return t.backticksScanned=!0,e||(t.pending+=s),t.pos+=o,!0}function Hf(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==126)return!1;const u=t.scanDelims(t.pos,!0);let i=u.length;const s=String.fromCharCode(r);if(i<2)return!1;let o;i%2&&(o=t.push("text","",0),o.content=s,i--);for(let l=0;l<i;l+=2)o=t.push("text","",0),o.content=s+s,t.delimiters.push({marker:r,length:0,token:t.tokens.length-1,end:-1,open:u.can_open,close:u.can_close});return t.pos+=u.length,!0}function ki(t,e){let n;const r=[],u=e.length;for(let i=0;i<u;i++){const s=e[i];if(s.marker!==126||s.end===-1)continue;const o=e[s.end];n=t.tokens[s.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=t.tokens[o.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",t.tokens[o.token-1].type==="text"&&t.tokens[o.token-1].content==="~"&&r.push(o.token-1)}for(;r.length;){const i=r.pop();let s=i+1;for(;s<t.tokens.length&&t.tokens[s].type==="s_close";)s++;s--,i!==s&&(n=t.tokens[s],t.tokens[s]=t.tokens[i],t.tokens[i]=n)}}function Jf(t){const e=t.tokens_meta,n=t.tokens_meta.length;ki(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&ki(t,e[r].delimiters)}const mo={tokenize:Hf,postProcess:Jf};function jf(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==95&&r!==42)return!1;const u=t.scanDelims(t.pos,r===42);for(let i=0;i<u.length;i++){const s=t.push("text","",0);s.content=String.fromCharCode(r),t.delimiters.push({marker:r,length:u.length,token:t.tokens.length-1,end:-1,open:u.can_open,close:u.can_close})}return t.pos+=u.length,!0}function yi(t,e){const n=e.length;for(let r=n-1;r>=0;r--){const u=e[r];if(u.marker!==95&&u.marker!==42||u.end===-1)continue;const i=e[u.end],s=r>0&&e[r-1].end===u.end+1&&e[r-1].marker===u.marker&&e[r-1].token===u.token-1&&e[u.end+1].token===i.token+1,o=String.fromCharCode(u.marker),l=t.tokens[u.token];l.type=s?"strong_open":"em_open",l.tag=s?"strong":"em",l.nesting=1,l.markup=s?o+o:o,l.content="";const a=t.tokens[i.token];a.type=s?"strong_close":"em_close",a.tag=s?"strong":"em",a.nesting=-1,a.markup=s?o+o:o,a.content="",s&&(t.tokens[e[r-1].token].content="",t.tokens[e[u.end+1].token].content="",r--)}}function Uf(t){const e=t.tokens_meta,n=t.tokens_meta.length;yi(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&yi(t,e[r].delimiters)}const go={tokenize:jf,postProcess:Uf};function Kf(t,e){let n,r,u,i,s="",o="",l=t.pos,a=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;const c=t.pos,f=t.posMax,p=t.pos+1,h=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(h<0)return!1;let d=h+1;if(d<f&&t.src.charCodeAt(d)===40){for(a=!1,d++;d<f&&(n=t.src.charCodeAt(d),!(!I(n)&&n!==10));d++);if(d>=f)return!1;if(l=d,u=t.md.helpers.parseLinkDestination(t.src,d,t.posMax),u.ok){for(s=t.md.normalizeLink(u.str),t.md.validateLink(s)?d=u.pos:s="",l=d;d<f&&(n=t.src.charCodeAt(d),!(!I(n)&&n!==10));d++);if(u=t.md.helpers.parseLinkTitle(t.src,d,t.posMax),d<f&&l!==d&&u.ok)for(o=u.str,d=u.pos;d<f&&(n=t.src.charCodeAt(d),!(!I(n)&&n!==10));d++);}(d>=f||t.src.charCodeAt(d)!==41)&&(a=!0),d++}if(a){if(typeof t.env.references>"u")return!1;if(d<f&&t.src.charCodeAt(d)===91?(l=d+1,d=t.md.helpers.parseLinkLabel(t,d),d>=0?r=t.src.slice(l,d++):d=h+1):d=h+1,r||(r=t.src.slice(p,h)),i=t.env.references[In(r)],!i)return t.pos=c,!1;s=i.href,o=i.title}if(!e){t.pos=p,t.posMax=h;const m=t.push("link_open","a",1),g=[["href",s]];m.attrs=g,o&&g.push(["title",o]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=d,t.posMax=f,!0}function Zf(t,e){let n,r,u,i,s,o,l,a,c="";const f=t.pos,p=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const h=t.pos+2,d=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(d<0)return!1;if(i=d+1,i<p&&t.src.charCodeAt(i)===40){for(i++;i<p&&(n=t.src.charCodeAt(i),!(!I(n)&&n!==10));i++);if(i>=p)return!1;for(a=i,o=t.md.helpers.parseLinkDestination(t.src,i,t.posMax),o.ok&&(c=t.md.normalizeLink(o.str),t.md.validateLink(c)?i=o.pos:c=""),a=i;i<p&&(n=t.src.charCodeAt(i),!(!I(n)&&n!==10));i++);if(o=t.md.helpers.parseLinkTitle(t.src,i,t.posMax),i<p&&a!==i&&o.ok)for(l=o.str,i=o.pos;i<p&&(n=t.src.charCodeAt(i),!(!I(n)&&n!==10));i++);else l="";if(i>=p||t.src.charCodeAt(i)!==41)return t.pos=f,!1;i++}else{if(typeof t.env.references>"u")return!1;if(i<p&&t.src.charCodeAt(i)===91?(a=i+1,i=t.md.helpers.parseLinkLabel(t,i),i>=0?u=t.src.slice(a,i++):i=d+1):i=d+1,u||(u=t.src.slice(h,d)),s=t.env.references[In(u)],!s)return t.pos=f,!1;c=s.href,l=s.title}if(!e){r=t.src.slice(h,d);const m=[];t.md.inline.parse(r,t.md,t.env,m);const g=t.push("image","img",0),b=[["src",c],["alt",""]];g.attrs=b,g.children=m,g.content=r,l&&b.push(["title",l])}return t.pos=i,t.posMax=p,!0}const Gf=/^([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])?)*)$/,Yf=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Xf(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,u=t.posMax;for(;;){if(++n>=u)return!1;const s=t.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const i=t.src.slice(r+1,n);if(Yf.test(i)){const s=t.md.normalizeLink(i);if(!t.md.validateLink(s))return!1;if(!e){const o=t.push("link_open","a",1);o.attrs=[["href",s]],o.markup="autolink",o.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(i);const a=t.push("link_close","a",-1);a.markup="autolink",a.info="auto"}return t.pos+=i.length+2,!0}if(Gf.test(i)){const s=t.md.normalizeLink("mailto:"+i);if(!t.md.validateLink(s))return!1;if(!e){const o=t.push("link_open","a",1);o.attrs=[["href",s]],o.markup="autolink",o.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(i);const a=t.push("link_close","a",-1);a.markup="autolink",a.info="auto"}return t.pos+=i.length+2,!0}return!1}function Qf(t){return/^<a[>\s]/i.test(t)}function ed(t){return/^<\/a\s*>/i.test(t)}function td(t){const e=t|32;return e>=97&&e<=122}function nd(t,e){if(!t.md.options.html)return!1;const n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;const u=t.src.charCodeAt(r+1);if(u!==33&&u!==63&&u!==47&&!td(u))return!1;const i=t.src.slice(r).match(Ff);if(!i)return!1;if(!e){const s=t.push("html_inline","",0);s.content=i[0],Qf(s.content)&&t.linkLevel++,ed(s.content)&&t.linkLevel--}return t.pos+=i[0].length,!0}const rd=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,ud=/^&([a-z][a-z0-9]{1,31});/i;function id(t,e){const n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){const i=t.src.slice(n).match(rd);if(i){if(!e){const s=i[1][0].toLowerCase()==="x"?parseInt(i[1].slice(1),16):parseInt(i[1],10),o=t.push("text_special","",0);o.content=ru(s)?_n(s):_n(65533),o.markup=i[0],o.info="entity"}return t.pos+=i[0].length,!0}}else{const i=t.src.slice(n).match(ud);if(i){const s=oo(i[0]);if(s!==i[0]){if(!e){const o=t.push("text_special","",0);o.content=s,o.markup=i[0],o.info="entity"}return t.pos+=i[0].length,!0}}}return!1}function Ci(t){const e={},n=t.length;if(!n)return;let r=0,u=-2;const i=[];for(let s=0;s<n;s++){const o=t[s];if(i.push(0),(t[r].marker!==o.marker||u!==o.token-1)&&(r=s),u=o.token,o.length=o.length||0,!o.close)continue;e.hasOwnProperty(o.marker)||(e[o.marker]=[-1,-1,-1,-1,-1,-1]);const l=e[o.marker][(o.open?3:0)+o.length%3];let a=r-i[r]-1,c=a;for(;a>l;a-=i[a]+1){const f=t[a];if(f.marker===o.marker&&f.open&&f.end<0){let p=!1;if((f.close||o.open)&&(f.length+o.length)%3===0&&(f.length%3!==0||o.length%3!==0)&&(p=!0),!p){const h=a>0&&!t[a-1].open?i[a-1]+1:0;i[s]=s-a+h,i[a]=h,o.open=!1,f.end=s,f.close=!1,c=-1,u=-2;break}}}c!==-1&&(e[o.marker][(o.open?3:0)+(o.length||0)%3]=c)}}function sd(t){const e=t.tokens_meta,n=t.tokens_meta.length;Ci(t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&Ci(e[r].delimiters)}function od(t){let e,n,r=0;const u=t.tokens,i=t.tokens.length;for(e=n=0;e<i;e++)u[e].nesting<0&&r--,u[e].level=r,u[e].nesting>0&&r++,u[e].type==="text"&&e+1<i&&u[e+1].type==="text"?u[e+1].content=u[e].content+u[e+1].content:(e!==n&&(u[n]=u[e]),n++);e!==n&&(u.length=n)}const nr=[["text",Pf],["linkify",qf],["newline",Vf],["escape",$f],["backticks",Wf],["strikethrough",mo.tokenize],["emphasis",go.tokenize],["link",Kf],["image",Zf],["autolink",Xf],["html_inline",nd],["entity",id]],rr=[["balance_pairs",sd],["strikethrough",mo.postProcess],["emphasis",go.postProcess],["fragments_join",od]];function Xt(){this.ruler=new X;for(let t=0;t<nr.length;t++)this.ruler.push(nr[t][0],nr[t][1]);this.ruler2=new X;for(let t=0;t<rr.length;t++)this.ruler2.push(rr[t][0],rr[t][1])}Xt.prototype.skipToken=function(t){const e=t.pos,n=this.ruler.getRules(""),r=n.length,u=t.md.options.maxNesting,i=t.cache;if(typeof i[e]<"u"){t.pos=i[e];return}let s=!1;if(t.level<u){for(let o=0;o<r;o++)if(t.level++,s=n[o](t,!0),t.level--,s){if(e>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;s||t.pos++,i[e]=t.pos};Xt.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,u=t.md.options.maxNesting;for(;t.pos<r;){const i=t.pos;let s=!1;if(t.level<u){for(let o=0;o<n;o++)if(s=e[o](t,!1),s){if(i>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};Xt.prototype.parse=function(t,e,n,r){const u=new this.State(t,e,n,r);this.tokenize(u);const i=this.ruler2.getRules(""),s=i.length;for(let o=0;o<s;o++)i[o](u)};Xt.prototype.State=Yt;function ld(t){const e={};t=t||{},e.src_Any=no.source,e.src_Cc=ro.source,e.src_Z=io.source,e.src_P=tu.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");const n="[><|]";return e.src_pseudo_letter="(?:(?!"+n+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+n+"|"+e.src_ZPCc+")(?!"+(t["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+e.src_ZCc+"|$)|\\!+(?!"+e.src_ZCc+"|[!]|$)|\\?(?!"+e.src_ZCc+"|[?]|$))+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function Or(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function Bn(t){return Object.prototype.toString.call(t)}function ad(t){return Bn(t)==="[object String]"}function cd(t){return Bn(t)==="[object Object]"}function fd(t){return Bn(t)==="[object RegExp]"}function Di(t){return Bn(t)==="[object Function]"}function dd(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const bo={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function hd(t){return Object.keys(t||{}).reduce(function(e,n){return e||bo.hasOwnProperty(n)},!1)}const pd={"http:":{validate:function(t,e,n){const r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){const r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){const r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},md="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",gd="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function bd(t){t.__index__=-1,t.__text_cache__=""}function xd(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function _i(){return function(t,e){e.normalize(t)}}function En(t){const e=t.re=ld(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(md),n.push(e.src_xn),e.src_tlds=n.join("|");function r(o){return o.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const u=[];t.__compiled__={};function i(o,l){throw new Error('(LinkifyIt) Invalid schema "'+o+'": '+l)}Object.keys(t.__schemas__).forEach(function(o){const l=t.__schemas__[o];if(l===null)return;const a={validate:null,link:null};if(t.__compiled__[o]=a,cd(l)){fd(l.validate)?a.validate=xd(l.validate):Di(l.validate)?a.validate=l.validate:i(o,l),Di(l.normalize)?a.normalize=l.normalize:l.normalize?i(o,l):a.normalize=_i();return}if(ad(l)){u.push(o);return}i(o,l)}),u.forEach(function(o){t.__compiled__[t.__schemas__[o]]&&(t.__compiled__[o].validate=t.__compiled__[t.__schemas__[o]].validate,t.__compiled__[o].normalize=t.__compiled__[t.__schemas__[o]].normalize)}),t.__compiled__[""]={validate:null,normalize:_i()};const s=Object.keys(t.__compiled__).filter(function(o){return o.length>0&&t.__compiled__[o]}).map(dd).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),bd(t)}function kd(t,e){const n=t.__index__,r=t.__last_index__,u=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=u,this.text=u,this.url=u}function Fr(t,e){const n=new kd(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function te(t,e){if(!(this instanceof te))return new te(t,e);e||hd(t)&&(e=t,t={}),this.__opts__=Or({},bo,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Or({},pd,t),this.__compiled__={},this.__tlds__=gd,this.__tlds_replaced__=!1,this.re={},En(this)}te.prototype.add=function(e,n){return this.__schemas__[e]=n,En(this),this};te.prototype.set=function(e){return this.__opts__=Or(this.__opts__,e),this};te.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let n,r,u,i,s,o,l,a,c;if(this.re.schema_test.test(e)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(e))!==null;)if(i=this.testSchemaAt(e,n[2],l.lastIndex),i){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(a=e.search(this.re.host_fuzzy_test),a>=0&&(this.__index__<0||a<this.__index__)&&(r=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(s=r.index+r[1].length,(this.__index__<0||s<this.__index__)&&(this.__schema__="",this.__index__=s,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=e.indexOf("@"),c>=0&&(u=e.match(this.re.email_fuzzy))!==null&&(s=u.index+u[1].length,o=u.index+u[0].length,(this.__index__<0||s<this.__index__||s===this.__index__&&o>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=o))),this.__index__>=0};te.prototype.pretest=function(e){return this.re.pretest.test(e)};te.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};te.prototype.match=function(e){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===e&&(n.push(Fr(this,r)),r=this.__last_index__);let u=r?e.slice(r):e;for(;this.test(u);)n.push(Fr(this,r)),u=u.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};te.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const n=this.re.schema_at_start.exec(e);if(!n)return null;const r=this.testSchemaAt(e,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,Fr(this,0)):null};te.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,u,i){return r!==i[u-1]}).reverse(),En(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,En(this),this)};te.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};te.prototype.onCompile=function(){};const ft=2147483647,ge=36,su=1,Jt=26,yd=38,Cd=700,xo=72,ko=128,yo="-",Dd=/^xn--/,_d=/[^\0-\x7F]/,Ed=/[\x2E\u3002\uFF0E\uFF61]/g,Sd={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ur=ge-su,be=Math.floor,ir=String.fromCharCode;function Fe(t){throw new RangeError(Sd[t])}function Ad(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function Co(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(Ed,".");const u=t.split("."),i=Ad(u,e).join(".");return r+i}function Do(t){const e=[];let n=0;const r=t.length;for(;n<r;){const u=t.charCodeAt(n++);if(u>=55296&&u<=56319&&n<r){const i=t.charCodeAt(n++);(i&64512)==56320?e.push(((u&1023)<<10)+(i&1023)+65536):(e.push(u),n--)}else e.push(u)}return e}const Md=t=>String.fromCodePoint(...t),wd=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:ge},Ei=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},_o=function(t,e,n){let r=0;for(t=n?be(t/Cd):t>>1,t+=be(t/e);t>ur*Jt>>1;r+=ge)t=be(t/ur);return be(r+(ur+1)*t/(t+yd))},Eo=function(t){const e=[],n=t.length;let r=0,u=ko,i=xo,s=t.lastIndexOf(yo);s<0&&(s=0);for(let o=0;o<s;++o)t.charCodeAt(o)>=128&&Fe("not-basic"),e.push(t.charCodeAt(o));for(let o=s>0?s+1:0;o<n;){const l=r;for(let c=1,f=ge;;f+=ge){o>=n&&Fe("invalid-input");const p=wd(t.charCodeAt(o++));p>=ge&&Fe("invalid-input"),p>be((ft-r)/c)&&Fe("overflow"),r+=p*c;const h=f<=i?su:f>=i+Jt?Jt:f-i;if(p<h)break;const d=ge-h;c>be(ft/d)&&Fe("overflow"),c*=d}const a=e.length+1;i=_o(r-l,a,l==0),be(r/a)>ft-u&&Fe("overflow"),u+=be(r/a),r%=a,e.splice(r++,0,u)}return String.fromCodePoint(...e)},So=function(t){const e=[];t=Do(t);const n=t.length;let r=ko,u=0,i=xo;for(const l of t)l<128&&e.push(ir(l));const s=e.length;let o=s;for(s&&e.push(yo);o<n;){let l=ft;for(const c of t)c>=r&&c<l&&(l=c);const a=o+1;l-r>be((ft-u)/a)&&Fe("overflow"),u+=(l-r)*a,r=l;for(const c of t)if(c<r&&++u>ft&&Fe("overflow"),c===r){let f=u;for(let p=ge;;p+=ge){const h=p<=i?su:p>=i+Jt?Jt:p-i;if(f<h)break;const d=f-h,m=ge-h;e.push(ir(Ei(h+d%m,0))),f=be(d/m)}e.push(ir(Ei(f,0))),i=_o(u,a,o===s),u=0,++o}++u,++r}return e.join("")},Td=function(t){return Co(t,function(e){return Dd.test(e)?Eo(e.slice(4).toLowerCase()):e})},Od=function(t){return Co(t,function(e){return _d.test(e)?"xn--"+So(e):e})},Ao={version:"2.3.1",ucs2:{decode:Do,encode:Md},decode:Eo,encode:So,toASCII:Od,toUnicode:Td},Fd={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Nd={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},Id={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},Rd={default:Fd,zero:Nd,commonmark:Id},Bd=/^(vbscript|javascript|file|data):/,vd=/^data:image\/(gif|png|jpeg|webp);/;function zd(t){const e=t.trim().toLowerCase();return Bd.test(e)?vd.test(e):!0}const Mo=["http:","https:","mailto:"];function Pd(t){const e=eu(t,!0);if(e.hostname&&(!e.protocol||Mo.indexOf(e.protocol)>=0))try{e.hostname=Ao.toASCII(e.hostname)}catch{}return Gt(Qr(e))}function Ld(t){const e=eu(t,!0);if(e.hostname&&(!e.protocol||Mo.indexOf(e.protocol)>=0))try{e.hostname=Ao.toUnicode(e.hostname)}catch{}return gt(Qr(e),gt.defaultChars+"%")}function se(t,e){if(!(this instanceof se))return new se(t,e);e||nu(t)||(e=t||{},t="default"),this.inline=new Xt,this.block=new Rn,this.core=new uu,this.renderer=new kt,this.linkify=new te,this.validateLink=zd,this.normalizeLink=Pd,this.normalizeLinkText=Ld,this.utils=q0,this.helpers=Nn({},H0),this.options={},this.configure(t),e&&this.set(e)}se.prototype.set=function(t){return Nn(this.options,t),this};se.prototype.configure=function(t){const e=this;if(nu(t)){const n=t;if(t=Rd[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this};se.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(u){n=n.concat(this[u].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(u){return n.indexOf(u)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};se.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(u){n=n.concat(this[u].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(u){return n.indexOf(u)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};se.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};se.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens};se.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};se.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};se.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const qd=new Br({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({params:t.getAttribute("data-params")||""})}],toDOM(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM(t){return["ol",{start:t.attrs.order==1?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:t=>({tight:t.hasAttribute("data-tight")})}],toDOM(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){return["a",t.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function Vd(t,e){if(t.isText&&e.isText&&w.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}class $d{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:w.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let n=this.top(),r=n.content,u=r[r.length-1],i=this.schema.text(e,n.marks),s;u&&(s=Vd(u,i))?r[r.length-1]=s:r.push(i)}openMark(e){let n=this.top();n.marks=e.addToSet(n.marks)}closeMark(e){let n=this.top();n.marks=e.removeFromSet(n.marks)}parseTokens(e){for(let n=0;n<e.length;n++){let r=e[n],u=this.tokenHandlers[r.type];if(!u)throw new Error("Token type `"+r.type+"` not supported by Markdown parser");u(this,r,e,n)}}addNode(e,n,r){let u=this.top(),i=e.createAndFill(n,r,u?u.marks:[]);return i?(this.push(i),i):null}openNode(e,n){this.stack.push({type:e,attrs:n,content:[],marks:w.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}}function Et(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}function sr(t,e){return t.noCloseToken||e=="code_inline"||e=="code_block"||e=="fence"}function Si(t){return t[t.length-1]==`
26
- `?t.slice(0,t.length-1):t}function or(){}function Wd(t,e){let n=Object.create(null);for(let r in e){let u=e[r];if(u.block){let i=t.nodeType(u.block);sr(u,r)?n[r]=(s,o,l,a)=>{s.openNode(i,Et(u,o,l,a)),s.addText(Si(o.content)),s.closeNode()}:(n[r+"_open"]=(s,o,l,a)=>s.openNode(i,Et(u,o,l,a)),n[r+"_close"]=s=>s.closeNode())}else if(u.node){let i=t.nodeType(u.node);n[r]=(s,o,l,a)=>s.addNode(i,Et(u,o,l,a))}else if(u.mark){let i=t.marks[u.mark];sr(u,r)?n[r]=(s,o,l,a)=>{s.openMark(i.create(Et(u,o,l,a))),s.addText(Si(o.content)),s.closeMark(i)}:(n[r+"_open"]=(s,o,l,a)=>s.openMark(i.create(Et(u,o,l,a))),n[r+"_close"]=s=>s.closeMark(i))}else if(u.ignore)sr(u,r)?n[r]=or:(n[r+"_open"]=or,n[r+"_close"]=or);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(u))}return n.text=(r,u)=>r.addText(u.content),n.inline=(r,u)=>r.parseTokens(u.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}class Hd{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=Wd(e,r)}parse(e,n={}){let r=new $d(this.schema,this.tokenHandlers),u;r.parseTokens(this.tokenizer.parse(e,n));do u=r.closeNode();while(r.stack.length);return u||this.schema.topNodeType.createAndFill()}}function Ai(t,e){for(;++e<t.length;)if(t[e].type!="list_item_open")return t[e].hidden;return!1}const Mi=new Hd(qd,se("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(t,e,n)=>({tight:Ai(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:Ai(e,n)})},heading:{block:"heading",getAttrs:t=>({level:+t.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:t=>({params:t.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:t=>({href:t.attrGet("href"),title:t.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}}),Jd={open:"",close:"",mixable:!0};class jd{constructor(e,n,r={}){this.nodes=e,this.marks=n,this.options=r}serialize(e,n={}){n=Object.assign({},this.options,n);let r=new Kd(this.nodes,this.marks,n);return r.renderContent(e),r.out}}const lr=new jd({blockquote(t,e){t.wrapBlock("> ",null,e,()=>t.renderContent(e))},code_block(t,e){const n=e.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";t.write(r+(e.attrs.params||"")+`
22
+ `:">",i};Ct.prototype.renderInline=function(t,e,n){let r="";const u=this.rules;for(let i=0,s=t.length;i<s;i++){const o=t[i].type;typeof u[o]<"u"?r+=u[o](t,i,e,n,this):r+=this.renderToken(t,i,e)}return r};Ct.prototype.renderInlineAsText=function(t,e,n){let r="";for(let u=0,i=t.length;u<i;u++)switch(t[u].type){case"text":r+=t[u].content;break;case"image":r+=this.renderInlineAsText(t[u].children,e,n);break;case"html_inline":case"html_block":r+=t[u].content;break;case"softbreak":case"hardbreak":r+=`
23
+ `;break}return r};Ct.prototype.render=function(t,e,n){let r="";const u=this.rules;for(let i=0,s=t.length;i<s;i++){const o=t[i].type;o==="inline"?r+=this.renderInline(t[i].children,e,n):typeof u[o]<"u"?r+=u[o](t,i,e,n,this):r+=this.renderToken(t,i,e,n)}return r};function X(){this.__rules__=[],this.__cache__=null}X.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};X.prototype.__compile__=function(){const t=this,e=[""];t.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){e.indexOf(r)<0&&e.push(r)})}),t.__cache__={},e.forEach(function(n){t.__cache__[n]=[],t.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||t.__cache__[n].push(r.fn))})})};X.prototype.at=function(t,e,n){const r=this.__find__(t),u=n||{};if(r===-1)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=u.alt||[],this.__cache__=null};X.prototype.before=function(t,e,n,r){const u=this.__find__(t),i=r||{};if(u===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(u,0,{name:e,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null};X.prototype.after=function(t,e,n,r){const u=this.__find__(t),i=r||{};if(u===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(u+1,0,{name:e,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null};X.prototype.push=function(t,e,n){const r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};X.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const u=this.__find__(r);if(u<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[u].enabled=!0,n.push(r)},this),this.__cache__=null,n};X.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};X.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const u=this.__find__(r);if(u<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[u].enabled=!1,n.push(r)},this),this.__cache__=null,n};X.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function fe(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}fe.prototype.attrIndex=function(e){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,u=n.length;r<u;r++)if(n[r][0]===e)return r;return-1};fe.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};fe.prototype.attrSet=function(e,n){const r=this.attrIndex(e),u=[e,n];r<0?this.attrPush(u):this.attrs[r]=u};fe.prototype.attrGet=function(e){const n=this.attrIndex(e);let r=null;return n>=0&&(r=this.attrs[n][1]),r};fe.prototype.attrJoin=function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function fo(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}fo.prototype.Token=fe;const K0=/\r\n?|\n/g,Z0=/\0/g;function G0(t){let e;e=t.src.replace(K0,`
24
+ `),e=e.replace(Z0,"�"),t.src=e}function Y0(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function X0(t){const e=t.tokens;for(let n=0,r=e.length;n<r;n++){const u=e[n];u.type==="inline"&&t.md.inline.parse(u.content,t.md,t.env,u.children)}}function Q0(t){return/^<a[>\s]/i.test(t)}function ef(t){return/^<\/a\s*>/i.test(t)}function tf(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n<r;n++){if(e[n].type!=="inline"||!t.md.linkify.pretest(e[n].content))continue;let u=e[n].children,i=0;for(let s=u.length-1;s>=0;s--){const o=u[s];if(o.type==="link_close"){for(s--;u[s].level!==o.level&&u[s].type!=="link_open";)s--;continue}if(o.type==="html_inline"&&(Q0(o.content)&&i>0&&i--,ef(o.content)&&i++),!(i>0)&&o.type==="text"&&t.md.linkify.test(o.content)){const l=o.content;let a=t.md.linkify.match(l);const c=[];let f=o.level,p=0;a.length>0&&a[0].index===0&&s>0&&u[s-1].type==="text_special"&&(a=a.slice(1));for(let h=0;h<a.length;h++){const d=a[h].url,m=t.md.normalizeLink(d);if(!t.md.validateLink(m))continue;let g=a[h].text;a[h].schema?a[h].schema==="mailto:"&&!/^mailto:/i.test(g)?g=t.md.normalizeLinkText("mailto:"+g).replace(/^mailto:/,""):g=t.md.normalizeLinkText(g):g=t.md.normalizeLinkText("http://"+g).replace(/^http:\/\//,"");const b=a[h].index;if(b>p){const E=new t.Token("text","",0);E.content=l.slice(p,b),E.level=f,c.push(E)}const k=new t.Token("link_open","a",1);k.attrs=[["href",m]],k.level=f++,k.markup="linkify",k.info="auto",c.push(k);const y=new t.Token("text","",0);y.content=g,y.level=f,c.push(y);const _=new t.Token("link_close","a",-1);_.level=--f,_.markup="linkify",_.info="auto",c.push(_),p=a[h].lastIndex}if(p<l.length){const h=new t.Token("text","",0);h.content=l.slice(p),h.level=f,c.push(h)}e[n].children=u=ao(u,s,c)}}}}const ho=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,nf=/\((c|tm|r)\)/i,rf=/\((c|tm|r)\)/ig,uf={c:"©",r:"®",tm:"™"};function sf(t,e){return uf[e.toLowerCase()]}function of(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(rf,sf)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function lf(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&ho.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function af(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(nf.test(t.tokens[e].content)&&of(t.tokens[e].children),ho.test(t.tokens[e].content)&&lf(t.tokens[e].children))}const cf=/['"]/,mi=/['"]/g,gi="’";function un(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function ff(t,e){let n;const r=[];for(let u=0;u<t.length;u++){const i=t[u],s=t[u].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,i.type!=="text")continue;let o=i.content,l=0,a=o.length;e:for(;l<a;){mi.lastIndex=l;const c=mi.exec(o);if(!c)break;let f=!0,p=!0;l=c.index+1;const h=c[0]==="'";let d=32;if(c.index-1>=0)d=o.charCodeAt(c.index-1);else for(n=u-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){d=t[n].content.charCodeAt(t[n].content.length-1);break}let m=32;if(l<a)m=o.charCodeAt(l);else for(n=u+1;n<t.length&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n++)if(t[n].content){m=t[n].content.charCodeAt(0);break}const g=Ht(d)||Wt(String.fromCharCode(d)),b=Ht(m)||Wt(String.fromCharCode(m)),k=$t(d),y=$t(m);if(y?f=!1:b&&(k||g||(f=!1)),k?p=!1:g&&(y||b||(p=!1)),m===34&&c[0]==='"'&&d>=48&&d<=57&&(p=f=!1),f&&p&&(f=g,p=b),!f&&!p){h&&(i.content=un(i.content,c.index,gi));continue}if(p)for(n=r.length-1;n>=0;n--){let _=r[n];if(r[n].level<s)break;if(_.single===h&&r[n].level===s){_=r[n];let E,M;h?(E=e.md.options.quotes[2],M=e.md.options.quotes[3]):(E=e.md.options.quotes[0],M=e.md.options.quotes[1]),i.content=un(i.content,c.index,M),t[_.token].content=un(t[_.token].content,_.pos,E),l+=M.length-1,_.token===u&&(l+=E.length-1),o=i.content,a=o.length,r.length=n;continue e}}f?r.push({token:u,pos:c.index,single:h,level:s}):p&&h&&(i.content=un(i.content,c.index,gi))}}}function df(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)t.tokens[e].type!=="inline"||!cf.test(t.tokens[e].content)||ff(t.tokens[e].children,t)}function hf(t){let e,n;const r=t.tokens,u=r.length;for(let i=0;i<u;i++){if(r[i].type!=="inline")continue;const s=r[i].children,o=s.length;for(e=0;e<o;e++)s[e].type==="text_special"&&(s[e].type="text");for(e=n=0;e<o;e++)s[e].type==="text"&&e+1<o&&s[e+1].type==="text"?s[e+1].content=s[e].content+s[e+1].content:(e!==n&&(s[n]=s[e]),n++);e!==n&&(s.length=n)}}const er=[["normalize",G0],["block",Y0],["inline",X0],["linkify",tf],["replacements",af],["smartquotes",df],["text_join",hf]];function iu(){this.ruler=new X;for(let t=0;t<er.length;t++)this.ruler.push(er[t][0],er[t][1])}iu.prototype.process=function(t){const e=this.ruler.getRules("");for(let n=0,r=e.length;n<r;n++)e[n](t)};iu.prototype.State=fo;function De(t,e,n,r){this.src=t,this.md=e,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const u=this.src;for(let i=0,s=0,o=0,l=0,a=u.length,c=!1;s<a;s++){const f=u.charCodeAt(s);if(!c)if(N(f)){o++,f===9?l+=4-l%4:l++;continue}else c=!0;(f===10||s===a-1)&&(f!==10&&s++,this.bMarks.push(i),this.eMarks.push(s),this.tShift.push(o),this.sCount.push(l),this.bsCount.push(0),c=!1,o=0,l=0,i=s+1)}this.bMarks.push(u.length),this.eMarks.push(u.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}De.prototype.push=function(t,e,n){const r=new fe(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};De.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};De.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;e<n&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e};De.prototype.skipSpaces=function(e){for(let n=this.src.length;e<n;e++){const r=this.src.charCodeAt(e);if(!N(r))break}return e};De.prototype.skipSpacesBack=function(e,n){if(e<=n)return e;for(;e>n;)if(!N(this.src.charCodeAt(--e)))return e+1;return e};De.prototype.skipChars=function(e,n){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===n;e++);return e};De.prototype.skipCharsBack=function(e,n,r){if(e<=r)return e;for(;e>r;)if(n!==this.src.charCodeAt(--e))return e+1;return e};De.prototype.getLines=function(e,n,r,u){if(e>=n)return"";const i=new Array(n-e);for(let s=0,o=e;o<n;o++,s++){let l=0;const a=this.bMarks[o];let c=a,f;for(o+1<n||u?f=this.eMarks[o]+1:f=this.eMarks[o];c<f&&l<r;){const p=this.src.charCodeAt(c);if(N(p))p===9?l+=4-(l+this.bsCount[o])%4:l++;else if(c-a<this.tShift[o])l++;else break;c++}l>r?i[s]=new Array(l-r+1).join(" ")+this.src.slice(c,f):i[s]=this.src.slice(c,f)}return i.join("")};De.prototype.Token=fe;const pf=65536;function tr(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function bi(t){const e=[],n=t.length;let r=0,u=t.charCodeAt(r),i=!1,s=0,o="";for(;r<n;)u===124&&(i?(o+=t.substring(s,r-1),s=r):(e.push(o+t.substring(s,r)),o="",s=r+1)),i=u===92,r++,u=t.charCodeAt(r);return e.push(o+t.substring(s)),e}function mf(t,e,n,r){if(e+2>n)return!1;let u=e+1;if(t.sCount[u]<t.blkIndent||t.sCount[u]-t.blkIndent>=4)return!1;let i=t.bMarks[u]+t.tShift[u];if(i>=t.eMarks[u])return!1;const s=t.src.charCodeAt(i++);if(s!==124&&s!==45&&s!==58||i>=t.eMarks[u])return!1;const o=t.src.charCodeAt(i++);if(o!==124&&o!==45&&o!==58&&!N(o)||s===45&&N(o))return!1;for(;i<t.eMarks[u];){const _=t.src.charCodeAt(i);if(_!==124&&_!==45&&_!==58&&!N(_))return!1;i++}let l=tr(t,e+1),a=l.split("|");const c=[];for(let _=0;_<a.length;_++){const E=a[_].trim();if(!E){if(_===0||_===a.length-1)continue;return!1}if(!/^:?-+:?$/.test(E))return!1;E.charCodeAt(E.length-1)===58?c.push(E.charCodeAt(0)===58?"center":"right"):E.charCodeAt(0)===58?c.push("left"):c.push("")}if(l=tr(t,e).trim(),l.indexOf("|")===-1||t.sCount[e]-t.blkIndent>=4)return!1;a=bi(l),a.length&&a[0]===""&&a.shift(),a.length&&a[a.length-1]===""&&a.pop();const f=a.length;if(f===0||f!==c.length)return!1;if(r)return!0;const p=t.parentType;t.parentType="table";const h=t.md.block.ruler.getRules("blockquote"),d=t.push("table_open","table",1),m=[e,0];d.map=m;const g=t.push("thead_open","thead",1);g.map=[e,e+1];const b=t.push("tr_open","tr",1);b.map=[e,e+1];for(let _=0;_<a.length;_++){const E=t.push("th_open","th",1);c[_]&&(E.attrs=[["style","text-align:"+c[_]]]);const M=t.push("inline","",0);M.content=a[_].trim(),M.children=[],t.push("th_close","th",-1)}t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let k,y=0;for(u=e+2;u<n&&!(t.sCount[u]<t.blkIndent);u++){let _=!1;for(let M=0,C=h.length;M<C;M++)if(h[M](t,u,n,!0)){_=!0;break}if(_||(l=tr(t,u).trim(),!l)||t.sCount[u]-t.blkIndent>=4||(a=bi(l),a.length&&a[0]===""&&a.shift(),a.length&&a[a.length-1]===""&&a.pop(),y+=f-a.length,y>pf))break;if(u===e+2){const M=t.push("tbody_open","tbody",1);M.map=k=[e+2,0]}const E=t.push("tr_open","tr",1);E.map=[u,u+1];for(let M=0;M<f;M++){const C=t.push("td_open","td",1);c[M]&&(C.attrs=[["style","text-align:"+c[M]]]);const w=t.push("inline","",0);w.content=a[M]?a[M].trim():"",w.children=[],t.push("td_close","td",-1)}t.push("tr_close","tr",-1)}return k&&(t.push("tbody_close","tbody",-1),k[1]=u),t.push("table_close","table",-1),m[1]=u,t.parentType=p,t.line=u,!0}function gf(t,e,n){if(t.sCount[e]-t.blkIndent<4)return!1;let r=e+1,u=r;for(;r<n;){if(t.isEmpty(r)){r++;continue}if(t.sCount[r]-t.blkIndent>=4){r++,u=r;continue}break}t.line=u;const i=t.push("code_block","code",0);return i.content=t.getLines(e,u,4+t.blkIndent,!1)+`
25
+ `,i.map=[e,t.line],!0}function bf(t,e,n,r){let u=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||u+3>i)return!1;const s=t.src.charCodeAt(u);if(s!==126&&s!==96)return!1;let o=u;u=t.skipChars(u,s);let l=u-o;if(l<3)return!1;const a=t.src.slice(o,u),c=t.src.slice(u,i);if(s===96&&c.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let f=e,p=!1;for(;f++,!(f>=n||(u=o=t.bMarks[f]+t.tShift[f],i=t.eMarks[f],u<i&&t.sCount[f]<t.blkIndent));)if(t.src.charCodeAt(u)===s&&!(t.sCount[f]-t.blkIndent>=4)&&(u=t.skipChars(u,s),!(u-o<l)&&(u=t.skipSpaces(u),!(u<i)))){p=!0;break}l=t.sCount[e],t.line=f+(p?1:0);const h=t.push("fence","code",0);return h.info=c,h.content=t.getLines(e+1,f,l,!0),h.markup=a,h.map=[e,t.line],!0}function xf(t,e,n,r){let u=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];const s=t.lineMax;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(u)!==62)return!1;if(r)return!0;const o=[],l=[],a=[],c=[],f=t.md.block.ruler.getRules("blockquote"),p=t.parentType;t.parentType="blockquote";let h=!1,d;for(d=e;d<n;d++){const y=t.sCount[d]<t.blkIndent;if(u=t.bMarks[d]+t.tShift[d],i=t.eMarks[d],u>=i)break;if(t.src.charCodeAt(u++)===62&&!y){let E=t.sCount[d]+1,M,C;t.src.charCodeAt(u)===32?(u++,E++,C=!1,M=!0):t.src.charCodeAt(u)===9?(M=!0,(t.bsCount[d]+E)%4===3?(u++,E++,C=!1):C=!0):M=!1;let w=E;for(o.push(t.bMarks[d]),t.bMarks[d]=u;u<i;){const I=t.src.charCodeAt(u);if(N(I))I===9?w+=4-(w+t.bsCount[d]+(C?1:0))%4:w++;else break;u++}h=u>=i,l.push(t.bsCount[d]),t.bsCount[d]=t.sCount[d]+1+(M?1:0),a.push(t.sCount[d]),t.sCount[d]=w-E,c.push(t.tShift[d]),t.tShift[d]=u-t.bMarks[d];continue}if(h)break;let _=!1;for(let E=0,M=f.length;E<M;E++)if(f[E](t,d,n,!0)){_=!0;break}if(_){t.lineMax=d,t.blkIndent!==0&&(o.push(t.bMarks[d]),l.push(t.bsCount[d]),c.push(t.tShift[d]),a.push(t.sCount[d]),t.sCount[d]-=t.blkIndent);break}o.push(t.bMarks[d]),l.push(t.bsCount[d]),c.push(t.tShift[d]),a.push(t.sCount[d]),t.sCount[d]=-1}const m=t.blkIndent;t.blkIndent=0;const g=t.push("blockquote_open","blockquote",1);g.markup=">";const b=[e,0];g.map=b,t.md.block.tokenize(t,e,d);const k=t.push("blockquote_close","blockquote",-1);k.markup=">",t.lineMax=s,t.parentType=p,b[1]=t.line;for(let y=0;y<c.length;y++)t.bMarks[y+e]=o[y],t.tShift[y+e]=c[y],t.sCount[y+e]=a[y],t.bsCount[y+e]=l[y];return t.blkIndent=m,!0}function kf(t,e,n,r){const u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let i=t.bMarks[e]+t.tShift[e];const s=t.src.charCodeAt(i++);if(s!==42&&s!==45&&s!==95)return!1;let o=1;for(;i<u;){const a=t.src.charCodeAt(i++);if(a!==s&&!N(a))return!1;a===s&&o++}if(o<3)return!1;if(r)return!0;t.line=e+1;const l=t.push("hr","hr",0);return l.map=[e,t.line],l.markup=Array(o+1).join(String.fromCharCode(s)),!0}function xi(t,e){const n=t.eMarks[e];let r=t.bMarks[e]+t.tShift[e];const u=t.src.charCodeAt(r++);if(u!==42&&u!==45&&u!==43)return-1;if(r<n){const i=t.src.charCodeAt(r);if(!N(i))return-1}return r}function ki(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];let u=n;if(u+1>=r)return-1;let i=t.src.charCodeAt(u++);if(i<48||i>57)return-1;for(;;){if(u>=r)return-1;if(i=t.src.charCodeAt(u++),i>=48&&i<=57){if(u-n>=10)return-1;continue}if(i===41||i===46)break;return-1}return u<r&&(i=t.src.charCodeAt(u),!N(i))?-1:u}function yf(t,e){const n=t.level+2;for(let r=e+2,u=t.tokens.length-2;r<u;r++)t.tokens[r].level===n&&t.tokens[r].type==="paragraph_open"&&(t.tokens[r+2].hidden=!0,t.tokens[r].hidden=!0,r+=2)}function Cf(t,e,n,r){let u,i,s,o,l=e,a=!0;if(t.sCount[l]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]<t.blkIndent)return!1;let c=!1;r&&t.parentType==="paragraph"&&t.sCount[l]>=t.blkIndent&&(c=!0);let f,p,h;if((h=ki(t,l))>=0){if(f=!0,s=t.bMarks[l]+t.tShift[l],p=Number(t.src.slice(s,h-1)),c&&p!==1)return!1}else if((h=xi(t,l))>=0)f=!1;else return!1;if(c&&t.skipSpaces(h)>=t.eMarks[l])return!1;if(r)return!0;const d=t.src.charCodeAt(h-1),m=t.tokens.length;f?(o=t.push("ordered_list_open","ol",1),p!==1&&(o.attrs=[["start",p]])):o=t.push("bullet_list_open","ul",1);const g=[l,0];o.map=g,o.markup=String.fromCharCode(d);let b=!1;const k=t.md.block.ruler.getRules("list"),y=t.parentType;for(t.parentType="list";l<n;){i=h,u=t.eMarks[l];const _=t.sCount[l]+h-(t.bMarks[l]+t.tShift[l]);let E=_;for(;i<u;){const we=t.src.charCodeAt(i);if(we===9)E+=4-(E+t.bsCount[l])%4;else if(we===32)E++;else break;i++}const M=i;let C;M>=u?C=1:C=E-_,C>4&&(C=1);const w=_+C;o=t.push("list_item_open","li",1),o.markup=String.fromCharCode(d);const I=[l,0];o.map=I,f&&(o.info=t.src.slice(s,h-1));const Q=t.tight,Je=t.tShift[l],Bn=t.sCount[l],vn=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=w,t.tight=!0,t.tShift[l]=M-t.bMarks[l],t.sCount[l]=E,M>=u&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,l,n,!0),(!t.tight||b)&&(a=!1),b=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=vn,t.tShift[l]=Je,t.sCount[l]=Bn,t.tight=Q,o=t.push("list_item_close","li",-1),o.markup=String.fromCharCode(d),l=t.line,I[1]=l,l>=n||t.sCount[l]<t.blkIndent||t.sCount[l]-t.blkIndent>=4)break;let it=!1;for(let we=0,zn=k.length;we<zn;we++)if(k[we](t,l,n,!0)){it=!0;break}if(it)break;if(f){if(h=ki(t,l),h<0)break;s=t.bMarks[l]+t.tShift[l]}else if(h=xi(t,l),h<0)break;if(d!==t.src.charCodeAt(h-1))break}return f?o=t.push("ordered_list_close","ol",-1):o=t.push("bullet_list_close","ul",-1),o.markup=String.fromCharCode(d),g[1]=l,t.line=l,t.parentType=y,a&&yf(t,m),!0}function Df(t,e,n,r){let u=t.bMarks[e]+t.tShift[e],i=t.eMarks[e],s=e+1;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(u)!==91)return!1;function o(k){const y=t.lineMax;if(k>=y||t.isEmpty(k))return null;let _=!1;if(t.sCount[k]-t.blkIndent>3&&(_=!0),t.sCount[k]<0&&(_=!0),!_){const C=t.md.block.ruler.getRules("reference"),w=t.parentType;t.parentType="reference";let I=!1;for(let Q=0,Je=C.length;Q<Je;Q++)if(C[Q](t,k,y,!0)){I=!0;break}if(t.parentType=w,I)return null}const E=t.bMarks[k]+t.tShift[k],M=t.eMarks[k];return t.src.slice(E,M+1)}let l=t.src.slice(u,i+1);i=l.length;let a=-1;for(u=1;u<i;u++){const k=l.charCodeAt(u);if(k===91)return!1;if(k===93){a=u;break}else if(k===10){const y=o(s);y!==null&&(l+=y,i=l.length,s++)}else if(k===92&&(u++,u<i&&l.charCodeAt(u)===10)){const y=o(s);y!==null&&(l+=y,i=l.length,s++)}}if(a<0||l.charCodeAt(a+1)!==58)return!1;for(u=a+2;u<i;u++){const k=l.charCodeAt(u);if(k===10){const y=o(s);y!==null&&(l+=y,i=l.length,s++)}else if(!N(k))break}const c=t.md.helpers.parseLinkDestination(l,u,i);if(!c.ok)return!1;const f=t.md.normalizeLink(c.str);if(!t.md.validateLink(f))return!1;u=c.pos;const p=u,h=s,d=u;for(;u<i;u++){const k=l.charCodeAt(u);if(k===10){const y=o(s);y!==null&&(l+=y,i=l.length,s++)}else if(!N(k))break}let m=t.md.helpers.parseLinkTitle(l,u,i);for(;m.can_continue;){const k=o(s);if(k===null)break;l+=k,u=i,i=l.length,s++,m=t.md.helpers.parseLinkTitle(l,u,i,m)}let g;for(u<i&&d!==u&&m.ok?(g=m.str,u=m.pos):(g="",u=p,s=h);u<i;){const k=l.charCodeAt(u);if(!N(k))break;u++}if(u<i&&l.charCodeAt(u)!==10&&g)for(g="",u=p,s=h;u<i;){const k=l.charCodeAt(u);if(!N(k))break;u++}if(u<i&&l.charCodeAt(u)!==10)return!1;const b=Nn(l.slice(1,a));return b?(r||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[b]>"u"&&(t.env.references[b]={title:g,href:f}),t.line=s),!0):!1}const _f=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ef="[a-zA-Z_:][a-zA-Z0-9:._-]*",Sf="[^\"'=<>`\\x00-\\x20]+",Af="'[^']*'",Mf='"[^"]*"',wf="(?:"+Sf+"|"+Af+"|"+Mf+")",Tf="(?:\\s+"+Ef+"(?:\\s*=\\s*"+wf+")?)",po="<[A-Za-z][A-Za-z0-9\\-]*"+Tf+"*\\s*\\/?>",mo="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Of="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",Ff="<[?][\\s\\S]*?[?]>",Nf="<![A-Za-z][^>]*>",If="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",Rf=new RegExp("^(?:"+po+"|"+mo+"|"+Of+"|"+Ff+"|"+Nf+"|"+If+")"),Bf=new RegExp("^(?:"+po+"|"+mo+")"),lt=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+_f.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Bf.source+"\\s*$"),/^$/,!1]];function vf(t,e,n,r){let u=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(u)!==60)return!1;let s=t.src.slice(u,i),o=0;for(;o<lt.length&&!lt[o][0].test(s);o++);if(o===lt.length)return!1;if(r)return lt[o][2];let l=e+1;if(!lt[o][1].test(s)){for(;l<n&&!(t.sCount[l]<t.blkIndent);l++)if(u=t.bMarks[l]+t.tShift[l],i=t.eMarks[l],s=t.src.slice(u,i),lt[o][1].test(s)){s.length!==0&&l++;break}}t.line=l;const a=t.push("html_block","",0);return a.map=[e,l],a.content=t.getLines(e,l,t.blkIndent,!0),!0}function zf(t,e,n,r){let u=t.bMarks[e]+t.tShift[e],i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let s=t.src.charCodeAt(u);if(s!==35||u>=i)return!1;let o=1;for(s=t.src.charCodeAt(++u);s===35&&u<i&&o<=6;)o++,s=t.src.charCodeAt(++u);if(o>6||u<i&&!N(s))return!1;if(r)return!0;i=t.skipSpacesBack(i,u);const l=t.skipCharsBack(i,35,u);l>u&&N(t.src.charCodeAt(l-1))&&(i=l),t.line=e+1;const a=t.push("heading_open","h"+String(o),1);a.markup="########".slice(0,o),a.map=[e,t.line];const c=t.push("inline","",0);c.content=t.src.slice(u,i).trim(),c.map=[e,t.line],c.children=[];const f=t.push("heading_close","h"+String(o),-1);return f.markup="########".slice(0,o),!0}function Pf(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const u=t.parentType;t.parentType="paragraph";let i=0,s,o=e+1;for(;o<n&&!t.isEmpty(o);o++){if(t.sCount[o]-t.blkIndent>3)continue;if(t.sCount[o]>=t.blkIndent){let h=t.bMarks[o]+t.tShift[o];const d=t.eMarks[o];if(h<d&&(s=t.src.charCodeAt(h),(s===45||s===61)&&(h=t.skipChars(h,s),h=t.skipSpaces(h),h>=d))){i=s===61?1:2;break}}if(t.sCount[o]<0)continue;let p=!1;for(let h=0,d=r.length;h<d;h++)if(r[h](t,o,n,!0)){p=!0;break}if(p)break}if(!i)return!1;const l=t.getLines(e,o,t.blkIndent,!1).trim();t.line=o+1;const a=t.push("heading_open","h"+String(i),1);a.markup=String.fromCharCode(s),a.map=[e,t.line];const c=t.push("inline","",0);c.content=l,c.map=[e,t.line-1],c.children=[];const f=t.push("heading_close","h"+String(i),-1);return f.markup=String.fromCharCode(s),t.parentType=u,!0}function Lf(t,e,n){const r=t.md.block.ruler.getRules("paragraph"),u=t.parentType;let i=e+1;for(t.parentType="paragraph";i<n&&!t.isEmpty(i);i++){if(t.sCount[i]-t.blkIndent>3||t.sCount[i]<0)continue;let a=!1;for(let c=0,f=r.length;c<f;c++)if(r[c](t,i,n,!0)){a=!0;break}if(a)break}const s=t.getLines(e,i,t.blkIndent,!1).trim();t.line=i;const o=t.push("paragraph_open","p",1);o.map=[e,t.line];const l=t.push("inline","",0);return l.content=s,l.map=[e,t.line],l.children=[],t.push("paragraph_close","p",-1),t.parentType=u,!0}const sn=[["table",mf,["paragraph","reference"]],["code",gf],["fence",bf,["paragraph","reference","blockquote","list"]],["blockquote",xf,["paragraph","reference","blockquote","list"]],["hr",kf,["paragraph","reference","blockquote","list"]],["list",Cf,["paragraph","reference","blockquote"]],["reference",Df],["html_block",vf,["paragraph","reference","blockquote"]],["heading",zf,["paragraph","reference","blockquote"]],["lheading",Pf],["paragraph",Lf]];function In(){this.ruler=new X;for(let t=0;t<sn.length;t++)this.ruler.push(sn[t][0],sn[t][1],{alt:(sn[t][2]||[]).slice()})}In.prototype.tokenize=function(t,e,n){const r=this.ruler.getRules(""),u=r.length,i=t.md.options.maxNesting;let s=e,o=!1;for(;s<n&&(t.line=s=t.skipEmptyLines(s),!(s>=n||t.sCount[s]<t.blkIndent));){if(t.level>=i){t.line=n;break}const l=t.line;let a=!1;for(let c=0;c<u;c++)if(a=r[c](t,s,n,!1),a){if(l>=t.line)throw new Error("block rule didn't increment state.line");break}if(!a)throw new Error("none of the block rules matched");t.tight=!o,t.isEmpty(t.line-1)&&(o=!0),s=t.line,s<n&&t.isEmpty(s)&&(o=!0,s++,t.line=s)}};In.prototype.parse=function(t,e,n,r){if(!t)return;const u=new this.State(t,e,n,r);this.tokenize(u,u.line,u.lineMax)};In.prototype.State=De;function Yt(t,e,n,r){this.src=t,this.env=n,this.md=e,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Yt.prototype.pushPending=function(){const t=new fe("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t};Yt.prototype.push=function(t,e,n){this.pending&&this.pushPending();const r=new fe(t,e,n);let u=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],u={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(u),r};Yt.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t),u=t>0?this.src.charCodeAt(t-1):32;let i=t;for(;i<n&&this.src.charCodeAt(i)===r;)i++;const s=i-t,o=i<n?this.src.charCodeAt(i):32,l=Ht(u)||Wt(String.fromCharCode(u)),a=Ht(o)||Wt(String.fromCharCode(o)),c=$t(u),f=$t(o),p=!f&&(!a||c||l),h=!c&&(!l||f||a);return{can_open:p&&(e||!h||l),can_close:h&&(e||!p||a),length:s}};Yt.prototype.Token=fe;function qf(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Vf(t,e){let n=t.pos;for(;n<t.posMax&&!qf(t.src.charCodeAt(n));)n++;return n===t.pos?!1:(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}const $f=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Wf(t,e){if(!t.md.options.linkify||t.linkLevel>0)return!1;const n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const u=t.pending.match($f);if(!u)return!1;const i=u[1],s=t.md.linkify.matchAtStart(t.src.slice(n-i.length));if(!s)return!1;let o=s.url;if(o.length<=i.length)return!1;o=o.replace(/\*+$/,"");const l=t.md.normalizeLink(o);if(!t.md.validateLink(l))return!1;if(!e){t.pending=t.pending.slice(0,-i.length);const a=t.push("link_open","a",1);a.attrs=[["href",l]],a.markup="linkify",a.info="auto";const c=t.push("text","",0);c.content=t.md.normalizeLinkText(o);const f=t.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return t.pos+=o.length-i.length,!0}function Hf(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,u=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let i=r-1;for(;i>=1&&t.pending.charCodeAt(i-1)===32;)i--;t.pending=t.pending.slice(0,i),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n<u&&N(t.src.charCodeAt(n));)n++;return t.pos=n,!0}const su=[];for(let t=0;t<256;t++)su.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){su[t.charCodeAt(0)]=1});function Jf(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let u=t.src.charCodeAt(n);if(u===10){for(e||t.push("hardbreak","br",0),n++;n<r&&(u=t.src.charCodeAt(n),!!N(u));)n++;return t.pos=n,!0}let i=t.src[n];if(u>=55296&&u<=56319&&n+1<r){const o=t.src.charCodeAt(n+1);o>=56320&&o<=57343&&(i+=t.src[n+1],n++)}const s="\\"+i;if(!e){const o=t.push("text_special","",0);u<256&&su[u]!==0?o.content=i:o.content=s,o.markup=s,o.info="escape"}return t.pos=n+1,!0}function jf(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const u=n;n++;const i=t.posMax;for(;n<i&&t.src.charCodeAt(n)===96;)n++;const s=t.src.slice(u,n),o=s.length;if(t.backticksScanned&&(t.backticks[o]||0)<=u)return e||(t.pending+=s),t.pos+=o,!0;let l=n,a;for(;(a=t.src.indexOf("`",l))!==-1;){for(l=a+1;l<i&&t.src.charCodeAt(l)===96;)l++;const c=l-a;if(c===o){if(!e){const f=t.push("code_inline","code",0);f.markup=s,f.content=t.src.slice(n,a).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=l,!0}t.backticks[c]=a}return t.backticksScanned=!0,e||(t.pending+=s),t.pos+=o,!0}function Uf(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==126)return!1;const u=t.scanDelims(t.pos,!0);let i=u.length;const s=String.fromCharCode(r);if(i<2)return!1;let o;i%2&&(o=t.push("text","",0),o.content=s,i--);for(let l=0;l<i;l+=2)o=t.push("text","",0),o.content=s+s,t.delimiters.push({marker:r,length:0,token:t.tokens.length-1,end:-1,open:u.can_open,close:u.can_close});return t.pos+=u.length,!0}function yi(t,e){let n;const r=[],u=e.length;for(let i=0;i<u;i++){const s=e[i];if(s.marker!==126||s.end===-1)continue;const o=e[s.end];n=t.tokens[s.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=t.tokens[o.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",t.tokens[o.token-1].type==="text"&&t.tokens[o.token-1].content==="~"&&r.push(o.token-1)}for(;r.length;){const i=r.pop();let s=i+1;for(;s<t.tokens.length&&t.tokens[s].type==="s_close";)s++;s--,i!==s&&(n=t.tokens[s],t.tokens[s]=t.tokens[i],t.tokens[i]=n)}}function Kf(t){const e=t.tokens_meta,n=t.tokens_meta.length;yi(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&yi(t,e[r].delimiters)}const go={tokenize:Uf,postProcess:Kf};function Zf(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==95&&r!==42)return!1;const u=t.scanDelims(t.pos,r===42);for(let i=0;i<u.length;i++){const s=t.push("text","",0);s.content=String.fromCharCode(r),t.delimiters.push({marker:r,length:u.length,token:t.tokens.length-1,end:-1,open:u.can_open,close:u.can_close})}return t.pos+=u.length,!0}function Ci(t,e){const n=e.length;for(let r=n-1;r>=0;r--){const u=e[r];if(u.marker!==95&&u.marker!==42||u.end===-1)continue;const i=e[u.end],s=r>0&&e[r-1].end===u.end+1&&e[r-1].marker===u.marker&&e[r-1].token===u.token-1&&e[u.end+1].token===i.token+1,o=String.fromCharCode(u.marker),l=t.tokens[u.token];l.type=s?"strong_open":"em_open",l.tag=s?"strong":"em",l.nesting=1,l.markup=s?o+o:o,l.content="";const a=t.tokens[i.token];a.type=s?"strong_close":"em_close",a.tag=s?"strong":"em",a.nesting=-1,a.markup=s?o+o:o,a.content="",s&&(t.tokens[e[r-1].token].content="",t.tokens[e[u.end+1].token].content="",r--)}}function Gf(t){const e=t.tokens_meta,n=t.tokens_meta.length;Ci(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&Ci(t,e[r].delimiters)}const bo={tokenize:Zf,postProcess:Gf};function Yf(t,e){let n,r,u,i,s="",o="",l=t.pos,a=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;const c=t.pos,f=t.posMax,p=t.pos+1,h=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(h<0)return!1;let d=h+1;if(d<f&&t.src.charCodeAt(d)===40){for(a=!1,d++;d<f&&(n=t.src.charCodeAt(d),!(!N(n)&&n!==10));d++);if(d>=f)return!1;if(l=d,u=t.md.helpers.parseLinkDestination(t.src,d,t.posMax),u.ok){for(s=t.md.normalizeLink(u.str),t.md.validateLink(s)?d=u.pos:s="",l=d;d<f&&(n=t.src.charCodeAt(d),!(!N(n)&&n!==10));d++);if(u=t.md.helpers.parseLinkTitle(t.src,d,t.posMax),d<f&&l!==d&&u.ok)for(o=u.str,d=u.pos;d<f&&(n=t.src.charCodeAt(d),!(!N(n)&&n!==10));d++);}(d>=f||t.src.charCodeAt(d)!==41)&&(a=!0),d++}if(a){if(typeof t.env.references>"u")return!1;if(d<f&&t.src.charCodeAt(d)===91?(l=d+1,d=t.md.helpers.parseLinkLabel(t,d),d>=0?r=t.src.slice(l,d++):d=h+1):d=h+1,r||(r=t.src.slice(p,h)),i=t.env.references[Nn(r)],!i)return t.pos=c,!1;s=i.href,o=i.title}if(!e){t.pos=p,t.posMax=h;const m=t.push("link_open","a",1),g=[["href",s]];m.attrs=g,o&&g.push(["title",o]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=d,t.posMax=f,!0}function Xf(t,e){let n,r,u,i,s,o,l,a,c="";const f=t.pos,p=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const h=t.pos+2,d=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(d<0)return!1;if(i=d+1,i<p&&t.src.charCodeAt(i)===40){for(i++;i<p&&(n=t.src.charCodeAt(i),!(!N(n)&&n!==10));i++);if(i>=p)return!1;for(a=i,o=t.md.helpers.parseLinkDestination(t.src,i,t.posMax),o.ok&&(c=t.md.normalizeLink(o.str),t.md.validateLink(c)?i=o.pos:c=""),a=i;i<p&&(n=t.src.charCodeAt(i),!(!N(n)&&n!==10));i++);if(o=t.md.helpers.parseLinkTitle(t.src,i,t.posMax),i<p&&a!==i&&o.ok)for(l=o.str,i=o.pos;i<p&&(n=t.src.charCodeAt(i),!(!N(n)&&n!==10));i++);else l="";if(i>=p||t.src.charCodeAt(i)!==41)return t.pos=f,!1;i++}else{if(typeof t.env.references>"u")return!1;if(i<p&&t.src.charCodeAt(i)===91?(a=i+1,i=t.md.helpers.parseLinkLabel(t,i),i>=0?u=t.src.slice(a,i++):i=d+1):i=d+1,u||(u=t.src.slice(h,d)),s=t.env.references[Nn(u)],!s)return t.pos=f,!1;c=s.href,l=s.title}if(!e){r=t.src.slice(h,d);const m=[];t.md.inline.parse(r,t.md,t.env,m);const g=t.push("image","img",0),b=[["src",c],["alt",""]];g.attrs=b,g.children=m,g.content=r,l&&b.push(["title",l])}return t.pos=i,t.posMax=p,!0}const Qf=/^([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])?)*)$/,ed=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function td(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,u=t.posMax;for(;;){if(++n>=u)return!1;const s=t.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const i=t.src.slice(r+1,n);if(ed.test(i)){const s=t.md.normalizeLink(i);if(!t.md.validateLink(s))return!1;if(!e){const o=t.push("link_open","a",1);o.attrs=[["href",s]],o.markup="autolink",o.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(i);const a=t.push("link_close","a",-1);a.markup="autolink",a.info="auto"}return t.pos+=i.length+2,!0}if(Qf.test(i)){const s=t.md.normalizeLink("mailto:"+i);if(!t.md.validateLink(s))return!1;if(!e){const o=t.push("link_open","a",1);o.attrs=[["href",s]],o.markup="autolink",o.info="auto";const l=t.push("text","",0);l.content=t.md.normalizeLinkText(i);const a=t.push("link_close","a",-1);a.markup="autolink",a.info="auto"}return t.pos+=i.length+2,!0}return!1}function nd(t){return/^<a[>\s]/i.test(t)}function rd(t){return/^<\/a\s*>/i.test(t)}function ud(t){const e=t|32;return e>=97&&e<=122}function id(t,e){if(!t.md.options.html)return!1;const n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;const u=t.src.charCodeAt(r+1);if(u!==33&&u!==63&&u!==47&&!ud(u))return!1;const i=t.src.slice(r).match(Rf);if(!i)return!1;if(!e){const s=t.push("html_inline","",0);s.content=i[0],nd(s.content)&&t.linkLevel++,rd(s.content)&&t.linkLevel--}return t.pos+=i[0].length,!0}const sd=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,od=/^&([a-z][a-z0-9]{1,31});/i;function ld(t,e){const n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){const i=t.src.slice(n).match(sd);if(i){if(!e){const s=i[1][0].toLowerCase()==="x"?parseInt(i[1].slice(1),16):parseInt(i[1],10),o=t.push("text_special","",0);o.content=uu(s)?Dn(s):Dn(65533),o.markup=i[0],o.info="entity"}return t.pos+=i[0].length,!0}}else{const i=t.src.slice(n).match(od);if(i){const s=lo(i[0]);if(s!==i[0]){if(!e){const o=t.push("text_special","",0);o.content=s,o.markup=i[0],o.info="entity"}return t.pos+=i[0].length,!0}}}return!1}function Di(t){const e={},n=t.length;if(!n)return;let r=0,u=-2;const i=[];for(let s=0;s<n;s++){const o=t[s];if(i.push(0),(t[r].marker!==o.marker||u!==o.token-1)&&(r=s),u=o.token,o.length=o.length||0,!o.close)continue;e.hasOwnProperty(o.marker)||(e[o.marker]=[-1,-1,-1,-1,-1,-1]);const l=e[o.marker][(o.open?3:0)+o.length%3];let a=r-i[r]-1,c=a;for(;a>l;a-=i[a]+1){const f=t[a];if(f.marker===o.marker&&f.open&&f.end<0){let p=!1;if((f.close||o.open)&&(f.length+o.length)%3===0&&(f.length%3!==0||o.length%3!==0)&&(p=!0),!p){const h=a>0&&!t[a-1].open?i[a-1]+1:0;i[s]=s-a+h,i[a]=h,o.open=!1,f.end=s,f.close=!1,c=-1,u=-2;break}}}c!==-1&&(e[o.marker][(o.open?3:0)+(o.length||0)%3]=c)}}function ad(t){const e=t.tokens_meta,n=t.tokens_meta.length;Di(t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&Di(e[r].delimiters)}function cd(t){let e,n,r=0;const u=t.tokens,i=t.tokens.length;for(e=n=0;e<i;e++)u[e].nesting<0&&r--,u[e].level=r,u[e].nesting>0&&r++,u[e].type==="text"&&e+1<i&&u[e+1].type==="text"?u[e+1].content=u[e].content+u[e+1].content:(e!==n&&(u[n]=u[e]),n++);e!==n&&(u.length=n)}const nr=[["text",Vf],["linkify",Wf],["newline",Hf],["escape",Jf],["backticks",jf],["strikethrough",go.tokenize],["emphasis",bo.tokenize],["link",Yf],["image",Xf],["autolink",td],["html_inline",id],["entity",ld]],rr=[["balance_pairs",ad],["strikethrough",go.postProcess],["emphasis",bo.postProcess],["fragments_join",cd]];function Xt(){this.ruler=new X;for(let t=0;t<nr.length;t++)this.ruler.push(nr[t][0],nr[t][1]);this.ruler2=new X;for(let t=0;t<rr.length;t++)this.ruler2.push(rr[t][0],rr[t][1])}Xt.prototype.skipToken=function(t){const e=t.pos,n=this.ruler.getRules(""),r=n.length,u=t.md.options.maxNesting,i=t.cache;if(typeof i[e]<"u"){t.pos=i[e];return}let s=!1;if(t.level<u){for(let o=0;o<r;o++)if(t.level++,s=n[o](t,!0),t.level--,s){if(e>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;s||t.pos++,i[e]=t.pos};Xt.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,u=t.md.options.maxNesting;for(;t.pos<r;){const i=t.pos;let s=!1;if(t.level<u){for(let o=0;o<n;o++)if(s=e[o](t,!1),s){if(i>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};Xt.prototype.parse=function(t,e,n,r){const u=new this.State(t,e,n,r);this.tokenize(u);const i=this.ruler2.getRules(""),s=i.length;for(let o=0;o<s;o++)i[o](u)};Xt.prototype.State=Yt;function fd(t){const e={};t=t||{},e.src_Any=ro.source,e.src_Cc=uo.source,e.src_Z=so.source,e.src_P=nu.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");const n="[><|]";return e.src_pseudo_letter="(?:(?!"+n+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+n+"|"+e.src_ZPCc+")(?!"+(t["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+e.src_ZCc+"|$)|\\!+(?!"+e.src_ZCc+"|[!]|$)|\\?(?!"+e.src_ZCc+"|[?]|$))+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function Or(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function Rn(t){return Object.prototype.toString.call(t)}function dd(t){return Rn(t)==="[object String]"}function hd(t){return Rn(t)==="[object Object]"}function pd(t){return Rn(t)==="[object RegExp]"}function _i(t){return Rn(t)==="[object Function]"}function md(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const xo={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function gd(t){return Object.keys(t||{}).reduce(function(e,n){return e||xo.hasOwnProperty(n)},!1)}const bd={"http:":{validate:function(t,e,n){const r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){const r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){const r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},xd="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",kd="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function yd(t){t.__index__=-1,t.__text_cache__=""}function Cd(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function Ei(){return function(t,e){e.normalize(t)}}function _n(t){const e=t.re=fd(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(xd),n.push(e.src_xn),e.src_tlds=n.join("|");function r(o){return o.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const u=[];t.__compiled__={};function i(o,l){throw new Error('(LinkifyIt) Invalid schema "'+o+'": '+l)}Object.keys(t.__schemas__).forEach(function(o){const l=t.__schemas__[o];if(l===null)return;const a={validate:null,link:null};if(t.__compiled__[o]=a,hd(l)){pd(l.validate)?a.validate=Cd(l.validate):_i(l.validate)?a.validate=l.validate:i(o,l),_i(l.normalize)?a.normalize=l.normalize:l.normalize?i(o,l):a.normalize=Ei();return}if(dd(l)){u.push(o);return}i(o,l)}),u.forEach(function(o){t.__compiled__[t.__schemas__[o]]&&(t.__compiled__[o].validate=t.__compiled__[t.__schemas__[o]].validate,t.__compiled__[o].normalize=t.__compiled__[t.__schemas__[o]].normalize)}),t.__compiled__[""]={validate:null,normalize:Ei()};const s=Object.keys(t.__compiled__).filter(function(o){return o.length>0&&t.__compiled__[o]}).map(md).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+s+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),yd(t)}function Dd(t,e){const n=t.__index__,r=t.__last_index__,u=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=u,this.text=u,this.url=u}function Fr(t,e){const n=new Dd(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function ne(t,e){if(!(this instanceof ne))return new ne(t,e);e||gd(t)&&(e=t,t={}),this.__opts__=Or({},xo,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Or({},bd,t),this.__compiled__={},this.__tlds__=kd,this.__tlds_replaced__=!1,this.re={},_n(this)}ne.prototype.add=function(e,n){return this.__schemas__[e]=n,_n(this),this};ne.prototype.set=function(e){return this.__opts__=Or(this.__opts__,e),this};ne.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let n,r,u,i,s,o,l,a,c;if(this.re.schema_test.test(e)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(e))!==null;)if(i=this.testSchemaAt(e,n[2],l.lastIndex),i){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(a=e.search(this.re.host_fuzzy_test),a>=0&&(this.__index__<0||a<this.__index__)&&(r=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(s=r.index+r[1].length,(this.__index__<0||s<this.__index__)&&(this.__schema__="",this.__index__=s,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=e.indexOf("@"),c>=0&&(u=e.match(this.re.email_fuzzy))!==null&&(s=u.index+u[1].length,o=u.index+u[0].length,(this.__index__<0||s<this.__index__||s===this.__index__&&o>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=o))),this.__index__>=0};ne.prototype.pretest=function(e){return this.re.pretest.test(e)};ne.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};ne.prototype.match=function(e){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===e&&(n.push(Fr(this,r)),r=this.__last_index__);let u=r?e.slice(r):e;for(;this.test(u);)n.push(Fr(this,r)),u=u.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};ne.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const n=this.re.schema_at_start.exec(e);if(!n)return null;const r=this.testSchemaAt(e,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,Fr(this,0)):null};ne.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,u,i){return r!==i[u-1]}).reverse(),_n(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,_n(this),this)};ne.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};ne.prototype.onCompile=function(){};const ht=2147483647,ge=36,ou=1,Jt=26,_d=38,Ed=700,ko=72,yo=128,Co="-",Sd=/^xn--/,Ad=/[^\0-\x7F]/,Md=/[\x2E\u3002\uFF0E\uFF61]/g,wd={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ur=ge-ou,be=Math.floor,ir=String.fromCharCode;function Fe(t){throw new RangeError(wd[t])}function Td(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function Do(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(Md,".");const u=t.split("."),i=Td(u,e).join(".");return r+i}function _o(t){const e=[];let n=0;const r=t.length;for(;n<r;){const u=t.charCodeAt(n++);if(u>=55296&&u<=56319&&n<r){const i=t.charCodeAt(n++);(i&64512)==56320?e.push(((u&1023)<<10)+(i&1023)+65536):(e.push(u),n--)}else e.push(u)}return e}const Od=t=>String.fromCodePoint(...t),Fd=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:ge},Si=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Eo=function(t,e,n){let r=0;for(t=n?be(t/Ed):t>>1,t+=be(t/e);t>ur*Jt>>1;r+=ge)t=be(t/ur);return be(r+(ur+1)*t/(t+_d))},So=function(t){const e=[],n=t.length;let r=0,u=yo,i=ko,s=t.lastIndexOf(Co);s<0&&(s=0);for(let o=0;o<s;++o)t.charCodeAt(o)>=128&&Fe("not-basic"),e.push(t.charCodeAt(o));for(let o=s>0?s+1:0;o<n;){const l=r;for(let c=1,f=ge;;f+=ge){o>=n&&Fe("invalid-input");const p=Fd(t.charCodeAt(o++));p>=ge&&Fe("invalid-input"),p>be((ht-r)/c)&&Fe("overflow"),r+=p*c;const h=f<=i?ou:f>=i+Jt?Jt:f-i;if(p<h)break;const d=ge-h;c>be(ht/d)&&Fe("overflow"),c*=d}const a=e.length+1;i=Eo(r-l,a,l==0),be(r/a)>ht-u&&Fe("overflow"),u+=be(r/a),r%=a,e.splice(r++,0,u)}return String.fromCodePoint(...e)},Ao=function(t){const e=[];t=_o(t);const n=t.length;let r=yo,u=0,i=ko;for(const l of t)l<128&&e.push(ir(l));const s=e.length;let o=s;for(s&&e.push(Co);o<n;){let l=ht;for(const c of t)c>=r&&c<l&&(l=c);const a=o+1;l-r>be((ht-u)/a)&&Fe("overflow"),u+=(l-r)*a,r=l;for(const c of t)if(c<r&&++u>ht&&Fe("overflow"),c===r){let f=u;for(let p=ge;;p+=ge){const h=p<=i?ou:p>=i+Jt?Jt:p-i;if(f<h)break;const d=f-h,m=ge-h;e.push(ir(Si(h+d%m,0))),f=be(d/m)}e.push(ir(Si(f,0))),i=Eo(u,a,o===s),u=0,++o}++u,++r}return e.join("")},Nd=function(t){return Do(t,function(e){return Sd.test(e)?So(e.slice(4).toLowerCase()):e})},Id=function(t){return Do(t,function(e){return Ad.test(e)?"xn--"+Ao(e):e})},Mo={version:"2.3.1",ucs2:{decode:_o,encode:Od},decode:So,encode:Ao,toASCII:Id,toUnicode:Nd},Rd={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Bd={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},vd={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},zd={default:Rd,zero:Bd,commonmark:vd},Pd=/^(vbscript|javascript|file|data):/,Ld=/^data:image\/(gif|png|jpeg|webp);/;function qd(t){const e=t.trim().toLowerCase();return Pd.test(e)?Ld.test(e):!0}const wo=["http:","https:","mailto:"];function Vd(t){const e=tu(t,!0);if(e.hostname&&(!e.protocol||wo.indexOf(e.protocol)>=0))try{e.hostname=Mo.toASCII(e.hostname)}catch{}return Gt(eu(e))}function $d(t){const e=tu(t,!0);if(e.hostname&&(!e.protocol||wo.indexOf(e.protocol)>=0))try{e.hostname=Mo.toUnicode(e.hostname)}catch{}return xt(eu(e),xt.defaultChars+"%")}function re(t,e){if(!(this instanceof re))return new re(t,e);e||ru(t)||(e=t||{},t="default"),this.inline=new Xt,this.block=new In,this.core=new iu,this.renderer=new Ct,this.linkify=new ne,this.validateLink=qd,this.normalizeLink=Vd,this.normalizeLinkText=$d,this.utils=W0,this.helpers=Fn({},U0),this.options={},this.configure(t),e&&this.set(e)}re.prototype.set=function(t){return Fn(this.options,t),this};re.prototype.configure=function(t){const e=this;if(ru(t)){const n=t;if(t=zd[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this};re.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(u){n=n.concat(this[u].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(u){return n.indexOf(u)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};re.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(u){n=n.concat(this[u].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(u){return n.indexOf(u)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};re.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};re.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens};re.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};re.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};re.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const Wd=new vr({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({params:t.getAttribute("data-params")||""})}],toDOM(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM(t){return["ol",{start:t.attrs.order==1?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:t=>({tight:t.hasAttribute("data-tight")})}],toDOM(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){return["a",t.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function Hd(t,e){if(t.isText&&e.isText&&T.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}class Jd{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:T.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let n=this.top(),r=n.content,u=r[r.length-1],i=this.schema.text(e,n.marks),s;u&&(s=Hd(u,i))?r[r.length-1]=s:r.push(i)}openMark(e){let n=this.top();n.marks=e.addToSet(n.marks)}closeMark(e){let n=this.top();n.marks=e.removeFromSet(n.marks)}parseTokens(e){for(let n=0;n<e.length;n++){let r=e[n],u=this.tokenHandlers[r.type];if(!u)throw new Error("Token type `"+r.type+"` not supported by Markdown parser");u(this,r,e,n)}}addNode(e,n,r){let u=this.top(),i=e.createAndFill(n,r,u?u.marks:[]);return i?(this.push(i),i):null}openNode(e,n){this.stack.push({type:e,attrs:n,content:[],marks:T.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}}function Et(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}function sr(t,e){return t.noCloseToken||e=="code_inline"||e=="code_block"||e=="fence"}function Ai(t){return t[t.length-1]==`
26
+ `?t.slice(0,t.length-1):t}function or(){}function jd(t,e){let n=Object.create(null);for(let r in e){let u=e[r];if(u.block){let i=t.nodeType(u.block);sr(u,r)?n[r]=(s,o,l,a)=>{s.openNode(i,Et(u,o,l,a)),s.addText(Ai(o.content)),s.closeNode()}:(n[r+"_open"]=(s,o,l,a)=>s.openNode(i,Et(u,o,l,a)),n[r+"_close"]=s=>s.closeNode())}else if(u.node){let i=t.nodeType(u.node);n[r]=(s,o,l,a)=>s.addNode(i,Et(u,o,l,a))}else if(u.mark){let i=t.marks[u.mark];sr(u,r)?n[r]=(s,o,l,a)=>{s.openMark(i.create(Et(u,o,l,a))),s.addText(Ai(o.content)),s.closeMark(i)}:(n[r+"_open"]=(s,o,l,a)=>s.openMark(i.create(Et(u,o,l,a))),n[r+"_close"]=s=>s.closeMark(i))}else if(u.ignore)sr(u,r)?n[r]=or:(n[r+"_open"]=or,n[r+"_close"]=or);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(u))}return n.text=(r,u)=>r.addText(u.content),n.inline=(r,u)=>r.parseTokens(u.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}class To{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=jd(e,r)}parse(e,n={}){let r=new Jd(this.schema,this.tokenHandlers),u;r.parseTokens(this.tokenizer.parse(e,n));do u=r.closeNode();while(r.stack.length);return u||this.schema.topNodeType.createAndFill()}}function Mi(t,e){for(;++e<t.length;)if(t[e].type!="list_item_open")return t[e].hidden;return!1}const Nr=new To(Wd,re("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(t,e,n)=>({tight:Mi(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:Mi(e,n)})},heading:{block:"heading",getAttrs:t=>({level:+t.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:t=>({params:t.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:t=>({href:t.attrGet("href"),title:t.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}}),Ud={open:"",close:"",mixable:!0};class Kd{constructor(e,n,r={}){this.nodes=e,this.marks=n,this.options=r}serialize(e,n={}){n=Object.assign({},this.options,n);let r=new Gd(this.nodes,this.marks,n);return r.renderContent(e),r.out}}const lr=new Kd({blockquote(t,e){t.wrapBlock("> ",null,e,()=>t.renderContent(e))},code_block(t,e){const n=e.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";t.write(r+(e.attrs.params||"")+`
27
27
  `),t.text(e.textContent,!1),t.write(`
28
28
  `),t.write(r),t.closeBlock(e)},heading(t,e){t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e,!1),t.closeBlock(e)},horizontal_rule(t,e){t.write(e.attrs.markup||"---"),t.closeBlock(e)},bullet_list(t,e){t.renderList(e," ",()=>(e.attrs.bullet||"*")+" ")},ordered_list(t,e){let n=e.attrs.order||1,r=String(n+e.childCount-1).length,u=t.repeat(" ",r+2);t.renderList(e,u,i=>{let s=String(n+i);return t.repeat(" ",r-s.length)+s+". "})},list_item(t,e){t.renderContent(e)},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},image(t,e){t.write("!["+t.esc(e.attrs.alt||"")+"]("+e.attrs.src.replace(/[\(\)]/g,"\\$&")+(e.attrs.title?' "'+e.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(t,e,n,r){for(let u=r+1;u<n.childCount;u++)if(n.child(u).type!=e.type){t.write(`\\
29
- `);return}},text(t,e){t.text(e.text,!t.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(t,e,n,r){return t.inAutolink=Ud(e,n,r),t.inAutolink?"<":"["},close(t,e,n,r){let{inAutolink:u}=t;return t.inAutolink=void 0,u?">":"]("+e.attrs.href.replace(/[\(\)"]/g,"\\$&")+(e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(t,e,n,r){return wi(n.child(r),-1)},close(t,e,n,r){return wi(n.child(r-1),1)},escape:!1}});function wi(t,e){let n=/`+/g,r,u=0;if(t.isText)for(;r=n.exec(t.text);)u=Math.max(u,r[0].length);let i=u>0&&e>0?" `":"`";for(let s=0;s<u;s++)i+="`";return u>0&&e<0&&(i+=" "),i}function Ud(t,e,n){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;let r=e.child(n);return!r.isText||r.text!=t.attrs.href||r.marks[r.marks.length-1]!=t?!1:n==e.childCount-1||!t.isInSet(e.child(n+1).marks)}class Kd{constructor(e,n,r){this.nodes=e,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=`
29
+ `);return}},text(t,e){t.text(e.text,!t.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(t,e,n,r){return t.inAutolink=Zd(e,n,r),t.inAutolink?"<":"["},close(t,e,n,r){let{inAutolink:u}=t;return t.inAutolink=void 0,u?">":"]("+e.attrs.href.replace(/[\(\)"]/g,"\\$&")+(e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(t,e,n,r){return wi(n.child(r),-1)},close(t,e,n,r){return wi(n.child(r-1),1)},escape:!1}});function wi(t,e){let n=/`+/g,r,u=0;if(t.isText)for(;r=n.exec(t.text);)u=Math.max(u,r[0].length);let i=u>0&&e>0?" `":"`";for(let s=0;s<u;s++)i+="`";return u>0&&e<0&&(i+=" "),i}function Zd(t,e,n){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;let r=e.child(n);return!r.isText||r.text!=t.attrs.href||r.marks[r.marks.length-1]!=t?!1:n==e.childCount-1||!t.isInSet(e.child(n+1).marks)}class Gd{constructor(e,n,r){this.nodes=e,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=`
30
30
  `),e>1){let n=this.delim,r=/\s+$/.exec(n);r&&(n=n.slice(0,n.length-r[0].length));for(let u=1;u<e;u++)this.out+=n+`
31
- `}this.closed=null}}getMark(e){let n=this.marks[e];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${e}\` not supported by Markdown renderer`);n=Jd}return n}wrapBlock(e,n,r,u){let i=this.delim;this.write(n??e),this.delim+=e,u(),this.delim=i,this.closeBlock(r)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
31
+ `}this.closed=null}}getMark(e){let n=this.marks[e];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${e}\` not supported by Markdown renderer`);n=Ud}return n}wrapBlock(e,n,r,u){let i=this.delim;this.write(n??e),this.delim+=e,u(),this.delim=i,this.closeBlock(r)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
32
32
  `)}write(e){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),e&&(this.out+=e)}closeBlock(e){this.closed=e}text(e,n=!0){let r=e.split(`
33
33
  `);for(let u=0;u<r.length;u++)this.write(),!n&&r[u][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(r[u],this.atBlockStart):r[u],u!=r.length-1&&(this.out+=`
34
- `)}render(e,n,r){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,n,r);else{if(this.options.strict!==!1)throw new Error("Token type `"+e.type.name+"` not supported by Markdown renderer");e.type.isLeaf||(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e))}}renderContent(e){e.forEach((n,r,u)=>this.render(n,e,u))}renderInline(e,n=!0){this.atBlockStart=n;let r=[],u="",i=(s,o,l)=>{let a=s?s.marks:[];s&&s.type.name===this.options.hardBreakNodeName&&(a=a.filter(m=>{if(l+1==e.childCount)return!1;let g=e.child(l+1);return m.isInSet(g.marks)&&(!g.isText||/\S/.test(g.text))}));let c=u;if(u="",s&&s.isText&&a.some(m=>{let g=this.getMark(m.type.name);return g&&g.expelEnclosingWhitespace&&!m.isInSet(r)})){let[m,g,b]=/^(\s*)(.*)$/m.exec(s.text);g&&(c+=g,s=b?s.withText(b):null,s||(a=r))}if(s&&s.isText&&a.some(m=>{let g=this.getMark(m.type.name);return g&&g.expelEnclosingWhitespace&&(l==e.childCount-1||!m.isInSet(e.child(l+1).marks))})){let[m,g,b]=/^(.*?)(\s*)$/m.exec(s.text);b&&(u=b,s=g?s.withText(g):null,s||(a=r))}let f=a.length?a[a.length-1]:null,p=f&&this.getMark(f.type.name).escape===!1,h=a.length-(p?1:0);e:for(let m=0;m<h;m++){let g=a[m];if(!this.getMark(g.type.name).mixable)break;for(let b=0;b<r.length;b++){let k=r[b];if(!this.getMark(k.type.name).mixable)break;if(g.eq(k)){m>b?a=a.slice(0,b).concat(g).concat(a.slice(b,m)).concat(a.slice(m+1,h)):b>m&&(a=a.slice(0,m).concat(a.slice(m+1,b)).concat(g).concat(a.slice(b,h)));continue e}}}let d=0;for(;d<Math.min(r.length,h)&&a[d].eq(r[d]);)++d;for(;d<r.length;)this.text(this.markString(r.pop(),!1,e,l),!1);if(c&&this.text(c),s){for(;r.length<h;){let m=a[r.length];r.push(m),this.text(this.markString(m,!0,e,l),!1),this.atBlockStart=!1}p&&s.isText?this.text(this.markString(f,!0,e,l)+s.text+this.markString(f,!1,e,l+1),!1):this.render(s,e,l),this.atBlockStart=!1}s?.isText&&s.nodeSize>0&&(this.atBlockStart=!1)};e.forEach(i),i(null,0,e.childCount),this.atBlockStart=!1}renderList(e,n,r){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let u=typeof e.attrs.tight<"u"?e.attrs.tight:this.options.tightLists,i=this.inTightList;this.inTightList=u,e.forEach((s,o,l)=>{l&&u&&this.flushClose(1),this.wrapBlock(n,r(l),e,()=>this.render(s,e,l))}),this.inTightList=i}esc(e,n=!1){return e=e.replace(/[`*\\~\[\]_]/g,(r,u)=>r=="_"&&u>0&&u+1<e.length&&e[u-1].match(/\w/)&&e[u+1].match(/\w/)?r:"\\"+r),n&&(e=e.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,"\\$&")),e}quote(e){let n=e.indexOf('"')==-1?'""':e.indexOf("'")==-1?"''":"()";return n[0]+e+n[1]}repeat(e,n){let r="";for(let u=0;u<n;u++)r+=e;return r}markString(e,n,r,u){let i=this.getMark(e.type.name),s=n?i.open:i.close;return typeof s=="string"?s:s(this,e,r,u)}getEnclosingWhitespace(e){return{leading:(e.match(/^(\s+)/)||[void 0])[0],trailing:(e.match(/(\s+)$/)||[void 0])[0]}}}var Sn=200,L=function(){};L.prototype.append=function(e){return e.length?(e=L.from(e),!this.length&&e||e.length<Sn&&this.leafAppend(e)||this.length<Sn&&e.leafPrepend(this)||this.appendInner(e)):this};L.prototype.prepend=function(e){return e.length?L.from(e).append(this):this};L.prototype.appendInner=function(e){return new Zd(this,e)};L.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?L.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};L.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};L.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};L.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var u=[];return this.forEach(function(i,s){return u.push(e(i,s))},n,r),u};L.from=function(e){return e instanceof L?e:e&&e.length?new wo(e):L.empty};var wo=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(u,i){return u==0&&i==this.length?this:new e(this.values.slice(u,i))},e.prototype.getInner=function(u){return this.values[u]},e.prototype.forEachInner=function(u,i,s,o){for(var l=i;l<s;l++)if(u(this.values[l],o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(u,i,s,o){for(var l=i-1;l>=s;l--)if(u(this.values[l],o+l)===!1)return!1},e.prototype.leafAppend=function(u){if(this.length+u.length<=Sn)return new e(this.values.concat(u.flatten()))},e.prototype.leafPrepend=function(u){if(this.length+u.length<=Sn)return new e(u.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(L);L.empty=new wo([]);var Zd=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,u,i,s){var o=this.left.length;if(u<o&&this.left.forEachInner(r,u,Math.min(i,o),s)===!1||i>o&&this.right.forEachInner(r,Math.max(u-o,0),Math.min(this.length,i)-o,s+o)===!1)return!1},e.prototype.forEachInvertedInner=function(r,u,i,s){var o=this.left.length;if(u>o&&this.right.forEachInvertedInner(r,u-o,Math.max(i,o)-o,s+o)===!1||i<o&&this.left.forEachInvertedInner(r,Math.min(u,o),i,s)===!1)return!1},e.prototype.sliceInner=function(r,u){if(r==0&&u==this.length)return this;var i=this.left.length;return u<=i?this.left.slice(r,u):r>=i?this.right.slice(r-i,u-i):this.left.slice(r,i).append(this.right.slice(0,u-i))},e.prototype.leafAppend=function(r){var u=this.right.leafAppend(r);if(u)return new e(this.left,u)},e.prototype.leafPrepend=function(r){var u=this.left.leafPrepend(r);if(u)return new e(u,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(L);const Gd=500;class ae{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let u,i;n&&(u=this.remapping(r,this.items.length),i=u.maps.length);let s=e.tr,o,l,a=[],c=[];return this.items.forEach((f,p)=>{if(!f.step){u||(u=this.remapping(r,p+1),i=u.maps.length),i--,c.push(f);return}if(u){c.push(new pe(f.map));let h=f.step.map(u.slice(i)),d;h&&s.maybeStep(h).doc&&(d=s.mapping.maps[s.mapping.maps.length-1],a.push(new pe(d,void 0,void 0,a.length+c.length))),i--,d&&u.appendMap(d,i)}else s.maybeStep(f.step);if(f.selection)return o=u?f.selection.map(u.slice(i)):f.selection,l=new ae(this.items.slice(0,r).append(c.reverse().concat(a)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:o}}addTransform(e,n,r,u){let i=[],s=this.eventCount,o=this.items,l=!u&&o.length?o.get(o.length-1):null;for(let c=0;c<e.steps.length;c++){let f=e.steps[c].invert(e.docs[c]),p=new pe(e.mapping.maps[c],f,n),h;(h=l&&l.merge(p))&&(p=h,c?i.pop():o=o.slice(0,o.length-1)),i.push(p),n&&(s++,n=void 0),u||(l=p)}let a=s-r.depth;return a>Xd&&(o=Yd(o,a),s-=a),new ae(o.append(i),s)}remapping(e,n){let r=new zt;return this.items.forEach((u,i)=>{let s=u.mirrorOffset!=null&&i-u.mirrorOffset>=e?r.maps.length-u.mirrorOffset:void 0;r.appendMap(u.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new ae(this.items.append(e.map(n=>new pe(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],u=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,o=this.eventCount;this.items.forEach(p=>{p.selection&&o--},u);let l=n;this.items.forEach(p=>{let h=i.getMirror(--l);if(h==null)return;s=Math.min(s,h);let d=i.maps[h];if(p.step){let m=e.steps[h].invert(e.docs[h]),g=p.selection&&p.selection.map(i.slice(l+1,h));g&&o++,r.push(new pe(d,m,g))}else r.push(new pe(d))},u);let a=[];for(let p=n;p<s;p++)a.push(new pe(i.maps[p]));let c=this.items.slice(0,u).append(a).append(r),f=new ae(c,o);return f.emptyItemCount()>Gd&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,u=[],i=0;return this.items.forEach((s,o)=>{if(o>=e)u.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(n.slice(r)),a=l&&l.getMap();if(r--,a&&n.appendMap(a,r),l){let c=s.selection&&s.selection.map(n.slice(r));c&&i++;let f=new pe(a.invert(),l,c),p,h=u.length-1;(p=u.length&&u[h].merge(f))?u[h]=p:u.push(f)}}else s.map&&r--},this.items.length,0),new ae(L.from(u.reverse()),i)}}ae.empty=new ae(L.empty,0);function Yd(t,e){let n;return t.forEach((r,u)=>{if(r.selection&&e--==0)return n=u,!1}),t.slice(n)}class pe{constructor(e,n,r,u){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=u}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new pe(n.getMap().invert(),n,this.selection)}}}class Ne{constructor(e,n,r,u,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=u,this.prevComposition=i}}const Xd=20;function Qd(t,e,n,r){let u=n.getMeta(Qe),i;if(u)return u.historyState;n.getMeta(nh)&&(t=new Ne(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Qe))return s.getMeta(Qe).redo?new Ne(t.done.addTransform(n,void 0,r,dn(e)),t.undone,Ti(n.mapping.maps),t.prevTime,t.prevComposition):new Ne(t.done,t.undone.addTransform(n,void 0,r,dn(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let o=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=o&&(t.prevTime<(n.time||0)-r.newGroupDelay||!eh(n,t.prevRanges)),a=s?ar(t.prevRanges,n.mapping):Ti(n.mapping.maps);return new Ne(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,dn(e)),ae.empty,a,n.time,o??t.prevComposition)}else return(i=n.getMeta("rebased"))?new Ne(t.done.rebased(n,i),t.undone.rebased(n,i),ar(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ne(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),ar(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function eh(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,u)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&u>=e[i]&&(n=!0)}),n}function Ti(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,u,i,s)=>e.push(i,s));return e}function ar(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let u=e.map(t[r],1),i=e.map(t[r+1],-1);u<=i&&n.push(u,i)}return n}function th(t,e,n){let r=dn(e),u=Qe.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),o=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),u,r),l=new Ne(n?o:i.remaining,n?i.remaining:o,null,0,-1);return i.transform.setSelection(s).setMeta(Qe,{redo:n,historyState:l})}let cr=!1,Oi=null;function dn(t){let e=t.plugins;if(Oi!=e){cr=!1,Oi=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){cr=!0;break}}return cr}const Qe=new cs("history"),nh=new cs("closeHistory");function rh(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Vr({key:Qe,state:{init(){return new Ne(ae.empty,ae.empty,null,0,-1)},apply(e,n,r){return Qd(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,u=r=="historyUndo"?Oo:r=="historyRedo"?Nr:null;return u?(n.preventDefault(),u(e.state,e.dispatch)):!1}}}})}function To(t,e){return(n,r)=>{let u=Qe.getState(n);if(!u||(t?u.undone:u.done).eventCount==0)return!1;if(r){let i=th(u,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const Oo=To(!1,!0),Nr=To(!0,!0);var We={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:"'"},An={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},uh=typeof navigator<"u"&&/Mac/.test(navigator.platform),ih=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var $=0;$<10;$++)We[48+$]=We[96+$]=String($);for(var $=1;$<=24;$++)We[$+111]="F"+$;for(var $=65;$<=90;$++)We[$]=String.fromCharCode($+32),An[$]=String.fromCharCode($);for(var fr in We)An.hasOwnProperty(fr)||(An[fr]=We[fr]);function sh(t){var e=uh&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||ih&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?An:We)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const oh=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),lh=typeof navigator<"u"&&/Win/.test(navigator.platform);function ah(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,u,i,s;for(let o=0;o<e.length-1;o++){let l=e[o];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))u=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))oh?s=!0:u=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),u&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function ch(t){let e=Object.create(null);for(let n in t)e[ah(n)]=t[n];return e}function dr(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function hr(t){return new Vr({props:{handleKeyDown:fh(t)}})}function fh(t){let e=ch(t);return function(n,r){let u=sh(r),i,s=e[dr(u,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(u.length==1&&u!=" "){if(r.shiftKey){let o=e[dr(u,r,!1)];if(o&&o(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(lh&&r.ctrlKey&&r.altKey)&&(i=We[r.keyCode])&&i!=u){let o=e[dr(i,r)];if(o&&o(n.state,n.dispatch,n))return!0}}return!1}}const Ir={headings:!0,bold:!0,italic:!0,code:!0,links:!0,bulletList:!0,orderedList:!0,blockquote:!0,codeBlock:!0,horizontalRule:!0,hardBreak:!0,headerLevels:3};function dh(t){return new Vr({view:()=>({update:()=>{t()}}),filterTransaction:()=>(t(),!0)})}const hh=t=>{const{value:e,onChange:n,onInput:r,onBlur:u,class:i,id:s,name:o,hasError:l,disabled:a,autofocus:c=!1,readOnly:f=!1,placeholder:p,showToolbar:h=!1,features:d}=t,m=A.Value.toSignal(f),g=A.Value.toSignal(a??!1),b=A.Value.toSignal(h),k=A.computedOf(d??Ir)(S=>({...Ir,...S})),y=A.prop(null),_=Io.ticker();return A.Fragment(A.Use(Ro.Theme,({appearance:S})=>A.html.div(A.OnDispose(()=>{y.value?.destroy()}),(t.cssInjection??"none")==="none"?null:A.Task(()=>Promise.resolve().then(()=>require("./styles-url-D8MjxiP-.cjs")),({default:E})=>No.LinkPortal({id:"beatui-prosemirror-css",href:E})),A.attr.class("bc-prosemirror-editor-container"),A.attr.class(i),A.attr.class(A.Value.map(l??!1,E=>E?"bc-input-container--error":"")),A.attr.id(s),A.attr.name(o),A.When(b,()=>A.When(y.map(E=>E!=null),()=>Cs({view:y,stateUpdate:_,features:k,readOnly:m})),()=>null),A.html.div(A.attr.class("bc-prosemirror-editor"),A.WithElement(E=>{const D=[];return(()=>{try{const O=A.Value.get(e)??"",oe=A.Value.get(m)??!1,yt=A.Value.get(g)??!1,vn=A.Value.get(k),Ct=mh(Br,Qc,vn),Qt=Mi.parse(O)??void 0,we=ph(Ct),zn=je.create({doc:Qt,schema:Ct,plugins:[rh(),hr({"Mod-z":Oo,"Mod-y":Nr,"Mod-Shift-z":Nr}),hr(we),hr(Ql),dh(_.tick)]}),le=new to(E,{state:zn,editable:()=>!oe&&!yt,dispatchTransaction(R){const de=le.state.apply(R);if(le.updateState(de),R.docChanged&&r!=null){const en=lr.serialize(de.doc);r(en)}}});if(y.set(le),A.Value.get(c)&&le.focus(),p!=null&&D.push(A.Value.on(p,R=>{R!=null&&R!==""?E.setAttribute("data-placeholder",R):E.removeAttribute("data-placeholder")})),D.push(A.Value.on(m,R=>{const de=A.Value.get(g);le.setProps({editable:()=>!R&&!de})})),D.push(A.Value.on(g,R=>{const de=A.Value.get(m);le.setProps({editable:()=>!de&&!R})})),D.push(A.Value.on(e,R=>{const de=lr.serialize(le.state.doc);if(R!==de){const en=Mi.parse(R??"");if(en!=null){const Fo=je.create({doc:en,schema:Ct,plugins:le.state.plugins});le.updateState(Fo)}}})),n!=null){const R=()=>{const de=lr.serialize(le.state.doc);n(de)};E.addEventListener("blur",R,!0),D.push(()=>E.removeEventListener("blur",R,!0))}if(u!=null){const R=()=>{u()};E.addEventListener("blur",R,!0),D.push(()=>E.removeEventListener("blur",R,!0))}D.push(S.on(R=>{R==="dark"?E.classList.add("bc-prosemirror-editor--dark"):E.classList.remove("bc-prosemirror-editor--dark")})),D.push(()=>le.destroy())}catch(O){console.error("[BeatUI] Failed to initialize ProseMirror editor:",O);const oe=E;oe.textContent="Failed to load ProseMirror Editor. Please ensure prosemirror packages are installed."}})(),A.OnDispose(()=>{D.forEach(O=>O())})})))))};function ph(t){const e={},n=t.marks.strong;n!=null&&(e["Mod-b"]=(i,s)=>cn(n)(i,s));const r=t.marks.em;r!=null&&(e["Mod-i"]=(i,s)=>cn(r)(i,s));const u=t.marks.code;return u!=null&&(e["Mod-`"]=(i,s)=>cn(u)(i,s)),e}function mh(t,e,n){const r={},u={},i=e.spec.nodes.get("doc"),s=e.spec.nodes.get("text");if(i==null||s==null)throw new Error("Basic schema missing required doc or text nodes");r.doc={...i,content:"block+"},r.text=s;const o=e.spec.nodes.get("paragraph");if(o!=null&&(r.paragraph={...o,content:"inline*"}),n.headings){const l=e.spec.nodes.get("heading");l!=null&&(r.heading={...l,content:"inline*"})}if(n.bulletList){const l=e.spec.nodes.get("bullet_list"),a=e.spec.nodes.get("list_item");l!=null&&(r.bullet_list={...l,content:"list_item+"}),a!=null&&(r.list_item={...a,content:"paragraph block*"})}if(n.orderedList){const l=e.spec.nodes.get("ordered_list"),a=e.spec.nodes.get("list_item");l!=null&&(r.ordered_list={...l,content:"list_item+"}),a!=null&&!r.list_item&&(r.list_item={...a,content:"paragraph block*"})}if(n.blockquote){const l=e.spec.nodes.get("blockquote");l!=null&&(r.blockquote={...l,content:"block+"})}if(n.codeBlock){const l=e.spec.nodes.get("code_block");l!=null&&(r.code_block=l)}if(n.horizontalRule){const l=e.spec.nodes.get("horizontal_rule");l!=null&&(r.horizontal_rule=l)}if(n.hardBreak){const l=e.spec.nodes.get("hard_break");l!=null&&(r.hard_break=l)}if(n.bold){const l=e.spec.marks.get("strong");l!=null&&(u.strong=l)}if(n.italic){const l=e.spec.marks.get("em");l!=null&&(u.em=l)}if(n.code){const l=e.spec.marks.get("code");l!=null&&(u.code=l)}if(n.links){const l=e.spec.marks.get("link");l!=null&&(u.link=l)}return new t({nodes:r,marks:u})}exports.DEFAULT_FEATURES=Ir;exports.Fragment=x;exports.NodeRange=Pi;exports.ProseMirrorMarkdownInput=hh;exports.ProseMirrorToolbar=Cs;exports.ReplaceAroundStep=G;exports.Slice=C;exports.canJoin=Pr;exports.canSplit=Ot;exports.findWrapping=es;exports.liftTarget=jt;
34
+ `)}render(e,n,r){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,n,r);else{if(this.options.strict!==!1)throw new Error("Token type `"+e.type.name+"` not supported by Markdown renderer");e.type.isLeaf||(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e))}}renderContent(e){e.forEach((n,r,u)=>this.render(n,e,u))}renderInline(e,n=!0){this.atBlockStart=n;let r=[],u="",i=(s,o,l)=>{let a=s?s.marks:[];s&&s.type.name===this.options.hardBreakNodeName&&(a=a.filter(m=>{if(l+1==e.childCount)return!1;let g=e.child(l+1);return m.isInSet(g.marks)&&(!g.isText||/\S/.test(g.text))}));let c=u;if(u="",s&&s.isText&&a.some(m=>{let g=this.getMark(m.type.name);return g&&g.expelEnclosingWhitespace&&!m.isInSet(r)})){let[m,g,b]=/^(\s*)(.*)$/m.exec(s.text);g&&(c+=g,s=b?s.withText(b):null,s||(a=r))}if(s&&s.isText&&a.some(m=>{let g=this.getMark(m.type.name);return g&&g.expelEnclosingWhitespace&&(l==e.childCount-1||!m.isInSet(e.child(l+1).marks))})){let[m,g,b]=/^(.*?)(\s*)$/m.exec(s.text);b&&(u=b,s=g?s.withText(g):null,s||(a=r))}let f=a.length?a[a.length-1]:null,p=f&&this.getMark(f.type.name).escape===!1,h=a.length-(p?1:0);e:for(let m=0;m<h;m++){let g=a[m];if(!this.getMark(g.type.name).mixable)break;for(let b=0;b<r.length;b++){let k=r[b];if(!this.getMark(k.type.name).mixable)break;if(g.eq(k)){m>b?a=a.slice(0,b).concat(g).concat(a.slice(b,m)).concat(a.slice(m+1,h)):b>m&&(a=a.slice(0,m).concat(a.slice(m+1,b)).concat(g).concat(a.slice(b,h)));continue e}}}let d=0;for(;d<Math.min(r.length,h)&&a[d].eq(r[d]);)++d;for(;d<r.length;)this.text(this.markString(r.pop(),!1,e,l),!1);if(c&&this.text(c),s){for(;r.length<h;){let m=a[r.length];r.push(m),this.text(this.markString(m,!0,e,l),!1),this.atBlockStart=!1}p&&s.isText?this.text(this.markString(f,!0,e,l)+s.text+this.markString(f,!1,e,l+1),!1):this.render(s,e,l),this.atBlockStart=!1}s?.isText&&s.nodeSize>0&&(this.atBlockStart=!1)};e.forEach(i),i(null,0,e.childCount),this.atBlockStart=!1}renderList(e,n,r){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let u=typeof e.attrs.tight<"u"?e.attrs.tight:this.options.tightLists,i=this.inTightList;this.inTightList=u,e.forEach((s,o,l)=>{l&&u&&this.flushClose(1),this.wrapBlock(n,r(l),e,()=>this.render(s,e,l))}),this.inTightList=i}esc(e,n=!1){return e=e.replace(/[`*\\~\[\]_]/g,(r,u)=>r=="_"&&u>0&&u+1<e.length&&e[u-1].match(/\w/)&&e[u+1].match(/\w/)?r:"\\"+r),n&&(e=e.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,"\\$&")),e}quote(e){let n=e.indexOf('"')==-1?'""':e.indexOf("'")==-1?"''":"()";return n[0]+e+n[1]}repeat(e,n){let r="";for(let u=0;u<n;u++)r+=e;return r}markString(e,n,r,u){let i=this.getMark(e.type.name),s=n?i.open:i.close;return typeof s=="string"?s:s(this,e,r,u)}getEnclosingWhitespace(e){return{leading:(e.match(/^(\s+)/)||[void 0])[0],trailing:(e.match(/(\s+)$/)||[void 0])[0]}}}var En=200,L=function(){};L.prototype.append=function(e){return e.length?(e=L.from(e),!this.length&&e||e.length<En&&this.leafAppend(e)||this.length<En&&e.leafPrepend(this)||this.appendInner(e)):this};L.prototype.prepend=function(e){return e.length?L.from(e).append(this):this};L.prototype.appendInner=function(e){return new Yd(this,e)};L.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?L.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};L.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};L.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};L.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var u=[];return this.forEach(function(i,s){return u.push(e(i,s))},n,r),u};L.from=function(e){return e instanceof L?e:e&&e.length?new Oo(e):L.empty};var Oo=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(u,i){return u==0&&i==this.length?this:new e(this.values.slice(u,i))},e.prototype.getInner=function(u){return this.values[u]},e.prototype.forEachInner=function(u,i,s,o){for(var l=i;l<s;l++)if(u(this.values[l],o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(u,i,s,o){for(var l=i-1;l>=s;l--)if(u(this.values[l],o+l)===!1)return!1},e.prototype.leafAppend=function(u){if(this.length+u.length<=En)return new e(this.values.concat(u.flatten()))},e.prototype.leafPrepend=function(u){if(this.length+u.length<=En)return new e(u.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(L);L.empty=new Oo([]);var Yd=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,u,i,s){var o=this.left.length;if(u<o&&this.left.forEachInner(r,u,Math.min(i,o),s)===!1||i>o&&this.right.forEachInner(r,Math.max(u-o,0),Math.min(this.length,i)-o,s+o)===!1)return!1},e.prototype.forEachInvertedInner=function(r,u,i,s){var o=this.left.length;if(u>o&&this.right.forEachInvertedInner(r,u-o,Math.max(i,o)-o,s+o)===!1||i<o&&this.left.forEachInvertedInner(r,Math.min(u,o),i,s)===!1)return!1},e.prototype.sliceInner=function(r,u){if(r==0&&u==this.length)return this;var i=this.left.length;return u<=i?this.left.slice(r,u):r>=i?this.right.slice(r-i,u-i):this.left.slice(r,i).append(this.right.slice(0,u-i))},e.prototype.leafAppend=function(r){var u=this.right.leafAppend(r);if(u)return new e(this.left,u)},e.prototype.leafPrepend=function(r){var u=this.left.leafPrepend(r);if(u)return new e(u,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(L);const Xd=500;class ae{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let u,i;n&&(u=this.remapping(r,this.items.length),i=u.maps.length);let s=e.tr,o,l,a=[],c=[];return this.items.forEach((f,p)=>{if(!f.step){u||(u=this.remapping(r,p+1),i=u.maps.length),i--,c.push(f);return}if(u){c.push(new pe(f.map));let h=f.step.map(u.slice(i)),d;h&&s.maybeStep(h).doc&&(d=s.mapping.maps[s.mapping.maps.length-1],a.push(new pe(d,void 0,void 0,a.length+c.length))),i--,d&&u.appendMap(d,i)}else s.maybeStep(f.step);if(f.selection)return o=u?f.selection.map(u.slice(i)):f.selection,l=new ae(this.items.slice(0,r).append(c.reverse().concat(a)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:o}}addTransform(e,n,r,u){let i=[],s=this.eventCount,o=this.items,l=!u&&o.length?o.get(o.length-1):null;for(let c=0;c<e.steps.length;c++){let f=e.steps[c].invert(e.docs[c]),p=new pe(e.mapping.maps[c],f,n),h;(h=l&&l.merge(p))&&(p=h,c?i.pop():o=o.slice(0,o.length-1)),i.push(p),n&&(s++,n=void 0),u||(l=p)}let a=s-r.depth;return a>eh&&(o=Qd(o,a),s-=a),new ae(o.append(i),s)}remapping(e,n){let r=new zt;return this.items.forEach((u,i)=>{let s=u.mirrorOffset!=null&&i-u.mirrorOffset>=e?r.maps.length-u.mirrorOffset:void 0;r.appendMap(u.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new ae(this.items.append(e.map(n=>new pe(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],u=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,o=this.eventCount;this.items.forEach(p=>{p.selection&&o--},u);let l=n;this.items.forEach(p=>{let h=i.getMirror(--l);if(h==null)return;s=Math.min(s,h);let d=i.maps[h];if(p.step){let m=e.steps[h].invert(e.docs[h]),g=p.selection&&p.selection.map(i.slice(l+1,h));g&&o++,r.push(new pe(d,m,g))}else r.push(new pe(d))},u);let a=[];for(let p=n;p<s;p++)a.push(new pe(i.maps[p]));let c=this.items.slice(0,u).append(a).append(r),f=new ae(c,o);return f.emptyItemCount()>Xd&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,u=[],i=0;return this.items.forEach((s,o)=>{if(o>=e)u.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(n.slice(r)),a=l&&l.getMap();if(r--,a&&n.appendMap(a,r),l){let c=s.selection&&s.selection.map(n.slice(r));c&&i++;let f=new pe(a.invert(),l,c),p,h=u.length-1;(p=u.length&&u[h].merge(f))?u[h]=p:u.push(f)}}else s.map&&r--},this.items.length,0),new ae(L.from(u.reverse()),i)}}ae.empty=new ae(L.empty,0);function Qd(t,e){let n;return t.forEach((r,u)=>{if(r.selection&&e--==0)return n=u,!1}),t.slice(n)}class pe{constructor(e,n,r,u){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=u}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new pe(n.getMap().invert(),n,this.selection)}}}class Ne{constructor(e,n,r,u,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=u,this.prevComposition=i}}const eh=20;function th(t,e,n,r){let u=n.getMeta(et),i;if(u)return u.historyState;n.getMeta(uh)&&(t=new Ne(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(et))return s.getMeta(et).redo?new Ne(t.done.addTransform(n,void 0,r,fn(e)),t.undone,Ti(n.mapping.maps),t.prevTime,t.prevComposition):new Ne(t.done,t.undone.addTransform(n,void 0,r,fn(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let o=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=o&&(t.prevTime<(n.time||0)-r.newGroupDelay||!nh(n,t.prevRanges)),a=s?ar(t.prevRanges,n.mapping):Ti(n.mapping.maps);return new Ne(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,fn(e)),ae.empty,a,n.time,o??t.prevComposition)}else return(i=n.getMeta("rebased"))?new Ne(t.done.rebased(n,i),t.undone.rebased(n,i),ar(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ne(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),ar(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function nh(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,u)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&u>=e[i]&&(n=!0)}),n}function Ti(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,u,i,s)=>e.push(i,s));return e}function ar(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let u=e.map(t[r],1),i=e.map(t[r+1],-1);u<=i&&n.push(u,i)}return n}function rh(t,e,n){let r=fn(e),u=et.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),o=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),u,r),l=new Ne(n?o:i.remaining,n?i.remaining:o,null,0,-1);return i.transform.setSelection(s).setMeta(et,{redo:n,historyState:l})}let cr=!1,Oi=null;function fn(t){let e=t.plugins;if(Oi!=e){cr=!1,Oi=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){cr=!0;break}}return cr}const et=new fs("history"),uh=new fs("closeHistory");function ih(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new $r({key:et,state:{init(){return new Ne(ae.empty,ae.empty,null,0,-1)},apply(e,n,r){return th(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,u=r=="historyUndo"?No:r=="historyRedo"?Ir:null;return u?(n.preventDefault(),u(e.state,e.dispatch)):!1}}}})}function Fo(t,e){return(n,r)=>{let u=et.getState(n);if(!u||(t?u.undone:u.done).eventCount==0)return!1;if(r){let i=rh(u,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const No=Fo(!1,!0),Ir=Fo(!0,!0);var We={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:"'"},Sn={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},sh=typeof navigator<"u"&&/Mac/.test(navigator.platform),oh=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var $=0;$<10;$++)We[48+$]=We[96+$]=String($);for(var $=1;$<=24;$++)We[$+111]="F"+$;for(var $=65;$<=90;$++)We[$]=String.fromCharCode($+32),Sn[$]=String.fromCharCode($);for(var fr in We)Sn.hasOwnProperty(fr)||(Sn[fr]=We[fr]);function lh(t){var e=sh&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||oh&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Sn:We)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const ah=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ch=typeof navigator<"u"&&/Win/.test(navigator.platform);function fh(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,u,i,s;for(let o=0;o<e.length-1;o++){let l=e[o];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))u=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))ah?s=!0:u=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),u&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function dh(t){let e=Object.create(null);for(let n in t)e[fh(n)]=t[n];return e}function dr(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function hr(t){return new $r({props:{handleKeyDown:hh(t)}})}function hh(t){let e=dh(t);return function(n,r){let u=lh(r),i,s=e[dr(u,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(u.length==1&&u!=" "){if(r.shiftKey){let o=e[dr(u,r,!1)];if(o&&o(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(ch&&r.ctrlKey&&r.altKey)&&(i=We[r.keyCode])&&i!=u){let o=e[dr(i,r)];if(o&&o(n.state,n.dispatch,n))return!0}}return!1}}const ph=new To(Nr.schema,re("commonmark",{breaks:!0}),Nr.tokens);function Fi(t,e){return(e?ph:Nr).parse(t??"")}const Rr={headings:!0,bold:!0,italic:!0,code:!0,links:!0,bulletList:!0,orderedList:!0,blockquote:!0,codeBlock:!0,horizontalRule:!0,hardBreak:!0,headerLevels:3};function mh(t){return new $r({view:()=>({update:()=>{t()}}),filterTransaction:()=>(t(),!0)})}const gh=t=>{const{value:e,onChange:n,onInput:r,onBlur:u,class:i,id:s,name:o,hasError:l,disabled:a,autofocus:c=!1,readOnly:f=!1,placeholder:p,showToolbar:h=!1,features:d,preserveLineBreaks:m=!1}=t,g=S.Value.toSignal(f),b=S.Value.toSignal(a??!1),k=S.Value.toSignal(h),y=S.computedOf(d??Rr)(M=>({...Rr,...M})),_=S.prop(null),E=vo.ticker();return S.Fragment(S.Use(zo.Theme,({appearance:M})=>S.html.div(S.OnDispose(()=>{_.value?.destroy()}),(t.cssInjection??"none")==="none"?null:S.Task(()=>Promise.resolve().then(()=>require("./styles-url-D8MjxiP-.cjs")),({default:C})=>Bo.LinkPortal({id:"beatui-prosemirror-css",href:C})),S.attr.class("bc-prosemirror-editor-container"),S.attr.class(i),S.attr.class(S.Value.map(l??!1,C=>C?"bc-input-container--error":"")),S.attr.id(s),S.attr.name(o),S.When(k,()=>S.When(_.map(C=>C!=null),()=>Ds({view:_,stateUpdate:E,features:y,readOnly:g})),()=>null),S.html.div(S.attr.class("bc-prosemirror-editor"),S.WithElement(C=>{const w=[];return(()=>{try{const Q=S.Value.get(e)??"",Je=S.Value.get(g)??!1,Bn=S.Value.get(b)??!1,vn=S.Value.get(y),it=xh(vr,n0,vn),we=Fi(Q,m),zn=bh(it),Io=Ue.create({doc:we,schema:it,plugins:[ih(),hr({"Mod-z":No,"Mod-y":Ir,"Mod-Shift-z":Ir}),hr(zn),hr(na),mh(E.tick)]}),le=new no(C,{state:Io,editable:()=>!Je&&!Bn,dispatchTransaction(R){const de=le.state.apply(R);if(le.updateState(de),R.docChanged&&r!=null){const Qt=lr.serialize(de.doc);r(Qt)}}});if(_.set(le),S.Value.get(c)&&le.focus(),p!=null&&w.push(S.Value.on(p,R=>{R!=null&&R!==""?C.setAttribute("data-placeholder",R):C.removeAttribute("data-placeholder")})),w.push(S.Value.on(g,R=>{const de=S.Value.get(b);le.setProps({editable:()=>!R&&!de})})),w.push(S.Value.on(b,R=>{const de=S.Value.get(g);le.setProps({editable:()=>!de&&!R})})),w.push(S.Value.on(e,R=>{const de=lr.serialize(le.state.doc);if(R!==de){const Qt=Fi(R,m);if(Qt!=null){const Ro=Ue.create({doc:Qt,schema:it,plugins:le.state.plugins});le.updateState(Ro)}}})),n!=null){const R=()=>{const de=lr.serialize(le.state.doc);n(de)};C.addEventListener("blur",R,!0),w.push(()=>C.removeEventListener("blur",R,!0))}if(u!=null){const R=()=>{u()};C.addEventListener("blur",R,!0),w.push(()=>C.removeEventListener("blur",R,!0))}w.push(M.on(R=>{R==="dark"?C.classList.add("bc-prosemirror-editor--dark"):C.classList.remove("bc-prosemirror-editor--dark")})),w.push(()=>le.destroy())}catch(Q){console.error("[BeatUI] Failed to initialize ProseMirror editor:",Q);const Je=C;Je.textContent="Failed to load ProseMirror Editor. Please ensure prosemirror packages are installed."}})(),S.OnDispose(()=>{w.forEach(Q=>Q())})})))))};function bh(t){const e={},n=t.marks.strong;n!=null&&(e["Mod-b"]=(i,s)=>an(n)(i,s));const r=t.marks.em;r!=null&&(e["Mod-i"]=(i,s)=>an(r)(i,s));const u=t.marks.code;return u!=null&&(e["Mod-`"]=(i,s)=>an(u)(i,s)),e}function xh(t,e,n){const r={},u={},i=e.spec.nodes.get("doc"),s=e.spec.nodes.get("text");if(i==null||s==null)throw new Error("Basic schema missing required doc or text nodes");r.doc={...i,content:"block+"},r.text=s;const o=e.spec.nodes.get("paragraph");if(o!=null&&(r.paragraph={...o,content:"inline*"}),n.headings){const l=e.spec.nodes.get("heading");l!=null&&(r.heading={...l,content:"inline*"})}if(n.bulletList){const l=e.spec.nodes.get("bullet_list"),a=e.spec.nodes.get("list_item");l!=null&&(r.bullet_list={...l,content:"list_item+"}),a!=null&&(r.list_item={...a,content:"paragraph block*"})}if(n.orderedList){const l=e.spec.nodes.get("ordered_list"),a=e.spec.nodes.get("list_item");l!=null&&(r.ordered_list={...l,content:"list_item+"}),a!=null&&!r.list_item&&(r.list_item={...a,content:"paragraph block*"})}if(n.blockquote){const l=e.spec.nodes.get("blockquote");l!=null&&(r.blockquote={...l,content:"block+"})}if(n.codeBlock){const l=e.spec.nodes.get("code_block");l!=null&&(r.code_block=l)}if(n.horizontalRule){const l=e.spec.nodes.get("horizontal_rule");l!=null&&(r.horizontal_rule=l)}if(n.hardBreak){const l=e.spec.nodes.get("hard_break");l!=null&&(r.hard_break=l)}if(n.bold){const l=e.spec.marks.get("strong");l!=null&&(u.strong=l)}if(n.italic){const l=e.spec.marks.get("em");l!=null&&(u.em=l)}if(n.code){const l=e.spec.marks.get("code");l!=null&&(u.code=l)}if(n.links){const l=e.spec.marks.get("link");l!=null&&(u.link=l)}return new t({nodes:r,marks:u})}exports.DEFAULT_FEATURES=Rr;exports.Fragment=x;exports.NodeRange=Li;exports.ProseMirrorMarkdownInput=gh;exports.ProseMirrorToolbar=Ds;exports.ReplaceAroundStep=G;exports.Slice=D;exports.canJoin=Lr;exports.canSplit=Ot;exports.findWrapping=ts;exports.liftTarget=jt;