atomic-server 0.40.1

Create, share and model Atomic Data with this graph database server. Run atomic-server without any arguments to start the server. Use --help to learn about the options.
Documentation
import{R as oe,r as z,h as Yh,i as Xh,a as ep,j as M,d as Te,I as zc,C as $s,k as $c,l as Du,B as Hs,f as Tu,m as tp,F as np,o as rp,q as ip,s as Hc,v as Mu,T as op,w as sp,x as Ou,P as up,S as ap,y as lp,z as cp,D as On,E as dp,c as fp,G as hp,H as pp,J as mp,K as gp}from"./index.js";function me(t){this.content=t}me.prototype={constructor:me,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new me(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new me(n)},addToStart:function(t,e){return new me([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new me(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new me(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=me.from(t),t.size?new me(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=me.from(t),t.size?new me(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=me.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}};me.from=function(t){if(t instanceof me)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new me(e)};function jc(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=jc(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function qc(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),u=e.child(--o),a=s.nodeSize;if(s==u){n-=a,r-=a;continue}if(!s.sameMarkup(u))return{a:n,b:r};if(s.isText&&s.text!=u.text){let l=0,c=Math.min(s.text.length,u.text.length);for(;l<c&&s.text[s.text.length-l-1]==u.text[u.text.length-l-1];)l++,n--,r--;return{a:n,b:r}}if(s.content.size||u.content.size){let l=qc(s.content,u.content,n-1,r-1);if(l)return l}n-=a,r-=a}}class E{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,u=0;u<n;s++){let a=this.content[s],l=u+a.nodeSize;if(l>e&&r(a,i+u,o||null,s)!==!1&&a.content.size){let c=u+1;a.nodesBetween(Math.max(0,e-c),Math.min(a.content.size,n-c),r,i+c)}u=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(u,a)=>{let l=u.isText?u.text.slice(Math.max(e,a)-a,n-a):u.isLeaf?i?typeof i=="function"?i(u):i:u.type.spec.leafText?u.type.spec.leafText(u):"":"";u.isBlock&&(u.isLeaf&&l||u.isTextblock)&&r&&(s?s=!1:o+=r),o+=l},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new E(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let u=this.content[o],a=s+u.nodeSize;a>e&&((s<e||a>n)&&(u.isText?u=u.cut(Math.max(0,e-s),Math.min(u.text.length,n-s)):u=u.cut(Math.max(0,e-s-1),Math.min(u.content.size,n-s-1))),r.push(u),i+=u.nodeSize),s=a}return new E(r,i)}cutByIndex(e,n){return e==n?E.empty:e==0&&n==this.content.length?this:new E(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new E(i,o)}addToStart(e){return new E([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new E(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return jc(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return qc(this,e,n,r)}findIndex(e,n=-1){if(e==0)return li(0,e);if(e==this.size)return li(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?li(r+1,s):li(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return E.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new E(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return E.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new E(n||e,r)}static from(e){if(!e)return E.empty;if(e instanceof E)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new E([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}E.empty=new E([],0);const es={index:0,offset:0};function li(t,e){return es.index=t,es.offset=e,es}function _i(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(!_i(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!_i(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let K=class js{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&_i(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 i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}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 js.none;if(e instanceof js)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};K.none=[];class Ni extends Error{}class T{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=Wc(this.content,e+this.openStart,n);return r&&new T(r,this.openStart,this.openEnd)}removeBetween(e,n){return new T(Vc(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 T.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new T(E.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new T(e,r,i)}}T.empty=new T(E.empty,0,0);function Vc(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:u}=t.findIndex(n);if(i==e||o.isText){if(u!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Vc(o.content,e-i-1,n-i-1)))}function Wc(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let u=Wc(s.content,e-o-1,n);return u&&t.replaceChild(i,s.copy(u))}function bp(t,e,n){if(n.openStart>t.depth)throw new Ni("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Ni("Inconsistent open depths");return Uc(t,e,n,0)}function Uc(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=Uc(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,u=s.content;return fn(s,u.cut(0,t.parentOffset).append(n.content).append(u.cut(e.parentOffset)))}else{let{start:s,end:u}=yp(n,t);return fn(o,Jc(t,s,u,e,r))}else return fn(o,Ii(t,e,r))}function Kc(t,e){if(!e.type.compatibleContent(t.type))throw new Ni("Cannot join "+e.type.name+" onto "+t.type.name)}function qs(t,e,n){let r=t.node(n);return Kc(r,e.node(n)),r}function dn(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 br(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(dn(t.nodeAfter,r),o++));for(let u=o;u<s;u++)dn(i.child(u),r);e&&e.depth==n&&e.textOffset&&dn(e.nodeBefore,r)}function fn(t,e){return t.type.checkContent(e),t.copy(e)}function Jc(t,e,n,r,i){let o=t.depth>i&&qs(t,e,i+1),s=r.depth>i&&qs(n,r,i+1),u=[];return br(null,t,i,u),o&&s&&e.index(i)==n.index(i)?(Kc(o,s),dn(fn(o,Jc(t,e,n,r,i+1)),u)):(o&&dn(fn(o,Ii(t,e,i+1)),u),br(e,n,i,u),s&&dn(fn(s,Ii(n,r,i+1)),u)),br(r,null,i,u),new E(u)}function Ii(t,e,n){let r=[];if(br(null,t,n,r),t.depth>n){let i=qs(t,e,n+1);dn(fn(i,Ii(t,e,n+1)),r)}return br(e,null,n,r),new E(r)}function yp(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(E.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Dr{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return K.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let u=r;r=i,i=u}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ri(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:u,offset:a}=s.content.findIndex(o),l=o-a;if(r.push(s,u,i+a),!l||(s=s.child(u),s.isText))break;o=l-1,i+=a+1}return new Dr(n,r,o)}static resolveCached(e,n){let r=Sa.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else Sa.set(e,r=new xp);let i=r.elts[r.i]=Dr.resolve(e,n);return r.i=(r.i+1)%kp,i}}class xp{constructor(){this.elts=[],this.i=0}}const kp=12,Sa=new WeakMap;class Ri{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 vp=Object.create(null);let hn=class Vs{constructor(e,n,r,i=K.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||E.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&_i(this.attrs,n||e.defaultAttrs||vp)&&K.sameSet(this.marks,r||K.none)}copy(e=null){return e==this.content?this:new Vs(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Vs(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 T.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),u=i.start(s),l=i.node(s).content.cut(i.pos-u,o.pos-u);return new T(l,i.depth-s,o.depth-s)}replace(e,n,r){return bp(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Dr.resolveCached(this,e)}resolveNoCache(e){return Dr.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Gc(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=E.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),u=s&&s.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let a=i;a<o;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=K.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(!K.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 i=E.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};hn.prototype.text=void 0;class Fi extends hn{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Gc(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 Fi(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Fi(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 Gc(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class yn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Cp(e,n);if(r.next==null)return yn.empty;let i=Zc(r);r.next&&r.err("Unexpected trailing text");let o=Mp(Tp(i));return Op(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,u){let a=s.matchFragment(e,r);if(a&&(!n||a.validEnd))return E.from(u.map(l=>l.createAndFill()));for(let l=0;l<s.next.length;l++){let{type:c,next:d}=s.next[l];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let h=o(d,u.concat(c));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let u=i;u.type;u=u.via)s.push(u.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:u,next:a}=o.next[s];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in n)&&(!i.type||a.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),n[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
`)}}yn.empty=new yn(!0);class Cp{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 Zc(t){let e=[];do e.push(wp(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function wp(t){let e=[];do e.push(Ep(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Ep(t){let e=Dp(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=Sp(t,e);else break;return e}function Aa(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Sp(t,e){let n=Aa(t),r=n;return t.eat(",")&&(t.next!="}"?r=Aa(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Ap(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function Dp(t){if(t.eat("(")){let e=Zc(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=Ap(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 Tp(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,u,a){let l={term:a,to:u};return e[s].push(l),l}function i(s,u){s.forEach(a=>a.to=u)}function o(s,u){if(s.type=="choice")return s.exprs.reduce((a,l)=>a.concat(o(l,u)),[]);if(s.type=="seq")for(let a=0;;a++){let l=o(s.exprs[a],u);if(a==s.exprs.length-1)return l;i(l,u=n())}else if(s.type=="star"){let a=n();return r(u,a),i(o(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=n();return i(o(s.expr,u),a),i(o(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(u)].concat(o(s.expr,u));if(s.type=="range"){let a=u;for(let l=0;l<s.min;l++){let c=n();i(o(s.expr,a),c),a=c}if(s.max==-1)i(o(s.expr,a),a);else for(let l=s.min;l<s.max;l++){let c=n();r(a,c),i(o(s.expr,a),c),a=c}return[r(a)]}else{if(s.type=="name")return[r(u,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Qc(t,e){return e-t}function Da(t,e){let n=[];return r(e),n.sort(Qc);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:u,to:a}=o[s];!u&&n.indexOf(a)==-1&&r(a)}}}function Mp(t){let e=Object.create(null);return n(Da(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:u,to:a})=>{if(!u)return;let l;for(let c=0;c<i.length;c++)i[c][0]==u&&(l=i[c][1]);Da(t,a).forEach(c=>{l||i.push([u,l=[]]),l.indexOf(c)==-1&&l.push(c)})})});let o=e[r.join(",")]=new yn(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let u=i[s][1].sort(Qc);o.next.push({type:i[s][0],next:e[u.join(",")]||n(u)})}return o}}function Op(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let u=0;u<i.next.length;u++){let{type:a,next:l}=i.next[u];s.push(a.name),o&&!(a.isText||a.hasRequiredAttrs())&&(o=!1),r.indexOf(l)==-1&&r.push(l)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Yc(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 Xc(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function ed(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function td(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Np(t,r,e[r]);return n}let Ta=class nd{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=td(e,r.attrs),this.defaultAttrs=Yc(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==yn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Xc(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new hn(this,this.computeAttrs(e),E.from(n),K.setFrom(r))}createChecked(e=null,n,r){return n=E.from(n),this.checkContent(n),new hn(this,this.computeAttrs(e),n,K.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=E.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(E.empty,!0);return o?new hn(this,e,n.append(o),K.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){ed(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:K.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new nd(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function _p(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class Np{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?_p(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Mo{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=td(e,i.attrs),this.excluded=null;let o=Yc(this.attrs);this.instance=o?new K(this,o):null}create(e=null){return!e&&this.instance?this.instance:new K(this,Xc(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new Mo(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){ed(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class _u{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=me.from(e.nodes),n.marks=me.from(e.marks||{}),this.nodes=Ta.compile(this.spec.nodes,this),this.marks=Mo.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",u=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=yn.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=u=="_"?null:u?Ma(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Ma(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Ta){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Fi(r,r.defaultAttrs,e,K.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return hn.fromJSON(this,e)}markFromJSON(e){return K.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Ma(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let u in t.marks){let a=t.marks[u];(i=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Ip(t){return t.tag!=null}function Rp(t){return t.style!=null}class Dt{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Ip(i))this.tags.push(i);else if(Rp(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new _a(this,n,!1);return r.addAll(e,K.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new _a(this,n,!0);return r.addAll(e,K.none,n.from,n.to),T.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(Pp(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],u=s.style;if(!(u.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||u.length>e.length&&(u.charCodeAt(e.length)!=61||u.slice(e.length+1)!=n))){if(s.getAttrs){let a=s.getAttrs(n);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let u=n[s];if((u.priority==null?50:u.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Na(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Na(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Dt(e,Dt.schemaRules(e)))}}const rd={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},Fp={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},id={ol:!0,ul:!0},Li=1,Pi=2,yr=4;function Oa(t,e,n){return e!=null?(e?Li:0)|(e==="full"?Pi:0):t&&t.whitespace=="pre"?Li|Pi:n&~yr}class ci{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=K.none,this.match=o||(s&yr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(E.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Li)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=E.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(E.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&&!rd.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class _a{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,s=Oa(null,n.preserveWhitespace,0)|(r?yr:0);i?o=new ci(i.type,i.attrs,K.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new ci(null,null,K.none,!0,null,s):o=new ci(e.schema.topNodeType,null,K.none,!0,null,s),this.nodes=[o],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,i=this.top;if(i.options&Pi||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i.options&Li)i.options&Pi?r=r.replace(/\r\n?/g,`
`):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=i.content[i.content.length-1],s=e.previousSibling;(!o||s&&s.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=e.nodeName.toLowerCase(),o;id.hasOwnProperty(i)&&this.parser.normalizeLists&&Lp(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));if(s?s.ignore:Fp.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,n);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let u,a=this.top,l=this.needsBlock;if(rd.hasOwnProperty(i))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),u=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);return}let c=s&&s.skip?n:this.readStyles(e,n);c&&this.addAll(e,c),u&&this.sync(a),this.needsBlock=l}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,s,u,s.consuming===!1?o:void 0)}}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let u=void 0;;){let a=this.parser.matchStyle(o,s,this,u);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(l=>!a.clearMark(l)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)u=a;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let a=this.enter(s,n.attrs||null,r,n.preserveWhitespace);a&&(o=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let u=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r)}o&&this.sync(u)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,u=i==null?null:e.childNodes[i];s!=u;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],u=s.findWrapping(e);if(u&&(!r||r.length>u.length)&&(r=u,i=s,!u.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=K.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):Ia(s.type,e.type))&&(o=s.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let u=Oa(e,o,s.options);s.options&yr&&s.content.length==0&&(u|=yr);let a=K.none;return r=r.filter(l=>(s.type?s.type.allowsMarkType(l.type):Ia(l.type,e))?(a=l.addToSet(a),!1):!0),this.nodes.push(new ci(e,n,a,i,null,u)),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;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(u,a)=>{for(;u>=0;u--){let l=n[u];if(l==""){if(u==n.length-1||u==0)continue;for(;a>=o;a--)if(s(u-1,a))return!0;return!1}else{let c=a>0||a==0&&i?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!c||c.name!=l&&c.groups.indexOf(l)==-1)return!1;a--}}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 Lp(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&id.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Pp(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Na(t){let e={};for(let n in t)e[n]=t[n];return e}function Ia(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=u=>{o.push(u);for(let a=0;a<u.edgeCount;a++){let{type:l,next:c}=u.edge(a);if(l==e||o.indexOf(c)<0&&s(c))return!0}};if(s(i.contentMatch))return!0}}class wn{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=ts(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let u=0,a=0;for(;u<o.length&&a<s.marks.length;){let l=s.marks[a];if(!this.marks[l.type.name]){a++;continue}if(!l.eq(o[u][0])||l.type.spec.spanning===!1)break;u++,a++}for(;u<o.length;)i=o.pop()[1];for(;a<s.marks.length;){let l=s.marks[a++],c=this.serializeMark(l,s.isInline,n);c&&(o.push([l,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=Ei(ts(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Ei(ts(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Ei(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new wn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Ra(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Ra(e.marks)}}function Ra(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ts(t){return t.document||window.document}const Fa=new WeakMap;function Bp(t){let e=Fa.get(t);return e===void 0&&Fa.set(t,e=zp(t)),e}function zp(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 i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function Ei(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 i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=Bp(r))&&o.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=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let u,a=n?t.createElementNS(n,i):t.createElement(i),l=e[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let d in l)if(l[d]!=null){let h=d.indexOf(" ");h>0?a.setAttributeNS(d.slice(0,h),d.slice(h+1),l[d]):a.setAttribute(d,l[d])}}for(let d=c;d<e.length;d++){let h=e[d];if(h===0){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:p,contentDOM:f}=Ei(t,h,n,r);if(a.appendChild(p),f){if(u)throw new RangeError("Multiple content holes");u=f}}}return{dom:a,contentDOM:u}}const od=65535,sd=Math.pow(2,16);function $p(t,e){return t+e*sd}function La(t){return t&od}function Hp(t){return(t-(t&od))/sd}const ud=1,ad=2,Si=4,ld=8;class Ws{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&ld)>0}get deletedBefore(){return(this.delInfo&(ud|Si))>0}get deletedAfter(){return(this.delInfo&(ad|Si))>0}get deletedAcross(){return(this.delInfo&Si)>0}}class Be{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Be.empty)return Be.empty}recover(e){let n=0,r=La(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Hp(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let a=this.ranges[u]-(this.inverted?i:0);if(a>e)break;let l=this.ranges[u+o],c=this.ranges[u+s],d=a+l;if(e<=d){let h=l?e==a?-1:e==d?1:n:n,p=a+i+(h<0?0:c);if(r)return p;let f=e==(n<0?a:d)?null:$p(u/3,e-a),m=e==a?ad:e==d?ud:Si;return(n<0?e!=a:e!=d)&&(m|=ld),new Ws(p,m,f)}i+=c-l}return r?e+i:new Ws(e+i,0,null)}touches(e,n){let r=0,i=La(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let a=this.ranges[u]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[u+o],c=a+l;if(e<=c&&u==i*3)return!0;r+=this.ranges[u+s]-l}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],u=s-(this.inverted?o:0),a=s+(this.inverted?0:o),l=this.ranges[i+n],c=this.ranges[i+r];e(u,u+l,a,a+c),o+=c-l}}invert(){return new Be(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Be.empty:new Be(e<0?[0,-e,0]:[0,0,e])}}Be.empty=new Be([]);class Hn{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new Hn(this.maps,this.mirror,e,n)}copy(){return new Hn(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Hn;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],u=s.mapResult(e,n);if(u.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this.maps[a].recover(u.recover);continue}}i|=u.delInfo,e=u.pos}return r?e:new Ws(e,i,null)}}const ns=Object.create(null);class Ce{getMap(){return Be.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=ns[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 ns)throw new RangeError("Duplicate use of step JSON ID "+e);return ns[e]=n,n.prototype.jsonID=e,n}}class ue{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new ue(e,null)}static fail(e){return new ue(null,e)}static fromReplace(e,n,r,i){try{return ue.ok(e.replace(n,r,i))}catch(o){if(o instanceof Ni)return ue.fail(o.message);throw o}}}function Nu(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(Nu(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return E.fromArray(r)}class Ht extends Ce{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new T(Nu(n.content,(s,u)=>!s.isAtom||!u.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return ue.fromReplace(e,this.from,this.to,o)}invert(){return new at(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 Ht(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ht&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ht(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 Ht(n.from,n.to,e.markFromJSON(n.mark))}}Ce.jsonID("addMark",Ht);class at extends Ce{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new T(Nu(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return ue.fromReplace(e,this.from,this.to,r)}invert(){return new Ht(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 at(n.pos,r.pos,this.mark)}merge(e){return e instanceof at&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new at(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new at(n.from,n.to,e.markFromJSON(n.mark))}}Ce.jsonID("removeMark",at);class jt extends Ce{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ue.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ue.fromReplace(e,this.pos,this.pos+1,new T(E.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new jt(this.pos,n.marks[i]);return new jt(this.pos,this.mark)}}return new Un(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new jt(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 jt(n.pos,e.markFromJSON(n.mark))}}Ce.jsonID("addNodeMark",jt);class Un extends Ce{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ue.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return ue.fromReplace(e,this.pos,this.pos+1,new T(E.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new jt(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Un(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 Un(n.pos,e.markFromJSON(n.mark))}}Ce.jsonID("removeNodeMark",Un);class ce extends Ce{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Us(e,this.from,this.to)?ue.fail("Structure replace would overwrite content"):ue.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Be([this.from,this.to-this.from,this.slice.size])}invert(e){return new ce(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 ce(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof ce)||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?T.empty:new T(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ce(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?T.empty:new T(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ce(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 ce(n.from,n.to,T.fromJSON(e,n.slice),!!n.structure)}}Ce.jsonID("replace",ce);class fe extends Ce{constructor(e,n,r,i,o,s,u=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=u}apply(e){if(this.structure&&(Us(e,this.from,this.gapFrom)||Us(e,this.gapTo,this.to)))return ue.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return ue.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?ue.fromReplace(e,this.from,this.to,r):ue.fail("Content does not fit in gap")}getMap(){return new Be([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 fe(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new fe(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new fe(n.from,n.to,n.gapFrom,n.gapTo,T.fromJSON(e,n.slice),n.insert,!!n.structure)}}Ce.jsonID("replaceAround",fe);function Us(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function jp(t,e,n,r){let i=[],o=[],s,u;t.doc.nodesBetween(e,n,(a,l,c)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let h=Math.max(l,e),p=Math.min(l+a.nodeSize,n),f=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(f)||(s&&s.to==h&&s.mark.eq(d[m])?s.to=p:i.push(s=new at(h,p,d[m])));u&&u.to==h?u.to=p:o.push(u=new Ht(h,p,r))}}),i.forEach(a=>t.step(a)),o.forEach(a=>t.step(a))}function qp(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,u)=>{if(!s.isInline)return;o++;let a=null;if(r instanceof Mo){let l=s.marks,c;for(;c=r.isInSet(l);)(a||(a=[])).push(c),l=c.removeFromSet(l)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let l=Math.min(u+s.nodeSize,n);for(let c=0;c<a.length;c++){let d=a[c],h;for(let p=0;p<i.length;p++){let f=i[p];f.step==o-1&&d.eq(i[p].style)&&(h=f)}h?(h.to=l,h.step=o):i.push({style:d,from:Math.max(u,e),to:l,step:o})}}}),i.forEach(s=>t.step(new at(s.from,s.to,s.style)))}function cd(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],u=e+1;for(let a=0;a<o.childCount;a++){let l=o.child(a),c=u+l.nodeSize,d=r.matchType(l.type);if(!d)s.push(new ce(u,c,T.empty));else{r=d;for(let h=0;h<l.marks.length;h++)n.allowsMarkType(l.marks[h].type)||t.step(new at(u,c,l.marks[h]));if(i&&l.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,f;for(;h=p.exec(l.text);)f||(f=new T(E.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),s.push(new ce(u+h.index,u+h.index+h[0].length,f))}}u=c}if(!r.validEnd){let a=r.fillBefore(E.empty,!0);t.replace(u,u,new T(a,0,0))}for(let a=s.length-1;a>=0;a--)t.step(s[a])}function Vp(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function ir(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!Vp(i,o,s))break}return null}function Wp(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),u=i.after(o+1),a=s,l=u,c=E.empty,d=0;for(let f=o,m=!1;f>n;f--)m||r.index(f)>0?(m=!0,c=E.from(r.node(f).copy(c)),d++):a--;let h=E.empty,p=0;for(let f=o,m=!1;f>n;f--)m||i.after(f+1)<i.end(f)?(m=!0,h=E.from(i.node(f).copy(h)),p++):l++;t.step(new fe(a,l,s,u,new T(c.append(h),d,p),c.size-d,!0))}function Iu(t,e,n=null,r=t){let i=Up(t,e),o=i&&Kp(r,e);return o?i.map(Pa).concat({type:e,attrs:n}).concat(o.map(Pa)):null}function Pa(t){return{type:t,attrs:null}}function Up(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function Kp(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let l=r;a&&l<i;l++)a=a.matchType(n.child(l).type);return!a||!a.validEnd?null:s}function Jp(t,e,n){let r=E.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let u=n[s].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=E.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new fe(i,o,i,o,new T(r,0,0),n.length,!0))}function Gp(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,u)=>{let a=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,a)&&Yp(t.doc,t.mapping.slice(o).map(u),r)){let l=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",f=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!f?l=!1:!p&&f&&(l=!0)}l===!1&&Qp(t,s,u,o),cd(t,t.mapping.slice(o).map(u,1),r,void 0,l===null);let c=t.mapping.slice(o),d=c.map(u,1),h=c.map(u+s.nodeSize,1);return t.step(new fe(d,h,d+1,h-1,new T(E.from(r.create(a,null,s.marks)),0,0),1,!0)),l===!0&&Zp(t,s,u,o),!1}})}function Zp(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,u=/\r?\n|\r/g;for(;s=u.exec(i.text);){let a=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Qp(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
`))}})}function Yp(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Xp(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new fe(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new T(E.from(s),0,0),1,!0))}function jn(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let l=i.depth-1,c=n-2;l>o;l--,c--){let d=i.node(l),h=i.index(l);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(h,d.childCount),f=r&&r[c+1];f&&(p=p.replaceChild(0,f.type.create(f.attrs)));let m=r&&r[c]||d;if(!d.canReplace(h+1,d.childCount)||!m.type.validContent(p))return!1}let u=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(u,u,a?a.type:i.node(o+1).type)}function e0(t,e,n=1,r){let i=t.doc.resolve(e),o=E.empty,s=E.empty;for(let u=i.depth,a=i.depth-n,l=n-1;u>a;u--,l--){o=E.from(i.node(u).copy(o));let c=r&&r[l];s=E.from(c?c.type.create(c.attrs,s):i.node(u).copy(s))}t.step(new ce(e,e,new T(o.append(s),n,n),!0))}function Zt(t,e){let n=t.resolve(e),r=n.index();return dd(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function dd(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Oo(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),u++,s=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),s=r.node(i+1)),o&&!o.isTextblock&&dd(o,s)&&r.node(i).canReplace(u,u+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function t0(t,e,n){let r=new ce(e-n,e+n,T.empty,!0);t.step(r)}function n0(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function fd(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let u=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(u>0?1:0),l=r.node(s),c=!1;if(o==1)c=l.canReplace(a,a,i);else{let d=l.contentMatchAt(a).findWrapping(i.firstChild.type);c=d&&l.canReplaceWith(a,a,d[0])}if(c)return u==0?r.pos:u<0?r.before(s+1):r.after(s+1)}return null}function _o(t,e,n=e,r=T.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return hd(i,o,r)?new ce(e,n,r):new r0(i,o,r).fit()}function hd(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class r0{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=E.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=E.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let l=this.findFittable();l?this.placeNodes(l):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,u=i.depth;for(;s&&u&&o.childCount==1;)o=o.firstChild.content,s--,u--;let a=new T(o,s,u);return e>-1?new fe(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new ce(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=rs(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let u=this.depth;u>=0;u--){let{type:a,match:l}=this.frontier[u],c,d=null;if(n==1&&(s?l.matchType(s.type)||(d=l.fillBefore(E.from(s),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:u,parent:o,inject:d};if(n==2&&s&&(c=l.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:u,parent:o,wrap:c};if(o&&l.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=rs(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new T(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=rs(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new T(pr(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new T(pr(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m<o.length;m++)this.openFrontierNode(o[m]);let s=this.unplaced,u=r?r.content:s.content,a=s.openStart-e,l=0,c=[],{match:d,type:h}=this.frontier[n];if(i){for(let m=0;m<i.childCount;m++)c.push(i.child(m));d=d.matchFragment(i)}let p=u.size+e-(s.content.size-s.openEnd);for(;l<u.childCount;){let m=u.child(l),g=d.matchType(m.type);if(!g)break;l++,(l>1||a==0||m.content.size)&&(d=g,c.push(pd(m.mark(h.allowedMarks(m.marks)),l==1?a:0,l==u.childCount?p:-1)))}let f=l==u.childCount;f||(p=-1),this.placed=mr(this.placed,n,E.from(c)),this.frontier[n].match=d,f&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=u;m<p;m++){let y=g.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),g=y.content}this.unplaced=f?e==0?T.empty:new T(pr(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new T(pr(s.content,e,l),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!is(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=is(e,n,i,r,o);if(s){for(let u=n-1;u>=0;u--){let{match:a,type:l}=this.frontier[u],c=is(e,u,l,a,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=mr(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=mr(this.placed,this.depth,E.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(E.empty,!0);n.childCount&&(this.placed=mr(this.placed,this.frontier.length,n))}}function pr(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(pr(t.firstChild.content,e-1,n)))}function mr(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(mr(t.lastChild.content,e-1,n)))}function rs(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function pd(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,pd(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(E.empty,!0)))),t.copy(r)}function is(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,s);return u&&!i0(n,o.content,s)?u:null}function i0(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function o0(t){return t.spec.defining||t.spec.definingForContent}function s0(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(hd(i,o,r))return t.step(new ce(e,n,r));let s=gd(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let u=-(i.depth+1);s.unshift(u);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let f=i.node(h).type.spec;if(f.defining||f.definingAsContext||f.isolating)break;s.indexOf(h)>-1?u=h:i.before(h)==p&&s.splice(1,0,-h)}let a=s.indexOf(u),l=[],c=r.openStart;for(let h=r.content,p=0;;p++){let f=h.firstChild;if(l.push(f),p==r.openStart)break;h=f.content}for(let h=c-1;h>=0;h--){let p=l[h],f=o0(p.type);if(f&&!p.sameMarkup(i.node(Math.abs(u)-1)))c=h;else if(f||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+c+1)%(r.openStart+1),f=l[p];if(f)for(let m=0;m<s.length;m++){let g=s[(m+a)%s.length],y=!0;g<0&&(y=!1,g=-g);let x=i.node(g-1),v=i.index(g-1);if(x.canReplaceWith(v,v,f.type,f.marks))return t.replace(i.before(g),y?o.after(g):n,new T(md(r.content,0,r.openStart,p),p,r.openEnd))}}let d=t.steps.length;for(let h=s.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>d));h--){let p=s[h];p<0||(e=i.before(p),n=o.after(p))}}function md(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(md(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(E.empty,!0))}return t}function u0(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=n0(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new T(E.from(r),0,0))}function a0(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=gd(r,i);for(let s=0;s<o.length;s++){let u=o[s],a=s==o.length-1;if(a&&u==0||r.node(u).type.contentMatch.validEnd)return t.delete(r.start(u),i.end(u));if(u>0&&(a||r.node(u-1).canReplace(r.index(u-1),i.indexAfter(u-1))))return t.delete(r.before(u),i.after(u))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function gd(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class qn extends Ce{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return ue.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return ue.fromReplace(e,this.pos,this.pos+1,new T(E.from(i),0,n.isLeaf?0:1))}getMap(){return Be.empty}invert(e){return new qn(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 qn(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 qn(n.pos,n.attr,n.value)}}Ce.jsonID("attr",qn);class Tr extends Ce{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return ue.ok(r)}getMap(){return Be.empty}invert(e){return new Tr(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 Tr(n.attr,n.value)}}Ce.jsonID("docAttr",Tr);let Kn=class extends Error{};Kn=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Kn.prototype=Object.create(Error.prototype);Kn.prototype.constructor=Kn;Kn.prototype.name="TransformError";class bd{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Hn}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Kn(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=T.empty){let i=_o(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new T(E.from(r),0,0))}delete(e,n){return this.replace(e,n,T.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return s0(this,e,n,r),this}replaceRangeWith(e,n,r){return u0(this,e,n,r),this}deleteRange(e,n){return a0(this,e,n),this}lift(e,n){return Wp(this,e,n),this}join(e,n=1){return t0(this,e,n),this}wrap(e,n){return Jp(this,e,n),this}setBlockType(e,n=e,r,i=null){return Gp(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return Xp(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new qn(e,n,r)),this}setDocAttribute(e,n){return this.step(new Tr(e,n)),this}addNodeMark(e,n){return this.step(new jt(e,n)),this}removeNodeMark(e,n){if(!(n instanceof K)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Un(e,n)),this}split(e,n=1,r){return e0(this,e,n,r),this}addMark(e,n,r){return jp(this,e,n,r),this}removeMark(e,n,r){return qp(this,e,n,r),this}clearIncompatible(e,n,r){return cd(this,e,n,r),this}}const ss=Object.create(null);class P{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new l0(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=T.empty){let r=n.content.lastChild,i=null;for(let u=0;u<n.openEnd;u++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let u=0;u<s.length;u++){let{$from:a,$to:l}=s[u],c=e.mapping.slice(o);e.replaceRange(c.map(a.pos),c.map(l.pos),u?T.empty:n),u==0&&$a(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:u}=i[o],a=e.mapping.slice(r),l=a.map(s.pos),c=a.map(u.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,n),$a(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new L(e):Fn(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?Fn(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Fn(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Xe(e.node(0))}static atStart(e){return Fn(e,e,0,0,1)||new Xe(e)}static atEnd(e){return Fn(e,e,e.content.size,e.childCount,-1)||new Xe(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ss[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 ss)throw new RangeError("Duplicate use of selection JSON ID "+e);return ss[e]=n,n.prototype.jsonID=e,n}getBookmark(){return L.between(this.$anchor,this.$head).getBookmark()}}P.prototype.visible=!0;class l0{constructor(e,n){this.$from=e,this.$to=n}}let Ba=!1;function za(t){!Ba&&!t.parent.inlineContent&&(Ba=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class L extends P{constructor(e,n=e){za(e),za(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 P.near(r);let i=e.resolve(n.map(this.anchor));return new L(i.parent.inlineContent?i:r,r)}replace(e,n=T.empty){if(super.replace(e,n),n==T.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof L&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new No(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 L(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=P.findFrom(n,r,!0)||P.findFrom(n,-r,!0);if(o)n=o.$head;else return P.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(P.findFrom(e,-r,!0)||P.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new L(e,n)}}P.jsonID("text",L);class No{constructor(e,n){this.anchor=e,this.head=n}map(e){return new No(e.map(this.anchor),e.map(this.head))}resolve(e){return L.between(e.resolve(this.anchor),e.resolve(this.head))}}class I extends P{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?P.near(o):new I(o)}content(){return new T(E.from(this.node),0,0)}eq(e){return e instanceof I&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ru(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new I(e.resolve(n.anchor))}static create(e,n){return new I(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}I.prototype.visible=!1;P.jsonID("node",I);class Ru{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new No(r,r):new Ru(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&I.isSelectable(r)?new I(n):P.near(n)}}class Xe extends P{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=T.empty){if(n==T.empty){e.delete(0,e.doc.content.size);let r=P.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Xe(e)}map(e){return new Xe(e)}eq(e){return e instanceof Xe}getBookmark(){return c0}}P.jsonID("all",Xe);const c0={map(){return this},resolve(t){return new Xe(t)}};function Fn(t,e,n,r,i,o=!1){if(e.inlineContent)return L.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let u=e.child(s);if(u.isAtom){if(!o&&I.isSelectable(u))return I.create(t,n-(i<0?u.nodeSize:0))}else{let a=Fn(t,u,n+i,i<0?u.childCount:0,i,o);if(a)return a}n+=u.nodeSize*i}return null}function $a(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof ce||i instanceof fe))return;let o=t.mapping.maps[r],s;o.forEach((u,a,l,c)=>{s==null&&(s=c)}),t.setSelection(P.near(t.doc.resolve(s),n))}const Ha=1,di=2,ja=4;class d0 extends bd{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|Ha)&~di,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ha)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=di,this}ensureMarks(e){return K.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&di)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~di,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)||K.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(P.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|=ja,this}get scrolledIntoView(){return(this.updated&ja)>0}}function qa(t,e){return!e||!t?t:t.bind(e)}class gr{constructor(e,n,r){this.name=e,this.init=qa(n.init,r),this.apply=qa(n.apply,r)}}const f0=[new gr("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new gr("selection",{init(t,e){return t.selection||P.atStart(e.doc)},apply(t){return t.selection}}),new gr("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new gr("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class us{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=f0.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 gr(r.key,r.spec.state,r))})}}class zn{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let u=this.config.plugins[s];if(u.spec.appendTransaction){let a=i?i[s].n:0,l=i?i[s].state:this,c=a<n.length&&u.spec.appendTransaction.call(u,a?n.slice(a):n,l,r);if(c&&r.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(c),r=r.applyInner(c),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new zn(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new d0(this)}static create(e){let n=new us(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new zn(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new us(this.schema,e.plugins),r=n.fields,i=new zn(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new us(e.schema,e.plugins),o=new zn(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=hn.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=P.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let u in r){let a=r[u],l=a.spec.state;if(a.key==s.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(n,u)){o[s.name]=l.fromJSON.call(a,e,n[u],o);return}}o[s.name]=s.init(e,o)}}),o}}function yd(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=yd(i,e,{})),n[r]=i}return n}class ae{constructor(e){this.spec=e,this.props={},e.props&&yd(e.props,this,this.props),this.key=e.key?e.key.key:xd("plugin")}getState(e){return e[this.key]}}const as=Object.create(null);function xd(t){return t in as?t+"$"+ ++as[t]:(as[t]=0,t+"$")}class we{constructor(e="key"){this.key=xd(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ge=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Mr=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Ks=null;const St=function(t,e,n){let r=Ks||(Ks=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},h0=function(){Ks=null},xn=function(t,e,n,r){return n&&(Va(t,e,n,r,-1)||Va(t,e,n,r,1))},p0=/^(img|br|input|textarea|hr)$/i;function Va(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:ut(t))){let o=t.parentNode;if(!o||o.nodeType!=1||qr(t)||p0.test(t.nodeName)||t.contentEditable=="false")return!1;e=ge(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?ut(t):0}else return!1}}function ut(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function m0(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=ut(t)}else if(t.parentNode&&!qr(t))e=ge(t),t=t.parentNode;else return null}}function g0(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&&!qr(t))e=ge(t)+1,t=t.parentNode;else return null}}function b0(t,e,n){for(let r=e==0,i=e==ut(t);r||i;){if(t==n)return!0;let o=ge(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==ut(t)}}function qr(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 Io=function(t){return t.focusNode&&xn(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function sn(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function y0(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function x0(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const ft=typeof navigator<"u"?navigator:null,Wa=typeof document<"u"?document:null,Qt=ft&&ft.userAgent||"",Js=/Edge\/(\d+)/.exec(Qt),kd=/MSIE \d/.exec(Qt),Gs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Qt),Ne=!!(kd||Gs||Js),Wt=kd?document.documentMode:Gs?+Gs[1]:Js?+Js[1]:0,et=!Ne&&/gecko\/(\d+)/i.test(Qt);et&&+(/Firefox\/(\d+)/.exec(Qt)||[0,0])[1];const Zs=!Ne&&/Chrome\/(\d+)/.exec(Qt),ve=!!Zs,vd=Zs?+Zs[1]:0,Se=!Ne&&!!ft&&/Apple Computer/.test(ft.vendor),Jn=Se&&(/Mobile\/\w+/.test(Qt)||!!ft&&ft.maxTouchPoints>2),Ve=Jn||(ft?/Mac/.test(ft.platform):!1),k0=ft?/Win/.test(ft.platform):!1,Ze=/Android \d/.test(Qt),Vr=!!Wa&&"webkitFontSmoothing"in Wa.documentElement.style,v0=Vr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function C0(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 wt(t,e){return typeof t=="number"?t:t[e]}function w0(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 Ua(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Mr(s)){if(s.nodeType!=1)continue;let u=s,a=u==o.body,l=a?C0(o):w0(u),c=0,d=0;if(e.top<l.top+wt(r,"top")?d=-(l.top-e.top+wt(i,"top")):e.bottom>l.bottom-wt(r,"bottom")&&(d=e.bottom-e.top>l.bottom-l.top?e.top+wt(i,"top")-l.top:e.bottom-l.bottom+wt(i,"bottom")),e.left<l.left+wt(r,"left")?c=-(l.left-e.left+wt(i,"left")):e.right>l.right-wt(r,"right")&&(c=e.right-l.right+wt(i,"right")),c||d)if(a)o.defaultView.scrollBy(c,d);else{let h=u.scrollLeft,p=u.scrollTop;d&&(u.scrollTop+=d),c&&(u.scrollLeft+=c);let f=u.scrollLeft-h,m=u.scrollTop-p;e={left:e.left-f,top:e.top-m,right:e.right-f,bottom:e.bottom-m}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function E0(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let u=t.root.elementFromPoint(o,s);if(!u||u==t.dom||!t.dom.contains(u))continue;let a=u.getBoundingClientRect();if(a.top>=n-20){r=u,i=a.top;break}}return{refDOM:r,refTop:i,stack:Cd(t.dom)}}function Cd(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Mr(r));return e}function S0({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;wd(n,r==0?0:r-e)}function wd(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let _n=null;function A0(t){if(t.setActive)return t.setActive();if(_n)return t.focus(_n);let e=Cd(t);t.focus(_n==null?{get preventScroll(){return _n={preventScroll:!0},!0}}:void 0),_n||(_n=!1,wd(e,0))}function Ed(t,e){let n,r=2e8,i,o=0,s=e.top,u=e.top,a,l;for(let c=t.firstChild,d=0;c;c=c.nextSibling,d++){let h;if(c.nodeType==1)h=c.getClientRects();else if(c.nodeType==3)h=St(c).getClientRects();else continue;for(let p=0;p<h.length;p++){let f=h[p];if(f.top<=s&&f.bottom>=u){s=Math.max(f.bottom,s),u=Math.min(f.top,u);let m=f.left>e.left?f.left-e.left:f.right<e.left?e.left-f.right:0;if(m<r){n=c,r=m,i=m&&n.nodeType==3?{left:f.right<e.left?f.right:f.left,top:e.top}:e,c.nodeType==1&&m&&(o=d+(e.left>=(f.left+f.right)/2?1:0));continue}}else f.top>e.top&&!a&&f.left<=e.left&&f.right>=e.left&&(a=c,l={left:Math.max(f.left,Math.min(f.right,e.left)),top:f.top});!n&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(o=d+1)}}return!n&&a&&(n=a,i=l,r=0),n&&n.nodeType==3?D0(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:Ed(n,i)}function D0(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=It(r,1);if(o.top!=o.bottom&&Fu(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Fu(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function T0(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function M0(t,e,n){let{node:r,offset:i}=Ed(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function O0(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let u=t.docView.nearestDesc(o,!0);if(!u)return null;if(u.dom.nodeType==1&&(u.node.isBlock&&u.parent||!u.contentDOM)){let a=u.dom.getBoundingClientRect();if(u.node.isBlock&&u.parent&&(!s&&a.left>r.left||a.top>r.top?i=u.posBefore:(!s&&a.right<r.left||a.bottom<r.top)&&(i=u.posAfter),s=!0),!u.contentDOM&&i<0&&!u.node.isText)return(u.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?u.posBefore:u.posAfter}o=u.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function Sd(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let u=s.getClientRects();for(let a=0;a<u.length;a++){let l=u[a];if(Fu(e,l))return Sd(s,e,l)}}if((o=(o+1)%r)==i)break}return t}function _0(t,e){let n=t.dom.ownerDocument,r,i=0,o=x0(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),u;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let l=t.dom.getBoundingClientRect();if(!Fu(e,l)||(s=Sd(t.dom,e,l),!s))return null}if(Se)for(let l=s;r&&l;l=Mr(l))l.draggable&&(r=void 0);if(s=T0(s,e),r){if(et&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let c=r.childNodes[i],d;c.nodeName=="IMG"&&(d=c.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}let l;Vr&&i&&r.nodeType==1&&(l=r.childNodes[i-1]).nodeType==1&&l.contentEditable=="false"&&l.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?u=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(u=O0(t,r,i,e))}u==null&&(u=M0(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:u,inside:a?a.posAtStart-a.border:-1}}function Ka(t){return t.top<t.bottom||t.left<t.right}function It(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Ka(r))return r}return Array.prototype.find.call(n,Ka)||t.getBoundingClientRect()}const N0=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ad(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=Vr||et;if(r.nodeType==3)if(s&&(N0.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let a=It(St(r,i,i),n);if(et&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let l=It(St(r,i-1,i-1),-1);if(l.top==a.top){let c=It(St(r,i,i+1),-1);if(c.top!=a.top)return dr(c,c.left<l.left)}}return a}else{let a=i,l=i,c=n<0?1:-1;return n<0&&!i?(l++,c=-1):n>=0&&i==r.nodeValue.length?(a--,c=1):n<0?a--:l++,dr(It(St(r,a,l),c),c<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==ut(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return ls(a.getBoundingClientRect(),!1)}if(o==null&&i<ut(r)){let a=r.childNodes[i];if(a.nodeType==1)return ls(a.getBoundingClientRect(),!0)}return ls(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==ut(r))){let a=r.childNodes[i-1],l=a.nodeType==3?St(a,ut(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(l)return dr(It(l,1),!1)}if(o==null&&i<ut(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let l=a?a.nodeType==3?St(a,0,s?0:1):a.nodeType==1?a:null:null;if(l)return dr(It(l,-1),!0)}return dr(It(r.nodeType==3?St(r):r,-n),n>=0)}function dr(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 ls(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 Dd(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function I0(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return Dd(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let u=t.docView.nearestDesc(o,!0);if(!u)break;if(u.node.isBlock){o=u.contentDOM||u.dom;break}o=u.dom.parentNode}let s=Ad(t,i.pos,1);for(let u=o.firstChild;u;u=u.nextSibling){let a;if(u.nodeType==1)a=u.getClientRects();else if(u.nodeType==3)a=St(u,0,u.nodeValue.length).getClientRects();else continue;for(let l=0;l<a.length;l++){let c=a[l];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 R0=/[\u0590-\u08ac]/;function F0(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,u=t.domSelection();return u?!R0.test(r.parent.textContent)||!u.modify?n=="left"||n=="backward"?o:s:Dd(t,e,()=>{let{focusNode:a,focusOffset:l,anchorNode:c,anchorOffset:d}=t.domSelectionRange(),h=u.caretBidiLevel;u.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:f,focusOffset:m}=t.domSelectionRange(),g=f&&!p.contains(f.nodeType==1?f:f.parentNode)||a==f&&l==m;try{u.collapse(c,d),a&&(a!=c||l!=d)&&u.extend&&u.extend(a,l)}catch{}return h!=null&&(u.caretBidiLevel=h),g}):r.pos==r.start()||r.pos==r.end()}let Ja=null,Ga=null,Za=!1;function L0(t,e,n){return Ja==e&&Ga==n?Za:(Ja=e,Ga=n,Za=n=="up"||n=="down"?I0(t,e,n):F0(t,e,n))}const We=0,Qa=1,an=2,ht=3;class Wr{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=We,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>ge(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],u=o+s.size;if(u>e||s instanceof Md){i=e-o;break}o=u}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Td&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?ge(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?ge(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,u=0;;u++){let a=this.children[u],l=s+a.size;if(i==-1&&e<=l){let c=s+a.border;if(e>=c&&n<=l-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,c);e=s;for(let d=u;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=ge(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(l>n||u==this.children.length-1)){n=l;for(let c=u+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){o=ge(d.dom);break}n+=d.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=l}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let h=0,p=0;h<this.children.length;h++){let f=this.children[h],m=p+f.size;if(o>p&&s<m)return f.setSelection(e-p-f.border,n-p-f.border,r,i);p=m}let u=this.domFromPos(e,e?-1:1),a=n==e?u:this.domFromPos(n,n?-1:1),l=r.getSelection(),c=!1;if((et||Se)&&e==n){let{node:h,offset:p}=u;if(h.nodeType==3){if(c=!!(p&&h.nodeValue[p-1]==`
`),c&&p==h.nodeValue.length)for(let f=h,m;f;f=f.parentNode){if(m=f.nextSibling){m.nodeName=="BR"&&(u=a={node:m.parentNode,offset:ge(m)+1});break}let g=f.pmViewDesc;if(g&&g.node&&g.node.isBlock)break}}else{let f=h.childNodes[p-1];c=f&&(f.nodeName=="BR"||f.contentEditable=="false")}}if(et&&l.focusNode&&l.focusNode!=a.node&&l.focusNode.nodeType==1){let h=l.focusNode.childNodes[l.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||c&&Se)&&xn(u.node,u.offset,l.anchorNode,l.anchorOffset)&&xn(a.node,a.offset,l.focusNode,l.focusOffset))return;let d=!1;if((l.extend||e==n)&&!c){l.collapse(u.node,u.offset);try{e!=n&&l.extend(a.node,a.offset),d=!0}catch{}}if(!d){if(e>n){let p=u;u=a,a=p}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(u.node,u.offset),l.removeAllRanges(),l.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,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let u=r+o.border,a=s-o.border;if(e>=u&&n<=a){this.dirty=e==r||n==s?an:Qa,e==u&&n==a&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=ht:o.markDirty(e-u,n-u);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?an:ht}r=s}this.dirty=an}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?an:Qa;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class Td extends Wr{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let u=document.createElement("span");u.appendChild(s),s=u}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==We&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class P0 extends Wr{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class kn extends Wr{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=wn.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new kn(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&ht||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=ht&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=We){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=We}}slice(e,n,r){let i=kn.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Xs(o,n,s,r)),e>0&&(o=Xs(o,0,e,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class Ut extends Wr{constructor(e,n,r,i,o,s,u,a,l){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=u}static create(e,n,r,i,o,s){let u=o.nodeViews[n.type.name],a,l=u&&u(n,o,()=>{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,i),c=l&&l.dom,d=l&&l.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:d}=wn.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let h=c;return c=Nd(c,r,n),l?a=new B0(e,n,r,i,c,d||null,h,l,o,s+1):n.isText?new Ro(e,n,r,i,c,h,o):new Ut(e,n,r,i,c,d||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>E.empty)}return e}matchesNode(e,n,r){return this.dirty==We&&e.eq(this.node)&&Ys(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,u=o&&o.pos<0,a=new $0(this,s&&s.node,e);q0(this.node,this.innerDeco,(l,c,d)=>{l.spec.marks?a.syncToMarks(l.spec.marks,r,e):l.type.side>=0&&!d&&a.syncToMarks(c==this.node.childCount?K.none:this.node.child(c).marks,r,e),a.placeWidget(l,e,i)},(l,c,d,h)=>{a.syncToMarks(l.marks,r,e);let p;a.findNodeMatch(l,c,d,h)||u&&e.state.selection.from>i&&e.state.selection.to<i+l.nodeSize&&(p=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(l,c,d,p,e)||a.updateNextNode(l,c,d,e,h,i)||a.addNode(l,c,d,e,i),i+=l.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==an)&&(s&&this.protectLocalComposition(e,s),Od(this.contentDOM,this.children,e),Jn&&V0(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof L)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,u=W0(this.node.content,s,r-n,i-n);return u<0?null:{node:o,pos:u,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new P0(this,o,n,i);e.input.compositionNodes.push(s),this.children=Xs(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==ht||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=We}updateOuterDeco(e){if(Ys(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=_d(this.dom,this.nodeDOM,Qs(this.outerDeco,this.node,n),Qs(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Ya(t,e,n,r,i){Nd(r,e,t);let o=new Ut(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Ro extends Ut{constructor(e,n,r,i,o,s,u){super(e,n,r,i,o,null,s,u,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==ht||this.dirty!=We&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=We||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=We,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new Ro(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=ht)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Md extends Wr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==We&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class B0 extends Ut{constructor(e,n,r,i,o,s,u,a,l,c){super(e,n,r,i,o,s,u,l,c),this.spec=a}update(e,n,r,i){if(this.dirty==ht)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Od(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],u=s.dom;if(u.parentNode==t){for(;u!=r;)r=Xa(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(u,r);if(s instanceof kn){let a=r?r.previousSibling:t.lastChild;Od(s.contentDOM,s.children,n),r=a?a.nextSibling:t.firstChild}}for(;r;)r=Xa(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const xr=function(t){t&&(this.nodeName=t)};xr.prototype=Object.create(null);const ln=[new xr];function Qs(t,e,n){if(t.length==0)return ln;let r=n?ln[0]:new xr,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new xr(s.nodeName));for(let u in s){let a=s[u];a!=null&&(n&&i.length==1&&i.push(r=new xr(e.isInline?"span":"div")),u=="class"?r.class=(r.class?r.class+" ":"")+a:u=="style"?r.style=(r.style?r.style+";":"")+a:u!="nodeName"&&(r[u]=a))}}}return i}function _d(t,e,n,r){if(n==ln&&r==ln)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],u=n[o];if(o){let a;u&&u.nodeName==s.nodeName&&i!=t&&(a=i.parentNode)&&a.nodeName.toLowerCase()==s.nodeName||(a=document.createElement(s.nodeName),a.pmIsDeco=!0,a.appendChild(i),u=ln[0]),i=a}z0(i,u||ln[0],s)}return i}function z0(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function Nd(t,e,n){return _d(t,t,ln,Qs(e,n,t.nodeType!=1))}function Ys(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 Xa(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class $0{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=H0(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=We,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let u=-1;for(let a=this.index;a<Math.min(this.index+3,this.top.children.length);a++){let l=this.top.children[a];if(l.matchesMark(e[o])&&!this.isLocked(l.dom)){u=a;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let a=kn.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let u=this.index,a=Math.min(this.top.children.length,u+5);u<a;u++){let l=this.top.children[u];if(l.matchesNode(e,n,r)&&!this.preMatch.matched.has(l)){o=u;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==ht&&s.dom==s.contentDOM&&(s.dirty=an),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let u=this.index;u<this.top.children.length;u++){let a=this.top.children[u];if(a instanceof Ut){let l=this.preMatch.matched.get(a);if(l!=null&&l!=o)return!1;let c=a.dom,d,h=this.isLocked(c)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=ht&&Ys(n,a.outerDeco));if(!h&&a.update(e,n,r,i))return this.destroyBetween(this.index,u),a.dom!=c&&(this.changed=!0),this.index++,!0;if(!h&&(d=this.recreateWrapper(a,e,n,r,i,s)))return this.top.children[this.index]=d,d.contentDOM&&(d.dirty=an,d.updateChildren(i,s+1),d.dirty=We),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let u=Ut.create(this.top,n,r,i,o,s);if(u.contentDOM){u.children=e.children,e.children=[];for(let a of u.children)a.parent=u}return e.destroy(),u}addNode(e,n,r,i,o){let s=Ut.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new Td(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof kn;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ro)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Se||ve)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new Md(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function H0(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let u;for(;;)if(r){let l=n.children[r-1];if(l instanceof kn)n=l,r=l.children.length;else{u=l,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=u.node;if(a){if(a!=t.child(i-1))break;--i,o.set(u,i),s.push(u)}}return{index:i,matched:o,matches:s.reverse()}}function j0(t,e){return t.type.side-e.type.side}function q0(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let l=0;l<t.childCount;l++){let c=t.child(l);r(c,i,e.forChild(o,c),l),o+=c.nodeSize}return}let s=0,u=[],a=null;for(let l=0;;){let c,d;for(;s<i.length&&i[s].to==o;){let g=i[s++];g.widget&&(c?(d||(d=[c])).push(g):c=g)}if(c)if(d){d.sort(j0);for(let g=0;g<d.length;g++)n(d[g],l,!!a)}else n(c,l,!!a);let h,p;if(a)p=-1,h=a,a=null;else if(l<t.childCount)p=l,h=t.child(l++);else break;for(let g=0;g<u.length;g++)u[g].to<=o&&u.splice(g--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)u.push(i[s++]);let f=o+h.nodeSize;if(h.isText){let g=f;s<i.length&&i[s].from<g&&(g=i[s].from);for(let y=0;y<u.length;y++)u[y].to<g&&(g=u[y].to);g<f&&(a=h.cut(g-o),h=h.cut(0,g-o),f=g,p=-1)}else for(;s<i.length&&i[s].to<f;)s++;let m=h.isInline&&!h.isLeaf?u.filter(g=>!g.inline):u.slice();r(h,m,e.forChild(o,h),p),o=f}}function V0(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 W0(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),u=o;if(o+=s.nodeSize,!s.isText)continue;let a=s.text;for(;i<t.childCount;){let l=t.child(i++);if(o+=l.nodeSize,!l.isText)break;a+=l.text}if(o>=n){if(o>=r&&a.slice(r-e.length-u,r-u)==e)return r-e.length;let l=u<r?a.lastIndexOf(e,r-u-1):-1;if(l>=0&&l+e.length+u>=n)return u+l;if(n==r&&a.length>=r+e.length-u&&a.slice(r-u,r-u+e.length)==e)return r}}return-1}function Xs(t,e,n,r,i){let o=[];for(let s=0,u=0;s<t.length;s++){let a=t[s],l=u,c=u+=a.size;l>=n||c<=e?o.push(a):(l<e&&o.push(a.slice(0,e-l,r)),i&&(o.push(i),i=void 0),c>n&&o.push(a.slice(n-l,a.size,r)))}return o}function Lu(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let u=r.resolve(s),a,l;if(Io(n)){for(a=u;i&&!i.node;)i=i.parent;let c=i.node;if(i&&c.isAtom&&I.isSelectable(c)&&i.parent&&!(c.isInline&&b0(n.focusNode,n.focusOffset,i.dom))){let d=i.posBefore;l=new I(s==d?u:r.resolve(d))}}else{let c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null;a=r.resolve(c)}if(!l){let c=e=="pointer"||t.state.selection.head<u.pos&&!o?1:-1;l=Pu(t,a,u,c)}return l}function Id(t){return t.editable?t.hasFocus():Fd(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Tt(t,e=!1){let n=t.state.selection;if(Rd(t,n),!!Id(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ve){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&xn(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)K0(t);else{let{anchor:r,head:i}=n,o,s;el&&!(n instanceof L)&&(n.$from.parent.inlineContent||(o=tl(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=tl(t,n.to))),t.docView.setSelection(r,i,t.root,e),el&&(o&&nl(o),s&&nl(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&U0(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const el=Se||ve&&vd<63;function tl(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Se&&i&&i.contentEditable=="false")return cs(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return cs(i);if(o)return cs(o)}}function cs(t){return t.contentEditable="true",Se&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function nl(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function U0(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Id(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function K0(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,ge(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&Ne&&Wt<=11&&(r.disabled=!0,r.disabled=!1)}function Rd(t,e){if(e instanceof I){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(rl(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else rl(t)}function rl(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Pu(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||L.between(e,n,r)}function il(t){return t.editable&&!t.hasFocus()?!1:Fd(t)}function Fd(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 J0(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return xn(e.node,e.offset,n.anchorNode,n.anchorOffset)}function eu(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&P.findFrom(o,e)}function Rt(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function ol(t,e,n){let r=t.state.selection;if(r instanceof L)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return Rt(t,new L(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=eu(t.state,e);return i&&i instanceof I?Rt(t,i):!1}else if(!(Ve&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let u=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(u))&&!s.contentDOM?I.isSelectable(o)?Rt(t,new I(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Vr?Rt(t,new L(t.state.doc.resolve(e<0?u:u+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof I&&r.node.isInline)return Rt(t,new L(e>0?r.$to:r.$from));{let i=eu(t.state,e);return i?Rt(t,i):!1}}}function Bi(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function kr(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Nn(t,e){return e<0?G0(t):Z0(t)}function G0(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(et&&n.nodeType==1&&r<Bi(n)&&kr(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(kr(u,-1))i=n,o=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if(Ld(n))break;{let u=n.previousSibling;for(;u&&kr(u,-1);)i=n.parentNode,o=ge(u),u=u.previousSibling;if(u)n=u,r=Bi(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?tu(t,n,r):i&&tu(t,i,o)}function Z0(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Bi(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let u=n.childNodes[r];if(kr(u,1))o=n,s=++r;else break}else{if(Ld(n))break;{let u=n.nextSibling;for(;u&&kr(u,1);)o=u.parentNode,s=ge(u)+1,u=u.nextSibling;if(u)n=u,r=0,i=Bi(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&tu(t,o,s)}function Ld(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Q0(t,e){for(;t&&e==t.childNodes.length&&!qr(t);)e=ge(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 Y0(t,e){for(;t&&!e&&!qr(t);)e=ge(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 tu(t,e,n){if(e.nodeType!=3){let o,s;(s=Q0(e,n))?(e=s,n=0):(o=Y0(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Io(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Tt(t)},50)}function sl(t,e){let n=t.state.doc.resolve(e);if(!(ve||k0)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function ul(t,e,n){let r=t.state.selection;if(r instanceof L&&!r.empty||n.indexOf("s")>-1||Ve&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=eu(t.state,e);if(s&&s instanceof I)return Rt(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,u=r instanceof Xe?P.near(s,e):P.findFrom(s,e);return u?Rt(t,u):!1}return!1}function al(t,e){if(!(t.state.selection instanceof L))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function ll(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function X0(t){if(!Se||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;ll(t,r,"true"),setTimeout(()=>ll(t,r,"false"),20)}return!1}function em(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function tm(t,e){let n=e.keyCode,r=em(e);if(n==8||Ve&&n==72&&r=="c")return al(t,-1)||Nn(t,-1);if(n==46&&!e.shiftKey||Ve&&n==68&&r=="c")return al(t,1)||Nn(t,1);if(n==13||n==27)return!0;if(n==37||Ve&&n==66&&r=="c"){let i=n==37?sl(t,t.state.selection.from)=="ltr"?-1:1:-1;return ol(t,i,r)||Nn(t,i)}else if(n==39||Ve&&n==70&&r=="c"){let i=n==39?sl(t,t.state.selection.from)=="ltr"?1:-1:1;return ol(t,i,r)||Nn(t,i)}else{if(n==38||Ve&&n==80&&r=="c")return ul(t,-1,r)||Nn(t,-1);if(n==40||Ve&&n==78&&r=="c")return X0(t)||ul(t,1,r)||Nn(t,1);if(r==(Ve?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Pd(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||wn.fromSchema(t.state.schema),u=qd(),a=u.createElement("div");a.appendChild(s.serializeFragment(r,{document:u}));let l=a.firstChild,c,d=0;for(;l&&l.nodeType==1&&(c=jd[l.nodeName.toLowerCase()]);){for(let p=c.length-1;p>=0;p--){let f=u.createElement(c[p]);for(;a.firstChild;)f.appendChild(a.firstChild);a.appendChild(f),d++}l=a.firstChild}l&&l.nodeType==1&&l.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`

`);return{dom:a,text:h,slice:e}}function Bd(t,e,n,r,i){let o=i.parent.type.spec.code,s,u;if(!n&&!e)return null;let a=e&&(r||o||!n);if(a){if(t.someProp("transformPastedText",h=>{e=h(e,o||r,t)}),o)return e?new T(E.from(t.state.schema.text(e.replace(/\r\n?/g,`
`))),0,0):T.empty;let d=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(d)u=d;else{let h=i.marks(),{schema:p}=t.state,f=wn.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(f.serializeNode(p.text(m,h)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=im(n),Vr&&om(s);let l=s&&s.querySelector("[data-pm-slice]"),c=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(u||(u=(t.someProp("clipboardParser")||t.someProp("domParser")||Dt.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||c),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!nm.test(h.parentNode.nodeName)?{ignore:!0}:null}})),c)u=sm(cl(u,+c[1],+c[2]),c[4]);else if(u=T.maxOpen(rm(u.content,i),!0),u.openStart||u.openEnd){let d=0,h=0;for(let p=u.content.firstChild;d<u.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=u.content.lastChild;h<u.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);u=cl(u,d,h)}return t.someProp("transformPasted",d=>{u=d(u,t)}),u}const nm=/^(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 rm(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(u=>{if(!s)return;let a=i.findWrapping(u.type),l;if(!a)return s=null;if(l=s.length&&o.length&&$d(a,o,u,s[s.length-1],0))s[s.length-1]=l;else{s.length&&(s[s.length-1]=Hd(s[s.length-1],o.length));let c=zd(u,a);s.push(c),i=i.matchType(c.type),o=a}}),s)return E.from(s)}return t}function zd(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,E.from(t));return t}function $d(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=$d(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(E.from(zd(n,t,i+1))))}}function Hd(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Hd(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(E.empty,!0);return t.copy(n.append(r))}function nu(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,u=s.content;return t.childCount>1&&(o=0),i<r-1&&(u=nu(u,e,n,r,i+1,o)),i>=n&&(u=e<0?s.contentMatchAt(0).fillBefore(u,o<=i).append(u):u.append(s.contentMatchAt(s.childCount).fillBefore(E.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(u))}function cl(t,e,n){return e<t.openStart&&(t=new T(nu(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new T(nu(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const jd={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 dl=null;function qd(){return dl||(dl=document.implementation.createHTMLDocument("title"))}function im(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=qd().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&jd[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=t,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function om(t){let e=t.querySelectorAll(ve?"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 sm(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let u=r.length-2;u>=0;u-=2){let a=n.nodes[r[u]];if(!a||a.hasRequiredAttrs())break;i=E.from(a.create(r[u+1],i)),o++,s++}return new T(i,o,s)}const Ae={},De={},um={touchstart:!0,touchmove:!0};class am{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.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 lm(t){for(let e in Ae){let n=Ae[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{dm(t,r)&&!Bu(t,r)&&(t.editable||!(r.type in De))&&n(t,r)},um[e]?{passive:!0}:void 0)}Se&&t.dom.addEventListener("input",()=>null),ru(t)}function qt(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function cm(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 ru(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Bu(t,r))})}function Bu(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function dm(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 fm(t,e){!Bu(t,e)&&Ae[e.type]&&(t.editable||!(e.type in De))&&Ae[e.type](t,e)}De.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Wd(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Ze&&ve&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Jn&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,sn(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||tm(t,n)?n.preventDefault():qt(t,"key")};De.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};De.keypress=(t,e)=>{let n=e;if(Wd(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ve&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof L)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Fo(t){return{left:t.clientX,top:t.clientY}}function hm(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function zu(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,u=>s>o.depth?u(t,n,o.nodeAfter,o.before(s),i,!0):u(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Vn(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 pm(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&I.isSelectable(r)?(Vn(t,new I(n)),!0):!1}function mm(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof I&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let u=s>o.depth?o.nodeAfter:o.node(s);if(I.isSelectable(u)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Vn(t,I.create(t.state.doc,i)),!0):!1}function gm(t,e,n,r,i){return zu(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?mm(t,n):pm(t,n))}function bm(t,e,n,r){return zu(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function ym(t,e,n,r){return zu(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||xm(t,n,r)}function xm(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Vn(t,L.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(s.inlineContent)Vn(t,L.create(r,u+1,u+1+s.content.size));else if(I.isSelectable(s))Vn(t,I.create(r,u));else continue;return!0}}function $u(t){return zi(t)}const Vd=Ve?"metaKey":"ctrlKey";Ae.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=$u(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&hm(n,t.input.lastClick)&&!n[Vd]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Fo(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new km(t,s,n,!!r)):(o=="doubleClick"?bm:ym)(t,s.pos,s.inside,n)?n.preventDefault():qt(t,"pointer"))};class km{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Vd],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let c=e.state.doc.resolve(n.pos);o=c.parent,s=c.depth?c.before():0}const u=i?null:r.target,a=u?e.docView.nearestDesc(u,!0):null;this.target=a&&a.dom.nodeType==1?a.dom:null;let{selection:l}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||l instanceof I&&l.from<=s&&l.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&et&&!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)),qt(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(()=>Tt(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(Fo(e))),this.updateAllowDefault(e),this.allowDefault||!n?qt(this.view,"pointer"):gm(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Se&&this.mightDrag&&!this.mightDrag.node.isAtom||ve&&!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)?(Vn(this.view,P.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):qt(this.view,"pointer")}move(e){this.updateAllowDefault(e),qt(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)}}Ae.touchstart=t=>{t.input.lastTouch=Date.now(),$u(t),qt(t,"pointer")};Ae.touchmove=t=>{t.input.lastTouch=Date.now(),qt(t,"pointer")};Ae.contextmenu=t=>$u(t);function Wd(t,e){return t.composing?!0:Se&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const vm=Ze?5e3:-1;De.compositionstart=De.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof L&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),zi(t,!0),t.markCursor=null;else if(zi(t,!e.selection.empty),et&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let u=t.domSelection();u&&u.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}Ud(t,vm)};De.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++,Ud(t,20))};function Ud(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>zi(t),e))}function Kd(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=wm());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Cm(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=m0(e.focusNode,e.focusOffset),r=g0(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.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 wm(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function zi(t,e=!1){if(!(Ze&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Kd(t),e||t.docView&&t.docView.dirty){let n=Lu(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function Em(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Or=Ne&&Wt<15||Jn&&v0<604;Ae.copy=De.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=Or?null:n.clipboardData,s=r.content(),{dom:u,text:a}=Pd(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",a)):Em(t,u),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Sm(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Am(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 i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?_r(t,r.value,null,i,e):_r(t,r.textContent,r.innerHTML,i,e)},50)}function _r(t,e,n,r,i){let o=Bd(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,i,o||T.empty)))return!0;if(!o)return!1;let s=Sm(o),u=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Jd(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," "):""}De.paste=(t,e)=>{let n=e;if(t.composing&&!Ze)return;let r=Or?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&_r(t,Jd(r),r.getData("text/html"),i,n)?n.preventDefault():Am(t,n)};class Gd{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Zd=Ve?"altKey":"ctrlKey";Ae.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Fo(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof I?i.to-1:i.to))){if(r&&r.mightDrag)s=I.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=I.create(t.state.doc,d.posBefore))}}let u=(s||t.state.selection).content(),{dom:a,text:l,slice:c}=Pd(t,u);(!n.dataTransfer.files.length||!ve||vd>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Or?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Or||n.dataTransfer.setData("text/plain",l),t.dragging=new Gd(c,!n[Zd],s)};Ae.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};De.dragover=De.dragenter=(t,e)=>e.preventDefault();De.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Fo(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",f=>{s=f(s,t)}):s=Bd(t,Jd(n.dataTransfer),Or?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[Zd]);if(t.someProp("handleDrop",f=>f(t,n,s||T.empty,u))){n.preventDefault();return}if(!s)return;n.preventDefault();let a=s?fd(t.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let l=t.state.tr;if(u){let{node:f}=r;f?f.replace(l):l.deleteSelection()}let c=l.mapping.map(a),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=l.doc;if(d?l.replaceRangeWith(c,c,s.content.firstChild):l.replaceRange(c,c,s),l.doc.eq(h))return;let p=l.doc.resolve(c);if(d&&I.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new I(p));else{let f=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((m,g,y,x)=>f=x),l.setSelection(Pu(t,p,l.doc.resolve(f)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))};Ae.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())&&Tt(t)},20))};Ae.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)};Ae.beforeinput=(t,e)=>{if(ve&&Ze&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,sn(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in De)Ae[t]=De[t];function Nr(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 $i{constructor(e,n){this.toDOM=e,this.spec=n||pn,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new _e(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof $i&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Nr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Kt{constructor(e,n){this.attrs=e,this.spec=n||pn}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new _e(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Kt&&Nr(this.attrs,e.attrs)&&Nr(this.spec,e.spec)}static is(e){return e.type instanceof Kt}destroy(){}}class Hu{constructor(e,n){this.attrs=e,this.spec=n||pn}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new _e(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof Hu&&Nr(this.attrs,e.attrs)&&Nr(this.spec,e.spec)}destroy(){}}class _e{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new _e(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 _e(e,e,new $i(n,r))}static inline(e,n,r,i){return new _e(e,n,new Kt(r,i))}static node(e,n,r,i){return new _e(e,n,new Hu(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Kt}get widget(){return this.type instanceof $i}}const Ln=[],pn={};class ie{constructor(e,n){this.local=e.length?e:Ln,this.children=n.length?n:Ln}static create(e,n){return n.length?Hi(n,e,0,pn):ke}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let u=this.local[s];u.from<=n&&u.to>=e&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let u=this.children[s]+1;this.children[s+2].findInner(e-u,n-u,r,i+u,o)}}map(e,n,r){return this==ke||e.maps.length==0?this:this.mapInner(e,n,0,0,r||pn)}mapInner(e,n,r,i,o){let s;for(let u=0;u<this.local.length;u++){let a=this.local[u].map(e,r,i);a&&a.type.valid(n,a)?(s||(s=[])).push(a):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?Dm(this.children,s||[],e,n,r,i,o):s?new ie(s.sort(mn),Ln):ke}add(e,n){return n.length?this==ke?ie.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((u,a)=>{let l=a+r,c;if(c=Yd(n,u,l)){for(i||(i=this.children.slice());o<i.length&&i[o]<a;)o+=3;i[o]==a?i[o+2]=i[o+2].addInner(u,c,l+1):i.splice(o,0,a,a+u.nodeSize,Hi(c,u,l+1,pn)),o+=3}});let s=Qd(o?Xd(n):n,-r);for(let u=0;u<s.length;u++)s[u].type.valid(e,s[u])||s.splice(u--,1);return new ie(s.length?this.local.concat(s).sort(mn):this.local,i||this.children)}remove(e){return e.length==0||this==ke?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,u=r[o]+n,a=r[o+1]+n;for(let c=0,d;c<e.length;c++)(d=e[c])&&d.from>u&&d.to<a&&(e[c]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let l=r[o+2].removeInner(s,u+1);l!=ke?r[o+2]=l:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let u=0;u<i.length;u++)i[u].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(u--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new ie(i,r):ke}forChild(e,n){if(this==ke)return this;if(n.isLeaf)return ie.empty;let r,i;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=e){this.children[u]==e&&(r=this.children[u+2]);break}let o=e+1,s=o+n.content.size;for(let u=0;u<this.local.length;u++){let a=this.local[u];if(a.from<s&&a.to>o&&a.type instanceof Kt){let l=Math.max(o,a.from)-o,c=Math.min(s,a.to)-o;l<c&&(i||(i=[])).push(a.copy(l,c))}}if(i){let u=new ie(i.sort(mn),Ln);return r?new Bt([u,r]):u}return r||ke}eq(e){if(this==e)return!0;if(!(e instanceof ie)||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 ju(this.localsInner(e))}localsInner(e){if(this==ke)return Ln;if(e.inlineContent||!this.local.some(Kt.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Kt||n.push(this.local[r]);return n}}ie.empty=new ie([],[]);ie.removeOverlap=ju;const ke=ie.empty;class Bt{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,pn));return Bt.from(r)}forChild(e,n){if(n.isLeaf)return ie.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=ke&&(o instanceof Bt?r=r.concat(o.members):r.push(o))}return Bt.from(r)}eq(e){if(!(e instanceof Bt)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?ju(r?n:n.sort(mn)):Ln}static from(e){switch(e.length){case 0:return ke;case 1:return e[0];default:return new Bt(e.every(n=>n instanceof ie)?e:e.reduce((n,r)=>n.concat(r instanceof ie?r:r.members),[]))}}}function Dm(t,e,n,r,i,o,s){let u=t.slice();for(let l=0,c=o;l<n.maps.length;l++){let d=0;n.maps[l].forEach((h,p,f,m)=>{let g=m-f-(p-h);for(let y=0;y<u.length;y+=3){let x=u[y+1];if(x<0||h>x+c-d)continue;let v=u[y]+c-d;p>=v?u[y+1]=h<=v?-2:-1:h>=c&&g&&(u[y]+=g,u[y+1]+=g)}d+=g}),c=n.maps[l].map(c,-1)}let a=!1;for(let l=0;l<u.length;l+=3)if(u[l+1]<0){if(u[l+1]==-2){a=!0,u[l+1]=-1;continue}let c=n.map(t[l]+o),d=c-i;if(d<0||d>=r.content.size){a=!0;continue}let h=n.map(t[l+1]+o,-1),p=h-i,{index:f,offset:m}=r.content.findIndex(d),g=r.maybeChild(f);if(g&&m==d&&m+g.nodeSize==p){let y=u[l+2].mapInner(n,g,c+1,t[l]+o+1,s);y!=ke?(u[l]=d,u[l+1]=p,u[l+2]=y):(u[l+1]=-2,a=!0)}else a=!0}if(a){let l=Tm(u,t,e,n,i,o,s),c=Hi(l,r,0,s);e=c.local;for(let d=0;d<u.length;d+=3)u[d+1]<0&&(u.splice(d,3),d-=3);for(let d=0,h=0;d<c.children.length;d+=3){let p=c.children[d];for(;h<u.length&&u[h]<p;)h+=3;u.splice(h,0,c.children[d],c.children[d+1],c.children[d+2])}}return new ie(e.sort(mn),u)}function Qd(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new _e(i.from+e,i.to+e,i.type))}return n}function Tm(t,e,n,r,i,o,s){function u(a,l){for(let c=0;c<a.local.length;c++){let d=a.local[c].map(r,i,l);d?n.push(d):s.onRemove&&s.onRemove(a.local[c].spec)}for(let c=0;c<a.children.length;c+=3)u(a.children[c+2],a.children[c]+l+1)}for(let a=0;a<t.length;a+=3)t[a+1]==-1&&u(t[a+2],e[a]+o+1);return n}function Yd(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function Xd(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Hi(t,e,n,r){let i=[],o=!1;e.forEach((u,a)=>{let l=Yd(t,u,a+n);if(l){o=!0;let c=Hi(l,u,n+a+1,r);c!=ke&&i.push(a,a+u.nodeSize,c)}});let s=Qd(o?Xd(t):t,-n).sort(mn);for(let u=0;u<s.length;u++)s[u].type.valid(e,s[u])||(r.onRemove&&r.onRemove(s[u].spec),s.splice(u--,1));return s.length||i.length?new ie(s,i):ke}function mn(t,e){return t.from-e.from||t.to-e.to}function ju(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),fl(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),fl(e,i,r.copy(o.from,r.to)));break}}}return e}function fl(t,e,n){for(;e<t.length&&mn(n,t[e])>0;)e++;t.splice(e,0,n)}function ds(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ke&&e.push(r)}),t.cursorWrapper&&e.push(ie.create(t.state.doc,[t.cursorWrapper.deco])),Bt.from(e)}const Mm={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Om=Ne&&Wt<=11;class _m{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 Nm{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new _m,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Ne&&Wt<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),Om&&(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,Mm)),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(il(this.view)){if(this.suppressingSelectionUpdates)return Tt(this.view);if(Ne&&Wt<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&xn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=Mr(o))n.add(o);for(let o=e.anchorNode;o;o=Mr(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}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(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&il(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,u=!1,a=[];if(e.editable)for(let c=0;c<n.length;c++){let d=this.registerMutation(n[c],a);d&&(o=o<0?d.from:Math.min(d.from,o),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(u=!0))}if(et&&a.length){let c=a.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,h]=c;d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let h of c){let p=h.parentNode;p&&p.nodeName=="LI"&&(!d||Fm(e,d)!=p)&&h.remove()}}}let l=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Io(r)&&(l=Lu(e))&&l.eq(P.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Tt(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),Im(e)),this.handleDOMChange(o,s,u,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Tt(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 d=e.addedNodes[c];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(Ne&&Wt<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:d,nextSibling:h}=e.addedNodes[c];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(i=d),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(o=h)}let s=i&&i.parentNode==e.target?ge(i)+1:0,u=r.localPosFromDOM(e.target,s,-1),a=o&&o.parentNode==e.target?ge(o):e.target.childNodes.length,l=r.localPosFromDOM(e.target,a,1);return{from:u,to:l}}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 hl=new WeakMap,pl=!1;function Im(t){if(!hl.has(t)&&(hl.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=et,pl)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."),pl=!0}}function ml(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return xn(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function Rm(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return ml(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?ml(t,n):null}function Fm(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 Lm(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:u}=t.docView.parseRange(e,n),a=t.domSelectionRange(),l,c=a.anchorNode;if(c&&t.dom.contains(c.nodeType==1?c:c.parentNode)&&(l=[{node:c,offset:a.anchorOffset}],Io(a)||l.push({node:a.focusNode,offset:a.focusOffset})),ve&&t.input.lastKeyCode===8)for(let g=o;g>i;g--){let y=r.childNodes[g-1],x=y.pmViewDesc;if(y.nodeName=="BR"&&!x){o=g;break}if(!x||x.size)break}let d=t.state.doc,h=t.someProp("domParser")||Dt.fromSchema(t.state.schema),p=d.resolve(s),f=null,m=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:l,ruleFromNode:Pm,context:p});if(l&&l[0].pos!=null){let g=l[0].pos,y=l[1]&&l[1].pos;y==null&&(y=g),f={anchor:g+s,head:y+s}}return{doc:m,sel:f,from:s,to:u}}function Pm(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Se&&/^(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||Se&&/^(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 Bm=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function zm(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let S=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,R=Lu(t,S);if(R&&!t.state.selection.eq(R)){if(ve&&Ze&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",q=>q(t,sn(13,"Enter"))))return;let H=t.state.tr.setSelection(R);S=="pointer"?H.setMeta("pointer",!0):S=="key"&&H.scrollIntoView(),o&&H.setMeta("composition",o),t.dispatch(H)}return}let s=t.state.doc.resolve(e),u=s.sharedDepth(n);e=s.before(u+1),n=t.state.doc.resolve(n).after(u+1);let a=t.state.selection,l=Lm(t,e,n),c=t.state.doc,d=c.slice(l.from,l.to),h,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,p="end"):(h=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let f=jm(d.content,l.doc.content,l.from,h,p);if((Jn&&t.input.lastIOSEnter>Date.now()-225||Ze)&&i.some(S=>S.nodeType==1&&!Bm.test(S.nodeName))&&(!f||f.endA>=f.endB)&&t.someProp("handleKeyDown",S=>S(t,sn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!f)if(r&&a instanceof L&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))f={start:a.from,endA:a.to,endB:a.to};else{if(l.sel){let S=gl(t,t.state.doc,l.sel);if(S&&!S.eq(t.state.selection)){let R=t.state.tr.setSelection(S);o&&R.setMeta("composition",o),t.dispatch(R)}}return}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&f.start==f.endB&&t.state.selection instanceof L&&(f.start>t.state.selection.from&&f.start<=t.state.selection.from+2&&t.state.selection.from>=l.from?f.start=t.state.selection.from:f.endA<t.state.selection.to&&f.endA>=t.state.selection.to-2&&t.state.selection.to<=l.to&&(f.endB+=t.state.selection.to-f.endA,f.endA=t.state.selection.to)),Ne&&Wt<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>l.from&&l.doc.textBetween(f.start-l.from-1,f.start-l.from+1)=="  "&&(f.start--,f.endA--,f.endB--);let m=l.doc.resolveNoCache(f.start-l.from),g=l.doc.resolveNoCache(f.endB-l.from),y=c.resolve(f.start),x=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=f.endA,v;if((Jn&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(S=>S.nodeName=="DIV"||S.nodeName=="P"))||!x&&m.pos<l.doc.content.size&&!m.sameParent(g)&&(v=P.findFrom(l.doc.resolve(m.pos+1),1,!0))&&v.head==g.pos)&&t.someProp("handleKeyDown",S=>S(t,sn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>f.start&&Hm(c,f.start,f.endA,m,g)&&t.someProp("handleKeyDown",S=>S(t,sn(8,"Backspace")))){Ze&&ve&&t.domObserver.suppressSelectionUpdates();return}ve&&Ze&&f.endB==f.start&&(t.input.lastAndroidDelete=Date.now()),Ze&&!x&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==f.endA&&(f.endB-=2,g=l.doc.resolveNoCache(f.endB-l.from),setTimeout(()=>{t.someProp("handleKeyDown",function(S){return S(t,sn(13,"Enter"))})},20));let b=f.start,w=f.endA,k,D,_;if(x){if(m.pos==g.pos)Ne&&Wt<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Tt(t),20)),k=t.state.tr.delete(b,w),D=c.resolve(f.start).marksAcross(c.resolve(f.endA));else if(f.endA==f.endB&&(_=$m(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start()))))k=t.state.tr,_.type=="add"?k.addMark(b,w,_.mark):k.removeMark(b,w,_.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let S=m.parent.textBetween(m.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",R=>R(t,b,w,S)))return;k=t.state.tr.insertText(S,b,w)}}if(k||(k=t.state.tr.replace(b,w,l.doc.slice(f.start-l.from,f.endB-l.from))),l.sel){let S=gl(t,k.doc,l.sel);S&&!(ve&&Ze&&t.composing&&S.empty&&(f.start!=f.endB||t.input.lastAndroidDelete<Date.now()-100)&&(S.head==b||S.head==k.mapping.map(w)-1)||Ne&&S.empty&&S.head==b)&&k.setSelection(S)}D&&k.ensureMarks(D),o&&k.setMeta("composition",o),t.dispatch(k.scrollIntoView())}function gl(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Pu(t,e.resolve(n.anchor),e.resolve(n.head))}function $m(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,u,a;for(let c=0;c<r.length;c++)i=r[c].removeFromSet(i);for(let c=0;c<n.length;c++)o=n[c].removeFromSet(o);if(i.length==1&&o.length==0)u=i[0],s="add",a=c=>c.mark(u.addToSet(c.marks));else if(i.length==0&&o.length==1)u=o[0],s="remove",a=c=>c.mark(u.removeFromSet(c.marks));else return null;let l=[];for(let c=0;c<e.childCount;c++)l.push(a(e.child(c)));if(E.from(l).eq(t))return{mark:u,type:s}}function Hm(t,e,n,r,i){if(n-e<=i.pos-r.pos||fs(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let u=o.nodeAfter;return u!=null&&n==e+u.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(fs(o,!0,!0));return!s.parent.isTextblock||s.pos>n||fs(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function fs(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function jm(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:u}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let a=Math.max(0,o-Math.min(s,u));r-=s+a-o}if(s<o&&t.size<e.size){let a=r<=o&&r>=s?o-r:0;o-=a,o&&o<e.size&&bl(e.textBetween(o-1,o+1))&&(o+=a?1:-1),u=o+(u-s),s=o}else if(u<o){let a=r<=o&&r>=u?o-r:0;o-=a,o&&o<t.size&&bl(t.textBetween(o-1,o+1))&&(o+=a?1:-1),s=o+(s-u),u=o}return{start:o,endA:s,endB:u}}function bl(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 qm{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 am,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Cl),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=kl(this),xl(this),this.nodeViews=vl(this),this.docView=Ya(this.state.doc,yl(this),ds(this),this.dom,this),this.domObserver=new Nm(this,(r,i,o,s)=>zm(this,r,i,o,s)),this.domObserver.start(),lm(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&&ru(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Cl),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 i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(Kd(this),s=!0),this.state=e;let u=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(u||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=vl(this);Wm(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(u||n.handleDOMEvents!=this._props.handleDOMEvents)&&ru(this),this.editable=kl(this),xl(this);let a=ds(this),l=yl(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=o||!this.docView.matchesNode(e.doc,l,a);(d||!e.selection.eq(i.selection))&&(s=!0);let h=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&E0(this);if(s){this.domObserver.stop();let p=d&&(Ne||ve)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Vm(i.selection,e.selection);if(d){let f=ve?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Cm(this)),(o||!this.docView.update(e.doc,l,a,this))&&(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=Ya(e.doc,l,a,this.dom,this)),f&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&J0(this))?Tt(this,p):(Rd(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():h&&S0(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof I){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Ua(this,n.getBoundingClientRect(),e)}else Ua(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,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new Gd(e.slice,e.move,i<0?void 0:I.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let u=this.directPlugins[s].props[e];if(u!=null&&(i=n?n(u):u))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let u=o[s].props[e];if(u!=null&&(i=n?n(u):u))return i}}hasFocus(){if(Ne){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&&A0(this.dom),Tt(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 _0(this,e)}coordsAtPos(e,n=1){return Ad(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return L0(this,n||this.state,e)}pasteHTML(e,n){return _r(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return _r(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(cm(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ds(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,h0())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return fm(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Se&&this.root.nodeType===11&&y0(this.dom.ownerDocument)==this.dom&&Rm(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function yl(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"),[_e.node(0,t.state.doc.content.size,e)]}function xl(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:_e.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function kl(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Vm(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 vl(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Wm(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function Cl(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Jt={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:"'"},ji={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Um=typeof navigator<"u"&&/Mac/.test(navigator.platform),Km=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var be=0;be<10;be++)Jt[48+be]=Jt[96+be]=String(be);for(var be=1;be<=24;be++)Jt[be+111]="F"+be;for(var be=65;be<=90;be++)Jt[be]=String.fromCharCode(be+32),ji[be]=String.fromCharCode(be);for(var hs in Jt)ji.hasOwnProperty(hs)||(ji[hs]=Jt[hs]);function Jm(t){var e=Um&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Km&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ji:Jt)[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 Gm=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Zm(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let u=0;u<e.length-1;u++){let a=e[u];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))o=!0;else if(/^mod$/i.test(a))Gm?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function Qm(t){let e=Object.create(null);for(let n in t)e[Zm(n)]=t[n];return e}function ps(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 Ym(t){return new ae({props:{handleKeyDown:ef(t)}})}function ef(t){let e=Qm(t);return function(n,r){let i=Jm(r),o,s=e[ps(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let u=e[ps(i,r,!1)];if(u&&u(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=Jt[r.keyCode])&&o!=i){let u=e[ps(o,r)];if(u&&u(n.state,n.dispatch,n))return!0}}return!1}}const Xm=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function tf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const e1=(t,e,n)=>{let r=tf(t,n);if(!r)return!1;let i=qu(r);if(!i){let s=r.blockRange(),u=s&&ir(s);return u==null?!1:(e&&e(t.tr.lift(s,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(sf(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Gn(o,"end")||I.isSelectable(o)))for(let s=r.depth;;s--){let u=_o(t.doc,r.before(s),r.after(s),T.empty);if(u&&u.slice.size<u.to-u.from){if(e){let a=t.tr.step(u);a.setSelection(Gn(o,"end")?P.findFrom(a.doc.resolve(a.mapping.map(i.pos,-1)),-1):I.create(a.doc,i.pos-o.nodeSize)),e(a.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},t1=(t,e,n)=>{let r=tf(t,n);if(!r)return!1;let i=qu(r);return i?nf(t,i,e):!1},n1=(t,e,n)=>{let r=rf(t,n);if(!r)return!1;let i=Vu(r);return i?nf(t,i,e):!1};function nf(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let s=e.nodeAfter,u=s,a=e.pos+1;for(;!u.isTextblock;a++){if(u.type.spec.isolating)return!1;let c=u.firstChild;if(!c)return!1;u=c}let l=_o(t.doc,o,a,T.empty);if(!l||l.from!=o||l instanceof ce&&l.slice.size>=a-o)return!1;if(n){let c=t.tr.step(l);c.setSelection(L.create(c.doc,o)),n(c.scrollIntoView())}return!0}function Gn(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 r1=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=qu(r)}let s=o&&o.nodeBefore;return!s||!I.isSelectable(s)?!1:(e&&e(t.tr.setSelection(I.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function qu(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 rf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const i1=(t,e,n)=>{let r=rf(t,n);if(!r)return!1;let i=Vu(r);if(!i)return!1;let o=i.nodeAfter;if(sf(t,i,e,1))return!0;if(r.parent.content.size==0&&(Gn(o,"start")||I.isSelectable(o))){let s=_o(t.doc,r.before(),r.after(),T.empty);if(s&&s.slice.size<s.to-s.from){if(e){let u=t.tr.step(s);u.setSelection(Gn(o,"start")?P.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):I.create(u.doc,u.mapping.map(i.pos))),e(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},o1=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=Vu(r)}let s=o&&o.nodeAfter;return!s||!I.isSelectable(s)?!1:(e&&e(t.tr.setSelection(I.create(t.doc,o.pos)).scrollIntoView()),!0)};function Vu(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 s1=(t,e)=>{let n=t.selection,r=n instanceof I,i;if(r){if(n.node.isTextblock||!Zt(t.doc,n.from))return!1;i=n.from}else if(i=Oo(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(I.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},u1=(t,e)=>{let n=t.selection,r;if(n instanceof I){if(n.node.isTextblock||!Zt(t.doc,n.to))return!1;r=n.to}else if(r=Oo(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},a1=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&ir(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},l1=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
`).scrollIntoView()),!0)};function of(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 c1=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=of(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let u=n.after(),a=t.tr.replaceWith(u,u,s.createAndFill());a.setSelection(P.near(a.doc.resolve(u),1)),e(a.scrollIntoView())}return!0},d1=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Xe||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=of(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=t.tr.insert(s,o.createAndFill());u.setSelection(L.create(u.doc,s+1)),e(u.scrollIntoView())}return!0},f1=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(jn(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&ir(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},h1=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(I.create(t.doc,i))),!0)};function p1(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Zt(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function sf(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,u,a=i.type.spec.isolating||o.type.spec.isolating;if(!a&&p1(t,e,n))return!0;let l=!a&&e.parent.canReplace(e.index(),e.index()+1);if(l&&(s=(u=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&u.matchType(s[0]||o.type).validEnd){if(n){let p=e.pos+o.nodeSize,f=E.empty;for(let y=s.length-1;y>=0;y--)f=E.from(s[y].create(null,f));f=E.from(i.copy(f));let m=t.tr.step(new fe(e.pos-1,p,e.pos,p,new T(f,1,0),s.length,!0)),g=p+2*s.length;Zt(m.doc,g)&&m.join(g),n(m.scrollIntoView())}return!0}let c=o.type.spec.isolating||r>0&&a?null:P.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),h=d&&ir(d);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(d,h).scrollIntoView()),!0;if(l&&Gn(o,"start",!0)&&Gn(i,"end")){let p=i,f=[];for(;f.push(p),!p.isTextblock;)p=p.lastChild;let m=o,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(n){let y=E.empty;for(let v=f.length-1;v>=0;v--)y=E.from(f[v].copy(y));let x=t.tr.step(new fe(e.pos-f.length,e.pos+o.nodeSize,e.pos+g,e.pos+o.nodeSize-g,new T(y,f.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function uf(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(L.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const m1=uf(-1),g1=uf(1);function b1(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),u=s&&Iu(s,t,e);return u?(r&&r(n.tr.wrap(s,u).scrollIntoView()),!0):!1}}function wl(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:u}}=n.selection.ranges[o];n.doc.nodesBetween(s,u,(a,l)=>{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)i=!0;else{let c=n.doc.resolve(l),d=c.index();i=c.parent.canReplaceWith(d,d+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:u},$to:{pos:a}}=n.selection.ranges[s];o.setBlockType(u,a,t,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function y1(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),u=!1,a=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let c=n.doc.resolve(s.start-2);a=new Ri(c,c,s.depth),s.endIndex<s.parent.childCount&&(s=new Ri(i,n.doc.resolve(o.end(s.depth)),s.depth)),u=!0}let l=Iu(a,t,e,s);return l?(r&&r(x1(n.tr,s,l,u,t).scrollIntoView()),!0):!1}}function x1(t,e,n,r,i){let o=E.empty;for(let c=n.length-1;c>=0;c--)o=E.from(n[c].type.create(n[c].attrs,o));t.step(new fe(e.start-(r?2:0),e.end,e.start,e.end,new T(o,0,0),n.length,!0));let s=0;for(let c=0;c<n.length;c++)n[c].type==i&&(s=c+1);let u=n.length-s,a=e.start+n.length-(r?2:0),l=e.parent;for(let c=e.startIndex,d=e.endIndex,h=!0;c<d;c++,h=!1)!h&&jn(t.doc,a,u)&&(t.split(a,u),a+=2*u),a+=l.child(c).nodeSize;return t}function k1(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?v1(e,n,t,o):C1(e,n,o):!0:!1}}function v1(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new fe(o-1,s,o,s,new T(E.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ri(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const u=ir(r);if(u==null)return!1;i.lift(r,u);let a=i.mapping.map(o,-1)-1;return Zt(i.doc,a)&&i.join(a),e(i.scrollIntoView()),!0}function C1(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,f=n.endIndex-1,m=n.startIndex;f>m;f--)p-=i.child(f).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let u=n.startIndex==0,a=n.endIndex==i.childCount,l=o.node(-1),c=o.index(-1);if(!l.canReplace(c+(u?0:1),c+1,s.content.append(a?E.empty:E.from(i))))return!1;let d=o.pos,h=d+s.nodeSize;return r.step(new fe(d-(u?1:0),h+(a?1:0),d+1,h-1,new T((u?E.empty:E.from(i.copy(E.empty))).append(a?E.empty:E.from(i.copy(E.empty))),u?0:1,a?0:1),u?0:1)),e(r.scrollIntoView()),!0}function w1(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,l=>l.childCount>0&&l.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let u=o.parent,a=u.child(s-1);if(a.type!=t)return!1;if(n){let l=a.lastChild&&a.lastChild.type==u.type,c=E.from(l?t.create():null),d=new T(E.from(t.create(null,E.from(u.type.create(null,c)))),l?3:1,0),h=o.start,p=o.end;n(e.tr.step(new fe(h-(l?3:1),p,h,p,d,1,!0)).scrollIntoView())}return!0}}function Lo(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class Po{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([u,a])=>[u,(...c)=>{const d=a(...c)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,u=[],a=!!e,l=e||o.tr,c=()=>(!a&&n&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(l),u.every(h=>h===!0)),d={...Object.fromEntries(Object.entries(r).map(([h,p])=>[h,(...m)=>{const g=this.buildProps(l,n),y=p(...m)(g);return u.push(y),d}])),run:c};return d}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...c)=>l(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,u={tr:e,editor:i,view:s,state:Lo({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([a,l])=>[a,(...c)=>l(...c)(u)]))}};return u}}class E1{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function O(t,e,n){return t.config[e]===void 0&&t.parent?O(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?O(t.parent,e,n):null}):t.config[e]}function Bo(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function af(t){const e=[],{nodeExtensions:n,markExtensions:r}=Bo(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const u={name:s.name,options:s.options,storage:s.storage,extensions:i},a=O(s,"addGlobalAttributes",u);if(!a)return;a().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([h,p])=>{e.push({type:d,name:h,attribute:{...o,...p}})})})})}),i.forEach(s=>{const u={name:s.name,options:s.options,storage:s.storage},a=O(s,"addAttributes",u);if(!a)return;const l=a();Object.entries(l).forEach(([c,d])=>{const h={...o,...d};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:s.name,name:c,attribute:h})})}),e}function pe(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function ne(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const u=o?o.split(" "):[],a=r[i]?r[i].split(" "):[],l=u.filter(c=>!a.includes(c));r[i]=[...a,...l].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function iu(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ne(n,r),{})}function lf(t){return typeof t=="function"}function $(t,e=void 0,...n){return lf(t)?e?t.bind(e)(...n):t(...n):t}function S1(t={}){return Object.keys(t).length===0&&t.constructor===Object}function A1(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function El(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const u=s.attribute.parseHTML?s.attribute.parseHTML(n):A1(n.getAttribute(s.name));return u==null?o:{...o,[s.name]:u}},{});return{...r,...i}}}}function Sl(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&S1(n)?!1:n!=null))}function D1(t,e){var n;const r=af(t),{nodeExtensions:i,markExtensions:o}=Bo(t),s=(n=i.find(l=>O(l,"topNode")))===null||n===void 0?void 0:n.name,u=Object.fromEntries(i.map(l=>{const c=r.filter(y=>y.type===l.name),d={name:l.name,options:l.options,storage:l.storage,editor:e},h=t.reduce((y,x)=>{const v=O(x,"extendNodeSchema",d);return{...y,...v?v(l):{}}},{}),p=Sl({...h,content:$(O(l,"content",d)),marks:$(O(l,"marks",d)),group:$(O(l,"group",d)),inline:$(O(l,"inline",d)),atom:$(O(l,"atom",d)),selectable:$(O(l,"selectable",d)),draggable:$(O(l,"draggable",d)),code:$(O(l,"code",d)),whitespace:$(O(l,"whitespace",d)),defining:$(O(l,"defining",d)),isolating:$(O(l,"isolating",d)),attrs:Object.fromEntries(c.map(y=>{var x;return[y.name,{default:(x=y==null?void 0:y.attribute)===null||x===void 0?void 0:x.default}]}))}),f=$(O(l,"parseHTML",d));f&&(p.parseDOM=f.map(y=>El(y,c)));const m=O(l,"renderHTML",d);m&&(p.toDOM=y=>m({node:y,HTMLAttributes:iu(y,c)}));const g=O(l,"renderText",d);return g&&(p.toText=g),[l.name,p]})),a=Object.fromEntries(o.map(l=>{const c=r.filter(g=>g.type===l.name),d={name:l.name,options:l.options,storage:l.storage,editor:e},h=t.reduce((g,y)=>{const x=O(y,"extendMarkSchema",d);return{...g,...x?x(l):{}}},{}),p=Sl({...h,inclusive:$(O(l,"inclusive",d)),excludes:$(O(l,"excludes",d)),group:$(O(l,"group",d)),spanning:$(O(l,"spanning",d)),code:$(O(l,"code",d)),attrs:Object.fromEntries(c.map(g=>{var y;return[g.name,{default:(y=g==null?void 0:g.attribute)===null||y===void 0?void 0:y.default}]}))}),f=$(O(l,"parseHTML",d));f&&(p.parseDOM=f.map(g=>El(g,c)));const m=O(l,"renderHTML",d);return m&&(p.toDOM=g=>m({mark:g,HTMLAttributes:iu(g,c)})),[l.name,p]}));return new _u({topNode:s,nodes:u,marks:a})}function ms(t,e){return e.nodes[t]||e.marks[t]||null}function Al(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const T1=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,u)=>{var a,l;const c=((l=(a=i.type.spec).toText)===null||l===void 0?void 0:l.call(a,{node:i,pos:o,parent:s,index:u}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?c:c.slice(0,Math.max(0,r-o))}),n};function Wu(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Ur{constructor(e){this.find=e.find,this.handler=e.handler}}const M1=(t,e)=>{if(Wu(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function fi(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:u}=t,{view:a}=n;if(a.composing)return!1;const l=a.state.doc.resolve(r);if(l.parent.type.spec.code||!((e=l.nodeBefore||l.nodeAfter)===null||e===void 0)&&e.marks.find(h=>h.type.spec.code))return!1;let c=!1;const d=T1(l)+o;return s.forEach(h=>{if(c)return;const p=M1(d,h.find);if(!p)return;const f=a.state.tr,m=Lo({state:a.state,transaction:f}),g={from:r-(p[0].length-o.length),to:i},{commands:y,chain:x,can:v}=new Po({editor:n,state:m});h.handler({state:m,range:g,match:p,commands:y,chain:x,can:v})===null||!f.steps.length||(f.setMeta(u,{transform:f,from:r,to:i,text:o}),a.dispatch(f),c=!0)}),c}function O1(t){const{editor:e,rules:n}=t,r=new ae({state:{init(){return null},apply(i,o){const s=i.getMeta(r);if(s)return s;const u=i.getMeta("applyInputRules");return!!u&&setTimeout(()=>{const{from:l,text:c}=u,d=l+c.length;fi({editor:e,from:l,to:d,text:c,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,u){return fi({editor:e,from:o,to:s,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&fi({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?fi({editor:e,from:s.pos,to:s.pos,text:`
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function _1(t){return typeof t=="number"}class N1{constructor(e){this.find=e.find,this.handler=e.handler}}const I1=(t,e,n)=>{if(Wu(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function R1(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:u}=t,{commands:a,chain:l,can:c}=new Po({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,i,(p,f)=>{if(!p.isTextblock||p.type.spec.code)return;const m=Math.max(r,f),g=Math.min(i,f+p.content.size),y=p.textBetween(m-f,g-f,void 0,"");I1(y,o.find,s).forEach(v=>{if(v.index===void 0)return;const b=m+v.index+1,w=b+v[0].length,k={from:n.tr.mapping.map(b),to:n.tr.mapping.map(w)},D=o.handler({state:n,range:k,match:v,commands:a,chain:l,can:c,pasteEvent:s,dropEvent:u});d.push(D)})}),d.every(p=>p!==null)}const F1=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function L1(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,u=typeof DragEvent<"u"?new DragEvent("drop"):null;const a=({state:c,from:d,to:h,rule:p,pasteEvt:f})=>{const m=c.tr,g=Lo({state:c,transaction:m});if(!(!R1({editor:e,state:g,from:Math.max(d-1,0),to:h.b-1,rule:p,pasteEvent:f,dropEvent:u})||!m.steps.length))return u=typeof DragEvent<"u"?new DragEvent("drop"):null,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m};return n.map(c=>new ae({view(d){const h=p=>{var f;r=!((f=d.dom.parentElement)===null||f===void 0)&&f.contains(p.target)?d.dom.parentElement:null};return window.addEventListener("dragstart",h),{destroy(){window.removeEventListener("dragstart",h)}}},props:{handleDOMEvents:{drop:(d,h)=>(o=r===d.dom.parentElement,u=h,!1),paste:(d,h)=>{var p;const f=(p=h.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return s=h,i=!!(f!=null&&f.includes("data-pm-slice")),!1}}},appendTransaction:(d,h,p)=>{const f=d[0],m=f.getMeta("uiEvent")==="paste"&&!i,g=f.getMeta("uiEvent")==="drop"&&!o,y=f.getMeta("applyPasteRules"),x=!!y;if(!m&&!g&&!x)return;if(x){const{from:w,text:k}=y,D=w+k.length,_=F1(k);return a({rule:c,state:p,from:w,to:{b:D},pasteEvt:_})}const v=h.doc.content.findDiffStart(p.doc.content),b=h.doc.content.findDiffEnd(p.doc.content);if(!(!_1(v)||!b||v===b.b))return a({rule:c,state:p,from:v,to:b,pasteEvt:s})}}))}function P1(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class $n{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=$n.resolve(e),this.schema=D1(this.extensions,n),this.setupExtensions()}static resolve(e){const n=$n.sort($n.flatten(e)),r=P1(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=O(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=O(r,"priority")||100,s=O(i,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:ms(n.name,this.schema)},i=O(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=$n.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const u={name:s.name,options:s.options,storage:s.storage,editor:e,type:ms(s.name,this.schema)},a=[],l=O(s,"addKeyboardShortcuts",u);let c={};if(s.type==="mark"&&O(s,"exitable",u)&&(c.ArrowRight=()=>ye.handleExit({editor:e,mark:s})),l){const m=Object.fromEntries(Object.entries(l()).map(([g,y])=>[g,()=>y({editor:e})]));c={...c,...m}}const d=Ym(c);a.push(d);const h=O(s,"addInputRules",u);Al(s,e.options.enableInputRules)&&h&&r.push(...h());const p=O(s,"addPasteRules",u);Al(s,e.options.enablePasteRules)&&p&&i.push(...p());const f=O(s,"addProseMirrorPlugins",u);if(f){const m=f();a.push(...m)}return a}).flat();return[O1({editor:e,rules:r}),...L1({editor:e,rules:i}),...o]}get attributes(){return af(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Bo(this.extensions);return Object.fromEntries(n.filter(r=>!!O(r,"addNodeView")).map(r=>{const i=this.attributes.filter(a=>a.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:pe(r.name,this.schema)},s=O(r,"addNodeView",o);if(!s)return[];const u=(a,l,c,d)=>{const h=iu(a,i);return s()({editor:e,node:a,getPos:c,decorations:d,HTMLAttributes:h,extension:r})};return[r.name,u]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:ms(e.name,this.schema)};e.type==="mark"&&(!((n=$(O(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=O(e,"onBeforeCreate",r),o=O(e,"onCreate",r),s=O(e,"onUpdate",r),u=O(e,"onSelectionUpdate",r),a=O(e,"onTransaction",r),l=O(e,"onFocus",r),c=O(e,"onBlur",r),d=O(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),u&&this.editor.on("selectionUpdate",u),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}}function B1(t){return Object.prototype.toString.call(t).slice(8,-1)}function hi(t){return B1(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function zo(t,e){const n={...t};return hi(t)&&hi(e)&&Object.keys(e).forEach(r=>{hi(e[r])&&hi(t[r])?n[r]=zo(t[r],e[r]):n[r]=e[r]}),n}class se{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=$(O(this,"addOptions",{name:this.name}))),this.storage=$(O(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new se(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>zo(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new se({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=$(O(n,"addOptions",{name:n.name})),n.storage=$(O(n,"addStorage",{name:n.name,options:n.options})),n}}function cf(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`

`,textSerializers:s={}}=n||{};let u="";return t.nodesBetween(r,i,(a,l,c,d)=>{var h;a.isBlock&&l>r&&(u+=o);const p=s==null?void 0:s[a.type.name];if(p)return c&&(u+=p({node:a,pos:l,parent:c,index:d,range:e})),!1;a.isText&&(u+=(h=a==null?void 0:a.text)===null||h===void 0?void 0:h.slice(Math.max(r,l)-l,i-l))}),u}function df(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const ff=se.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ae({key:new we("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(c=>c.$from.pos)),u=Math.max(...o.map(c=>c.$to.pos)),a=df(n);return cf(r,{from:s,to:u},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),z1=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),$1=(t=!1)=>({commands:e})=>e.setContent("",t),H1=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(u,a)=>{if(u.type.isText)return;const{doc:l,mapping:c}=e,d=l.resolve(c.map(a)),h=l.resolve(c.map(a+u.nodeSize)),p=d.blockRange(h);if(!p)return;const f=ir(p);if(u.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,m)}(f||f===0)&&e.lift(p,f)})}),!0},j1=t=>e=>t(e),q1=()=>({state:t,dispatch:e})=>d1(t,e),V1=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new L(r.doc.resolve(s-1))),!0},W1=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const u=i.before(o),a=i.after(o);t.delete(u,a).scrollIntoView()}return!0}return!1},U1=t=>({tr:e,state:n,dispatch:r})=>{const i=pe(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const a=o.before(s),l=o.after(s);e.delete(a,l).scrollIntoView()}return!0}return!1},K1=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},J1=()=>({state:t,dispatch:e})=>Xm(t,e),G1=()=>({commands:t})=>t.keyboardShortcut("Enter"),Z1=()=>({state:t,dispatch:e})=>c1(t,e);function qi(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Wu(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function ou(t,e,n={}){return t.find(r=>r.type===e&&qi(r.attrs,n))}function Q1(t,e,n={}){return!!ou(t,e,n)}function Uu(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=ou([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,u=o+1,a=s+r.node.nodeSize;for(ou([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;u<t.parent.childCount&&Q1([...t.parent.child(u).marks],e,n);)a+=t.parent.child(u).nodeSize,u+=1;return{from:s,to:a}}function Yt(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const Y1=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=Yt(t,r.schema),{doc:s,selection:u}=n,{$from:a,from:l,to:c}=u;if(i){const d=Uu(a,o,e);if(d&&d.from<=l&&d.to>=c){const h=L.create(s,d.from,d.to);n.setSelection(h)}}return!0},X1=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Ku(t){return t instanceof L}function At(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function hf(t,e=null){if(!e)return null;const n=P.atStart(t),r=P.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?L.create(t,At(0,i,o),At(t.content.size,i,o)):L.create(t,At(e,i,o),At(e,i,o))}function $o(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const eg=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{$o()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!Ku(n.state.selection))return s(),!0;const u=hf(i.doc,t)||n.state.selection,a=n.state.selection.eq(u);return o&&(a||i.setSelection(u),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},tg=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),ng=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),pf=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&pf(r)}return t};function pi(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return pf(n)}function Vi(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{return Array.isArray(t)&&t.length>0?E.fromArray(t.map(s=>e.nodeFromJSON(s))):e.nodeFromJSON(t)}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Vi("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,u="";const a=new _u({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:l=>(s=!0,u=typeof l=="string"?l:l.outerHTML,null)}]}})});if(n.slice?Dt.fromSchema(a).parseSlice(pi(t),n.parseOptions):Dt.fromSchema(a).parse(pi(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${u}`)})}const o=Dt.fromSchema(e);return n.slice?o.parseSlice(pi(t),n.parseOptions).content:o.parse(pi(t),n.parseOptions)}return Vi("",e,n)}function rg(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof ce||i instanceof fe))return;const o=t.mapping.maps[r];let s=0;o.forEach((u,a,l,c)=>{s===0&&(s=c)}),t.setSelection(P.near(t.doc.resolve(s),n))}const ig=t=>!("type"in t),og=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let u;try{u=Vi(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(f){return o.emit("contentError",{editor:o,error:f,disableCollaboration:()=>{console.error("[tiptap error]: Unable to disable collaboration at this point in time")}}),!1}let{from:a,to:l}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,d=!0;if((ig(u)?u:[u]).forEach(f=>{f.check(),c=c?f.isText&&f.marks.length===0:!1,d=d?f.isBlock:!1}),a===l&&d){const{parent:f}=r.doc.resolve(a);f.isTextblock&&!f.type.spec.code&&!f.childCount&&(a-=1,l+=1)}let p;c?(Array.isArray(e)?p=e.map(f=>f.text||"").join(""):typeof e=="object"&&e&&e.text?p=e.text:p=e,r.insertText(p,a,l)):(p=u,r.replaceWith(a,l,p)),n.updateSelection&&rg(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:a,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:a,text:p})}return!0},sg=()=>({state:t,dispatch:e})=>s1(t,e),ug=()=>({state:t,dispatch:e})=>u1(t,e),ag=()=>({state:t,dispatch:e})=>e1(t,e),lg=()=>({state:t,dispatch:e})=>i1(t,e),cg=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Oo(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},dg=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Oo(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},fg=()=>({state:t,dispatch:e})=>t1(t,e),hg=()=>({state:t,dispatch:e})=>n1(t,e);function mf(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function pg(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let u=0;u<e.length-1;u+=1){const a=e[u];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))o=!0;else if(/^mod$/i.test(a))$o()||mf()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const mg=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=pg(t).split(/-(?!$)/),s=o.find(l=>!["Alt","Ctrl","Meta","Shift"].includes(l)),u=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{n.someProp("handleKeyDown",l=>l(n,u))});return a==null||a.steps.forEach(l=>{const c=l.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function Ir(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?pe(e,t.schema):null,u=[];t.doc.nodesBetween(r,i,(d,h)=>{if(d.isText)return;const p=Math.max(r,h),f=Math.min(i,h+d.nodeSize);u.push({node:d,from:p,to:f})});const a=i-r,l=u.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>qi(d.node.attrs,n,{strict:!1}));return o?!!l.length:l.reduce((d,h)=>d+h.to-h.from,0)>=a}const gg=(t,e={})=>({state:n,dispatch:r})=>{const i=pe(t,n.schema);return Ir(n,i,e)?a1(n,r):!1},bg=()=>({state:t,dispatch:e})=>f1(t,e),yg=t=>({state:e,dispatch:n})=>{const r=pe(t,e.schema);return k1(r)(e,n)},xg=()=>({state:t,dispatch:e})=>l1(t,e);function Ho(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Dl(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const kg=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const u=Ho(typeof t=="string"?t:t.name,r.schema);return u?(u==="node"&&(o=pe(t,r.schema)),u==="mark"&&(s=Yt(t,r.schema)),i&&n.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(l,c)=>{o&&o===l.type&&n.setNodeMarkup(c,void 0,Dl(l.attrs,e)),s&&l.marks.length&&l.marks.forEach(d=>{s===d.type&&n.addMark(c,c+l.nodeSize,s.create(Dl(d.attrs,e)))})})}),!0):!1},vg=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),Cg=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),wg=()=>({state:t,dispatch:e})=>r1(t,e),Eg=()=>({state:t,dispatch:e})=>o1(t,e),Sg=()=>({state:t,dispatch:e})=>h1(t,e),Ag=()=>({state:t,dispatch:e})=>g1(t,e),Dg=()=>({state:t,dispatch:e})=>m1(t,e);function su(t,e,n={},r={}){return Vi(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const Tg=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:u})=>{var a,l;const{doc:c}=o;if(n.preserveWhitespace!=="full"){const d=su(t,i.schema,n,{errorOnInvalidContent:(a=r.errorOnInvalidContent)!==null&&a!==void 0?a:i.options.enableContentCheck});return s&&o.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),u.insertContentAt({from:0,to:c.content.size},t,{parseOptions:n,errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck})};function jo(t,e){const n=Yt(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,a=>{s.push(...a.marks)});const u=s.find(a=>a.type.name===n.name);return u?{...u.attrs}:{}}function Mg(t,e){const n=new bd(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Og(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function _g(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function Ng(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Ju(t){return e=>Ng(e.$from,t)}function Gu(t,e){const n=wn.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function Ig(t,e){const n={from:0,to:t.content.size};return cf(t,n,e)}function Rg(t,e){const n=pe(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,u=>{o.push(u)});const s=o.reverse().find(u=>u.type.name===n.name);return s?{...s.attrs}:{}}function gf(t,e){const n=Ho(typeof e=="string"?e:e.name,t.schema);return n==="node"?Rg(t,e):n==="mark"?jo(t,e):{}}function Fg(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function Lg(t){const e=Fg(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function Pg(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((u,a)=>{s.push({from:u,to:a})});else{const{from:u,to:a}=n[o];if(u===void 0||a===void 0)return;s.push({from:u,to:a})}s.forEach(({from:u,to:a})=>{const l=e.slice(o).map(u,-1),c=e.slice(o).map(a),d=e.invert().map(l,-1),h=e.invert().map(c);r.push({oldRange:{from:d,to:h},newRange:{from:l,to:c}})})}),Lg(r)}function Zu(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=Uu(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Ai(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function uu(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Yt(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>o?o.name===d.type.name:!0).find(d=>qi(d.attrs,n,{strict:!1}));let s=0;const u=[];if(i.forEach(({$from:d,$to:h})=>{const p=d.pos,f=h.pos;t.doc.nodesBetween(p,f,(m,g)=>{if(!m.isText&&!m.marks.length)return;const y=Math.max(p,g),x=Math.min(f,g+m.nodeSize),v=x-y;s+=v,u.push(...m.marks.map(b=>({mark:b,from:y,to:x})))})}),s===0)return!1;const a=u.filter(d=>o?o.name===d.mark.type.name:!0).filter(d=>qi(d.mark.attrs,n,{strict:!1})).reduce((d,h)=>d+h.to-h.from,0),l=u.filter(d=>o?d.mark.type!==o&&d.mark.type.excludes(o):!0).reduce((d,h)=>d+h.to-h.from,0);return(a>0?a+l:a)>=s}function Bg(t,e,n={}){if(!e)return Ir(t,null,n)||uu(t,null,n);const r=Ho(e,t.schema);return r==="node"?Ir(t,e,n):r==="mark"?uu(t,e,n):!1}function Tl(t,e){const{nodeExtensions:n}=Bo(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=$(O(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Qu(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(Qu(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function bf(t){return t instanceof I}function yf(t,e,n){const i=t.state.doc.content.size,o=At(e,0,i),s=At(n,0,i),u=t.coordsAtPos(o),a=t.coordsAtPos(s,-1),l=Math.min(u.top,a.top),c=Math.max(u.bottom,a.bottom),d=Math.min(u.left,a.left),h=Math.max(u.right,a.right),p=h-d,f=c-l,y={top:l,bottom:c,left:d,right:h,width:p,height:f,x:d,y:l};return{...y,toJSON:()=>y}}function zg(t,e,n){var r;const{selection:i}=e;let o=null;if(Ku(i)&&(o=i.$cursor),o){const u=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(u)||!u.some(a=>a.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:u,$to:a})=>{let l=u.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(u.pos,a.pos,(c,d,h)=>{if(l)return!1;if(c.isInline){const p=!h||h.type.allowsMarkType(n),f=!!n.isInSet(c.marks)||!c.marks.some(m=>m.type.excludes(n));l=p&&f}return!l}),l})}const $g=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:u}=o,a=Yt(t,r.schema);if(i)if(s){const l=jo(r,a);n.addStoredMark(a.create({...l,...e}))}else u.forEach(l=>{const c=l.$from.pos,d=l.$to.pos;r.doc.nodesBetween(c,d,(h,p)=>{const f=Math.max(p,c),m=Math.min(p+h.nodeSize,d);h.marks.find(y=>y.type===a)?h.marks.forEach(y=>{a===y.type&&n.addMark(f,m,a.create({...y.attrs,...e}))}):n.addMark(f,m,a.create(e))})});return zg(r,n,a)},Hg=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),jg=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=pe(t,n.schema);return o.isTextblock?i().command(({commands:s})=>wl(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>wl(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},qg=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=At(t,0,r.content.size),o=I.create(r,i);e.setSelection(o)}return!0},Vg=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=L.atStart(r).from,u=L.atEnd(r).to,a=At(i,s,u),l=At(o,s,u),c=L.create(r,a,l);e.setSelection(c)}return!0},Wg=t=>({state:e,dispatch:n})=>{const r=pe(t,e.schema);return w1(r)(e,n)};function Ml(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const Ug=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:u,$to:a}=o,l=i.extensionManager.attributes,c=Ai(l,u.node().type.name,u.node().attrs);if(o instanceof I&&o.node.isBlock)return!u.parentOffset||!jn(s,u.pos)?!1:(r&&(t&&Ml(n,i.extensionManager.splittableMarks),e.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,h=u.depth===0?void 0:Og(u.node(-1).contentMatchAt(u.indexAfter(-1)));let p=d&&h?[{type:h,attrs:c}]:void 0,f=jn(e.doc,e.mapping.map(u.pos),1,p);if(!p&&!f&&jn(e.doc,e.mapping.map(u.pos),1,h?[{type:h}]:void 0)&&(f=!0,p=h?[{type:h,attrs:c}]:void 0),r){if(f&&(o instanceof L&&e.deleteSelection(),e.split(e.mapping.map(u.pos),1,p),h&&!d&&!u.parentOffset&&u.parent.type!==h)){const m=e.mapping.map(u.before()),g=e.doc.resolve(m);u.node(-1).canReplaceWith(g.index(),g.index()+1,h)&&e.setNodeMarkup(e.mapping.map(u.before()),h)}t&&Ml(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return f},Kg=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const u=pe(t,r.schema),{$from:a,$to:l}=r.selection,c=r.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const d=a.node(-1);if(d.type!==u)return!1;const h=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==u||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){let y=E.empty;const x=a.index(-1)?1:a.index(-2)?2:3;for(let _=a.depth-x;_>=a.depth-3;_-=1)y=E.from(a.node(_).copy(y));const v=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,b={...Ai(h,a.node().type.name,a.node().attrs),...e},w=((s=u.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(b))||void 0;y=y.append(E.from(u.createAndFill(null,w)||void 0));const k=a.before(a.depth-(x-1));n.replace(k,a.after(-v),new T(y,4-x,0));let D=-1;n.doc.nodesBetween(k,n.doc.content.size,(_,S)=>{if(D>-1)return!1;_.isTextblock&&_.content.size===0&&(D=S+1)}),D>-1&&n.setSelection(L.near(n.doc.resolve(D))),n.scrollIntoView()}return!0}const p=l.pos===a.end()?d.contentMatchAt(0).defaultType:null,f={...Ai(h,d.type.name,d.attrs),...e},m={...Ai(h,a.node().type.name,a.node().attrs),...e};n.delete(a.pos,l.pos);const g=p?[{type:u,attrs:f},{type:p,attrs:m}]:[{type:u,attrs:f}];if(!jn(n.doc,a.pos,2))return!1;if(i){const{selection:y,storedMarks:x}=r,{splittableMarks:v}=o.extensionManager,b=x||y.$to.parentOffset&&y.$from.marks();if(n.split(a.pos,2,g).scrollIntoView(),!b||!i)return!0;const w=b.filter(k=>v.includes(k.type.name));n.ensureMarks(w)}return!0},gs=(t,e)=>{const n=Ju(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Zt(t.doc,n.pos)&&t.join(n.pos),!0},bs=(t,e)=>{const n=Ju(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Zt(t.doc,r)&&t.join(r),!0},Jg=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:u,chain:a,commands:l,can:c})=>{const{extensions:d,splittableMarks:h}=i.extensionManager,p=pe(t,s.schema),f=pe(e,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:x}=m,v=y.blockRange(x),b=g||m.$to.parentOffset&&m.$from.marks();if(!v)return!1;const w=Ju(k=>Tl(k.type.name,d))(m);if(v.depth>=1&&w&&v.depth-w.depth<=1){if(w.node.type===p)return l.liftListItem(f);if(Tl(w.node.type.name,d)&&p.validContent(w.node.content)&&u)return a().command(()=>(o.setNodeMarkup(w.pos,p),!0)).command(()=>gs(o,p)).command(()=>bs(o,p)).run()}return!n||!b||!u?a().command(()=>c().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>gs(o,p)).command(()=>bs(o,p)).run():a().command(()=>{const k=c().wrapInList(p,r),D=b.filter(_=>h.includes(_.type.name));return o.ensureMarks(D),k?!0:l.clearNodes()}).wrapInList(p,r).command(()=>gs(o,p)).command(()=>bs(o,p)).run()},Gg=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Yt(t,r.schema);return uu(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},Zg=(t,e,n={})=>({state:r,commands:i})=>{const o=pe(t,r.schema),s=pe(e,r.schema);return Ir(r,o,n)?i.setNode(s):i.setNode(o,n)},Qg=(t,e={})=>({state:n,commands:r})=>{const i=pe(t,n.schema);return Ir(n,i,e)?r.lift(i):r.wrapIn(i,e)},Yg=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,u=o.transform;for(let a=u.steps.length-1;a>=0;a-=1)s.step(u.steps[a].invert(u.docs[a]));if(o.text){const a=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,a))}else s.delete(o.from,o.to)}return!0}}return!1},Xg=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},eb=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:u}=n,a=Yt(t,r.schema),{$from:l,empty:c,ranges:d}=u;if(!i)return!0;if(c&&s){let{from:h,to:p}=u;const f=(o=l.marks().find(g=>g.type===a))===null||o===void 0?void 0:o.attrs,m=Uu(l,a,f);m&&(h=m.from,p=m.to),n.removeMark(h,p,a)}else d.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,a)});return n.removeStoredMark(a),!0},tb=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const u=Ho(typeof t=="string"?t:t.name,r.schema);return u?(u==="node"&&(o=pe(t,r.schema)),u==="mark"&&(s=Yt(t,r.schema)),i&&n.selection.ranges.forEach(a=>{const l=a.$from.pos,c=a.$to.pos;r.doc.nodesBetween(l,c,(d,h)=>{o&&o===d.type&&n.setNodeMarkup(h,void 0,{...d.attrs,...e}),s&&d.marks.length&&d.marks.forEach(p=>{if(s===p.type){const f=Math.max(h,l),m=Math.min(h+d.nodeSize,c);n.addMark(f,m,s.create({...p.attrs,...e}))}})})}),!0):!1},nb=(t,e={})=>({state:n,dispatch:r})=>{const i=pe(t,n.schema);return b1(i,e)(n,r)},rb=(t,e={})=>({state:n,dispatch:r})=>{const i=pe(t,n.schema);return y1(i,e)(n,r)};var ib=Object.freeze({__proto__:null,blur:z1,clearContent:$1,clearNodes:H1,command:j1,createParagraphNear:q1,cut:V1,deleteCurrentNode:W1,deleteNode:U1,deleteRange:K1,deleteSelection:J1,enter:G1,exitCode:Z1,extendMarkRange:Y1,first:X1,focus:eg,forEach:tg,insertContent:ng,insertContentAt:og,joinBackward:ag,joinDown:ug,joinForward:lg,joinItemBackward:cg,joinItemForward:dg,joinTextblockBackward:fg,joinTextblockForward:hg,joinUp:sg,keyboardShortcut:mg,lift:gg,liftEmptyBlock:bg,liftListItem:yg,newlineInCode:xg,resetAttributes:kg,scrollIntoView:vg,selectAll:Cg,selectNodeBackward:wg,selectNodeForward:Eg,selectParentNode:Sg,selectTextblockEnd:Ag,selectTextblockStart:Dg,setContent:Tg,setMark:$g,setMeta:Hg,setNode:jg,setNodeSelection:qg,setTextSelection:Vg,sinkListItem:Wg,splitBlock:Ug,splitListItem:Kg,toggleList:Jg,toggleMark:Gg,toggleNode:Zg,toggleWrap:Qg,undoInputRule:Yg,unsetAllMarks:Xg,unsetMark:eb,updateAttributes:tb,wrapIn:nb,wrapInList:rb});const xf=se.create({name:"commands",addCommands(){return{...ib}}}),kf=se.create({name:"editable",addProseMirrorPlugins(){return[new ae({key:new we("editable"),props:{editable:()=>this.editor.options.editable}})]}}),vf=se.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new ae({key:new we("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Cf=se.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:u})=>{const{selection:a,doc:l}=u,{empty:c,$anchor:d}=a,{pos:h,parent:p}=d,f=d.parent.isTextblock&&h>0?u.doc.resolve(h-1):d,m=f.parent.type.spec.isolating,g=d.pos-d.parentOffset,y=m&&f.parent.childCount===1?g===d.pos:P.atStart(l).from===h;return!c||!p.type.isTextblock||p.textContent.length||!y||y&&d.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return $o()||mf()?o:i},addProseMirrorPlugins(){return[new ae({key:new we("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(f=>f.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:o,to:s}=e.selection,u=P.atStart(e.doc).from,a=P.atEnd(e.doc).to;if(i||!(o===u&&s===a)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const d=n.tr,h=Lo({state:n,transaction:d}),{commands:p}=new Po({editor:this.editor,state:h});if(p.clearNodes(),!!d.steps.length)return d}})]}}),wf=se.create({name:"tabindex",addProseMirrorPlugins(){return[new ae({key:new we("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var ob=Object.freeze({__proto__:null,ClipboardTextSerializer:ff,Commands:xf,Editable:kf,FocusEvents:vf,Keymap:Cf,Tabindex:wf});class un{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new un(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new un(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new un(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=this.pos+r+1,s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;const u=new un(s,this.editor,i,i?n:null);i&&(u.actualDepth=this.depth+1),e.push(new un(s,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let u=0;u<s.length;u+=1){const a=s[u];if(o[a]!==n[a])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(a=>n[a]===s.node.attrs[a])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){const n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}}const sb=`.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.ProseMirror [contenteditable="false"] {
  white-space: normal;
}

.ProseMirror [contenteditable="false"] [contenteditable="true"] {
  white-space: pre-wrap;
}

.ProseMirror pre {
  white-space: pre-wrap;
}

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.ProseMirror-gapcursor {
  display: none;
  pointer-events: none;
  position: absolute;
  margin: 0;
}

.ProseMirror-gapcursor:after {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  width: 20px;
  border-top: 1px solid black;
  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes ProseMirror-cursor-blink {
  to {
    visibility: hidden;
  }
}

.ProseMirror-hideselection *::selection {
  background: transparent;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection * {
  caret-color: transparent;
}

.ProseMirror-focused .ProseMirror-gapcursor {
  display: block;
}

.tippy-box[data-animation=fade][data-state=hidden] {
  opacity: 0
}`;function ub(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}class ab extends E1{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n}},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=ub(sb,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=lf(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[kf,ff.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),xf,vf,Cf,wf]:[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new $n(i,this)}createCommandManager(){this.commandManager=new Po({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=su(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),e=su(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=hf(e,this.options.autofocus);this.view=new qm(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:zn.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var u;return(u=this.capturedTransaction)===null||u===void 0?void 0:u.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return gf(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return Bg(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Gu(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`

`,textSerializers:r={}}=e||{};return Ig(this.state.doc,{blockSeparator:n,textSerializers:{...df(this.schema),...r}})}get isEmpty(){return Qu(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new un(n,this)}get $doc(){return this.$pos(0)}}function Zn(t){return new Ur({find:t.find,handler:({state:e,range:n,match:r})=>{const i=$(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],u=r[0];if(s){const a=u.search(/\S/),l=n.from+u.indexOf(s),c=l+s.length;if(Zu(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>l).length)return null;c<n.to&&o.delete(c,n.to),l>n.from&&o.delete(n.from+a,l);const h=n.from+a+s.length;o.addMark(n.from+a,h,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function Ef(t){return new Ur({find:t.find,handler:({state:e,range:n,match:r})=>{const i=$(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let u=n.to;const a=t.type.create(i);if(r[1]){const l=r[0].lastIndexOf(r[1]);let c=s+l;c>u?c=u:u=c+r[1].length;const d=r[0][r[0].length-1];o.insertText(d,s+r[0].length-1),o.replaceWith(c,u,a)}else if(r[0]){const l=t.type.isInline?s:s-1;o.insert(l,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(u))}o.scrollIntoView()}})}function au(t){return new Ur({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=$(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function re(t){return new Ur({find:t.find,handler:({state:e,range:n,match:r})=>{let i=t.replace,o=n.from;const s=n.to;if(r[1]){const u=r[0].lastIndexOf(r[1]);i+=r[0].slice(u+r[1].length),o+=u;const a=o-s;a>0&&(i=r[0].slice(u-a,u)+i,o=s)}e.tr.insertText(i,o,s)}})}function Rr(t){return new Ur({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=$(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&Iu(a,t.type,o);if(!l)return null;if(s.wrap(a,l),t.keepMarks&&t.editor){const{selection:d,storedMarks:h}=e,{splittableMarks:p}=t.editor.extensionManager,f=h||d.$to.parentOffset&&d.$from.marks();if(f){const m=f.filter(g=>p.includes(g.type.name));s.ensureMarks(m)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,o).run()}const c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&Zt(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&s.join(n.from-1)}})}class ye{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=$(O(this,"addOptions",{name:this.name}))),this.storage=$(O(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ye(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>zo(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new ye(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=$(O(n,"addOptions",{name:n.name})),n.storage=$(O(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(l=>(l==null?void 0:l.type.name)===n.name))return!1;const a=s.find(l=>(l==null?void 0:l.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let G=class lu{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=$(O(this,"addOptions",{name:this.name}))),this.storage=$(O(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new lu(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>zo(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new lu(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=$(O(n,"addOptions",{name:n.name})),n.storage=$(O(n,"addStorage",{name:n.name,options:n.options})),n}};function lb(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class cb{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,i,o,s,u,a;const{view:l}=this.editor,c=e.target,d=c.nodeType===3?(n=c.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(c)||!d)return;let h=0,p=0;if(this.dom!==d){const g=this.dom.getBoundingClientRect(),y=d.getBoundingClientRect(),x=(i=e.offsetX)!==null&&i!==void 0?i:(o=e.nativeEvent)===null||o===void 0?void 0:o.offsetX,v=(s=e.offsetY)!==null&&s!==void 0?s:(u=e.nativeEvent)===null||u===void 0?void 0:u.offsetY;h=y.x-g.x+x,p=y.y-g.y+v}(a=e.dataTransfer)===null||a===void 0||a.setDragImage(this.dom,h,p);const f=I.create(l.state.doc,this.getPos()),m=l.state.tr.setSelection(f);l.dispatch(m)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const o=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!o)return!0;const{isEditable:a}=this.editor,{isDragging:l}=this,c=!!this.node.type.spec.draggable,d=I.isSelectable(this.node),h=e.type==="copy",p=e.type==="paste",f=e.type==="cut",m=e.type==="mousedown";if(!c&&d&&o&&e.preventDefault(),c&&o&&!l)return e.preventDefault(),!1;if(c&&a&&!l&&m){const g=r.closest("[data-drag-handle]");g&&(this.dom===g||this.dom.contains(g))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(l||s||h||p||f||m&&d)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&($o()||lb())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0})}deleteNode(){const e=this.getPos(),n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function vn(t){return new N1({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=$(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,u=r[r.length-1],a=r[0];let l=n.to;if(u){const c=a.search(/\S/),d=n.from+a.indexOf(u),h=d+u.length;if(Zu(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(g=>g===t.type&&g!==f.mark.type)).filter(f=>f.to>d).length)return null;h<n.to&&s.delete(h,n.to),d>n.from&&s.delete(n.from+c,d),l=n.from+c+u.length,s.addMark(n.from+c,l,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function db(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var Ie="top",Ke="bottom",Je="right",Re="left",Yu="auto",Kr=[Ie,Ke,Je,Re],Qn="start",Fr="end",fb="clippingParents",Sf="viewport",fr="popper",hb="reference",Ol=Kr.reduce(function(t,e){return t.concat([e+"-"+Qn,e+"-"+Fr])},[]),Af=[].concat(Kr,[Yu]).reduce(function(t,e){return t.concat([e,e+"-"+Qn,e+"-"+Fr])},[]),pb="beforeRead",mb="read",gb="afterRead",bb="beforeMain",yb="main",xb="afterMain",kb="beforeWrite",vb="write",Cb="afterWrite",wb=[pb,mb,gb,bb,yb,xb,kb,vb,Cb];function pt(t){return t?(t.nodeName||"").toLowerCase():null}function ze(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Cn(t){var e=ze(t).Element;return t instanceof e||t instanceof Element}function Ue(t){var e=ze(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Xu(t){if(typeof ShadowRoot>"u")return!1;var e=ze(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Eb(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!Ue(o)||!pt(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var u=i[s];u===!1?o.removeAttribute(s):o.setAttribute(s,u===!0?"":u)}))})}function Sb(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),u=s.reduce(function(a,l){return a[l]="",a},{});!Ue(i)||!pt(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(a){i.removeAttribute(a)}))})}}const Df={name:"applyStyles",enabled:!0,phase:"write",fn:Eb,effect:Sb,requires:["computeStyles"]};function dt(t){return t.split("-")[0]}var gn=Math.max,Wi=Math.min,Yn=Math.round;function cu(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Tf(){return!/^((?!chrome|android).)*safari/i.test(cu())}function Xn(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Ue(t)&&(i=t.offsetWidth>0&&Yn(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Yn(r.height)/t.offsetHeight||1);var s=Cn(t)?ze(t):window,u=s.visualViewport,a=!Tf()&&n,l=(r.left+(a&&u?u.offsetLeft:0))/i,c=(r.top+(a&&u?u.offsetTop:0))/o,d=r.width/i,h=r.height/o;return{width:d,height:h,top:c,right:l+d,bottom:c+h,left:l,x:l,y:c}}function ea(t){var e=Xn(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Mf(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Xu(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Mt(t){return ze(t).getComputedStyle(t)}function Ab(t){return["table","td","th"].indexOf(pt(t))>=0}function Xt(t){return((Cn(t)?t.ownerDocument:t.document)||window.document).documentElement}function qo(t){return pt(t)==="html"?t:t.assignedSlot||t.parentNode||(Xu(t)?t.host:null)||Xt(t)}function _l(t){return!Ue(t)||Mt(t).position==="fixed"?null:t.offsetParent}function Db(t){var e=/firefox/i.test(cu()),n=/Trident/i.test(cu());if(n&&Ue(t)){var r=Mt(t);if(r.position==="fixed")return null}var i=qo(t);for(Xu(i)&&(i=i.host);Ue(i)&&["html","body"].indexOf(pt(i))<0;){var o=Mt(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Jr(t){for(var e=ze(t),n=_l(t);n&&Ab(n)&&Mt(n).position==="static";)n=_l(n);return n&&(pt(n)==="html"||pt(n)==="body"&&Mt(n).position==="static")?e:n||Db(t)||e}function ta(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function vr(t,e,n){return gn(t,Wi(e,n))}function Tb(t,e,n){var r=vr(t,e,n);return r>n?n:r}function Of(){return{top:0,right:0,bottom:0,left:0}}function _f(t){return Object.assign({},Of(),t)}function Nf(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Mb=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,_f(typeof e!="number"?e:Nf(e,Kr))};function Ob(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,u=dt(n.placement),a=ta(u),l=[Re,Je].indexOf(u)>=0,c=l?"height":"width";if(!(!o||!s)){var d=Mb(i.padding,n),h=ea(o),p=a==="y"?Ie:Re,f=a==="y"?Ke:Je,m=n.rects.reference[c]+n.rects.reference[a]-s[a]-n.rects.popper[c],g=s[a]-n.rects.reference[a],y=Jr(o),x=y?a==="y"?y.clientHeight||0:y.clientWidth||0:0,v=m/2-g/2,b=d[p],w=x-h[c]-d[f],k=x/2-h[c]/2+v,D=vr(b,k,w),_=a;n.modifiersData[r]=(e={},e[_]=D,e.centerOffset=D-k,e)}}function _b(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Mf(e.elements.popper,i)&&(e.elements.arrow=i))}const Nb={name:"arrow",enabled:!0,phase:"main",fn:Ob,effect:_b,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function er(t){return t.split("-")[1]}var Ib={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Rb(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Yn(n*i)/i||0,y:Yn(r*i)/i||0}}function Nl(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,u=t.position,a=t.gpuAcceleration,l=t.adaptive,c=t.roundOffsets,d=t.isFixed,h=s.x,p=h===void 0?0:h,f=s.y,m=f===void 0?0:f,g=typeof c=="function"?c({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var y=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),v=Re,b=Ie,w=window;if(l){var k=Jr(n),D="clientHeight",_="clientWidth";if(k===ze(n)&&(k=Xt(n),Mt(k).position!=="static"&&u==="absolute"&&(D="scrollHeight",_="scrollWidth")),k=k,i===Ie||(i===Re||i===Je)&&o===Fr){b=Ke;var S=d&&k===w&&w.visualViewport?w.visualViewport.height:k[D];m-=S-r.height,m*=a?1:-1}if(i===Re||(i===Ie||i===Ke)&&o===Fr){v=Je;var R=d&&k===w&&w.visualViewport?w.visualViewport.width:k[_];p-=R-r.width,p*=a?1:-1}}var H=Object.assign({position:u},l&&Ib),q=c===!0?Rb({x:p,y:m},ze(n)):{x:p,y:m};if(p=q.x,m=q.y,a){var V;return Object.assign({},H,(V={},V[b]=x?"0":"",V[v]=y?"0":"",V.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",V))}return Object.assign({},H,(e={},e[b]=x?m+"px":"",e[v]=y?p+"px":"",e.transform="",e))}function Fb(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,u=n.roundOffsets,a=u===void 0?!0:u,l={placement:dt(e.placement),variation:er(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Nl(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Nl(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Lb={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Fb,data:{}};var mi={passive:!0};function Pb(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,u=s===void 0?!0:s,a=ze(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&l.forEach(function(c){c.addEventListener("scroll",n.update,mi)}),u&&a.addEventListener("resize",n.update,mi),function(){o&&l.forEach(function(c){c.removeEventListener("scroll",n.update,mi)}),u&&a.removeEventListener("resize",n.update,mi)}}const Bb={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Pb,data:{}};var zb={left:"right",right:"left",bottom:"top",top:"bottom"};function Di(t){return t.replace(/left|right|bottom|top/g,function(e){return zb[e]})}var $b={start:"end",end:"start"};function Il(t){return t.replace(/start|end/g,function(e){return $b[e]})}function na(t){var e=ze(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function ra(t){return Xn(Xt(t)).left+na(t).scrollLeft}function Hb(t,e){var n=ze(t),r=Xt(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,u=0,a=0;if(i){o=i.width,s=i.height;var l=Tf();(l||!l&&e==="fixed")&&(u=i.offsetLeft,a=i.offsetTop)}return{width:o,height:s,x:u+ra(t),y:a}}function jb(t){var e,n=Xt(t),r=na(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=gn(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=gn(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+ra(t),a=-r.scrollTop;return Mt(i||n).direction==="rtl"&&(u+=gn(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:u,y:a}}function ia(t){var e=Mt(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function If(t){return["html","body","#document"].indexOf(pt(t))>=0?t.ownerDocument.body:Ue(t)&&ia(t)?t:If(qo(t))}function Cr(t,e){var n;e===void 0&&(e=[]);var r=If(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=ze(r),s=i?[o].concat(o.visualViewport||[],ia(r)?r:[]):r,u=e.concat(s);return i?u:u.concat(Cr(qo(s)))}function du(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function qb(t,e){var n=Xn(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Rl(t,e,n){return e===Sf?du(Hb(t,n)):Cn(e)?qb(e,n):du(jb(Xt(t)))}function Vb(t){var e=Cr(qo(t)),n=["absolute","fixed"].indexOf(Mt(t).position)>=0,r=n&&Ue(t)?Jr(t):t;return Cn(r)?e.filter(function(i){return Cn(i)&&Mf(i,r)&&pt(i)!=="body"}):[]}function Wb(t,e,n,r){var i=e==="clippingParents"?Vb(t):[].concat(e),o=[].concat(i,[n]),s=o[0],u=o.reduce(function(a,l){var c=Rl(t,l,r);return a.top=gn(c.top,a.top),a.right=Wi(c.right,a.right),a.bottom=Wi(c.bottom,a.bottom),a.left=gn(c.left,a.left),a},Rl(t,s,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function Rf(t){var e=t.reference,n=t.element,r=t.placement,i=r?dt(r):null,o=r?er(r):null,s=e.x+e.width/2-n.width/2,u=e.y+e.height/2-n.height/2,a;switch(i){case Ie:a={x:s,y:e.y-n.height};break;case Ke:a={x:s,y:e.y+e.height};break;case Je:a={x:e.x+e.width,y:u};break;case Re:a={x:e.x-n.width,y:u};break;default:a={x:e.x,y:e.y}}var l=i?ta(i):null;if(l!=null){var c=l==="y"?"height":"width";switch(o){case Qn:a[l]=a[l]-(e[c]/2-n[c]/2);break;case Fr:a[l]=a[l]+(e[c]/2-n[c]/2);break}}return a}function Lr(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,u=n.boundary,a=u===void 0?fb:u,l=n.rootBoundary,c=l===void 0?Sf:l,d=n.elementContext,h=d===void 0?fr:d,p=n.altBoundary,f=p===void 0?!1:p,m=n.padding,g=m===void 0?0:m,y=_f(typeof g!="number"?g:Nf(g,Kr)),x=h===fr?hb:fr,v=t.rects.popper,b=t.elements[f?x:h],w=Wb(Cn(b)?b:b.contextElement||Xt(t.elements.popper),a,c,s),k=Xn(t.elements.reference),D=Rf({reference:k,element:v,strategy:"absolute",placement:i}),_=du(Object.assign({},v,D)),S=h===fr?_:k,R={top:w.top-S.top+y.top,bottom:S.bottom-w.bottom+y.bottom,left:w.left-S.left+y.left,right:S.right-w.right+y.right},H=t.modifiersData.offset;if(h===fr&&H){var q=H[i];Object.keys(R).forEach(function(V){var ee=[Je,Ke].indexOf(V)>=0?1:-1,W=[Ie,Ke].indexOf(V)>=0?"y":"x";R[V]+=q[W]*ee})}return R}function Ub(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,u=n.flipVariations,a=n.allowedAutoPlacements,l=a===void 0?Af:a,c=er(r),d=c?u?Ol:Ol.filter(function(f){return er(f)===c}):Kr,h=d.filter(function(f){return l.indexOf(f)>=0});h.length===0&&(h=d);var p=h.reduce(function(f,m){return f[m]=Lr(t,{placement:m,boundary:i,rootBoundary:o,padding:s})[dt(m)],f},{});return Object.keys(p).sort(function(f,m){return p[f]-p[m]})}function Kb(t){if(dt(t)===Yu)return[];var e=Di(t);return[Il(t),e,Il(e)]}function Jb(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,u=s===void 0?!0:s,a=n.fallbackPlacements,l=n.padding,c=n.boundary,d=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,f=p===void 0?!0:p,m=n.allowedAutoPlacements,g=e.options.placement,y=dt(g),x=y===g,v=a||(x||!f?[Di(g)]:Kb(g)),b=[g].concat(v).reduce(function(xt,Ge){return xt.concat(dt(Ge)===Yu?Ub(e,{placement:Ge,boundary:c,rootBoundary:d,padding:l,flipVariations:f,allowedAutoPlacements:m}):Ge)},[]),w=e.rects.reference,k=e.rects.popper,D=new Map,_=!0,S=b[0],R=0;R<b.length;R++){var H=b[R],q=dt(H),V=er(H)===Qn,ee=[Ie,Ke].indexOf(q)>=0,W=ee?"width":"height",Z=Lr(e,{placement:H,boundary:c,rootBoundary:d,altBoundary:h,padding:l}),Q=ee?V?Je:Re:V?Ke:Ie;w[W]>k[W]&&(Q=Di(Q));var U=Di(Q),Pe=[];if(o&&Pe.push(Z[q]<=0),u&&Pe.push(Z[Q]<=0,Z[U]<=0),Pe.every(function(xt){return xt})){S=H,_=!1;break}D.set(H,Pe)}if(_)for(var xe=f?3:1,yt=function(Ge){var kt=b.find(function(Sn){var vt=D.get(Sn);if(vt)return vt.slice(0,Ge).every(function(An){return An})});if(kt)return S=kt,"break"},Me=xe;Me>0;Me--){var en=yt(Me);if(en==="break")break}e.placement!==S&&(e.modifiersData[r]._skip=!0,e.placement=S,e.reset=!0)}}const Gb={name:"flip",enabled:!0,phase:"main",fn:Jb,requiresIfExists:["offset"],data:{_skip:!1}};function Fl(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Ll(t){return[Ie,Je,Ke,Re].some(function(e){return t[e]>=0})}function Zb(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=Lr(e,{elementContext:"reference"}),u=Lr(e,{altBoundary:!0}),a=Fl(s,r),l=Fl(u,i,o),c=Ll(a),d=Ll(l);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const Qb={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Zb};function Yb(t,e,n){var r=dt(t),i=[Re,Ie].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],u=o[1];return s=s||0,u=(u||0)*i,[Re,Je].indexOf(r)>=0?{x:u,y:s}:{x:s,y:u}}function Xb(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Af.reduce(function(c,d){return c[d]=Yb(d,e.rects,o),c},{}),u=s[e.placement],a=u.x,l=u.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=l),e.modifiersData[r]=s}const e2={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Xb};function t2(t){var e=t.state,n=t.name;e.modifiersData[n]=Rf({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const n2={name:"popperOffsets",enabled:!0,phase:"read",fn:t2,data:{}};function r2(t){return t==="x"?"y":"x"}function i2(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,u=s===void 0?!1:s,a=n.boundary,l=n.rootBoundary,c=n.altBoundary,d=n.padding,h=n.tether,p=h===void 0?!0:h,f=n.tetherOffset,m=f===void 0?0:f,g=Lr(e,{boundary:a,rootBoundary:l,padding:d,altBoundary:c}),y=dt(e.placement),x=er(e.placement),v=!x,b=ta(y),w=r2(b),k=e.modifiersData.popperOffsets,D=e.rects.reference,_=e.rects.popper,S=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,R=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),H=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,q={x:0,y:0};if(k){if(o){var V,ee=b==="y"?Ie:Re,W=b==="y"?Ke:Je,Z=b==="y"?"height":"width",Q=k[b],U=Q+g[ee],Pe=Q-g[W],xe=p?-_[Z]/2:0,yt=x===Qn?D[Z]:_[Z],Me=x===Qn?-_[Z]:-D[Z],en=e.elements.arrow,xt=p&&en?ea(en):{width:0,height:0},Ge=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Of(),kt=Ge[ee],Sn=Ge[W],vt=vr(0,D[Z],xt[Z]),An=v?D[Z]/2-xe-vt-kt-R.mainAxis:yt-vt-kt-R.mainAxis,Ot=v?-D[Z]/2+xe+vt+Sn+R.mainAxis:Me+vt+Sn+R.mainAxis,Dn=e.elements.arrow&&Jr(e.elements.arrow),Yr=Dn?b==="y"?Dn.clientTop||0:Dn.clientLeft||0:0,sr=(V=H==null?void 0:H[b])!=null?V:0,Xr=Q+An-sr-Yr,ei=Q+Ot-sr,ur=vr(p?Wi(U,Xr):U,Q,p?gn(Pe,ei):Pe);k[b]=ur,q[b]=ur-Q}if(u){var ar,ti=b==="x"?Ie:Re,ni=b==="x"?Ke:Je,Ct=k[w],_t=w==="y"?"height":"width",lr=Ct+g[ti],tn=Ct-g[ni],cr=[Ie,Re].indexOf(y)!==-1,ri=(ar=H==null?void 0:H[w])!=null?ar:0,ii=cr?lr:Ct-D[_t]-_[_t]-ri+R.altAxis,oi=cr?Ct+D[_t]+_[_t]-ri-R.altAxis:tn,si=p&&cr?Tb(ii,Ct,oi):vr(p?ii:lr,Ct,p?oi:tn);k[w]=si,q[w]=si-Ct}e.modifiersData[r]=q}}const o2={name:"preventOverflow",enabled:!0,phase:"main",fn:i2,requiresIfExists:["offset"]};function s2(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function u2(t){return t===ze(t)||!Ue(t)?na(t):s2(t)}function a2(t){var e=t.getBoundingClientRect(),n=Yn(e.width)/t.offsetWidth||1,r=Yn(e.height)/t.offsetHeight||1;return n!==1||r!==1}function l2(t,e,n){n===void 0&&(n=!1);var r=Ue(e),i=Ue(e)&&a2(e),o=Xt(e),s=Xn(t,i,n),u={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!n)&&((pt(e)!=="body"||ia(o))&&(u=u2(e)),Ue(e)?(a=Xn(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):o&&(a.x=ra(o))),{x:s.left+u.scrollLeft-a.x,y:s.top+u.scrollTop-a.y,width:s.width,height:s.height}}function c2(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(u){if(!n.has(u)){var a=e.get(u);a&&i(a)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function d2(t){var e=c2(t);return wb.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function f2(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function h2(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Pl={placement:"bottom",modifiers:[],strategy:"absolute"};function Bl(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function p2(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?Pl:i;return function(u,a,l){l===void 0&&(l=o);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Pl,o),modifiersData:{},elements:{reference:u,popper:a},attributes:{},styles:{}},d=[],h=!1,p={state:c,setOptions:function(y){var x=typeof y=="function"?y(c.options):y;m(),c.options=Object.assign({},o,c.options,x),c.scrollParents={reference:Cn(u)?Cr(u):u.contextElement?Cr(u.contextElement):[],popper:Cr(a)};var v=d2(h2([].concat(r,c.options.modifiers)));return c.orderedModifiers=v.filter(function(b){return b.enabled}),f(),p.update()},forceUpdate:function(){if(!h){var y=c.elements,x=y.reference,v=y.popper;if(Bl(x,v)){c.rects={reference:l2(x,Jr(v),c.options.strategy==="fixed"),popper:ea(v)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(R){return c.modifiersData[R.name]=Object.assign({},R.data)});for(var b=0;b<c.orderedModifiers.length;b++){if(c.reset===!0){c.reset=!1,b=-1;continue}var w=c.orderedModifiers[b],k=w.fn,D=w.options,_=D===void 0?{}:D,S=w.name;typeof k=="function"&&(c=k({state:c,options:_,name:S,instance:p})||c)}}}},update:f2(function(){return new Promise(function(g){p.forceUpdate(),g(c)})}),destroy:function(){m(),h=!0}};if(!Bl(u,a))return p;p.setOptions(l).then(function(g){!h&&l.onFirstUpdate&&l.onFirstUpdate(g)});function f(){c.orderedModifiers.forEach(function(g){var y=g.name,x=g.options,v=x===void 0?{}:x,b=g.effect;if(typeof b=="function"){var w=b({state:c,name:y,instance:p,options:v}),k=function(){};d.push(w||k)}})}function m(){d.forEach(function(g){return g()}),d=[]}return p}}var m2=[Bb,n2,Lb,Df,e2,Gb,o2,Nb,Qb],g2=p2({defaultModifiers:m2}),b2="tippy-box",Ff="tippy-content",y2="tippy-backdrop",Lf="tippy-arrow",Pf="tippy-svg-arrow",rn={passive:!0,capture:!0},Bf=function(){return document.body};function ys(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function oa(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function zf(t,e){return typeof t=="function"?t.apply(void 0,e):t}function zl(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function x2(t){return t.split(/\s+/).filter(Boolean)}function Pn(t){return[].concat(t)}function $l(t,e){t.indexOf(e)===-1&&t.push(e)}function k2(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function v2(t){return t.split("-")[0]}function Ui(t){return[].slice.call(t)}function Hl(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function wr(){return document.createElement("div")}function Vo(t){return["Element","Fragment"].some(function(e){return oa(t,e)})}function C2(t){return oa(t,"NodeList")}function w2(t){return oa(t,"MouseEvent")}function E2(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function S2(t){return Vo(t)?[t]:C2(t)?Ui(t):Array.isArray(t)?t:Ui(document.querySelectorAll(t))}function xs(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function jl(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function A2(t){var e,n=Pn(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function D2(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,u=i.props,a=u.interactiveBorder,l=v2(s.placement),c=s.modifiersData.offset;if(!c)return!0;var d=l==="bottom"?c.top.y:0,h=l==="top"?c.bottom.y:0,p=l==="right"?c.left.x:0,f=l==="left"?c.right.x:0,m=o.top-r+d>a,g=r-o.bottom-h>a,y=o.left-n+p>a,x=n-o.right-f>a;return m||g||y||x})}function ks(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function ql(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var st={isTouch:!1},Vl=0;function T2(){st.isTouch||(st.isTouch=!0,window.performance&&document.addEventListener("mousemove",$f))}function $f(){var t=performance.now();t-Vl<20&&(st.isTouch=!1,document.removeEventListener("mousemove",$f)),Vl=t}function M2(){var t=document.activeElement;if(E2(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function O2(){document.addEventListener("touchstart",T2,rn),window.addEventListener("blur",M2)}var _2=typeof window<"u"&&typeof document<"u",N2=_2?!!window.msCrypto:!1,I2={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},R2={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ye=Object.assign({appendTo:Bf,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},I2,R2),F2=Object.keys(Ye),L2=function(e){var n=Object.keys(e);n.forEach(function(r){Ye[r]=e[r]})};function Hf(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var u;r[o]=t[o]!==void 0?t[o]:(u=Ye[o])!=null?u:s}return r},{});return Object.assign({},t,n)}function P2(t,e){var n=e?Object.keys(Hf(Object.assign({},Ye,{plugins:e}))):F2,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function Wl(t,e){var n=Object.assign({},e,{content:zf(e.content,[t])},e.ignoreAttributes?{}:P2(t,e.plugins));return n.aria=Object.assign({},Ye.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var B2=function(){return"innerHTML"};function fu(t,e){t[B2()]=e}function Ul(t){var e=wr();return t===!0?e.className=Lf:(e.className=Pf,Vo(t)?e.appendChild(t):fu(e,t)),e}function Kl(t,e){Vo(e.content)?(fu(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?fu(t,e.content):t.textContent=e.content)}function hu(t){var e=t.firstElementChild,n=Ui(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Ff)}),arrow:n.find(function(r){return r.classList.contains(Lf)||r.classList.contains(Pf)}),backdrop:n.find(function(r){return r.classList.contains(y2)})}}function jf(t){var e=wr(),n=wr();n.className=b2,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=wr();r.className=Ff,r.setAttribute("data-state","hidden"),Kl(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var u=hu(e),a=u.box,l=u.content,c=u.arrow;s.theme?a.setAttribute("data-theme",s.theme):a.removeAttribute("data-theme"),typeof s.animation=="string"?a.setAttribute("data-animation",s.animation):a.removeAttribute("data-animation"),s.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?a.setAttribute("role",s.role):a.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&Kl(l,t.props),s.arrow?c?o.arrow!==s.arrow&&(a.removeChild(c),a.appendChild(Ul(s.arrow))):a.appendChild(Ul(s.arrow)):c&&a.removeChild(c)}return{popper:e,onUpdate:i}}jf.$$tippy=!0;var z2=1,gi=[],vs=[];function $2(t,e){var n=Wl(t,Object.assign({},Ye,Hf(Hl(e)))),r,i,o,s=!1,u=!1,a=!1,l=!1,c,d,h,p=[],f=zl(Xr,n.interactiveDebounce),m,g=z2++,y=null,x=k2(n.plugins),v={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:g,reference:t,popper:wr(),popperInstance:y,props:n,state:v,plugins:x,clearDelayTimeouts:ii,setProps:oi,setContent:si,show:Uh,hide:Kh,hideWithInteractivity:Jh,enable:cr,disable:ri,unmount:Gh,destroy:Zh};if(!n.render)return b;var w=n.render(b),k=w.popper,D=w.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+b.id,b.popper=k,t._tippy=b,k._tippy=b;var _=x.map(function(C){return C.fn(b)}),S=t.hasAttribute("aria-expanded");return Dn(),xe(),Q(),U("onCreate",[b]),n.showOnCreate&&lr(),k.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&ee().addEventListener("mousemove",f)}),b;function R(){var C=b.props.touch;return Array.isArray(C)?C:[C,0]}function H(){return R()[0]==="hold"}function q(){var C;return!!((C=b.props.render)!=null&&C.$$tippy)}function V(){return m||t}function ee(){var C=V().parentNode;return C?A2(C):document}function W(){return hu(k)}function Z(C){return b.state.isMounted&&!b.state.isVisible||st.isTouch||c&&c.type==="focus"?0:ys(b.props.delay,C?0:1,Ye.delay)}function Q(C){C===void 0&&(C=!1),k.style.pointerEvents=b.props.interactive&&!C?"":"none",k.style.zIndex=""+b.props.zIndex}function U(C,N,F){if(F===void 0&&(F=!0),_.forEach(function(j){j[C]&&j[C].apply(j,N)}),F){var J;(J=b.props)[C].apply(J,N)}}function Pe(){var C=b.props.aria;if(C.content){var N="aria-"+C.content,F=k.id,J=Pn(b.props.triggerTarget||t);J.forEach(function(j){var Ee=j.getAttribute(N);if(b.state.isVisible)j.setAttribute(N,Ee?Ee+" "+F:F);else{var He=Ee&&Ee.replace(F,"").trim();He?j.setAttribute(N,He):j.removeAttribute(N)}})}}function xe(){if(!(S||!b.props.aria.expanded)){var C=Pn(b.props.triggerTarget||t);C.forEach(function(N){b.props.interactive?N.setAttribute("aria-expanded",b.state.isVisible&&N===V()?"true":"false"):N.removeAttribute("aria-expanded")})}}function yt(){ee().removeEventListener("mousemove",f),gi=gi.filter(function(C){return C!==f})}function Me(C){if(!(st.isTouch&&(a||C.type==="mousedown"))){var N=C.composedPath&&C.composedPath()[0]||C.target;if(!(b.props.interactive&&ql(k,N))){if(Pn(b.props.triggerTarget||t).some(function(F){return ql(F,N)})){if(st.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else U("onClickOutside",[b,C]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),u=!0,setTimeout(function(){u=!1}),b.state.isMounted||kt())}}}function en(){a=!0}function xt(){a=!1}function Ge(){var C=ee();C.addEventListener("mousedown",Me,!0),C.addEventListener("touchend",Me,rn),C.addEventListener("touchstart",xt,rn),C.addEventListener("touchmove",en,rn)}function kt(){var C=ee();C.removeEventListener("mousedown",Me,!0),C.removeEventListener("touchend",Me,rn),C.removeEventListener("touchstart",xt,rn),C.removeEventListener("touchmove",en,rn)}function Sn(C,N){An(C,function(){!b.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&N()})}function vt(C,N){An(C,N)}function An(C,N){var F=W().box;function J(j){j.target===F&&(ks(F,"remove",J),N())}if(C===0)return N();ks(F,"remove",d),ks(F,"add",J),d=J}function Ot(C,N,F){F===void 0&&(F=!1);var J=Pn(b.props.triggerTarget||t);J.forEach(function(j){j.addEventListener(C,N,F),p.push({node:j,eventType:C,handler:N,options:F})})}function Dn(){H()&&(Ot("touchstart",sr,{passive:!0}),Ot("touchend",ei,{passive:!0})),x2(b.props.trigger).forEach(function(C){if(C!=="manual")switch(Ot(C,sr),C){case"mouseenter":Ot("mouseleave",ei);break;case"focus":Ot(N2?"focusout":"blur",ur);break;case"focusin":Ot("focusout",ur);break}})}function Yr(){p.forEach(function(C){var N=C.node,F=C.eventType,J=C.handler,j=C.options;N.removeEventListener(F,J,j)}),p=[]}function sr(C){var N,F=!1;if(!(!b.state.isEnabled||ar(C)||u)){var J=((N=c)==null?void 0:N.type)==="focus";c=C,m=C.currentTarget,xe(),!b.state.isVisible&&w2(C)&&gi.forEach(function(j){return j(C)}),C.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?F=!0:lr(C),C.type==="click"&&(s=!F),F&&!J&&tn(C)}}function Xr(C){var N=C.target,F=V().contains(N)||k.contains(N);if(!(C.type==="mousemove"&&F)){var J=_t().concat(k).map(function(j){var Ee,He=j._tippy,Tn=(Ee=He.popperInstance)==null?void 0:Ee.state;return Tn?{popperRect:j.getBoundingClientRect(),popperState:Tn,props:n}:null}).filter(Boolean);D2(J,C)&&(yt(),tn(C))}}function ei(C){var N=ar(C)||b.props.trigger.indexOf("click")>=0&&s;if(!N){if(b.props.interactive){b.hideWithInteractivity(C);return}tn(C)}}function ur(C){b.props.trigger.indexOf("focusin")<0&&C.target!==V()||b.props.interactive&&C.relatedTarget&&k.contains(C.relatedTarget)||tn(C)}function ar(C){return st.isTouch?H()!==C.type.indexOf("touch")>=0:!1}function ti(){ni();var C=b.props,N=C.popperOptions,F=C.placement,J=C.offset,j=C.getReferenceClientRect,Ee=C.moveTransition,He=q()?hu(k).arrow:null,Tn=j?{getBoundingClientRect:j,contextElement:j.contextElement||V()}:t,Ea={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(ui){var Mn=ui.state;if(q()){var Qh=W(),Xo=Qh.box;["placement","reference-hidden","escaped"].forEach(function(ai){ai==="placement"?Xo.setAttribute("data-placement",Mn.placement):Mn.attributes.popper["data-popper-"+ai]?Xo.setAttribute("data-"+ai,""):Xo.removeAttribute("data-"+ai)}),Mn.attributes.popper={}}}},nn=[{name:"offset",options:{offset:J}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ee}},Ea];q()&&He&&nn.push({name:"arrow",options:{element:He,padding:3}}),nn.push.apply(nn,(N==null?void 0:N.modifiers)||[]),b.popperInstance=g2(Tn,k,Object.assign({},N,{placement:F,onFirstUpdate:h,modifiers:nn}))}function ni(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Ct(){var C=b.props.appendTo,N,F=V();b.props.interactive&&C===Bf||C==="parent"?N=F.parentNode:N=zf(C,[F]),N.contains(k)||N.appendChild(k),b.state.isMounted=!0,ti()}function _t(){return Ui(k.querySelectorAll("[data-tippy-root]"))}function lr(C){b.clearDelayTimeouts(),C&&U("onTrigger",[b,C]),Ge();var N=Z(!0),F=R(),J=F[0],j=F[1];st.isTouch&&J==="hold"&&j&&(N=j),N?r=setTimeout(function(){b.show()},N):b.show()}function tn(C){if(b.clearDelayTimeouts(),U("onUntrigger",[b,C]),!b.state.isVisible){kt();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(C.type)>=0&&s)){var N=Z(!1);N?i=setTimeout(function(){b.state.isVisible&&b.hide()},N):o=requestAnimationFrame(function(){b.hide()})}}function cr(){b.state.isEnabled=!0}function ri(){b.hide(),b.state.isEnabled=!1}function ii(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function oi(C){if(!b.state.isDestroyed){U("onBeforeUpdate",[b,C]),Yr();var N=b.props,F=Wl(t,Object.assign({},N,Hl(C),{ignoreAttributes:!0}));b.props=F,Dn(),N.interactiveDebounce!==F.interactiveDebounce&&(yt(),f=zl(Xr,F.interactiveDebounce)),N.triggerTarget&&!F.triggerTarget?Pn(N.triggerTarget).forEach(function(J){J.removeAttribute("aria-expanded")}):F.triggerTarget&&t.removeAttribute("aria-expanded"),xe(),Q(),D&&D(N,F),b.popperInstance&&(ti(),_t().forEach(function(J){requestAnimationFrame(J._tippy.popperInstance.forceUpdate)})),U("onAfterUpdate",[b,C])}}function si(C){b.setProps({content:C})}function Uh(){var C=b.state.isVisible,N=b.state.isDestroyed,F=!b.state.isEnabled,J=st.isTouch&&!b.props.touch,j=ys(b.props.duration,0,Ye.duration);if(!(C||N||F||J)&&!V().hasAttribute("disabled")&&(U("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,q()&&(k.style.visibility="visible"),Q(),Ge(),b.state.isMounted||(k.style.transition="none"),q()){var Ee=W(),He=Ee.box,Tn=Ee.content;xs([He,Tn],0)}h=function(){var nn;if(!(!b.state.isVisible||l)){if(l=!0,k.offsetHeight,k.style.transition=b.props.moveTransition,q()&&b.props.animation){var Yo=W(),ui=Yo.box,Mn=Yo.content;xs([ui,Mn],j),jl([ui,Mn],"visible")}Pe(),xe(),$l(vs,b),(nn=b.popperInstance)==null||nn.forceUpdate(),U("onMount",[b]),b.props.animation&&q()&&vt(j,function(){b.state.isShown=!0,U("onShown",[b])})}},Ct()}}function Kh(){var C=!b.state.isVisible,N=b.state.isDestroyed,F=!b.state.isEnabled,J=ys(b.props.duration,1,Ye.duration);if(!(C||N||F)&&(U("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,l=!1,s=!1,q()&&(k.style.visibility="hidden"),yt(),kt(),Q(!0),q()){var j=W(),Ee=j.box,He=j.content;b.props.animation&&(xs([Ee,He],J),jl([Ee,He],"hidden"))}Pe(),xe(),b.props.animation?q()&&Sn(J,b.unmount):b.unmount()}}function Jh(C){ee().addEventListener("mousemove",f),$l(gi,f),f(C)}function Gh(){b.state.isVisible&&b.hide(),b.state.isMounted&&(ni(),_t().forEach(function(C){C._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),vs=vs.filter(function(C){return C!==b}),b.state.isMounted=!1,U("onHidden",[b]))}function Zh(){b.state.isDestroyed||(b.clearDelayTimeouts(),b.unmount(),Yr(),delete t._tippy,b.state.isDestroyed=!0,U("onDestroy",[b]))}}function En(t,e){e===void 0&&(e={});var n=Ye.plugins.concat(e.plugins||[]);O2();var r=Object.assign({},e,{plugins:n}),i=S2(t),o=i.reduce(function(s,u){var a=u&&$2(u,r);return a&&s.push(a),s},[]);return Vo(t)?o[0]:o}En.defaultProps=Ye;En.setDefaultProps=L2;En.currentInput=st;Object.assign({},Df,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});En.setDefaultProps({render:jf});class H2{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:u,state:a,from:l,to:c})=>{const{doc:d,selection:h}=a,{empty:p}=h,f=!d.textBetween(l,c).length&&Ku(a.selection),m=this.element.contains(document.activeElement);return!(!(u.hasFocus()||m)||p||f||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var a;if(this.preventHide){this.preventHide=!1;return}u!=null&&u.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(u.relatedTarget))||this.hide()},this.tippyBlurHandler=u=>{this.blurHandler({event:u})},this.handleDebouncedUpdate=(u,a)=>{const l=!(a!=null&&a.selection.eq(u.state.selection)),c=!(a!=null&&a.doc.eq(u.state.doc));!l&&!c||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(u,l,c,a)},this.updateDelay))},this.updateHandler=(u,a,l,c)=>{var d,h,p;const{state:f,composing:m}=u,{selection:g}=f;if(m||!a&&!l)return;this.createTooltip();const{ranges:x}=g,v=Math.min(...x.map(k=>k.$from.pos)),b=Math.max(...x.map(k=>k.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,view:u,state:f,oldState:c,from:v,to:b}))){this.hide();return}(h=this.tippy)===null||h===void 0||h.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(bf(f.selection)){let k=u.nodeDOM(v);const D=k.dataset.nodeViewWrapper?k:k.querySelector("[data-node-view-wrapper]");if(D&&(k=D.firstChild),k)return k.getBoundingClientRect()}return yf(u,v,b)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=En(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const o=!(n!=null&&n.selection.eq(e.state.selection)),s=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const qf=t=>new ae({key:typeof t.pluginKey=="string"?new we(t.pluginKey):t.pluginKey,view:e=>new H2({view:e,...t})});se.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[qf({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class j2{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:u})=>{const{selection:a}=u,{$anchor:l,empty:c}=a,d=l.depth===1,h=l.parent.isTextblock&&!l.parent.type.spec.code&&!l.parent.textContent;return!(!s.hasFocus()||!c||!d||!h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var u;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((u=this.element.parentNode)===null||u===void 0)&&u.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=En(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;const{state:s}=e,{doc:u,selection:a}=s,{from:l,to:c}=a;if(n&&n.doc.eq(u)&&n.selection.eq(a))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>yf(e,l,c))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Vf=t=>new ae({key:typeof t.pluginKey=="string"?new we(t.pluginKey):t.pluginKey,view:e=>new j2({view:e,...t})});se.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Vf({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});var Wf={exports:{}},Cs={};/**
 * @license React
 * use-sync-external-store-shim.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Jl;function q2(){if(Jl)return Cs;Jl=1;var t=oe;function e(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function u(d,h){var p=h(),f=r({inst:{value:p,getSnapshot:h}}),m=f[0].inst,g=f[1];return o(function(){m.value=p,m.getSnapshot=h,a(m)&&g({inst:m})},[d,p,h]),i(function(){return a(m)&&g({inst:m}),d(function(){a(m)&&g({inst:m})})},[d]),s(p),p}function a(d){var h=d.getSnapshot;d=d.value;try{var p=h();return!n(d,p)}catch{return!0}}function l(d,h){return h()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:u;return Cs.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:c,Cs}Wf.exports=q2();var sa=Wf.exports;const V2=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},W2=({contentComponent:t})=>{const e=sa.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return oe.createElement(oe.Fragment,null,Object.values(e))};function U2(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:Yh.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}class K2 extends oe.Component{constructor(e){var n;super(e),this.editorContentRef=oe.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=U2(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return oe.createElement(oe.Fragment,null,oe.createElement("div",{ref:V2(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&oe.createElement(W2,{contentComponent:e.contentComponent}))}}const J2=z.forwardRef((t,e)=>{const n=oe.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return oe.createElement(K2,{key:n,innerRef:e,...t})}),G2=oe.memo(J2);var Uf={exports:{}},ws={};/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Gl;function Z2(){if(Gl)return ws;Gl=1;var t=oe,e=sa;function n(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,o=t.useRef,s=t.useEffect,u=t.useMemo,a=t.useDebugValue;return ws.useSyncExternalStoreWithSelector=function(l,c,d,h,p){var f=o(null);if(f.current===null){var m={hasValue:!1,value:null};f.current=m}else m=f.current;f=u(function(){function y(k){if(!x){if(x=!0,v=k,k=h(k),p!==void 0&&m.hasValue){var D=m.value;if(p(D,k))return b=D}return b=k}if(D=b,r(v,k))return D;var _=h(k);return p!==void 0&&p(D,_)?D:(v=k,b=_)}var x=!1,v,b,w=d===void 0?null:d;return[function(){return y(c())},w===null?void 0:function(){return y(w())}]},[c,d,h,p]);var g=i(l,f[0],f[1]);return s(function(){m.hasValue=!0,m.value=g},[g]),a(g),g},ws}Uf.exports=Z2();var Q2=Uf.exports;class Y2{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function X2(t){const[e]=z.useState(()=>new Y2(t.editor)),n=Q2.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getServerSnapshot,t.selector,t.equalityFn);return z.useEffect(()=>e.watch(t.editor),[t.editor,e]),z.useDebugValue(n),n}const ey=!1,pu=typeof window>"u",ty=pu||!!(typeof window<"u"&&window.next);class ny{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return pu||ty?null:this.createEditor();if(this.options.current.immediatelyRender&&pu&&ey)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)===null||o===void 0?void 0:o.call(i,...r)},onBlur:(...r)=>{var i,o;return(o=(i=this.options.current).onBlur)===null||o===void 0?void 0:o.call(i,...r)},onCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onCreate)===null||o===void 0?void 0:o.call(i,...r)},onDestroy:(...r)=>{var i,o;return(o=(i=this.options.current).onDestroy)===null||o===void 0?void 0:o.call(i,...r)},onFocus:(...r)=>{var i,o;return(o=(i=this.options.current).onFocus)===null||o===void 0?void 0:o.call(i,...r)},onSelectionUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)===null||o===void 0?void 0:o.call(i,...r)},onTransaction:(...r)=>{var i,o;return(o=(i=this.options.current).onTransaction)===null||o===void 0?void 0:o.call(i,...r)},onUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onUpdate)===null||o===void 0?void 0:o.call(i,...r)},onContentError:(...r)=>{var i,o;return(o=(i=this.options.current).onContentError)===null||o===void 0?void 0:o.call(i,...r)}};return new ab(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?this.editor.setOptions(this.options.current):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function ry(t={},e=[]){const n=z.useRef(t);n.current=t;const[r]=z.useState(()=>new ny(n)),i=sa.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return z.useDebugValue(i),z.useEffect(r.onRender(e)),X2({editor:i,selector:({transactionNumber:o})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&o===0?0:o+1}),i}const Kf=z.createContext({editor:null});Kf.Consumer;const Jf=()=>z.useContext(Kf),iy=t=>{const[e,n]=z.useState(null),{editor:r}=Jf();return z.useEffect(()=>{var i;if(!e||!((i=t.editor)===null||i===void 0)&&i.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:o="bubbleMenu",editor:s,tippyOptions:u={},updateDelay:a,shouldShow:l=null}=t,c=s||r;if(!c){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const d=qf({updateDelay:a,editor:c,element:e,pluginKey:o,shouldShow:l,tippyOptions:u});return c.registerPlugin(d),()=>c.unregisterPlugin(o)},[t.editor,r,e]),oe.createElement("div",{ref:n,className:t.className,style:{visibility:"hidden"}},t.children)},oy=t=>{const[e,n]=z.useState(null),{editor:r}=Jf();return z.useEffect(()=>{var i;if(!e||!((i=t.editor)===null||i===void 0)&&i.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:o="floatingMenu",editor:s,tippyOptions:u={},shouldShow:a=null}=t,l=s||r;if(!l){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const c=Vf({pluginKey:o,editor:l,element:e,tippyOptions:u,shouldShow:a});return l.registerPlugin(c),()=>l.unregisterPlugin(o)},[t.editor,r,e]),oe.createElement("div",{ref:n,className:t.className,style:{visibility:"hidden"}},t.children)},Gf=z.createContext({onDragStart:void 0}),sy=()=>z.useContext(Gf),Zl=oe.forwardRef((t,e)=>{const{onDragStart:n}=sy(),r=t.as||"div";return oe.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function uy(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function ay(t){var e;return typeof t=="object"&&((e=t.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class Zf{constructor(e,{editor:n,props:r={},as:i="div",className:o="",attrs:s}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),s&&Object.keys(s).forEach(u=>{this.element.setAttribute(u,s[u])}),this.editor.isInitialized?Xh.flushSync(()=>{this.render()}):this.render()}render(){var e;const n=this.component,r=this.props,i=this.editor;(uy(n)||ay(n))&&(r.ref=o=>{this.ref=o}),this.reactElement=oe.createElement(n,r),(e=i==null?void 0:i.contentComponent)===null||e===void 0||e.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;const n=this.editor;(e=n==null?void 0:n.contentComponent)===null||e===void 0||e.removeRenderer(this.id)}}class ly extends cb{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(l={})=>this.updateAttributes(l),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const l=c=>c.charAt(0).toUpperCase()+c.substring(1);this.component.displayName=l(this.extension.name)}const i={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:l=>{l&&this.contentDOMElement&&l.firstChild!==this.contentDOMElement&&l.appendChild(this.contentDOMElement)}},o=this.component,s=oe.memo(l=>oe.createElement(Gf.Provider,{value:i},oe.createElement(o,l)));s.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let u=this.node.isInline?"span":"div";this.options.as&&(u=this.options.as);const{className:a=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new Zf(s,{editor:this.editor,props:e,as:u,className:`node-${this.node.type.name} ${a}`.trim(),attrs:this.options.attrs})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection;if(e<=this.getPos()&&n>=this.getPos()+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n){const r=i=>{this.renderer.updateProps(i)};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,o=this.decorations;return this.node=e,this.decorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:e,newDecorations:n,updateProps:()=>r({node:e,decorations:n})})}return e===this.node&&this.decorations===n||(this.node=e,this.decorations=n,r({node:e,decorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}}function cy(t,e){return n=>n.editor.contentComponent?new ly(t,n,e):{}}const dy=/^\s*>\s$/,fy=G.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",ne(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Rr({find:dy,type:this.type})]}}),hy=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,py=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,my=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,gy=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,by=ye.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",ne(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Zn({find:hy,type:this.type}),Zn({find:my,type:this.type})]},addPasteRules(){return[vn({find:py,type:this.type}),vn({find:gy,type:this.type})]}}),yy=G.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ne(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Ql=ye.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",ne(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=jo(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Yl=/^\s*([-+*])\s$/,xy=G.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ne(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(yy.name,this.editor.getAttributes(Ql.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Rr({find:Yl,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Rr({find:Yl,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Ql.name),editor:this.editor})),[t]}}),ky=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,vy=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,Cy=ye.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ne(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Zn({find:ky,type:this.type})]},addPasteRules(){return[vn({find:vy,type:this.type})]}}),wy=/^```([a-z]+)?[\s\n]$/,Ey=/^~~~([a-z]+)?[\s\n]$/,Sy=G.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ne(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`

`);return!o||!s?!1:t.chain().command(({tr:u})=>(u.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const u=i.after();return u===void 0?!1:r.nodeAt(u)?t.commands.command(({tr:l})=>(l.setSelection(P.near(r.resolve(u))),!0)):t.commands.exitCode()}}},addInputRules(){return[au({find:wy,type:this.type,getAttributes:t=>({language:t[1]})}),au({find:Ey,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ae({key:new we("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s,schema:u}=t.state,a=u.text(n.replace(/\r\n?/g,`
`));return s.replaceSelectionWith(this.type.create({language:o},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(L.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),Ay=G.create({name:"doc",topNode:!0,content:"block+"});function Dy(t={}){return new ae({view(e){return new Ty(e,t)}})}class Ty{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let u=e.nodeBefore,a=e.nodeAfter;if(u||a){let l=this.editorView.nodeDOM(this.cursorPos-(u?u.nodeSize:0));if(l){let c=l.getBoundingClientRect(),d=u?c.bottom:c.top;u&&a&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:c.left,right:c.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let u=this.editorView.coordsAtPos(this.cursorPos);r={left:u.left-this.width/2,right:u.left+this.width/2,top:u.top,bottom:u.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let u=i.getBoundingClientRect();o=u.left-i.scrollLeft,s=u.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let u=fd(this.editorView.state.doc,s,this.editorView.dragging.slice);u!=null&&(s=u)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const My=se.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Dy(this.options)]}});class te extends P{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return te.valid(r)?new te(r):P.near(r)}content(){return T.empty}eq(e){return e instanceof te&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new te(e.resolve(n.pos))}getBookmark(){return new ua(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!Oy(e)||!_y(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&te.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let u=e.node(s);if(n>0?e.indexAfter(s)<u.childCount:e.index(s)>0){o=u.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let a=e.doc.resolve(i);if(te.valid(a))return a}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!I.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let u=e.doc.resolve(i);if(te.valid(u))return u}return null}}}te.prototype.visible=!1;te.findFrom=te.findGapCursorFrom;P.jsonID("gapcursor",te);class ua{constructor(e){this.pos=e}map(e){return new ua(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return te.valid(n)?new te(n):P.near(n)}}function Oy(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function _y(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Ny(){return new ae({props:{decorations:Ly,createSelectionBetween(t,e,n){return e.pos==n.pos&&te.valid(n)?new te(n):null},handleClick:Ry,handleKeyDown:Iy,handleDOMEvents:{beforeinput:Fy}}})}const Iy=ef({ArrowLeft:bi("horiz",-1),ArrowRight:bi("horiz",1),ArrowUp:bi("vert",-1),ArrowDown:bi("vert",1)});function bi(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,u=e>0?s.$to:s.$from,a=s.empty;if(s instanceof L){if(!o.endOfTextblock(n)||u.depth==0)return!1;a=!1,u=r.doc.resolve(e>0?u.after():u.before())}let l=te.findGapCursorFrom(u,e,a);return l?(i&&i(r.tr.setSelection(new te(l))),!0):!1}}function Ry(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!te.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&I.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new te(r))),!0)}function Fy(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof te))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=E.empty;for(let s=r.length-1;s>=0;s--)i=E.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new T(i,0,0));return o.setSelection(L.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function Ly(t){if(!(t.selection instanceof te))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ie.create(t.doc,[_e.widget(t.selection.head,e,{key:"gapcursor"})])}const Py=se.create({name:"gapCursor",addProseMirrorPlugins(){return[Ny()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=$(O(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),By=G.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ne(this.options.HTMLAttributes,t)]},renderText(){return`
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:u}=r.extensionManager,a=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:l,dispatch:c})=>{if(c&&a&&s){const d=a.filter(h=>u.includes(h.type.name));l.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),zy=G.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ne(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>au({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Ki=200,he=function(){};he.prototype.append=function(e){return e.length?(e=he.from(e),!this.length&&e||e.length<Ki&&this.leafAppend(e)||this.length<Ki&&e.leafPrepend(this)||this.appendInner(e)):this};he.prototype.prepend=function(e){return e.length?he.from(e).append(this):this};he.prototype.appendInner=function(e){return new $y(this,e)};he.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?he.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};he.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};he.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)};he.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};he.from=function(e){return e instanceof he?e:e&&e.length?new Qf(e):he.empty};var Qf=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,u){for(var a=o;a<s;a++)if(i(this.values[a],u+a)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,u){for(var a=o-1;a>=s;a--)if(i(this.values[a],u+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ki)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ki)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(he);he.empty=new Qf([]);var $y=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(o,u),s)===!1||o>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,o)-u,s+u)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(o,u)-u,s+u)===!1||o<u&&this.left.forEachInvertedInner(r,Math.min(i,u),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(he);const Hy=500;class Qe{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,u,a,l=[],c=[];return this.items.forEach((d,h)=>{if(!d.step){i||(i=this.remapping(r,h+1),o=i.maps.length),o--,c.push(d);return}if(i){c.push(new nt(d.map));let p=d.step.map(i.slice(o)),f;p&&s.maybeStep(p).doc&&(f=s.mapping.maps[s.mapping.maps.length-1],l.push(new nt(f,void 0,void 0,l.length+c.length))),o--,f&&i.appendMap(f,o)}else s.maybeStep(d.step);if(d.selection)return u=i?d.selection.map(i.slice(o)):d.selection,a=new Qe(this.items.slice(0,r).append(c.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:u}}addTransform(e,n,r,i){let o=[],s=this.eventCount,u=this.items,a=!i&&u.length?u.get(u.length-1):null;for(let c=0;c<e.steps.length;c++){let d=e.steps[c].invert(e.docs[c]),h=new nt(e.mapping.maps[c],d,n),p;(p=a&&a.merge(h))&&(h=p,c?o.pop():u=u.slice(0,u.length-1)),o.push(h),n&&(s++,n=void 0),i||(a=h)}let l=s-r.depth;return l>qy&&(u=jy(u,l),s-=l),new Qe(u.append(o),s)}remapping(e,n){let r=new Hn;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Qe(this.items.append(e.map(n=>new nt(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,u=this.eventCount;this.items.forEach(h=>{h.selection&&u--},i);let a=n;this.items.forEach(h=>{let p=o.getMirror(--a);if(p==null)return;s=Math.min(s,p);let f=o.maps[p];if(h.step){let m=e.steps[p].invert(e.docs[p]),g=h.selection&&h.selection.map(o.slice(a+1,p));g&&u++,r.push(new nt(f,m,g))}else r.push(new nt(f))},i);let l=[];for(let h=n;h<s;h++)l.push(new nt(o.maps[h]));let c=this.items.slice(0,i).append(l).append(r),d=new Qe(c,u);return d.emptyItemCount()>Hy&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,u)=>{if(u>=e)i.push(s),s.selection&&o++;else if(s.step){let a=s.step.map(n.slice(r)),l=a&&a.getMap();if(r--,l&&n.appendMap(l,r),a){let c=s.selection&&s.selection.map(n.slice(r));c&&o++;let d=new nt(l.invert(),a,c),h,p=i.length-1;(h=i.length&&i[p].merge(d))?i[p]=h:i.push(d)}}else s.map&&r--},this.items.length,0),new Qe(he.from(i.reverse()),o)}}Qe.empty=new Qe(he.empty,0);function jy(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class nt{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new nt(n.getMap().invert(),n,this.selection)}}}class Ft{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const qy=20;function Vy(t,e,n,r){let i=n.getMeta(bn),o;if(i)return i.historyState;n.getMeta(Ky)&&(t=new Ft(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(bn))return s.getMeta(bn).redo?new Ft(t.done.addTransform(n,void 0,r,Ti(e)),t.undone,Xl(n.mapping.maps),t.prevTime,t.prevComposition):new Ft(t.done,t.undone.addTransform(n,void 0,r,Ti(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let u=n.getMeta("composition"),a=t.prevTime==0||!s&&t.prevComposition!=u&&(t.prevTime<(n.time||0)-r.newGroupDelay||!Wy(n,t.prevRanges)),l=s?Es(t.prevRanges,n.mapping):Xl(n.mapping.maps);return new Ft(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,Ti(e)),Qe.empty,l,n.time,u??t.prevComposition)}else return(o=n.getMeta("rebased"))?new Ft(t.done.rebased(n,o),t.undone.rebased(n,o),Es(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ft(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Es(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function Wy(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function Xl(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Es(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function Uy(t,e,n){let r=Ti(e),i=bn.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),u=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),a=new Ft(n?u:o.remaining,n?o.remaining:u,null,0,-1);return o.transform.setSelection(s).setMeta(bn,{redo:n,historyState:a})}let Ss=!1,ec=null;function Ti(t){let e=t.plugins;if(ec!=e){Ss=!1,ec=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Ss=!0;break}}return Ss}const bn=new we("history"),Ky=new we("closeHistory");function Jy(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new ae({key:bn,state:{init(){return new Ft(Qe.empty,Qe.empty,null,0,-1)},apply(e,n,r){return Vy(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Xf:r=="historyRedo"?eh:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Yf(t,e){return(n,r)=>{let i=bn.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=Uy(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Xf=Yf(!1,!0),eh=Yf(!0,!0),Gy=se.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Xf(t,e),redo:()=>({state:t,dispatch:e})=>eh(t,e)}},addProseMirrorPlugins(){return[Jy(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Zy=G.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ne(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:i}=n,o=t();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):bf(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:u})=>{var a;if(u){const{$to:l}=s.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?s.setSelection(L.create(s.doc,l.pos+1)):l.nodeAfter.isBlock?s.setSelection(I.create(s.doc,l.pos)):s.setSelection(L.create(s.doc,l.pos));else{const d=(a=l.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();d&&(s.insert(c,d),s.setSelection(L.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Ef({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Qy=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Yy=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Xy=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,ex=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,tx=ye.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ne(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Zn({find:Qy,type:this.type}),Zn({find:Xy,type:this.type})]},addPasteRules(){return[vn({find:Yy,type:this.type}),vn({find:ex,type:this.type})]}}),nx=G.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ne(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),rx=G.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ne(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),tc=ye.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",ne(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=jo(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),nc=/^(\d+)\.\s$/,ix=G.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ne(this.options.HTMLAttributes,n),0]:["ol",ne(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(rx.name,this.editor.getAttributes(tc.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Rr({find:nc,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Rr({find:nc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(tc.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),ox=G.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ne(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),sx=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,ux=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,ax=ye.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ne(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Zn({find:sx,type:this.type})]},addPasteRules(){return[vn({find:ux,type:this.type})]}}),lx=G.create({name:"text",group:"inline"}),cx=se.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,u,a,l,c,d,h,p,f,m,g,y;const x=[];return this.options.bold!==!1&&x.push(by.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&x.push(fy.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&x.push(xy.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(Cy.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(Sy.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(Ay.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&x.push(My.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&x.push(Py.configure((u=this.options)===null||u===void 0?void 0:u.gapcursor)),this.options.hardBreak!==!1&&x.push(By.configure((a=this.options)===null||a===void 0?void 0:a.hardBreak)),this.options.heading!==!1&&x.push(zy.configure((l=this.options)===null||l===void 0?void 0:l.heading)),this.options.history!==!1&&x.push(Gy.configure((c=this.options)===null||c===void 0?void 0:c.history)),this.options.horizontalRule!==!1&&x.push(Zy.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&x.push(tx.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&x.push(nx.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&x.push(ix.configure((f=this.options)===null||f===void 0?void 0:f.orderedList)),this.options.paragraph!==!1&&x.push(ox.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&x.push(ax.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&x.push(lx.configure((y=this.options)===null||y===void 0?void 0:y.text)),x}}),dx="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",fx="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",tr=(t,e)=>{for(const n in e)t[n]=e[n];return t},mu="numeric",gu="ascii",bu="alpha",Mi="asciinumeric",yi="alphanumeric",yu="domain",th="emoji",hx="scheme",px="slashscheme",rc="whitespace";function mx(t,e){return t in e||(e[t]=[]),e[t]}function cn(t,e,n){e[mu]&&(e[Mi]=!0,e[yi]=!0),e[gu]&&(e[Mi]=!0,e[bu]=!0),e[Mi]&&(e[yi]=!0),e[bu]&&(e[yi]=!0),e[yi]&&(e[yu]=!0),e[th]&&(e[yu]=!0);for(const r in e){const i=mx(r,n);i.indexOf(t)<0&&i.push(t)}}function gx(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Oe(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}Oe.groups={};Oe.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(t))return o}return e.jd},has(t,e){return e===void 0&&(e=!1),e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||Oe.groups;let i;return e&&e.j?i=e:(i=new Oe(e),n&&r&&cn(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const o=t.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(t[s]);return i.tt(t[o-1],e,n,r)},tt(t,e,n,r){r=r||Oe.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const o=e;let s,u=i.go(t);if(u?(s=new Oe,tr(s.j,u.j),s.jr.push.apply(s.jr,u.jr),s.jd=u.jd,s.t=u.t):s=new Oe,o){if(r)if(s.t&&typeof s.t=="string"){const a=tr(gx(s.t,r),n);cn(o,a,r)}else n&&cn(o,n,r);s.t=o}return i.j[t]=s,s}};const B=(t,e,n,r,i)=>t.ta(e,n,r,i),je=(t,e,n,r,i)=>t.tr(e,n,r,i),ic=(t,e,n,r,i)=>t.ts(e,n,r,i),A=(t,e,n,r,i)=>t.tt(e,n,r,i),Et="WORD",xu="UWORD",Pr="LOCALHOST",ku="TLD",vu="UTLD",Oi="SCHEME",Bn="SLASH_SCHEME",aa="NUM",nh="WS",la="NL",Er="OPENBRACE",Sr="CLOSEBRACE",Ji="OPENBRACKET",Gi="CLOSEBRACKET",Zi="OPENPAREN",Qi="CLOSEPAREN",Yi="OPENANGLEBRACKET",Xi="CLOSEANGLEBRACKET",eo="FULLWIDTHLEFTPAREN",to="FULLWIDTHRIGHTPAREN",no="LEFTCORNERBRACKET",ro="RIGHTCORNERBRACKET",io="LEFTWHITECORNERBRACKET",oo="RIGHTWHITECORNERBRACKET",so="FULLWIDTHLESSTHAN",uo="FULLWIDTHGREATERTHAN",ao="AMPERSAND",lo="APOSTROPHE",co="ASTERISK",Lt="AT",fo="BACKSLASH",ho="BACKTICK",po="CARET",zt="COLON",ca="COMMA",mo="DOLLAR",rt="DOT",go="EQUALS",da="EXCLAMATION",it="HYPHEN",bo="PERCENT",yo="PIPE",xo="PLUS",ko="POUND",vo="QUERY",fa="QUOTE",ha="SEMI",ot="SLASH",Ar="TILDE",Co="UNDERSCORE",rh="EMOJI",wo="SYM";var ih=Object.freeze({__proto__:null,WORD:Et,UWORD:xu,LOCALHOST:Pr,TLD:ku,UTLD:vu,SCHEME:Oi,SLASH_SCHEME:Bn,NUM:aa,WS:nh,NL:la,OPENBRACE:Er,CLOSEBRACE:Sr,OPENBRACKET:Ji,CLOSEBRACKET:Gi,OPENPAREN:Zi,CLOSEPAREN:Qi,OPENANGLEBRACKET:Yi,CLOSEANGLEBRACKET:Xi,FULLWIDTHLEFTPAREN:eo,FULLWIDTHRIGHTPAREN:to,LEFTCORNERBRACKET:no,RIGHTCORNERBRACKET:ro,LEFTWHITECORNERBRACKET:io,RIGHTWHITECORNERBRACKET:oo,FULLWIDTHLESSTHAN:so,FULLWIDTHGREATERTHAN:uo,AMPERSAND:ao,APOSTROPHE:lo,ASTERISK:co,AT:Lt,BACKSLASH:fo,BACKTICK:ho,CARET:po,COLON:zt,COMMA:ca,DOLLAR:mo,DOT:rt,EQUALS:go,EXCLAMATION:da,HYPHEN:it,PERCENT:bo,PIPE:yo,PLUS:xo,POUND:ko,QUERY:vo,QUOTE:fa,SEMI:ha,SLASH:ot,TILDE:Ar,UNDERSCORE:Co,EMOJI:rh,SYM:wo});const In=/[a-z]/,As=new RegExp("\\p{L}","u"),Ds=new RegExp("\\p{Emoji}","u"),Ts=/\d/,oc=/\s/,sc=`
`,bx="️",yx="‍";let xi=null,ki=null;function xx(t){t===void 0&&(t=[]);const e={};Oe.groups=e;const n=new Oe;xi==null&&(xi=uc(dx)),ki==null&&(ki=uc(fx)),A(n,"'",lo),A(n,"{",Er),A(n,"}",Sr),A(n,"[",Ji),A(n,"]",Gi),A(n,"(",Zi),A(n,")",Qi),A(n,"<",Yi),A(n,">",Xi),A(n,"(",eo),A(n,")",to),A(n,"「",no),A(n,"」",ro),A(n,"『",io),A(n,"』",oo),A(n,"<",so),A(n,">",uo),A(n,"&",ao),A(n,"*",co),A(n,"@",Lt),A(n,"`",ho),A(n,"^",po),A(n,":",zt),A(n,",",ca),A(n,"$",mo),A(n,".",rt),A(n,"=",go),A(n,"!",da),A(n,"-",it),A(n,"%",bo),A(n,"|",yo),A(n,"+",xo),A(n,"#",ko),A(n,"?",vo),A(n,'"',fa),A(n,"/",ot),A(n,";",ha),A(n,"~",Ar),A(n,"_",Co),A(n,"\\",fo);const r=je(n,Ts,aa,{[mu]:!0});je(r,Ts,r);const i=je(n,In,Et,{[gu]:!0});je(i,In,i);const o=je(n,As,xu,{[bu]:!0});je(o,In),je(o,As,o);const s=je(n,oc,nh,{[rc]:!0});A(n,sc,la,{[rc]:!0}),A(s,sc),je(s,oc,s);const u=je(n,Ds,rh,{[th]:!0});je(u,Ds,u),A(u,bx,u);const a=A(u,yx);je(a,Ds,u);const l=[[In,i]],c=[[In,null],[As,o]];for(let d=0;d<xi.length;d++)Nt(n,xi[d],ku,Et,l);for(let d=0;d<ki.length;d++)Nt(n,ki[d],vu,xu,c);cn(ku,{tld:!0,ascii:!0},e),cn(vu,{utld:!0,alpha:!0},e),Nt(n,"file",Oi,Et,l),Nt(n,"mailto",Oi,Et,l),Nt(n,"http",Bn,Et,l),Nt(n,"https",Bn,Et,l),Nt(n,"ftp",Bn,Et,l),Nt(n,"ftps",Bn,Et,l),cn(Oi,{scheme:!0,ascii:!0},e),cn(Bn,{slashscheme:!0,ascii:!0},e),t=t.sort((d,h)=>d[0]>h[0]?1:-1);for(let d=0;d<t.length;d++){const h=t[d][0],f=t[d][1]?{[hx]:!0}:{[px]:!0};h.indexOf("-")>=0?f[yu]=!0:In.test(h)?Ts.test(h)?f[Mi]=!0:f[gu]=!0:f[mu]=!0,ic(n,h,h,f)}return ic(n,"localhost",Pr,{ascii:!0}),n.jd=new Oe(wo),{start:n,tokens:tr({groups:e},ih)}}function kx(t,e){const n=vx(e.replace(/[A-Z]/g,u=>u.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let u=t,a=null,l=0,c=null,d=-1,h=-1;for(;s<r&&(a=u.go(n[s]));)u=a,u.accepts()?(d=0,h=0,c=u):d>=0&&(d+=n[s].length,h++),l+=n[s].length,o+=n[s].length,s++;o-=d,s-=h,l-=d,i.push({t:c.t,v:e.slice(o-l,o),s:o-l,e:o})}return i}function vx(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),o,s=i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Nt(t,e,n,r,i){let o;const s=e.length;for(let u=0;u<s-1;u++){const a=e[u];t.j[a]?o=t.j[a]:(o=new Oe(r),o.jr=i.slice(),t.j[a]=o),t=o}return o=new Oe(n),o.jr=i.slice(),t.j[e[s-1]]=o,o}function uc(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let o=0;for(;i.indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}const Br={defaultProtocol:"http",events:null,format:ac,formatHref:ac,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function pa(t,e){e===void 0&&(e=null);let n=tr({},Br);t&&(n=tr(n,t instanceof pa?t.o:t));const r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}pa.prototype={o:Br,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:Br[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function ac(t){return t}function oh(t,e){this.t="token",this.v=t,this.tk=e}oh.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=Br.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},u=t.get("className",n,e),a=t.get("target",n,e),l=t.get("rel",n,e),c=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return s.href=r,u&&(s.class=u),a&&(s.target=a),l&&(s.rel=l),c&&tr(s,c),{tagName:i,attributes:s,content:o,eventListeners:d}}};function Wo(t,e){class n extends oh{constructor(i,o){super(i,o),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const lc=Wo("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),cc=Wo("text"),Cx=Wo("nl"),vi=Wo("url",{isLink:!0,toHref(t){return t===void 0&&(t=Br.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Pr&&t[1].t===zt}}),qe=t=>new Oe(t);function wx(t){let{groups:e}=t;const n=e.domain.concat([ao,co,Lt,fo,ho,po,mo,go,it,aa,bo,yo,xo,ko,ot,wo,Ar,Co]),r=[lo,zt,ca,rt,da,vo,fa,ha,Yi,Xi,Er,Sr,Gi,Ji,Zi,Qi,eo,to,no,ro,io,oo,so,uo],i=[ao,lo,co,fo,ho,po,mo,go,it,Er,Sr,bo,yo,xo,ko,vo,ot,wo,Ar,Co],o=qe(),s=A(o,Ar);B(s,i,s),B(s,e.domain,s);const u=qe(),a=qe(),l=qe();B(o,e.domain,u),B(o,e.scheme,a),B(o,e.slashscheme,l),B(u,i,s),B(u,e.domain,u);const c=A(u,Lt);A(s,Lt,c),A(a,Lt,c),A(l,Lt,c);const d=A(s,rt);B(d,i,s),B(d,e.domain,s);const h=qe();B(c,e.domain,h),B(h,e.domain,h);const p=A(h,rt);B(p,e.domain,h);const f=qe(lc);B(p,e.tld,f),B(p,e.utld,f),A(c,Pr,f);const m=A(h,it);B(m,e.domain,h),B(f,e.domain,h),A(f,rt,p),A(f,it,m);const g=A(f,zt);B(g,e.numeric,lc);const y=A(u,it),x=A(u,rt);B(y,e.domain,u),B(x,i,s),B(x,e.domain,u);const v=qe(vi);B(x,e.tld,v),B(x,e.utld,v),B(v,e.domain,u),B(v,i,s),A(v,rt,x),A(v,it,y),A(v,Lt,c);const b=A(v,zt),w=qe(vi);B(b,e.numeric,w);const k=qe(vi),D=qe();B(k,n,k),B(k,r,D),B(D,n,k),B(D,r,D),A(v,ot,k),A(w,ot,k);const _=A(a,zt),S=A(l,zt),R=A(S,ot),H=A(R,ot);B(a,e.domain,u),A(a,rt,x),A(a,it,y),B(l,e.domain,u),A(l,rt,x),A(l,it,y),B(_,e.domain,k),A(_,ot,k),B(H,e.domain,k),B(H,n,k),A(H,ot,k);const q=[[Er,Sr],[Ji,Gi],[Zi,Qi],[Yi,Xi],[eo,to],[no,ro],[io,oo],[so,uo]];for(let V=0;V<q.length;V++){const[ee,W]=q[V],Z=A(k,ee);A(D,ee,Z),A(Z,W,k);const Q=qe(vi);B(Z,n,Q);const U=qe();B(Z,r),B(Q,n,Q),B(Q,r,U),B(U,n,Q),B(U,r,U),A(Q,W,k),A(U,W,k)}return A(o,Pr,v),A(o,la,Cx),{start:o,tokens:ih}}function Ex(t,e,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let u=t,a=null,l=null,c=0,d=null,h=-1;for(;i<r&&!(a=u.go(n[i].t));)s.push(n[i++]);for(;i<r&&(l=a||u.go(n[i].t));)a=null,u=l,u.accepts()?(h=0,d=u):h>=0&&h++,i++,c++;if(h<0)i-=c,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(Ms(cc,e,s)),s=[]),i-=h,c-=h;const p=d.t,f=n.slice(i-c,i);o.push(Ms(p,e,f))}}return s.length>0&&o.push(Ms(cc,e,s)),o}function Ms(t,e,n){const r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}const Sx=typeof console<"u"&&console&&console.warn||(()=>{}),Ax="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",X={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Dx(){Oe.groups={},X.scanner=null,X.parser=null,X.tokenQueue=[],X.pluginQueue=[],X.customSchemes=[],X.initialized=!1}function dc(t,e){if(e===void 0&&(e=!1),X.initialized&&Sx(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Ax}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);X.customSchemes.push([t,e])}function Tx(){X.scanner=xx(X.customSchemes);for(let t=0;t<X.tokenQueue.length;t++)X.tokenQueue[t][1]({scanner:X.scanner});X.parser=wx(X.scanner.tokens);for(let t=0;t<X.pluginQueue.length;t++)X.pluginQueue[t][1]({scanner:X.scanner,parser:X.parser});X.initialized=!0}function sh(t){return X.initialized||Tx(),Ex(X.parser.start,t,kx(X.scanner.start,t))}function uh(t,e,n){if(e===void 0&&(e=null),n===void 0&&(n=null),e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new pa(n),i=sh(t),o=[];for(let s=0;s<i.length;s++){const u=i[s];u.isLink&&(!e||u.t===e)&&r.check(u)&&o.push(u.toFormattedObject(r))}return o}function Mx(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function Ox(t){return new ae({key:new we("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(l=>l.docChanged)&&!n.doc.eq(r.doc),o=e.some(l=>l.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,u=Mg(n.doc,[...e]);if(Pg(u).forEach(({newRange:l})=>{const c=_g(r.doc,l,p=>p.isTextblock);let d,h;if(c.length>1?(d=c[0],h=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):c.length&&r.doc.textBetween(l.from,l.to," "," ").endsWith(" ")&&(d=c[0],h=r.doc.textBetween(d.pos,l.to,void 0," ")),d&&h){const p=h.split(" ").filter(y=>y!=="");if(p.length<=0)return!1;const f=p[p.length-1],m=d.pos+h.lastIndexOf(f);if(!f)return!1;const g=sh(f).map(y=>y.toObject(t.defaultProtocol));if(!Mx(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).forEach(y=>{Zu(y.from,y.to,r.doc).some(x=>x.mark.type===t.type)||s.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function _x(t){return new ae({key:new we("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=r.target;const u=[];for(;s.nodeName!=="DIV";)u.push(s),s=s.parentNode;if(!u.find(h=>h.nodeName==="A"))return!1;const a=gf(e.state,t.type.name),l=r.target,c=(i=l==null?void 0:l.href)!==null&&i!==void 0?i:a.href,d=(o=l==null?void 0:l.target)!==null&&o!==void 0?o:a.target;return l&&c?(window.open(c,d),!0):!1}}})}function Nx(t){return new ae({key:new we("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let u="";r.content.forEach(l=>{u+=l.textContent});const a=uh(u,{defaultProtocol:t.defaultProtocol}).find(l=>l.isLink&&l.value===u);return!u||!a?!1:(t.editor.commands.setMark(t.type,{href:a.href}),!0)}}})}const Ix=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function fc(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(Ix,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Rx=ye.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){dc(t);return}dc(t.scheme,t.optionalSlashes)})},onDestroy(){Dx()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!fc(e,this.options.protocols)?!1:null}}]},renderHTML({HTMLAttributes:t}){return fc(t.href,this.options.protocols)?["a",ne(this.options.HTMLAttributes,t),0]:["a",ne(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[vn({find:t=>{const e=[];if(t){const{validate:n}=this.options,r=uh(t).filter(i=>i.isLink&&n(i.value));r.length&&r.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push(Ox({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),this.options.openOnClick===!0&&t.push(_x({type:this.type})),this.options.linkOnPaste&&t.push(Nx({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),Fx=se.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new ae({key:new we("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const o=this.editor.isEmpty;return t.descendants((s,u)=>{const a=r>=u&&r<=u+s.nodeSize,l=!s.isLeaf&&Qu(s);if((a||!this.options.showOnlyCurrent)&&l){const c=[this.options.emptyNodeClass];o&&c.push(this.options.emptyEditorClass);const d=_e.node(u,u+s.nodeSize,{class:c.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:u,hasAnchor:a}):this.options.placeholder});i.push(d)}return this.options.includeChildren}),ie.create(t,i)}}})]}}),Lx=t=>re({find:/--$/,replace:t??"—"}),Px=t=>re({find:/\.\.\.$/,replace:t??"…"}),Bx=t=>re({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:t??"“"}),zx=t=>re({find:/"$/,replace:t??"”"}),$x=t=>re({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:t??"‘"}),Hx=t=>re({find:/'$/,replace:t??"’"}),jx=t=>re({find:/<-$/,replace:t??"←"}),qx=t=>re({find:/->$/,replace:t??"→"}),Vx=t=>re({find:/\(c\)$/,replace:t??"©"}),Wx=t=>re({find:/\(tm\)$/,replace:t??"™"}),Ux=t=>re({find:/\(sm\)$/,replace:t??"℠"}),Kx=t=>re({find:/\(r\)$/,replace:t??"®"}),Jx=t=>re({find:/(?:^|\s)(1\/2)\s$/,replace:t??"½"}),Gx=t=>re({find:/\+\/-$/,replace:t??"±"}),Zx=t=>re({find:/!=$/,replace:t??"≠"}),Qx=t=>re({find:/<<$/,replace:t??"«"}),Yx=t=>re({find:/>>$/,replace:t??"»"}),Xx=t=>re({find:/\d+\s?([*x])\s?\d+$/,replace:t??"×"}),e3=t=>re({find:/\^2$/,replace:t??"²"}),t3=t=>re({find:/\^3$/,replace:t??"³"}),n3=t=>re({find:/(?:^|\s)(1\/4)\s$/,replace:t??"¼"}),r3=t=>re({find:/(?:^|\s)(3\/4)\s$/,replace:t??"¾"}),i3=se.create({name:"typography",addOptions(){return{closeDoubleQuote:"”",closeSingleQuote:"’",copyright:"©",ellipsis:"…",emDash:"—",laquo:"«",leftArrow:"←",multiplication:"×",notEqual:"≠",oneHalf:"½",oneQuarter:"¼",openDoubleQuote:"“",openSingleQuote:"‘",plusMinus:"±",raquo:"»",registeredTrademark:"®",rightArrow:"→",servicemark:"℠",superscriptThree:"³",superscriptTwo:"²",threeQuarters:"¾",trademark:"™"}},addInputRules(){const t=[];return this.options.emDash!==!1&&t.push(Lx(this.options.emDash)),this.options.ellipsis!==!1&&t.push(Px(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&t.push(Bx(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&t.push(zx(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&t.push($x(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&t.push(Hx(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&t.push(jx(this.options.leftArrow)),this.options.rightArrow!==!1&&t.push(qx(this.options.rightArrow)),this.options.copyright!==!1&&t.push(Vx(this.options.copyright)),this.options.trademark!==!1&&t.push(Wx(this.options.trademark)),this.options.servicemark!==!1&&t.push(Ux(this.options.servicemark)),this.options.registeredTrademark!==!1&&t.push(Kx(this.options.registeredTrademark)),this.options.oneHalf!==!1&&t.push(Jx(this.options.oneHalf)),this.options.plusMinus!==!1&&t.push(Gx(this.options.plusMinus)),this.options.notEqual!==!1&&t.push(Zx(this.options.notEqual)),this.options.laquo!==!1&&t.push(Qx(this.options.laquo)),this.options.raquo!==!1&&t.push(Yx(this.options.raquo)),this.options.multiplication!==!1&&t.push(Xx(this.options.multiplication)),this.options.superscriptTwo!==!1&&t.push(e3(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&t.push(t3(this.options.superscriptThree)),this.options.oneQuarter!==!1&&t.push(n3(this.options.oneQuarter)),this.options.threeQuarters!==!1&&t.push(r3(this.options.threeQuarters)),t}}),hc={};function o3(t){let e=hc[t];if(e)return e;e=hc[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 nr(t,e){typeof e!="string"&&(e=nr.defaultChars);const n=o3(e);return t.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let o=0,s=r.length;o<s;o+=3){const u=parseInt(r.slice(o+1,o+3),16);if(u<128){i+=n[u];continue}if((u&224)===192&&o+3<s){const a=parseInt(r.slice(o+4,o+6),16);if((a&192)===128){const l=u<<6&1984|a&63;l<128?i+="��":i+=String.fromCharCode(l),o+=3;continue}}if((u&240)===224&&o+6<s){const a=parseInt(r.slice(o+4,o+6),16),l=parseInt(r.slice(o+7,o+9),16);if((a&192)===128&&(l&192)===128){const c=u<<12&61440|a<<6&4032|l&63;c<2048||c>=55296&&c<=57343?i+="���":i+=String.fromCharCode(c),o+=6;continue}}if((u&248)===240&&o+9<s){const a=parseInt(r.slice(o+4,o+6),16),l=parseInt(r.slice(o+7,o+9),16),c=parseInt(r.slice(o+10,o+12),16);if((a&192)===128&&(l&192)===128&&(c&192)===128){let d=u<<18&1835008|a<<12&258048|l<<6&4032|c&63;d<65536||d>1114111?i+="����":(d-=65536,i+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),o+=9;continue}}i+="�"}return i})}nr.defaultChars=";/?:@&=+$,#";nr.componentChars="";const pc={};function s3(t){let e=pc[t];if(e)return e;e=pc[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 Gr(t,e,n){typeof e!="string"&&(n=e,e=Gr.defaultChars),typeof n>"u"&&(n=!0);const r=s3(e);let i="";for(let o=0,s=t.length;o<s;o++){const u=t.charCodeAt(o);if(n&&u===37&&o+2<s&&/^[0-9a-f]{2}$/i.test(t.slice(o+1,o+3))){i+=t.slice(o,o+3),o+=2;continue}if(u<128){i+=r[u];continue}if(u>=55296&&u<=57343){if(u>=55296&&u<=56319&&o+1<s){const a=t.charCodeAt(o+1);if(a>=56320&&a<=57343){i+=encodeURIComponent(t[o]+t[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[o])}return i}Gr.defaultChars=";/?:@&=+$,-_.!~*'()#";Gr.componentChars="-_.!~*'()";function ma(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 Eo(){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 u3=/^([a-z0-9.+-]+:)/i,a3=/:[0-9]*$/,l3=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c3=["<",">",'"',"`"," ","\r",`
`,"	"],d3=["{","}","|","\\","^","`"].concat(c3),f3=["'"].concat(d3),mc=["%","/","?",";","#"].concat(f3),gc=["/","?","#"],h3=255,bc=/^[+a-z0-9A-Z_-]{0,63}$/,p3=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,yc={javascript:!0,"javascript:":!0},xc={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function ga(t,e){if(t&&t instanceof Eo)return t;const n=new Eo;return n.parse(t,e),n}Eo.prototype.parse=function(t,e){let n,r,i,o=t;if(o=o.trim(),!e&&t.split("#").length===1){const l=l3.exec(o);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}let s=u3.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(e||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=o.substr(0,2)==="//",i&&!(s&&yc[s])&&(o=o.substr(2),this.slashes=!0)),!yc[s]&&(i||s&&!xc[s])){let l=-1;for(let f=0;f<gc.length;f++)r=o.indexOf(gc[f]),r!==-1&&(l===-1||r<l)&&(l=r);let c,d;l===-1?d=o.lastIndexOf("@"):d=o.lastIndexOf("@",l),d!==-1&&(c=o.slice(0,d),o=o.slice(d+1),this.auth=c),l=-1;for(let f=0;f<mc.length;f++)r=o.indexOf(mc[f]),r!==-1&&(l===-1||r<l)&&(l=r);l===-1&&(l=o.length),o[l-1]===":"&&l--;const h=o.slice(0,l);o=o.slice(l),this.parseHost(h),this.hostname=this.hostname||"";const p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){const f=this.hostname.split(/\./);for(let m=0,g=f.length;m<g;m++){const y=f[m];if(y&&!y.match(bc)){let x="";for(let v=0,b=y.length;v<b;v++)y.charCodeAt(v)>127?x+="x":x+=y[v];if(!x.match(bc)){const v=f.slice(0,m),b=f.slice(m+1),w=y.match(p3);w&&(v.push(w[1]),b.unshift(w[2])),b.length&&(o=b.join(".")+o),this.hostname=v.join(".");break}}}}this.hostname.length>h3&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const u=o.indexOf("#");u!==-1&&(this.hash=o.substr(u),o=o.slice(0,u));const a=o.indexOf("?");return a!==-1&&(this.search=o.substr(a),o=o.slice(0,a)),o&&(this.pathname=o),xc[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Eo.prototype.parseHost=function(t){let e=a3.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 m3=Object.freeze(Object.defineProperty({__proto__:null,decode:nr,encode:Gr,format:ma,parse:ga},Symbol.toStringTag,{value:"Module"})),ah=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,lh=/[\0-\x1F\x7F-\x9F]/,g3=/[\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]/,ba=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,ch=/[\$\+<->\^`\|~\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]/,dh=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,b3=Object.freeze(Object.defineProperty({__proto__:null,Any:ah,Cc:lh,Cf:g3,P:ba,S:ch,Z:dh},Symbol.toStringTag,{value:"Module"})),y3=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))),x3=new Uint16Array("Ȁaglq	\x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Os;const k3=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]]),v3=(Os=String.fromCodePoint)!==null&&Os!==void 0?Os: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 C3(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=k3.get(t))!==null&&e!==void 0?e:t}var de;(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"})(de||(de={}));const w3=32;var Vt;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Vt||(Vt={}));function Cu(t){return t>=de.ZERO&&t<=de.NINE}function E3(t){return t>=de.UPPER_A&&t<=de.UPPER_F||t>=de.LOWER_A&&t<=de.LOWER_F}function S3(t){return t>=de.UPPER_A&&t<=de.UPPER_Z||t>=de.LOWER_A&&t<=de.LOWER_Z||Cu(t)}function A3(t){return t===de.EQUALS||S3(t)}var le;(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"})(le||(le={}));var $t;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})($t||($t={}));class D3{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=le.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=$t.Strict}startEntity(e){this.decodeMode=e,this.state=le.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case le.EntityStart:return e.charCodeAt(n)===de.NUM?(this.state=le.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=le.NamedEntity,this.stateNamedEntity(e,n));case le.NumericStart:return this.stateNumericStart(e,n);case le.NumericDecimal:return this.stateNumericDecimal(e,n);case le.NumericHex:return this.stateNumericHex(e,n);case le.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|w3)===de.LOWER_X?(this.state=le.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=le.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const o=r-n;this.result=this.result*Math.pow(i,o)+parseInt(e.substr(n,o),i),this.consumed+=o}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Cu(i)||E3(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Cu(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,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===de.SEMI)this.consumed+=1;else if(this.decodeMode===$t.Strict)return 0;return this.emitCodePoint(C3(this.result),this.consumed),this.errors&&(e!==de.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],o=(i&Vt.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const s=e.charCodeAt(n);if(this.treeIndex=T3(r,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===$t.Attribute&&(o===0||A3(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],o=(i&Vt.VALUE_LENGTH)>>14,o!==0){if(s===de.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==$t.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Vt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Vt.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case le.NamedEntity:return this.result!==0&&(this.decodeMode!==$t.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case le.NumericDecimal:return this.emitNumericEntity(0,2);case le.NumericHex:return this.emitNumericEntity(0,3);case le.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case le.EntityStart:return 0}}}function fh(t){let e="";const n=new D3(t,r=>e+=v3(r));return function(i,o){let s=0,u=0;for(;(u=i.indexOf("&",u))>=0;){e+=i.slice(s,u),n.startEntity(o);const l=n.write(i,u+1);if(l<0){s=u+n.end();break}s=u+l,u=l===0?s+1:s}const a=e+i.slice(s);return e="",a}}function T3(t,e,n,r){const i=(e&Vt.BRANCH_LENGTH)>>7,o=e&Vt.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const a=r-o;return a<0||a>=i?-1:t[n+a]-1}let s=n,u=s+i-1;for(;s<=u;){const a=s+u>>>1,l=t[a];if(l<r)s=a+1;else if(l>r)u=a-1;else return t[a+i]}return-1}const M3=fh(y3);fh(x3);function hh(t,e=$t.Legacy){return M3(t,e)}function O3(t){return Object.prototype.toString.call(t)}function ya(t){return O3(t)==="[object String]"}const _3=Object.prototype.hasOwnProperty;function N3(t,e){return _3.call(t,e)}function Uo(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 ph(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function xa(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 So(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 mh=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,I3=/&([a-z#][a-z0-9]{1,31});/gi,R3=new RegExp(mh.source+"|"+I3.source,"gi"),F3=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function L3(t,e){if(e.charCodeAt(0)===35&&F3.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return xa(r)?So(r):t}const n=hh(t);return n!==t?n:t}function P3(t){return t.indexOf("\\")<0?t:t.replace(mh,"$1")}function rr(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(R3,function(e,n,r){return n||L3(e,r)})}const B3=/[&<>"]/,z3=/[&<>"]/g,$3={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function H3(t){return $3[t]}function Gt(t){return B3.test(t)?t.replace(z3,H3):t}const j3=/[.?*+^$[\]\\(){}|-]/g;function q3(t){return t.replace(j3,"\\$&")}function Y(t){switch(t){case 9:case 32:return!0}return!1}function zr(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 $r(t){return ba.test(t)||ch.test(t)}function Hr(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 Ko(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const V3={mdurl:m3,ucmicro:b3},W3=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:ph,assign:Uo,escapeHtml:Gt,escapeRE:q3,fromCodePoint:So,has:N3,isMdAsciiPunct:Hr,isPunctChar:$r,isSpace:Y,isString:ya,isValidEntityCode:xa,isWhiteSpace:zr,lib:V3,normalizeReference:Ko,unescapeAll:rr,unescapeMd:P3},Symbol.toStringTag,{value:"Module"}));function U3(t,e,n){let r,i,o,s;const u=t.posMax,a=t.pos;for(t.pos=e+1,r=1;t.pos<u;){if(o=t.src.charCodeAt(t.pos),o===93&&(r--,r===0)){i=!0;break}if(s=t.pos,t.md.inline.skipToken(t),o===91){if(s===t.pos-1)r++;else if(n)return t.pos=a,-1}}let l=-1;return i&&(l=t.pos),t.pos=a,l}function K3(t,e,n){let r,i=e;const o={ok:!1,pos:0,str:""};if(t.charCodeAt(i)===60){for(i++;i<n;){if(r=t.charCodeAt(i),r===10||r===60)return o;if(r===62)return o.pos=i+1,o.str=rr(t.slice(e+1,i)),o.ok=!0,o;if(r===92&&i+1<n){i+=2;continue}i++}return o}let s=0;for(;i<n&&(r=t.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(t.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(s++,s>32))return o;if(r===41){if(s===0)break;s--}i++}return e===i||s!==0||(o.str=rr(t.slice(e,i)),o.pos=i,o.ok=!0),o}function J3(t,e,n,r){let i,o=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(o>=n)return s;let u=t.charCodeAt(o);if(u!==34&&u!==39&&u!==40)return s;e++,o++,u===40&&(u=41),s.marker=u}for(;o<n;){if(i=t.charCodeAt(o),i===s.marker)return s.pos=o+1,s.str+=rr(t.slice(e,o)),s.ok=!0,s;if(i===40&&s.marker===41)return s;i===92&&o+1<n&&o++,o++}return s.can_continue=!0,s.str+=rr(t.slice(e,o)),s}const G3=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:K3,parseLinkLabel:U3,parseLinkTitle:J3},Symbol.toStringTag,{value:"Module"})),mt={};mt.code_inline=function(t,e,n,r,i){const o=t[e];return"<code"+i.renderAttrs(o)+">"+Gt(o.content)+"</code>"};mt.code_block=function(t,e,n,r,i){const o=t[e];return"<pre"+i.renderAttrs(o)+"><code>"+Gt(t[e].content)+`</code></pre>
`};mt.fence=function(t,e,n,r,i){const o=t[e],s=o.info?rr(o.info).trim():"";let u="",a="";if(s){const c=s.split(/(\s+)/g);u=c[0],a=c.slice(2).join("")}let l;if(n.highlight?l=n.highlight(o.content,u,a)||Gt(o.content):l=Gt(o.content),l.indexOf("<pre")===0)return l+`
`;if(s){const c=o.attrIndex("class"),d=o.attrs?o.attrs.slice():[];c<0?d.push(["class",n.langPrefix+u]):(d[c]=d[c].slice(),d[c][1]+=" "+n.langPrefix+u);const h={attrs:d};return`<pre><code${i.renderAttrs(h)}>${l}</code></pre>
`}return`<pre><code${i.renderAttrs(o)}>${l}</code></pre>
`};mt.image=function(t,e,n,r,i){const o=t[e];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(t,e,n)};mt.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
`:`<br>
`};mt.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
`:`<br>
`:`
`};mt.text=function(t,e){return Gt(t[e].content)};mt.html_block=function(t,e){return t[e].content};mt.html_inline=function(t,e){return t[e].content};function or(){this.rules=Uo({},mt)}or.prototype.renderAttrs=function(e){let n,r,i;if(!e.attrs)return"";for(i="",n=0,r=e.attrs.length;n<r;n++)i+=" "+Gt(e.attrs[n][0])+'="'+Gt(e.attrs[n][1])+'"';return i};or.prototype.renderToken=function(e,n,r){const i=e[n];let o="";if(i.hidden)return"";i.block&&i.nesting!==-1&&n&&e[n-1].hidden&&(o+=`
`),o+=(i.nesting===-1?"</":"<")+i.tag,o+=this.renderAttrs(i),i.nesting===0&&r.xhtmlOut&&(o+=" /");let s=!1;if(i.block&&(s=!0,i.nesting===1&&n+1<e.length)){const u=e[n+1];(u.type==="inline"||u.hidden||u.nesting===-1&&u.tag===i.tag)&&(s=!1)}return o+=s?`>
`:">",o};or.prototype.renderInline=function(t,e,n){let r="";const i=this.rules;for(let o=0,s=t.length;o<s;o++){const u=t[o].type;typeof i[u]<"u"?r+=i[u](t,o,e,n,this):r+=this.renderToken(t,o,e)}return r};or.prototype.renderInlineAsText=function(t,e,n){let r="";for(let i=0,o=t.length;i<o;i++)switch(t[i].type){case"text":r+=t[i].content;break;case"image":r+=this.renderInlineAsText(t[i].children,e,n);break;case"html_inline":case"html_block":r+=t[i].content;break;case"softbreak":case"hardbreak":r+=`
`;break}return r};or.prototype.render=function(t,e,n){let r="";const i=this.rules;for(let o=0,s=t.length;o<s;o++){const u=t[o].type;u==="inline"?r+=this.renderInline(t[o].children,e,n):typeof i[u]<"u"?r+=i[u](t,o,e,n,this):r+=this.renderToken(t,o,e,n)}return r};function Fe(){this.__rules__=[],this.__cache__=null}Fe.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};Fe.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))})})};Fe.prototype.at=function(t,e,n){const r=this.__find__(t),i=n||{};if(r===-1)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=i.alt||[],this.__cache__=null};Fe.prototype.before=function(t,e,n,r){const i=this.__find__(t),o=r||{};if(i===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i,0,{name:e,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null};Fe.prototype.after=function(t,e,n,r){const i=this.__find__(t),o=r||{};if(i===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i+1,0,{name:e,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null};Fe.prototype.push=function(t,e,n){const r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};Fe.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!0,n.push(r)},this),this.__cache__=null,n};Fe.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};Fe.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!1,n.push(r)},this),this.__cache__=null,n};Fe.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function tt(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}tt.prototype.attrIndex=function(e){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,i=n.length;r<i;r++)if(n[r][0]===e)return r;return-1};tt.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};tt.prototype.attrSet=function(e,n){const r=this.attrIndex(e),i=[e,n];r<0?this.attrPush(i):this.attrs[r]=i};tt.prototype.attrGet=function(e){const n=this.attrIndex(e);let r=null;return n>=0&&(r=this.attrs[n][1]),r};tt.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 gh(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}gh.prototype.Token=tt;const Z3=/\r\n?|\n/g,Q3=/\0/g;function Y3(t){let e;e=t.src.replace(Z3,`
`),e=e.replace(Q3,"�"),t.src=e}function X3(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 ek(t){const e=t.tokens;for(let n=0,r=e.length;n<r;n++){const i=e[n];i.type==="inline"&&t.md.inline.parse(i.content,t.md,t.env,i.children)}}function tk(t){return/^<a[>\s]/i.test(t)}function nk(t){return/^<\/a\s*>/i.test(t)}function rk(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 i=e[n].children,o=0;for(let s=i.length-1;s>=0;s--){const u=i[s];if(u.type==="link_close"){for(s--;i[s].level!==u.level&&i[s].type!=="link_open";)s--;continue}if(u.type==="html_inline"&&(tk(u.content)&&o>0&&o--,nk(u.content)&&o++),!(o>0)&&u.type==="text"&&t.md.linkify.test(u.content)){const a=u.content;let l=t.md.linkify.match(a);const c=[];let d=u.level,h=0;l.length>0&&l[0].index===0&&s>0&&i[s-1].type==="text_special"&&(l=l.slice(1));for(let p=0;p<l.length;p++){const f=l[p].url,m=t.md.normalizeLink(f);if(!t.md.validateLink(m))continue;let g=l[p].text;l[p].schema?l[p].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 y=l[p].index;if(y>h){const w=new t.Token("text","",0);w.content=a.slice(h,y),w.level=d,c.push(w)}const x=new t.Token("link_open","a",1);x.attrs=[["href",m]],x.level=d++,x.markup="linkify",x.info="auto",c.push(x);const v=new t.Token("text","",0);v.content=g,v.level=d,c.push(v);const b=new t.Token("link_close","a",-1);b.level=--d,b.markup="linkify",b.info="auto",c.push(b),h=l[p].lastIndex}if(h<a.length){const p=new t.Token("text","",0);p.content=a.slice(h),p.level=d,c.push(p)}e[n].children=i=ph(i,s,c)}}}}const bh=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,ik=/\((c|tm|r)\)/i,ok=/\((c|tm|r)\)/ig,sk={c:"©",r:"®",tm:"™"};function uk(t,e){return sk[e.toLowerCase()]}function ak(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(ok,uk)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function lk(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&bh.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 ck(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(ik.test(t.tokens[e].content)&&ak(t.tokens[e].children),bh.test(t.tokens[e].content)&&lk(t.tokens[e].children))}const dk=/['"]/,kc=/['"]/g,vc="’";function Ci(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function fk(t,e){let n;const r=[];for(let i=0;i<t.length;i++){const o=t[i],s=t[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!=="text")continue;let u=o.content,a=0,l=u.length;e:for(;a<l;){kc.lastIndex=a;const c=kc.exec(u);if(!c)break;let d=!0,h=!0;a=c.index+1;const p=c[0]==="'";let f=32;if(c.index-1>=0)f=u.charCodeAt(c.index-1);else for(n=i-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){f=t[n].content.charCodeAt(t[n].content.length-1);break}let m=32;if(a<l)m=u.charCodeAt(a);else for(n=i+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=Hr(f)||$r(String.fromCharCode(f)),y=Hr(m)||$r(String.fromCharCode(m)),x=zr(f),v=zr(m);if(v?d=!1:y&&(x||g||(d=!1)),x?h=!1:g&&(v||y||(h=!1)),m===34&&c[0]==='"'&&f>=48&&f<=57&&(h=d=!1),d&&h&&(d=g,h=y),!d&&!h){p&&(o.content=Ci(o.content,c.index,vc));continue}if(h)for(n=r.length-1;n>=0;n--){let b=r[n];if(r[n].level<s)break;if(b.single===p&&r[n].level===s){b=r[n];let w,k;p?(w=e.md.options.quotes[2],k=e.md.options.quotes[3]):(w=e.md.options.quotes[0],k=e.md.options.quotes[1]),o.content=Ci(o.content,c.index,k),t[b.token].content=Ci(t[b.token].content,b.pos,w),a+=k.length-1,b.token===i&&(a+=w.length-1),u=o.content,l=u.length,r.length=n;continue e}}d?r.push({token:i,pos:c.index,single:p,level:s}):h&&p&&(o.content=Ci(o.content,c.index,vc))}}}function hk(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)t.tokens[e].type!=="inline"||!dk.test(t.tokens[e].content)||fk(t.tokens[e].children,t)}function pk(t){let e,n;const r=t.tokens,i=r.length;for(let o=0;o<i;o++){if(r[o].type!=="inline")continue;const s=r[o].children,u=s.length;for(e=0;e<u;e++)s[e].type==="text_special"&&(s[e].type="text");for(e=n=0;e<u;e++)s[e].type==="text"&&e+1<u&&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 _s=[["normalize",Y3],["block",X3],["inline",ek],["linkify",rk],["replacements",ck],["smartquotes",hk],["text_join",pk]];function ka(){this.ruler=new Fe;for(let t=0;t<_s.length;t++)this.ruler.push(_s[t][0],_s[t][1])}ka.prototype.process=function(t){const e=this.ruler.getRules("");for(let n=0,r=e.length;n<r;n++)e[n](t)};ka.prototype.State=gh;function gt(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 i=this.src;for(let o=0,s=0,u=0,a=0,l=i.length,c=!1;s<l;s++){const d=i.charCodeAt(s);if(!c)if(Y(d)){u++,d===9?a+=4-a%4:a++;continue}else c=!0;(d===10||s===l-1)&&(d!==10&&s++,this.bMarks.push(o),this.eMarks.push(s),this.tShift.push(u),this.sCount.push(a),this.bsCount.push(0),c=!1,u=0,a=0,o=s+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}gt.prototype.push=function(t,e,n){const r=new tt(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};gt.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};gt.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;e<n&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e};gt.prototype.skipSpaces=function(e){for(let n=this.src.length;e<n;e++){const r=this.src.charCodeAt(e);if(!Y(r))break}return e};gt.prototype.skipSpacesBack=function(e,n){if(e<=n)return e;for(;e>n;)if(!Y(this.src.charCodeAt(--e)))return e+1;return e};gt.prototype.skipChars=function(e,n){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===n;e++);return e};gt.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};gt.prototype.getLines=function(e,n,r,i){if(e>=n)return"";const o=new Array(n-e);for(let s=0,u=e;u<n;u++,s++){let a=0;const l=this.bMarks[u];let c=l,d;for(u+1<n||i?d=this.eMarks[u]+1:d=this.eMarks[u];c<d&&a<r;){const h=this.src.charCodeAt(c);if(Y(h))h===9?a+=4-(a+this.bsCount[u])%4:a++;else if(c-l<this.tShift[u])a++;else break;c++}a>r?o[s]=new Array(a-r+1).join(" ")+this.src.slice(c,d):o[s]=this.src.slice(c,d)}return o.join("")};gt.prototype.Token=tt;const mk=65536;function Ns(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function Cc(t){const e=[],n=t.length;let r=0,i=t.charCodeAt(r),o=!1,s=0,u="";for(;r<n;)i===124&&(o?(u+=t.substring(s,r-1),s=r):(e.push(u+t.substring(s,r)),u="",s=r+1)),o=i===92,r++,i=t.charCodeAt(r);return e.push(u+t.substring(s)),e}function gk(t,e,n,r){if(e+2>n)return!1;let i=e+1;if(t.sCount[i]<t.blkIndent||t.sCount[i]-t.blkIndent>=4)return!1;let o=t.bMarks[i]+t.tShift[i];if(o>=t.eMarks[i])return!1;const s=t.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58||o>=t.eMarks[i])return!1;const u=t.src.charCodeAt(o++);if(u!==124&&u!==45&&u!==58&&!Y(u)||s===45&&Y(u))return!1;for(;o<t.eMarks[i];){const b=t.src.charCodeAt(o);if(b!==124&&b!==45&&b!==58&&!Y(b))return!1;o++}let a=Ns(t,e+1),l=a.split("|");const c=[];for(let b=0;b<l.length;b++){const w=l[b].trim();if(!w){if(b===0||b===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(w))return!1;w.charCodeAt(w.length-1)===58?c.push(w.charCodeAt(0)===58?"center":"right"):w.charCodeAt(0)===58?c.push("left"):c.push("")}if(a=Ns(t,e).trim(),a.indexOf("|")===-1||t.sCount[e]-t.blkIndent>=4)return!1;l=Cc(a),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop();const d=l.length;if(d===0||d!==c.length)return!1;if(r)return!0;const h=t.parentType;t.parentType="table";const p=t.md.block.ruler.getRules("blockquote"),f=t.push("table_open","table",1),m=[e,0];f.map=m;const g=t.push("thead_open","thead",1);g.map=[e,e+1];const y=t.push("tr_open","tr",1);y.map=[e,e+1];for(let b=0;b<l.length;b++){const w=t.push("th_open","th",1);c[b]&&(w.attrs=[["style","text-align:"+c[b]]]);const k=t.push("inline","",0);k.content=l[b].trim(),k.children=[],t.push("th_close","th",-1)}t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let x,v=0;for(i=e+2;i<n&&!(t.sCount[i]<t.blkIndent);i++){let b=!1;for(let k=0,D=p.length;k<D;k++)if(p[k](t,i,n,!0)){b=!0;break}if(b||(a=Ns(t,i).trim(),!a)||t.sCount[i]-t.blkIndent>=4||(l=Cc(a),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop(),v+=d-l.length,v>mk))break;if(i===e+2){const k=t.push("tbody_open","tbody",1);k.map=x=[e+2,0]}const w=t.push("tr_open","tr",1);w.map=[i,i+1];for(let k=0;k<d;k++){const D=t.push("td_open","td",1);c[k]&&(D.attrs=[["style","text-align:"+c[k]]]);const _=t.push("inline","",0);_.content=l[k]?l[k].trim():"",_.children=[],t.push("td_close","td",-1)}t.push("tr_close","tr",-1)}return x&&(t.push("tbody_close","tbody",-1),x[1]=i),t.push("table_close","table",-1),m[1]=i,t.parentType=h,t.line=i,!0}function bk(t,e,n){if(t.sCount[e]-t.blkIndent<4)return!1;let r=e+1,i=r;for(;r<n;){if(t.isEmpty(r)){r++;continue}if(t.sCount[r]-t.blkIndent>=4){r++,i=r;continue}break}t.line=i;const o=t.push("code_block","code",0);return o.content=t.getLines(e,i,4+t.blkIndent,!1)+`
`,o.map=[e,t.line],!0}function yk(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||i+3>o)return!1;const s=t.src.charCodeAt(i);if(s!==126&&s!==96)return!1;let u=i;i=t.skipChars(i,s);let a=i-u;if(a<3)return!1;const l=t.src.slice(u,i),c=t.src.slice(i,o);if(s===96&&c.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let d=e,h=!1;for(;d++,!(d>=n||(i=u=t.bMarks[d]+t.tShift[d],o=t.eMarks[d],i<o&&t.sCount[d]<t.blkIndent));)if(t.src.charCodeAt(i)===s&&!(t.sCount[d]-t.blkIndent>=4)&&(i=t.skipChars(i,s),!(i-u<a)&&(i=t.skipSpaces(i),!(i<o)))){h=!0;break}a=t.sCount[e],t.line=d+(h?1:0);const p=t.push("fence","code",0);return p.info=c,p.content=t.getLines(e+1,d,a,!0),p.markup=l,p.map=[e,t.line],!0}function xk(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];const s=t.lineMax;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(i)!==62)return!1;if(r)return!0;const u=[],a=[],l=[],c=[],d=t.md.block.ruler.getRules("blockquote"),h=t.parentType;t.parentType="blockquote";let p=!1,f;for(f=e;f<n;f++){const v=t.sCount[f]<t.blkIndent;if(i=t.bMarks[f]+t.tShift[f],o=t.eMarks[f],i>=o)break;if(t.src.charCodeAt(i++)===62&&!v){let w=t.sCount[f]+1,k,D;t.src.charCodeAt(i)===32?(i++,w++,D=!1,k=!0):t.src.charCodeAt(i)===9?(k=!0,(t.bsCount[f]+w)%4===3?(i++,w++,D=!1):D=!0):k=!1;let _=w;for(u.push(t.bMarks[f]),t.bMarks[f]=i;i<o;){const S=t.src.charCodeAt(i);if(Y(S))S===9?_+=4-(_+t.bsCount[f]+(D?1:0))%4:_++;else break;i++}p=i>=o,a.push(t.bsCount[f]),t.bsCount[f]=t.sCount[f]+1+(k?1:0),l.push(t.sCount[f]),t.sCount[f]=_-w,c.push(t.tShift[f]),t.tShift[f]=i-t.bMarks[f];continue}if(p)break;let b=!1;for(let w=0,k=d.length;w<k;w++)if(d[w](t,f,n,!0)){b=!0;break}if(b){t.lineMax=f,t.blkIndent!==0&&(u.push(t.bMarks[f]),a.push(t.bsCount[f]),c.push(t.tShift[f]),l.push(t.sCount[f]),t.sCount[f]-=t.blkIndent);break}u.push(t.bMarks[f]),a.push(t.bsCount[f]),c.push(t.tShift[f]),l.push(t.sCount[f]),t.sCount[f]=-1}const m=t.blkIndent;t.blkIndent=0;const g=t.push("blockquote_open","blockquote",1);g.markup=">";const y=[e,0];g.map=y,t.md.block.tokenize(t,e,f);const x=t.push("blockquote_close","blockquote",-1);x.markup=">",t.lineMax=s,t.parentType=h,y[1]=t.line;for(let v=0;v<c.length;v++)t.bMarks[v+e]=u[v],t.tShift[v+e]=c[v],t.sCount[v+e]=l[v],t.bsCount[v+e]=a[v];return t.blkIndent=m,!0}function kk(t,e,n,r){const i=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let o=t.bMarks[e]+t.tShift[e];const s=t.src.charCodeAt(o++);if(s!==42&&s!==45&&s!==95)return!1;let u=1;for(;o<i;){const l=t.src.charCodeAt(o++);if(l!==s&&!Y(l))return!1;l===s&&u++}if(u<3)return!1;if(r)return!0;t.line=e+1;const a=t.push("hr","hr",0);return a.map=[e,t.line],a.markup=Array(u+1).join(String.fromCharCode(s)),!0}function wc(t,e){const n=t.eMarks[e];let r=t.bMarks[e]+t.tShift[e];const i=t.src.charCodeAt(r++);if(i!==42&&i!==45&&i!==43)return-1;if(r<n){const o=t.src.charCodeAt(r);if(!Y(o))return-1}return r}function Ec(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];let i=n;if(i+1>=r)return-1;let o=t.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=t.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i<r&&(o=t.src.charCodeAt(i),!Y(o))?-1:i}function vk(t,e){const n=t.level+2;for(let r=e+2,i=t.tokens.length-2;r<i;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 Ck(t,e,n,r){let i,o,s,u,a=e,l=!0;if(t.sCount[a]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[a]-t.listIndent>=4&&t.sCount[a]<t.blkIndent)return!1;let c=!1;r&&t.parentType==="paragraph"&&t.sCount[a]>=t.blkIndent&&(c=!0);let d,h,p;if((p=Ec(t,a))>=0){if(d=!0,s=t.bMarks[a]+t.tShift[a],h=Number(t.src.slice(s,p-1)),c&&h!==1)return!1}else if((p=wc(t,a))>=0)d=!1;else return!1;if(c&&t.skipSpaces(p)>=t.eMarks[a])return!1;if(r)return!0;const f=t.src.charCodeAt(p-1),m=t.tokens.length;d?(u=t.push("ordered_list_open","ol",1),h!==1&&(u.attrs=[["start",h]])):u=t.push("bullet_list_open","ul",1);const g=[a,0];u.map=g,u.markup=String.fromCharCode(f);let y=!1;const x=t.md.block.ruler.getRules("list"),v=t.parentType;for(t.parentType="list";a<n;){o=p,i=t.eMarks[a];const b=t.sCount[a]+p-(t.bMarks[a]+t.tShift[a]);let w=b;for(;o<i;){const W=t.src.charCodeAt(o);if(W===9)w+=4-(w+t.bsCount[a])%4;else if(W===32)w++;else break;o++}const k=o;let D;k>=i?D=1:D=w-b,D>4&&(D=1);const _=b+D;u=t.push("list_item_open","li",1),u.markup=String.fromCharCode(f);const S=[a,0];u.map=S,d&&(u.info=t.src.slice(s,p-1));const R=t.tight,H=t.tShift[a],q=t.sCount[a],V=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=_,t.tight=!0,t.tShift[a]=k-t.bMarks[a],t.sCount[a]=w,k>=i&&t.isEmpty(a+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,a,n,!0),(!t.tight||y)&&(l=!1),y=t.line-a>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=V,t.tShift[a]=H,t.sCount[a]=q,t.tight=R,u=t.push("list_item_close","li",-1),u.markup=String.fromCharCode(f),a=t.line,S[1]=a,a>=n||t.sCount[a]<t.blkIndent||t.sCount[a]-t.blkIndent>=4)break;let ee=!1;for(let W=0,Z=x.length;W<Z;W++)if(x[W](t,a,n,!0)){ee=!0;break}if(ee)break;if(d){if(p=Ec(t,a),p<0)break;s=t.bMarks[a]+t.tShift[a]}else if(p=wc(t,a),p<0)break;if(f!==t.src.charCodeAt(p-1))break}return d?u=t.push("ordered_list_close","ol",-1):u=t.push("bullet_list_close","ul",-1),u.markup=String.fromCharCode(f),g[1]=a,t.line=a,t.parentType=v,l&&vk(t,m),!0}function wk(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e],s=e+1;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(i)!==91)return!1;function u(x){const v=t.lineMax;if(x>=v||t.isEmpty(x))return null;let b=!1;if(t.sCount[x]-t.blkIndent>3&&(b=!0),t.sCount[x]<0&&(b=!0),!b){const D=t.md.block.ruler.getRules("reference"),_=t.parentType;t.parentType="reference";let S=!1;for(let R=0,H=D.length;R<H;R++)if(D[R](t,x,v,!0)){S=!0;break}if(t.parentType=_,S)return null}const w=t.bMarks[x]+t.tShift[x],k=t.eMarks[x];return t.src.slice(w,k+1)}let a=t.src.slice(i,o+1);o=a.length;let l=-1;for(i=1;i<o;i++){const x=a.charCodeAt(i);if(x===91)return!1;if(x===93){l=i;break}else if(x===10){const v=u(s);v!==null&&(a+=v,o=a.length,s++)}else if(x===92&&(i++,i<o&&a.charCodeAt(i)===10)){const v=u(s);v!==null&&(a+=v,o=a.length,s++)}}if(l<0||a.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<o;i++){const x=a.charCodeAt(i);if(x===10){const v=u(s);v!==null&&(a+=v,o=a.length,s++)}else if(!Y(x))break}const c=t.md.helpers.parseLinkDestination(a,i,o);if(!c.ok)return!1;const d=t.md.normalizeLink(c.str);if(!t.md.validateLink(d))return!1;i=c.pos;const h=i,p=s,f=i;for(;i<o;i++){const x=a.charCodeAt(i);if(x===10){const v=u(s);v!==null&&(a+=v,o=a.length,s++)}else if(!Y(x))break}let m=t.md.helpers.parseLinkTitle(a,i,o);for(;m.can_continue;){const x=u(s);if(x===null)break;a+=x,i=o,o=a.length,s++,m=t.md.helpers.parseLinkTitle(a,i,o,m)}let g;for(i<o&&f!==i&&m.ok?(g=m.str,i=m.pos):(g="",i=h,s=p);i<o;){const x=a.charCodeAt(i);if(!Y(x))break;i++}if(i<o&&a.charCodeAt(i)!==10&&g)for(g="",i=h,s=p;i<o;){const x=a.charCodeAt(i);if(!Y(x))break;i++}if(i<o&&a.charCodeAt(i)!==10)return!1;const y=Ko(a.slice(1,l));return y?(r||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[y]>"u"&&(t.env.references[y]={title:g,href:d}),t.line=s),!0):!1}const Ek=["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"],Sk="[a-zA-Z_:][a-zA-Z0-9:._-]*",Ak="[^\"'=<>`\\x00-\\x20]+",Dk="'[^']*'",Tk='"[^"]*"',Mk="(?:"+Ak+"|"+Dk+"|"+Tk+")",Ok="(?:\\s+"+Sk+"(?:\\s*=\\s*"+Mk+")?)",yh="<[A-Za-z][A-Za-z0-9\\-]*"+Ok+"*\\s*\\/?>",xh="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",_k="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",Nk="<[?][\\s\\S]*?[?]>",Ik="<![A-Za-z][^>]*>",Rk="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",Fk=new RegExp("^(?:"+yh+"|"+xh+"|"+_k+"|"+Nk+"|"+Ik+"|"+Rk+")"),Lk=new RegExp("^(?:"+yh+"|"+xh+")"),Rn=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+Ek.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Lk.source+"\\s*$"),/^$/,!1]];function Pk(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(i)!==60)return!1;let s=t.src.slice(i,o),u=0;for(;u<Rn.length&&!Rn[u][0].test(s);u++);if(u===Rn.length)return!1;if(r)return Rn[u][2];let a=e+1;if(!Rn[u][1].test(s)){for(;a<n&&!(t.sCount[a]<t.blkIndent);a++)if(i=t.bMarks[a]+t.tShift[a],o=t.eMarks[a],s=t.src.slice(i,o),Rn[u][1].test(s)){s.length!==0&&a++;break}}t.line=a;const l=t.push("html_block","",0);return l.map=[e,a],l.content=t.getLines(e,a,t.blkIndent,!0),!0}function Bk(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let s=t.src.charCodeAt(i);if(s!==35||i>=o)return!1;let u=1;for(s=t.src.charCodeAt(++i);s===35&&i<o&&u<=6;)u++,s=t.src.charCodeAt(++i);if(u>6||i<o&&!Y(s))return!1;if(r)return!0;o=t.skipSpacesBack(o,i);const a=t.skipCharsBack(o,35,i);a>i&&Y(t.src.charCodeAt(a-1))&&(o=a),t.line=e+1;const l=t.push("heading_open","h"+String(u),1);l.markup="########".slice(0,u),l.map=[e,t.line];const c=t.push("inline","",0);c.content=t.src.slice(i,o).trim(),c.map=[e,t.line],c.children=[];const d=t.push("heading_close","h"+String(u),-1);return d.markup="########".slice(0,u),!0}function zk(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const i=t.parentType;t.parentType="paragraph";let o=0,s,u=e+1;for(;u<n&&!t.isEmpty(u);u++){if(t.sCount[u]-t.blkIndent>3)continue;if(t.sCount[u]>=t.blkIndent){let p=t.bMarks[u]+t.tShift[u];const f=t.eMarks[u];if(p<f&&(s=t.src.charCodeAt(p),(s===45||s===61)&&(p=t.skipChars(p,s),p=t.skipSpaces(p),p>=f))){o=s===61?1:2;break}}if(t.sCount[u]<0)continue;let h=!1;for(let p=0,f=r.length;p<f;p++)if(r[p](t,u,n,!0)){h=!0;break}if(h)break}if(!o)return!1;const a=t.getLines(e,u,t.blkIndent,!1).trim();t.line=u+1;const l=t.push("heading_open","h"+String(o),1);l.markup=String.fromCharCode(s),l.map=[e,t.line];const c=t.push("inline","",0);c.content=a,c.map=[e,t.line-1],c.children=[];const d=t.push("heading_close","h"+String(o),-1);return d.markup=String.fromCharCode(s),t.parentType=i,!0}function $k(t,e,n){const r=t.md.block.ruler.getRules("paragraph"),i=t.parentType;let o=e+1;for(t.parentType="paragraph";o<n&&!t.isEmpty(o);o++){if(t.sCount[o]-t.blkIndent>3||t.sCount[o]<0)continue;let l=!1;for(let c=0,d=r.length;c<d;c++)if(r[c](t,o,n,!0)){l=!0;break}if(l)break}const s=t.getLines(e,o,t.blkIndent,!1).trim();t.line=o;const u=t.push("paragraph_open","p",1);u.map=[e,t.line];const a=t.push("inline","",0);return a.content=s,a.map=[e,t.line],a.children=[],t.push("paragraph_close","p",-1),t.parentType=i,!0}const wi=[["table",gk,["paragraph","reference"]],["code",bk],["fence",yk,["paragraph","reference","blockquote","list"]],["blockquote",xk,["paragraph","reference","blockquote","list"]],["hr",kk,["paragraph","reference","blockquote","list"]],["list",Ck,["paragraph","reference","blockquote"]],["reference",wk],["html_block",Pk,["paragraph","reference","blockquote"]],["heading",Bk,["paragraph","reference","blockquote"]],["lheading",zk],["paragraph",$k]];function Jo(){this.ruler=new Fe;for(let t=0;t<wi.length;t++)this.ruler.push(wi[t][0],wi[t][1],{alt:(wi[t][2]||[]).slice()})}Jo.prototype.tokenize=function(t,e,n){const r=this.ruler.getRules(""),i=r.length,o=t.md.options.maxNesting;let s=e,u=!1;for(;s<n&&(t.line=s=t.skipEmptyLines(s),!(s>=n||t.sCount[s]<t.blkIndent));){if(t.level>=o){t.line=n;break}const a=t.line;let l=!1;for(let c=0;c<i;c++)if(l=r[c](t,s,n,!1),l){if(a>=t.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");t.tight=!u,t.isEmpty(t.line-1)&&(u=!0),s=t.line,s<n&&t.isEmpty(s)&&(u=!0,s++,t.line=s)}};Jo.prototype.parse=function(t,e,n,r){if(!t)return;const i=new this.State(t,e,n,r);this.tokenize(i,i.line,i.lineMax)};Jo.prototype.State=gt;function Zr(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}Zr.prototype.pushPending=function(){const t=new tt("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t};Zr.prototype.push=function(t,e,n){this.pending&&this.pushPending();const r=new tt(t,e,n);let i=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=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};Zr.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t),i=t>0?this.src.charCodeAt(t-1):32;let o=t;for(;o<n&&this.src.charCodeAt(o)===r;)o++;const s=o-t,u=o<n?this.src.charCodeAt(o):32,a=Hr(i)||$r(String.fromCharCode(i)),l=Hr(u)||$r(String.fromCharCode(u)),c=zr(i),d=zr(u),h=!d&&(!l||c||a),p=!c&&(!a||d||l);return{can_open:h&&(e||!p||a),can_close:p&&(e||!h||l),length:s}};Zr.prototype.Token=tt;function Hk(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 jk(t,e){let n=t.pos;for(;n<t.posMax&&!Hk(t.src.charCodeAt(n));)n++;return n===t.pos?!1:(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}const qk=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Vk(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 i=t.pending.match(qk);if(!i)return!1;const o=i[1],s=t.md.linkify.matchAtStart(t.src.slice(n-o.length));if(!s)return!1;let u=s.url;if(u.length<=o.length)return!1;u=u.replace(/\*+$/,"");const a=t.md.normalizeLink(u);if(!t.md.validateLink(a))return!1;if(!e){t.pending=t.pending.slice(0,-o.length);const l=t.push("link_open","a",1);l.attrs=[["href",a]],l.markup="linkify",l.info="auto";const c=t.push("text","",0);c.content=t.md.normalizeLinkText(u);const d=t.push("link_close","a",-1);d.markup="linkify",d.info="auto"}return t.pos+=u.length-o.length,!0}function Wk(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,i=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&t.pending.charCodeAt(o-1)===32;)o--;t.pending=t.pending.slice(0,o),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<i&&Y(t.src.charCodeAt(n));)n++;return t.pos=n,!0}const va=[];for(let t=0;t<256;t++)va.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){va[t.charCodeAt(0)]=1});function Uk(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=t.src.charCodeAt(n);if(i===10){for(e||t.push("hardbreak","br",0),n++;n<r&&(i=t.src.charCodeAt(n),!!Y(i));)n++;return t.pos=n,!0}let o=t.src[n];if(i>=55296&&i<=56319&&n+1<r){const u=t.src.charCodeAt(n+1);u>=56320&&u<=57343&&(o+=t.src[n+1],n++)}const s="\\"+o;if(!e){const u=t.push("text_special","",0);i<256&&va[i]!==0?u.content=o:u.content=s,u.markup=s,u.info="escape"}return t.pos=n+1,!0}function Kk(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const i=n;n++;const o=t.posMax;for(;n<o&&t.src.charCodeAt(n)===96;)n++;const s=t.src.slice(i,n),u=s.length;if(t.backticksScanned&&(t.backticks[u]||0)<=i)return e||(t.pending+=s),t.pos+=u,!0;let a=n,l;for(;(l=t.src.indexOf("`",a))!==-1;){for(a=l+1;a<o&&t.src.charCodeAt(a)===96;)a++;const c=a-l;if(c===u){if(!e){const d=t.push("code_inline","code",0);d.markup=s,d.content=t.src.slice(n,l).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=a,!0}t.backticks[c]=l}return t.backticksScanned=!0,e||(t.pending+=s),t.pos+=u,!0}function Jk(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==126)return!1;const i=t.scanDelims(t.pos,!0);let o=i.length;const s=String.fromCharCode(r);if(o<2)return!1;let u;o%2&&(u=t.push("text","",0),u.content=s,o--);for(let a=0;a<o;a+=2)u=t.push("text","",0),u.content=s+s,t.delimiters.push({marker:r,length:0,token:t.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return t.pos+=i.length,!0}function Sc(t,e){let n;const r=[],i=e.length;for(let o=0;o<i;o++){const s=e[o];if(s.marker!==126||s.end===-1)continue;const u=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[u.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",t.tokens[u.token-1].type==="text"&&t.tokens[u.token-1].content==="~"&&r.push(u.token-1)}for(;r.length;){const o=r.pop();let s=o+1;for(;s<t.tokens.length&&t.tokens[s].type==="s_close";)s++;s--,o!==s&&(n=t.tokens[s],t.tokens[s]=t.tokens[o],t.tokens[o]=n)}}function Gk(t){const e=t.tokens_meta,n=t.tokens_meta.length;Sc(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&Sc(t,e[r].delimiters)}const kh={tokenize:Jk,postProcess:Gk};function Zk(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==95&&r!==42)return!1;const i=t.scanDelims(t.pos,r===42);for(let o=0;o<i.length;o++){const s=t.push("text","",0);s.content=String.fromCharCode(r),t.delimiters.push({marker:r,length:i.length,token:t.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return t.pos+=i.length,!0}function Ac(t,e){const n=e.length;for(let r=n-1;r>=0;r--){const i=e[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=e[i.end],s=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===o.token+1,u=String.fromCharCode(i.marker),a=t.tokens[i.token];a.type=s?"strong_open":"em_open",a.tag=s?"strong":"em",a.nesting=1,a.markup=s?u+u:u,a.content="";const l=t.tokens[o.token];l.type=s?"strong_close":"em_close",l.tag=s?"strong":"em",l.nesting=-1,l.markup=s?u+u:u,l.content="",s&&(t.tokens[e[r-1].token].content="",t.tokens[e[i.end+1].token].content="",r--)}}function Qk(t){const e=t.tokens_meta,n=t.tokens_meta.length;Ac(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&Ac(t,e[r].delimiters)}const vh={tokenize:Zk,postProcess:Qk};function Yk(t,e){let n,r,i,o,s="",u="",a=t.pos,l=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;const c=t.pos,d=t.posMax,h=t.pos+1,p=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(p<0)return!1;let f=p+1;if(f<d&&t.src.charCodeAt(f)===40){for(l=!1,f++;f<d&&(n=t.src.charCodeAt(f),!(!Y(n)&&n!==10));f++);if(f>=d)return!1;if(a=f,i=t.md.helpers.parseLinkDestination(t.src,f,t.posMax),i.ok){for(s=t.md.normalizeLink(i.str),t.md.validateLink(s)?f=i.pos:s="",a=f;f<d&&(n=t.src.charCodeAt(f),!(!Y(n)&&n!==10));f++);if(i=t.md.helpers.parseLinkTitle(t.src,f,t.posMax),f<d&&a!==f&&i.ok)for(u=i.str,f=i.pos;f<d&&(n=t.src.charCodeAt(f),!(!Y(n)&&n!==10));f++);}(f>=d||t.src.charCodeAt(f)!==41)&&(l=!0),f++}if(l){if(typeof t.env.references>"u")return!1;if(f<d&&t.src.charCodeAt(f)===91?(a=f+1,f=t.md.helpers.parseLinkLabel(t,f),f>=0?r=t.src.slice(a,f++):f=p+1):f=p+1,r||(r=t.src.slice(h,p)),o=t.env.references[Ko(r)],!o)return t.pos=c,!1;s=o.href,u=o.title}if(!e){t.pos=h,t.posMax=p;const m=t.push("link_open","a",1),g=[["href",s]];m.attrs=g,u&&g.push(["title",u]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=f,t.posMax=d,!0}function Xk(t,e){let n,r,i,o,s,u,a,l,c="";const d=t.pos,h=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const p=t.pos+2,f=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(f<0)return!1;if(o=f+1,o<h&&t.src.charCodeAt(o)===40){for(o++;o<h&&(n=t.src.charCodeAt(o),!(!Y(n)&&n!==10));o++);if(o>=h)return!1;for(l=o,u=t.md.helpers.parseLinkDestination(t.src,o,t.posMax),u.ok&&(c=t.md.normalizeLink(u.str),t.md.validateLink(c)?o=u.pos:c=""),l=o;o<h&&(n=t.src.charCodeAt(o),!(!Y(n)&&n!==10));o++);if(u=t.md.helpers.parseLinkTitle(t.src,o,t.posMax),o<h&&l!==o&&u.ok)for(a=u.str,o=u.pos;o<h&&(n=t.src.charCodeAt(o),!(!Y(n)&&n!==10));o++);else a="";if(o>=h||t.src.charCodeAt(o)!==41)return t.pos=d,!1;o++}else{if(typeof t.env.references>"u")return!1;if(o<h&&t.src.charCodeAt(o)===91?(l=o+1,o=t.md.helpers.parseLinkLabel(t,o),o>=0?i=t.src.slice(l,o++):o=f+1):o=f+1,i||(i=t.src.slice(p,f)),s=t.env.references[Ko(i)],!s)return t.pos=d,!1;c=s.href,a=s.title}if(!e){r=t.src.slice(p,f);const m=[];t.md.inline.parse(r,t.md,t.env,m);const g=t.push("image","img",0),y=[["src",c],["alt",""]];g.attrs=y,g.children=m,g.content=r,a&&y.push(["title",a])}return t.pos=o,t.posMax=h,!0}const e6=/^([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])?)*)$/,t6=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function n6(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,i=t.posMax;for(;;){if(++n>=i)return!1;const s=t.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const o=t.src.slice(r+1,n);if(t6.test(o)){const s=t.md.normalizeLink(o);if(!t.md.validateLink(s))return!1;if(!e){const u=t.push("link_open","a",1);u.attrs=[["href",s]],u.markup="autolink",u.info="auto";const a=t.push("text","",0);a.content=t.md.normalizeLinkText(o);const l=t.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return t.pos+=o.length+2,!0}if(e6.test(o)){const s=t.md.normalizeLink("mailto:"+o);if(!t.md.validateLink(s))return!1;if(!e){const u=t.push("link_open","a",1);u.attrs=[["href",s]],u.markup="autolink",u.info="auto";const a=t.push("text","",0);a.content=t.md.normalizeLinkText(o);const l=t.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return t.pos+=o.length+2,!0}return!1}function r6(t){return/^<a[>\s]/i.test(t)}function i6(t){return/^<\/a\s*>/i.test(t)}function o6(t){const e=t|32;return e>=97&&e<=122}function s6(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 i=t.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!o6(i))return!1;const o=t.src.slice(r).match(Fk);if(!o)return!1;if(!e){const s=t.push("html_inline","",0);s.content=o[0],r6(s.content)&&t.linkLevel++,i6(s.content)&&t.linkLevel--}return t.pos+=o[0].length,!0}const u6=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,a6=/^&([a-z][a-z0-9]{1,31});/i;function l6(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 o=t.src.slice(n).match(u6);if(o){if(!e){const s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),u=t.push("text_special","",0);u.content=xa(s)?So(s):So(65533),u.markup=o[0],u.info="entity"}return t.pos+=o[0].length,!0}}else{const o=t.src.slice(n).match(a6);if(o){const s=hh(o[0]);if(s!==o[0]){if(!e){const u=t.push("text_special","",0);u.content=s,u.markup=o[0],u.info="entity"}return t.pos+=o[0].length,!0}}}return!1}function Dc(t){const e={},n=t.length;if(!n)return;let r=0,i=-2;const o=[];for(let s=0;s<n;s++){const u=t[s];if(o.push(0),(t[r].marker!==u.marker||i!==u.token-1)&&(r=s),i=u.token,u.length=u.length||0,!u.close)continue;e.hasOwnProperty(u.marker)||(e[u.marker]=[-1,-1,-1,-1,-1,-1]);const a=e[u.marker][(u.open?3:0)+u.length%3];let l=r-o[r]-1,c=l;for(;l>a;l-=o[l]+1){const d=t[l];if(d.marker===u.marker&&d.open&&d.end<0){let h=!1;if((d.close||u.open)&&(d.length+u.length)%3===0&&(d.length%3!==0||u.length%3!==0)&&(h=!0),!h){const p=l>0&&!t[l-1].open?o[l-1]+1:0;o[s]=s-l+p,o[l]=p,u.open=!1,d.end=s,d.close=!1,c=-1,i=-2;break}}}c!==-1&&(e[u.marker][(u.open?3:0)+(u.length||0)%3]=c)}}function c6(t){const e=t.tokens_meta,n=t.tokens_meta.length;Dc(t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&Dc(e[r].delimiters)}function d6(t){let e,n,r=0;const i=t.tokens,o=t.tokens.length;for(e=n=0;e<o;e++)i[e].nesting<0&&r--,i[e].level=r,i[e].nesting>0&&r++,i[e].type==="text"&&e+1<o&&i[e+1].type==="text"?i[e+1].content=i[e].content+i[e+1].content:(e!==n&&(i[n]=i[e]),n++);e!==n&&(i.length=n)}const Is=[["text",jk],["linkify",Vk],["newline",Wk],["escape",Uk],["backticks",Kk],["strikethrough",kh.tokenize],["emphasis",vh.tokenize],["link",Yk],["image",Xk],["autolink",n6],["html_inline",s6],["entity",l6]],Rs=[["balance_pairs",c6],["strikethrough",kh.postProcess],["emphasis",vh.postProcess],["fragments_join",d6]];function Qr(){this.ruler=new Fe;for(let t=0;t<Is.length;t++)this.ruler.push(Is[t][0],Is[t][1]);this.ruler2=new Fe;for(let t=0;t<Rs.length;t++)this.ruler2.push(Rs[t][0],Rs[t][1])}Qr.prototype.skipToken=function(t){const e=t.pos,n=this.ruler.getRules(""),r=n.length,i=t.md.options.maxNesting,o=t.cache;if(typeof o[e]<"u"){t.pos=o[e];return}let s=!1;if(t.level<i){for(let u=0;u<r;u++)if(t.level++,s=n[u](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++,o[e]=t.pos};Qr.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,i=t.md.options.maxNesting;for(;t.pos<r;){const o=t.pos;let s=!1;if(t.level<i){for(let u=0;u<n;u++)if(s=e[u](t,!1),s){if(o>=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()};Qr.prototype.parse=function(t,e,n,r){const i=new this.State(t,e,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),s=o.length;for(let u=0;u<s;u++)o[u](i)};Qr.prototype.State=Zr;function f6(t){const e={};t=t||{},e.src_Any=ah.source,e.src_Cc=lh.source,e.src_Z=dh.source,e.src_P=ba.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 wu(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function Go(t){return Object.prototype.toString.call(t)}function h6(t){return Go(t)==="[object String]"}function p6(t){return Go(t)==="[object Object]"}function m6(t){return Go(t)==="[object RegExp]"}function Tc(t){return Go(t)==="[object Function]"}function g6(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Ch={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function b6(t){return Object.keys(t||{}).reduce(function(e,n){return e||Ch.hasOwnProperty(n)},!1)}const y6={"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}}},x6="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]",k6="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function v6(t){t.__index__=-1,t.__text_cache__=""}function C6(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function Mc(){return function(t,e){e.normalize(t)}}function Ao(t){const e=t.re=f6(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(x6),n.push(e.src_xn),e.src_tlds=n.join("|");function r(u){return u.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 i=[];t.__compiled__={};function o(u,a){throw new Error('(LinkifyIt) Invalid schema "'+u+'": '+a)}Object.keys(t.__schemas__).forEach(function(u){const a=t.__schemas__[u];if(a===null)return;const l={validate:null,link:null};if(t.__compiled__[u]=l,p6(a)){m6(a.validate)?l.validate=C6(a.validate):Tc(a.validate)?l.validate=a.validate:o(u,a),Tc(a.normalize)?l.normalize=a.normalize:a.normalize?o(u,a):l.normalize=Mc();return}if(h6(a)){i.push(u);return}o(u,a)}),i.forEach(function(u){t.__compiled__[t.__schemas__[u]]&&(t.__compiled__[u].validate=t.__compiled__[t.__schemas__[u]].validate,t.__compiled__[u].normalize=t.__compiled__[t.__schemas__[u]].normalize)}),t.__compiled__[""]={validate:null,normalize:Mc()};const s=Object.keys(t.__compiled__).filter(function(u){return u.length>0&&t.__compiled__[u]}).map(g6).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"),v6(t)}function w6(t,e){const n=t.__index__,r=t.__last_index__,i=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=i,this.text=i,this.url=i}function Eu(t,e){const n=new w6(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function $e(t,e){if(!(this instanceof $e))return new $e(t,e);e||b6(t)&&(e=t,t={}),this.__opts__=wu({},Ch,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=wu({},y6,t),this.__compiled__={},this.__tlds__=k6,this.__tlds_replaced__=!1,this.re={},Ao(this)}$e.prototype.add=function(e,n){return this.__schemas__[e]=n,Ao(this),this};$e.prototype.set=function(e){return this.__opts__=wu(this.__opts__,e),this};$e.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let n,r,i,o,s,u,a,l,c;if(this.re.schema_test.test(e)){for(a=this.re.schema_search,a.lastIndex=0;(n=a.exec(e))!==null;)if(o=this.testSchemaAt(e,n[2],a.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<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&&(i=e.match(this.re.email_fuzzy))!==null&&(s=i.index+i[1].length,u=i.index+i[0].length,(this.__index__<0||s<this.__index__||s===this.__index__&&u>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=u))),this.__index__>=0};$e.prototype.pretest=function(e){return this.re.pretest.test(e)};$e.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};$e.prototype.match=function(e){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===e&&(n.push(Eu(this,r)),r=this.__last_index__);let i=r?e.slice(r):e;for(;this.test(i);)n.push(Eu(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};$e.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,Eu(this,0)):null};$e.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,i,o){return r!==o[i-1]}).reverse(),Ao(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Ao(this),this)};$e.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};$e.prototype.onCompile=function(){};const Wn=2147483647,lt=36,Ca=1,jr=26,E6=38,S6=700,wh=72,Eh=128,Sh="-",A6=/^xn--/,D6=/[^\0-\x7F]/,T6=/[\x2E\u3002\uFF0E\uFF61]/g,M6={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Fs=lt-Ca,ct=Math.floor,Ls=String.fromCharCode;function Pt(t){throw new RangeError(M6[t])}function O6(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function Ah(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(T6,".");const i=t.split("."),o=O6(i,e).join(".");return r+o}function Dh(t){const e=[];let n=0;const r=t.length;for(;n<r;){const i=t.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){const o=t.charCodeAt(n++);(o&64512)==56320?e.push(((i&1023)<<10)+(o&1023)+65536):(e.push(i),n--)}else e.push(i)}return e}const _6=t=>String.fromCodePoint(...t),N6=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:lt},Oc=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Th=function(t,e,n){let r=0;for(t=n?ct(t/S6):t>>1,t+=ct(t/e);t>Fs*jr>>1;r+=lt)t=ct(t/Fs);return ct(r+(Fs+1)*t/(t+E6))},Mh=function(t){const e=[],n=t.length;let r=0,i=Eh,o=wh,s=t.lastIndexOf(Sh);s<0&&(s=0);for(let u=0;u<s;++u)t.charCodeAt(u)>=128&&Pt("not-basic"),e.push(t.charCodeAt(u));for(let u=s>0?s+1:0;u<n;){const a=r;for(let c=1,d=lt;;d+=lt){u>=n&&Pt("invalid-input");const h=N6(t.charCodeAt(u++));h>=lt&&Pt("invalid-input"),h>ct((Wn-r)/c)&&Pt("overflow"),r+=h*c;const p=d<=o?Ca:d>=o+jr?jr:d-o;if(h<p)break;const f=lt-p;c>ct(Wn/f)&&Pt("overflow"),c*=f}const l=e.length+1;o=Th(r-a,l,a==0),ct(r/l)>Wn-i&&Pt("overflow"),i+=ct(r/l),r%=l,e.splice(r++,0,i)}return String.fromCodePoint(...e)},Oh=function(t){const e=[];t=Dh(t);const n=t.length;let r=Eh,i=0,o=wh;for(const a of t)a<128&&e.push(Ls(a));const s=e.length;let u=s;for(s&&e.push(Sh);u<n;){let a=Wn;for(const c of t)c>=r&&c<a&&(a=c);const l=u+1;a-r>ct((Wn-i)/l)&&Pt("overflow"),i+=(a-r)*l,r=a;for(const c of t)if(c<r&&++i>Wn&&Pt("overflow"),c===r){let d=i;for(let h=lt;;h+=lt){const p=h<=o?Ca:h>=o+jr?jr:h-o;if(d<p)break;const f=d-p,m=lt-p;e.push(Ls(Oc(p+f%m,0))),d=ct(f/m)}e.push(Ls(Oc(d,0))),o=Th(i,l,u===s),i=0,++u}++i,++r}return e.join("")},I6=function(t){return Ah(t,function(e){return A6.test(e)?Mh(e.slice(4).toLowerCase()):e})},R6=function(t){return Ah(t,function(e){return D6.test(e)?"xn--"+Oh(e):e})},_h={version:"2.3.1",ucs2:{decode:Dh,encode:_6},decode:Mh,encode:Oh,toASCII:R6,toUnicode:I6},F6={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},L6={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"]}}},P6={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"]}}},B6={default:F6,zero:L6,commonmark:P6},z6=/^(vbscript|javascript|file|data):/,$6=/^data:image\/(gif|png|jpeg|webp);/;function H6(t){const e=t.trim().toLowerCase();return z6.test(e)?$6.test(e):!0}const Nh=["http:","https:","mailto:"];function j6(t){const e=ga(t,!0);if(e.hostname&&(!e.protocol||Nh.indexOf(e.protocol)>=0))try{e.hostname=_h.toASCII(e.hostname)}catch{}return Gr(ma(e))}function q6(t){const e=ga(t,!0);if(e.hostname&&(!e.protocol||Nh.indexOf(e.protocol)>=0))try{e.hostname=_h.toUnicode(e.hostname)}catch{}return nr(ma(e),nr.defaultChars+"%")}function Le(t,e){if(!(this instanceof Le))return new Le(t,e);e||ya(t)||(e=t||{},t="default"),this.inline=new Qr,this.block=new Jo,this.core=new ka,this.renderer=new or,this.linkify=new $e,this.validateLink=H6,this.normalizeLink=j6,this.normalizeLinkText=q6,this.utils=W3,this.helpers=Uo({},G3),this.options={},this.configure(t),e&&this.set(e)}Le.prototype.set=function(t){return Uo(this.options,t),this};Le.prototype.configure=function(t){const e=this;if(ya(t)){const n=t;if(t=B6[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};Le.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};Le.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(i){return n.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};Le.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};Le.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};Le.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};Le.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};Le.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const V6=new _u({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:{parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function W6(t,e){if(t.isText&&e.isText&&K.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}class U6{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:K.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,i=r[r.length-1],o=this.schema.text(e,n.marks),s;i&&(s=W6(i,o))?r[r.length-1]=s:r.push(o)}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],i=this.tokenHandlers[r.type];if(!i)throw new Error("Token type `"+r.type+"` not supported by Markdown parser");i(this,r,e,n)}}addNode(e,n,r){let i=this.top(),o=e.createAndFill(n,r,i?i.marks:[]);return o?(this.push(o),o):null}openNode(e,n){this.stack.push({type:e,attrs:n,content:[],marks:K.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}}function hr(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}function Ps(t,e){return t.noCloseToken||e=="code_inline"||e=="code_block"||e=="fence"}function _c(t){return t[t.length-1]==`
`?t.slice(0,t.length-1):t}function Bs(){}function K6(t,e){let n=Object.create(null);for(let r in e){let i=e[r];if(i.block){let o=t.nodeType(i.block);Ps(i,r)?n[r]=(s,u,a,l)=>{s.openNode(o,hr(i,u,a,l)),s.addText(_c(u.content)),s.closeNode()}:(n[r+"_open"]=(s,u,a,l)=>s.openNode(o,hr(i,u,a,l)),n[r+"_close"]=s=>s.closeNode())}else if(i.node){let o=t.nodeType(i.node);n[r]=(s,u,a,l)=>s.addNode(o,hr(i,u,a,l))}else if(i.mark){let o=t.marks[i.mark];Ps(i,r)?n[r]=(s,u,a,l)=>{s.openMark(o.create(hr(i,u,a,l))),s.addText(_c(u.content)),s.closeMark(o)}:(n[r+"_open"]=(s,u,a,l)=>s.openMark(o.create(hr(i,u,a,l))),n[r+"_close"]=s=>s.closeMark(o))}else if(i.ignore)Ps(i,r)?n[r]=Bs:(n[r+"_open"]=Bs,n[r+"_close"]=Bs);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(i))}return n.text=(r,i)=>r.addText(i.content),n.inline=(r,i)=>r.parseTokens(i.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}let J6=class{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=K6(e,r)}parse(e,n={}){let r=new U6(this.schema,this.tokenHandlers),i;r.parseTokens(this.tokenizer.parse(e,n));do i=r.closeNode();while(r.stack.length);return i||this.schema.topNodeType.createAndFill()}};function Nc(t,e){for(;++e<t.length;)if(t[e].type!="list_item_open")return t[e].hidden;return!1}new J6(V6,Le("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(t,e,n)=>({tight:Nc(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:Nc(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}});const G6={open:"",close:"",mixable:!0};let Z6=class{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 Ih(this.nodes,this.marks,n);return r.renderContent(e),r.out}};const bt=new Z6({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||"")+`
`),t.text(e.textContent,!1),t.write(`
`),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,i=t.repeat(" ",r+2);t.renderList(e,i,o=>{let s=String(n+o);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 i=r+1;i<n.childCount;i++)if(n.child(i).type!=e.type){t.write(`\\
`);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=Q6(e,n,r),t.inAutolink?"<":"["},close(t,e,n,r){let{inAutolink:i}=t;return t.inAutolink=void 0,i?">":"]("+e.attrs.href.replace(/[\(\)"]/g,"\\$&")+(e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(t,e,n,r){return Ic(n.child(r),-1)},close(t,e,n,r){return Ic(n.child(r-1),1)},escape:!1}});function Ic(t,e){let n=/`+/g,r,i=0;if(t.isText)for(;r=n.exec(t.text);)i=Math.max(i,r[0].length);let o=i>0&&e>0?" `":"`";for(let s=0;s<i;s++)o+="`";return i>0&&e<0&&(o+=" "),o}function Q6(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)}let Ih=class{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+=`
`),e>1){let n=this.delim,r=/\s+$/.exec(n);r&&(n=n.slice(0,n.length-r[0].length));for(let i=1;i<e;i++)this.out+=n+`
`}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=G6}return n}wrapBlock(e,n,r,i){let o=this.delim;this.write(n??e),this.delim+=e,i(),this.delim=o,this.closeBlock(r)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
`)}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(`
`);for(let i=0;i<r.length;i++)this.write(),!n&&r[i][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(r[i],this.atBlockStart):r[i],i!=r.length-1&&(this.out+=`
`)}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,i)=>this.render(n,e,i))}renderInline(e,n=!0){this.atBlockStart=n;let r=[],i="",o=(s,u,a)=>{let l=s?s.marks:[];s&&s.type.name===this.options.hardBreakNodeName&&(l=l.filter(m=>{if(a+1==e.childCount)return!1;let g=e.child(a+1);return m.isInSet(g.marks)&&(!g.isText||/\S/.test(g.text))}));let c=i;if(i="",s&&s.isText&&l.some(m=>{let g=this.getMark(m.type.name);return g&&g.expelEnclosingWhitespace&&!m.isInSet(r)})){let[m,g,y]=/^(\s*)(.*)$/m.exec(s.text);g&&(c+=g,s=y?s.withText(y):null,s||(l=r))}if(s&&s.isText&&l.some(m=>{let g=this.getMark(m.type.name);return g&&g.expelEnclosingWhitespace&&(a==e.childCount-1||!m.isInSet(e.child(a+1).marks))})){let[m,g,y]=/^(.*?)(\s*)$/m.exec(s.text);y&&(i=y,s=g?s.withText(g):null,s||(l=r))}let d=l.length?l[l.length-1]:null,h=d&&this.getMark(d.type.name).escape===!1,p=l.length-(h?1:0);e:for(let m=0;m<p;m++){let g=l[m];if(!this.getMark(g.type.name).mixable)break;for(let y=0;y<r.length;y++){let x=r[y];if(!this.getMark(x.type.name).mixable)break;if(g.eq(x)){m>y?l=l.slice(0,y).concat(g).concat(l.slice(y,m)).concat(l.slice(m+1,p)):y>m&&(l=l.slice(0,m).concat(l.slice(m+1,y)).concat(g).concat(l.slice(y,p)));continue e}}}let f=0;for(;f<Math.min(r.length,p)&&l[f].eq(r[f]);)++f;for(;f<r.length;)this.text(this.markString(r.pop(),!1,e,a),!1);if(c&&this.text(c),s){for(;r.length<p;){let m=l[r.length];r.push(m),this.text(this.markString(m,!0,e,a),!1),this.atBlockStart=!1}h&&s.isText?this.text(this.markString(d,!0,e,a)+s.text+this.markString(d,!1,e,a+1),!1):this.render(s,e,a),this.atBlockStart=!1}s!=null&&s.isText&&s.nodeSize>0&&(this.atBlockStart=!1)};e.forEach(o),o(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 i=typeof e.attrs.tight<"u"?e.attrs.tight:this.options.tightLists,o=this.inTightList;this.inTightList=i,e.forEach((s,u,a)=>{a&&i&&this.flushClose(1),this.wrapBlock(n,r(a),e,()=>this.render(s,e,a))}),this.inTightList=o}esc(e,n=!1){return e=e.replace(/[`*\\~\[\]_]/g,(r,i)=>r=="_"&&i>0&&i+1<e.length&&e[i-1].match(/\w/)&&e[i+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 i=0;i<n;i++)r+=e;return r}markString(e,n,r,i){let o=this.getMark(e.type.name),s=n?o.open:o.close;return typeof s=="string"?s:s(this,e,r,i)}getEnclosingWhitespace(e){return{leading:(e.match(/^(\s+)/)||[void 0])[0],trailing:(e.match(/(\s+)$/)||[void 0])[0]}}};var Su=!0,Rh=!1,Fh=!1,Y6=function(t,e){e&&(Su=!e.enabled,Rh=!!e.label,Fh=!!e.labelAfter),t.core.ruler.after("inline","github-task-lists",function(n){for(var r=n.tokens,i=2;i<r.length;i++)ev(r,i)&&(tv(r[i],n.Token),Rc(r[i-2],"class","task-list-item"+(Su?"":" enabled")),Rc(r[X6(r,i-2)],"class","contains-task-list"))})};function Rc(t,e,n){var r=t.attrIndex(e),i=[e,n];r<0?t.attrPush(i):t.attrs[r]=i}function X6(t,e){for(var n=t[e].level-1,r=e-1;r>=0;r--)if(t[r].level===n)return r;return-1}function ev(t,e){return sv(t[e])&&uv(t[e-1])&&av(t[e-2])&&lv(t[e])}function tv(t,e){if(t.children.unshift(nv(t,e)),t.children[1].content=t.children[1].content.slice(3),t.content=t.content.slice(3),Rh)if(Fh){t.children.pop();var n="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);t.children[0].content=t.children[0].content.slice(0,-1)+' id="'+n+'">',t.children.push(ov(t.content,n,e))}else t.children.unshift(rv(e)),t.children.push(iv(e))}function nv(t,e){var n=new e("html_inline","",0),r=Su?' disabled="" ':"";return t.content.indexOf("[ ] ")===0?n.content='<input class="task-list-item-checkbox"'+r+'type="checkbox">':(t.content.indexOf("[x] ")===0||t.content.indexOf("[X] ")===0)&&(n.content='<input class="task-list-item-checkbox" checked=""'+r+'type="checkbox">'),n}function rv(t){var e=new t("html_inline","",0);return e.content="<label>",e}function iv(t){var e=new t("html_inline","",0);return e.content="</label>",e}function ov(t,e,n){var r=new n("html_inline","",0);return r.content='<label class="task-list-item-label" for="'+e+'">'+t+"</label>",r.attrs=[{for:e}],r}function sv(t){return t.type==="inline"}function uv(t){return t.type==="paragraph_open"}function av(t){return t.type==="list_item_open"}function lv(t){return t.content.indexOf("[ ] ")===0||t.content.indexOf("[x] ")===0||t.content.indexOf("[X] ")===0}const cv=ep(Y6);var dv=Object.defineProperty,fv=(t,e,n)=>e in t?dv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Do=(t,e,n)=>(fv(t,typeof e!="symbol"?e+"":e,n),n);const hv=se.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:t=>t.getAttribute("data-tight")==="true"||!t.querySelector("p"),renderHTML:t=>({class:t.tight?this.options.tightClass:null,"data-tight":t.tight?"true":null})}}}]},addCommands(){var t=this;return{toggleTight:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:r,commands:i}=n;function o(s){if(!r.isActive(s))return!1;const u=r.getAttributes(s);return i.updateAttributes(s,{tight:e??!(u!=null&&u.tight)})}return t.options.listTypes.some(s=>o(s))}}}}}),Fc=Le();function Lh(t,e){return Fc.inline.State.prototype.scanDelims.call({src:t,posMax:t.length}),new Fc.inline.State(t,null,null,[]).scanDelims(e,!0)}function Ph(t,e,n,r){let i=t.substring(0,n)+t.substring(n+e.length);return i=i.substring(0,n+r)+e+i.substring(n+r),i}function pv(t,e,n,r){let i=n,o=t;for(;i<r&&!Lh(o,i).can_open;)o=Ph(o,e,i,1),i++;return{text:o,from:i,to:r}}function mv(t,e,n,r){let i=r,o=t;for(;i>n&&!Lh(o,i).can_close;)o=Ph(o,e,i,-1),i--;return{text:o,from:n,to:i}}function gv(t,e,n,r){let i={text:t,from:n,to:r};return i=pv(i.text,e,i.from,i.to),i=mv(i.text,e,i.from,i.to),i.to-i.from<e.length+1&&(i.text=i.text.substring(0,i.from)+i.text.substring(i.to+e.length)),i.text}class bv extends Ih{constructor(e,n,r){super(e,n,r??{}),Do(this,"inTable",!1),this.inlines=[]}render(e,n,r){super.render(e,n,r);const i=this.inlines[this.inlines.length-1];if(i!=null&&i.start&&i!==null&&i!==void 0&&i.end){const{delimiter:o,start:s,end:u}=this.normalizeInline(i);this.out=gv(this.out,o,s,u),this.inlines.pop()}}markString(e,n,r,i){const o=this.marks[e.type.name];if(o.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:o.open});else{const s=this.inlines.pop();this.inlines.push({...s,end:this.out.length})}return super.markString(e,n,r,i)}normalizeInline(e){let{start:n,end:r}=e;for(;this.out.charAt(n).match(/\s/);)n++;return{...e,start:n}}}const Bh=ye.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(t,e){var n,r;return this.editor.storage.markdown.options.html?(n=(r=Lc(e))===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${e.type.name}" mark is only available in html mode`),"")},close(t,e){var n,r;return this.editor.storage.markdown.options.html&&(n=(r=Lc(e))===null||r===void 0?void 0:r[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function Lc(t){const e=t.type.schema,n=e.text(" ",[t]),i=Gu(E.from(n),e).match(/^(<.*?>) (<\/.*?>)$/);return i?[i[1],i[2]]:null}function wa(t){const e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function yv(t){return t==null?void 0:t.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function xv(t){const e=t.parentElement,n=e.cloneNode();for(;e.firstChild&&e.firstChild!==t;)n.appendChild(e.firstChild);n.childNodes.length>0&&e.parentElement.insertBefore(n,e),e.parentElement.insertBefore(t,e),e.childNodes.length===0&&e.remove()}function kv(t){const e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}const Zo=G.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(t,e,n){this.editor.storage.markdown.options.html?t.write(vv(e,n)):(console.warn(`Tiptap Markdown: "${e.type.name}" node is only available in html mode`),t.write(`[${e.type.name}]`)),e.isBlock&&t.closeBlock(e)},parse:{}}}}});function vv(t,e){const n=t.type.schema,r=Gu(E.from(t),n);return t.isBlock&&(e instanceof E||e.type.name===n.topNodeType.name)?Cv(r):r}function Cv(t){const n=wa(t).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
${n.innerHTML}
`:`
`,n.outerHTML}const wv=G.create({name:"blockquote"}),Ev=wv.extend({addStorage(){return{markdown:{serialize:bt.nodes.blockquote,parse:{}}}}}),Sv=G.create({name:"bulletList"}),zh=Sv.extend({addStorage(){return{markdown:{serialize(t,e){return t.renderList(e,"  ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),Av=G.create({name:"codeBlock"}),Dv=Av.extend({addStorage(){return{markdown:{serialize(t,e){t.write("```"+(e.attrs.language||"")+`
`),t.text(e.textContent,!1),t.ensureNewLine(),t.write("```"),t.closeBlock(e)},parse:{setup(t){var e;t.set({langPrefix:(e=this.options.languageClassPrefix)!==null&&e!==void 0?e:"language-"})},updateDOM(t){t.innerHTML=t.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),Tv=G.create({name:"hardBreak"}),$h=Tv.extend({addStorage(){return{markdown:{serialize(t,e,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=e.type){t.write(t.inTable?Zo.storage.markdown.serialize.call(this,t,e,n):`\\
`);return}},parse:{}}}}}),Mv=G.create({name:"heading"}),Ov=Mv.extend({addStorage(){return{markdown:{serialize:bt.nodes.heading,parse:{}}}}}),_v=G.create({name:"horizontalRule"}),Nv=_v.extend({addStorage(){return{markdown:{serialize:bt.nodes.horizontal_rule,parse:{}}}}}),Iv=G.create({name:"image"}),Rv=Iv.extend({addStorage(){return{markdown:{serialize:bt.nodes.image,parse:{}}}}}),Fv=G.create({name:"listItem"}),Lv=Fv.extend({addStorage(){return{markdown:{serialize:bt.nodes.list_item,parse:{}}}}}),Pv=G.create({name:"orderedList"});function Bv(t,e,n){let r=0;for(;n-r>0&&e.child(n-r-1).type.name===t.type.name;r++);return r}const zv=Pv.extend({addStorage(){return{markdown:{serialize(t,e,n,r){const i=e.attrs.start||1,o=String(i+e.childCount-1).length,s=t.repeat(" ",o+2),a=Bv(e,n,r)%2?") ":". ";t.renderList(e,s,l=>{const c=String(i+l);return t.repeat(" ",o-c.length)+c+a})},parse:{}}}}}),$v=G.create({name:"paragraph"}),Hv=$v.extend({addStorage(){return{markdown:{serialize:bt.nodes.paragraph,parse:{}}}}});function zs(t){var e,n;return(e=t==null||(n=t.content)===null||n===void 0?void 0:n.content)!==null&&e!==void 0?e:[]}const jv=G.create({name:"table"}),qv=jv.extend({addStorage(){return{markdown:{serialize(t,e,n){if(!Vv(e)){Zo.storage.markdown.serialize.call(this,t,e,n);return}t.inTable=!0,e.forEach((r,i,o)=>{if(t.write("| "),r.forEach((s,u,a)=>{a&&t.write(" | ");const l=s.firstChild;l.textContent.trim()&&t.renderInline(l)}),t.write(" |"),t.ensureNewLine(),!o){const s=Array.from({length:r.childCount}).map(()=>"---").join(" | ");t.write(`| ${s} |`),t.ensureNewLine()}}),t.closeBlock(e),t.inTable=!1},parse:{}}}}});function Pc(t){return t.attrs.colspan>1||t.attrs.rowspan>1}function Vv(t){const e=zs(t),n=e[0],r=e.slice(1);return!(zs(n).some(i=>i.type.name!=="tableHeader"||Pc(i)||i.childCount>1)||r.some(i=>zs(i).some(o=>o.type.name==="tableHeader"||Pc(o)||o.childCount>1)))}const Wv=G.create({name:"taskItem"}),Uv=Wv.extend({addStorage(){return{markdown:{serialize(t,e){const n=e.attrs.checked?"[x]":"[ ]";t.write(`${n} `),t.renderContent(e)},parse:{updateDOM(t){[...t.querySelectorAll(".task-list-item")].forEach(e=>{const n=e.querySelector("input");e.setAttribute("data-type","taskItem"),n&&(e.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),Kv=G.create({name:"taskList"}),Jv=Kv.extend({addStorage(){return{markdown:{serialize:zh.storage.markdown.serialize,parse:{setup(t){t.use(cv)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),Gv=G.create({name:"text"}),Zv=Gv.extend({addStorage(){return{markdown:{serialize(t,e){t.text(yv(e.text))},parse:{}}}}}),Qv=ye.create({name:"bold"}),Yv=Qv.extend({addStorage(){return{markdown:{serialize:bt.marks.strong,parse:{}}}}}),Xv=ye.create({name:"code"}),eC=Xv.extend({addStorage(){return{markdown:{serialize:bt.marks.code,parse:{}}}}}),tC=ye.create({name:"italic"}),nC=tC.extend({addStorage(){return{markdown:{serialize:bt.marks.em,parse:{}}}}}),rC=ye.create({name:"link"}),iC=rC.extend({addStorage(){return{markdown:{serialize:bt.marks.link,parse:{}}}}}),oC=ye.create({name:"strike"}),sC=oC.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),uC=[Ev,zh,Dv,$h,Ov,Nv,Zo,Rv,Lv,zv,Hv,qv,Uv,Jv,Zv,Yv,eC,Bh,nC,iC,sC];function To(t){var e,n;const r=(e=t.storage)===null||e===void 0?void 0:e.markdown,i=(n=uC.find(o=>o.name===t.name))===null||n===void 0?void 0:n.storage.markdown;return r||i?{...i,...r}:null}class aC{constructor(e){Do(this,"editor",null),this.editor=e}serialize(e){const n=new bv(this.nodes,this.marks,{hardBreakNodeName:$h.name});return n.renderContent(e),n.out}get nodes(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Zo)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&e!==void 0?e:[])}}get marks(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(Bh)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&e!==void 0?e:[])}}serializeNode(e){var n;return(n=To(e))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:e.options})}serializeMark(e){var n;const r=(n=To(e))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:e.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:e.options}):r.close}:null}}class lC{constructor(e,n){Do(this,"editor",null),Do(this,"md",null);let{html:r,linkify:i,breaks:o}=n;this.editor=e,this.md=this.withPatchedRenderer(Le({html:r,linkify:i,breaks:o}))}parse(e){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof e=="string"){this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=To(o))===null||s===void 0||(s=s.parse)===null||s===void 0||(s=s.setup)===null||s===void 0?void 0:s.call({editor:this.editor,options:o.options},this.md)});const r=this.md.render(e),i=wa(r);return this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=To(o))===null||s===void 0||(s=s.parse)===null||s===void 0||(s=s.updateDOM)===null||s===void 0?void 0:s.call({editor:this.editor,options:o.options},i)}),this.normalizeDOM(i,{inline:n,content:e}),i.innerHTML}return e}normalizeDOM(e,n){let{inline:r,content:i}=n;return this.normalizeBlocks(e),e.querySelectorAll("*").forEach(o=>{var s;((s=o.nextSibling)===null||s===void 0?void 0:s.nodeType)===Node.TEXT_NODE&&!o.closest("pre")&&(o.nextSibling.textContent=o.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(e,i),e}normalizeBlocks(e){const r=Object.values(this.editor.schema.nodes).filter(i=>i.isBlock).map(i=>{var o;return(o=i.spec.parseDOM)===null||o===void 0?void 0:o.map(s=>s.tag)}).flat().filter(Boolean).join(",");r&&[...e.querySelectorAll(r)].forEach(i=>{i.parentElement.matches("p")&&xv(i)})}normalizeInline(e,n){var r;if((r=e.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var i,o,s,u;const a=e.firstElementChild,{nextElementSibling:l}=a,c=(i=(o=n.match(/^\s+/))===null||o===void 0?void 0:o[0])!==null&&i!==void 0?i:"",d=l?"":(s=(u=n.match(/\s+$/))===null||u===void 0?void 0:u[0])!==null&&s!==void 0?s:"";if(n.match(/^\n\n/)){a.innerHTML=`${a.innerHTML}${d}`;return}kv(a),e.innerHTML=`${c}${e.innerHTML}${d}`}}withPatchedRenderer(e){const n=r=>function(){const i=r(...arguments);return i===`
`?i:i[i.length-1]===`
`?i.slice(0,-1):i};return e.renderer.rules.hardbreak=n(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=n(e.renderer.rules.softbreak),e.renderer.rules.fence=n(e.renderer.rules.fence),e.renderer.rules.code_block=n(e.renderer.rules.code_block),e.renderer.renderToken=n(e.renderer.renderToken.bind(e.renderer)),e}}const cC=se.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new ae({key:new we("markdownClipboard"),props:{clipboardTextParser:(t,e,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(t,{inline:!0});return Dt.fromSchema(this.editor.schema).parseSlice(wa(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),dC=se.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const t=ob.Commands.config.addCommands();return{setContent:(e,n,r)=>i=>t.setContent(i.editor.storage.markdown.parser.parse(e),n,r)(i),insertContentAt:(e,n,r)=>i=>t.insertContentAt(e,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new lC(this.editor,this.options),serializer:new aC(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[hv.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),cC.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),Hh=z.createContext(null),Qo=()=>z.useContext(Hh),fC=({editor:t,children:e})=>M.jsx(Hh.Provider,{value:t,children:e});function hC({onChange:t}){const e=Qo();return z.useEffect(()=>{if(!e)return;const n=()=>{t==null||t(e.storage.markdown.getMarkdown())};return e&&e.on("update",n),()=>{e&&e.off("update",n)}},[e,t]),null}function jh(){const[t,e]=z.useState(!1),n=z.useRef(null);return z.useEffect(()=>{if(!n.current)return;const r=i=>{const o=i.target;requestAnimationFrame(()=>e(o.validity.valid))};return n.current.addEventListener("input",r),()=>{var i;return(i=n.current)==null?void 0:i.removeEventListener("input",r)}},[]),[t,n]}function pC({onDone:t}){const[e,n]=z.useState(""),r=Qo(),[i,o]=jh();z.useEffect(()=>{r&&n(r.getAttributes("link").href)},[r]);const s=()=>{r&&(r.chain().focus().extendMarkRange("link").setLink({href:e}).run(),t())},u=()=>{r&&(r.chain().focus().unsetLink().run(),t())};return r?M.jsxs($s,{children:[M.jsx(mC,{children:M.jsx($c,{ref:o,type:"url",required:!0,value:e,onChange:a=>n(a.target.value),placeholder:"https://example.com"})}),M.jsxs(Du,{justify:"end",children:[M.jsx(Hs,{subtle:!0,disabled:!r.isActive("link"),onClick:u,children:"Remove"}),M.jsx(Hs,{onClick:s,disabled:!i,children:"Set"})]})]}):M.jsx(M.Fragment,{})}const mC=Te(zc).withConfig({displayName:"EditLinkForm__StyledInputWrapper",componentId:"sc-3fc8317a-0"})(["&:has(:user-invalid){border-color:"," !important;}"],t=>t.theme.colors.alert),on=Te.button.withConfig({displayName:"ToggleButton",componentId:"sc-798c0953-0"})(["display:flex;align-items:center;background-color:",";color:",";appearance:none;border:none;border-radius:",";padding:0.4rem;cursor:pointer;",";&:not(:disabled){&:hover{background-color:",";color:",";}}&:disabled{opacity:0.5;cursor:not-allowed;}"],t=>t.$active?t.theme.colors.main:"transparent",t=>t.$active?"white":t.theme.colors.textLight,t=>t.theme.radius,Tu("background-color","color"),t=>t.$active?t.theme.colors.mainDark:t.theme.colors.bg2,t=>t.$active?"white":t.theme.colors.text),gC=t=>t.isActive("codeBlock")?"codeBlock":t.isActive("heading",{level:1})?"heading-1":t.isActive("heading",{level:2})?"heading-2":t.isActive("heading",{level:3})?"heading-3":t.isActive("heading",{level:4})?"heading-4":t.isActive("heading",{level:5})?"heading-5":t.isActive("heading",{level:6})?"heading-6":"paragraph",bC=t=>t.startsWith("heading")?["heading",parseInt(t.split("-")[1])]:[t];function yC(){const t=Qo();if(!t)return M.jsx(M.Fragment,{});const e=gC(t),n=r=>{const[i,o]=bC(r);t.commands.setNode(i,o?{level:o}:void 0)};return M.jsxs(tp,{value:e,disabled:t.isActive("image"),onChange:r=>n(r.target.value),children:[M.jsx("option",{value:"paragraph",children:"Paragraph"}),M.jsx("option",{value:"codeBlock",children:"Codeblock"}),M.jsx("option",{value:"heading-1",children:"Heading 1"}),M.jsx("option",{value:"heading-2",children:"Heading 2"}),M.jsx("option",{value:"heading-3",children:"Heading 3"}),M.jsx("option",{value:"heading-4",children:"Heading 4"}),M.jsx("option",{value:"heading-5",children:"Heading 5"}),M.jsx("option",{value:"heading-6",children:"Heading 6"})]})}function xC(){const t=Qo(),[e,n]=z.useState(!1);return t?M.jsx(iy,{editor:t,children:M.jsxs(kC,{gap:"0.5ch",children:[M.jsx(yC,{}),M.jsx(on,{title:"Toggle bold",$active:!!t.isActive("bold"),onClick:()=>t.chain().focus().toggleBold().run(),disabled:!t.can().chain().focus().toggleBold().run(),type:"button",children:M.jsx(np,{})}),M.jsx(on,{title:"Toggle italic",$active:!!t.isActive("italic"),onClick:()=>t.chain().focus().toggleItalic().run(),disabled:!t.can().chain().focus().toggleItalic().run(),type:"button",children:M.jsx(rp,{})}),M.jsx(on,{title:"Toggle strikethrough",$active:!!t.isActive("strike"),onClick:()=>t.chain().focus().toggleStrike().run(),disabled:!t.can().chain().focus().toggleStrike().run(),type:"button",children:M.jsx(ip,{})}),M.jsx(on,{title:"Toggle blockquote",$active:!!t.isActive("blockquote"),onClick:()=>t.chain().focus().toggleBlockquote().run(),disabled:!t.can().chain().focus().toggleBlockquote().run(),type:"button",children:M.jsx(Hc,{})}),M.jsx(on,{title:"Toggle inline code",$active:!!t.isActive("code"),onClick:()=>t.chain().focus().toggleCode().run(),disabled:!t.can().chain().focus().toggleCode().run(),type:"button",children:M.jsx(Mu,{})}),M.jsx(vC,{modal:!0,open:e,onOpenChange:n,Trigger:M.jsx(on,{as:op,$active:!!t.isActive("link"),disabled:!t.can().chain().focus().toggleCode().run(),type:"button",children:M.jsx(sp,{})}),children:M.jsx(pC,{onDone:()=>n(!1)})})]})}):M.jsx(M.Fragment,{})}const kC=Te(Du).withConfig({displayName:"BubbleMenu__BubbleMenuInner",componentId:"sc-296df297-0"})(["background-color:",";border-radius:",";padding:",";box-shadow:",";@supports (backdrop-filter:blur(5px)){background-color:",";backdrop-filter:blur(5px);}"],t=>t.theme.colors.bg,t=>t.theme.radius,t=>t.theme.size(2),t=>t.theme.boxShadowSoft,t=>Ou(.15,t.theme.colors.bg)),vC=Te(up).withConfig({displayName:"BubbleMenu__StyledPopover",componentId:"sc-296df297-1"})(["background-color:",";backdrop-filter:blur(5px);padding:",";border-radius:",";@supports (backdrop-filter:blur(5px)){background-color:",";backdrop-filter:blur(5px);}"],t=>t.theme.colors.bg,t=>t.theme.size(),t=>t.theme.radius,t=>Ou(.15,t.theme.colors.bg));function CC(t){var e;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=t,u=db(n),a=new RegExp(`\\s${u}$`),l=o?"^":"",c=r?new RegExp(`${l}${u}.*?(?=\\s${u}|$)`,"gm"):new RegExp(`${l}(?:^)?${u}[^\\s${u}]*`,"gm"),d=((e=s.nodeBefore)===null||e===void 0?void 0:e.isText)&&s.nodeBefore.text;if(!d)return null;const h=s.pos-d.length,p=Array.from(d.matchAll(c)).pop();if(!p||p.input===void 0||p.index===void 0)return null;const f=p.input.slice(Math.max(0,p.index-1),p.index),m=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(f);if(i!==null&&!m)return null;const g=h+p.index;let y=g+p[0].length;return r&&a.test(d.slice(y-1,y+1))&&(p[0]+=" ",y+=1),g<s.pos&&y>=s.pos?{range:{from:g,to:y},query:p[0].slice(n.length),text:p[0]}:null}const wC=new we("suggestion");function EC({pluginKey:t=wC,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:u="suggestion",command:a=()=>null,items:l=()=>[],render:c=()=>({}),allow:d=()=>!0,findSuggestionMatch:h=CC}){let p;const f=c==null?void 0:c(),m=new ae({key:t,view(){return{update:async(g,y)=>{var x,v,b,w,k,D,_;const S=(x=this.key)===null||x===void 0?void 0:x.getState(y),R=(v=this.key)===null||v===void 0?void 0:v.getState(g.state),H=S.active&&R.active&&S.range.from!==R.range.from,q=!S.active&&R.active,V=S.active&&!R.active,ee=!q&&!V&&S.query!==R.query,W=q||H&&ee,Z=ee||H,Q=V;if(!W&&!Z&&!Q)return;const U=Q&&!W?S:R,Pe=g.dom.querySelector(`[data-decoration-id="${U.decorationId}"]`);p={editor:e,range:U.range,query:U.query,text:U.text,items:[],command:xe=>a({editor:e,range:U.range,props:xe}),decorationNode:Pe,clientRect:Pe?()=>{var xe;const{decorationId:yt}=(xe=this.key)===null||xe===void 0?void 0:xe.getState(e.state),Me=g.dom.querySelector(`[data-decoration-id="${yt}"]`);return(Me==null?void 0:Me.getBoundingClientRect())||null}:null},W&&((b=f==null?void 0:f.onBeforeStart)===null||b===void 0||b.call(f,p)),Z&&((w=f==null?void 0:f.onBeforeUpdate)===null||w===void 0||w.call(f,p)),(Z||W)&&(p.items=await l({editor:e,query:U.query})),Q&&((k=f==null?void 0:f.onExit)===null||k===void 0||k.call(f,p)),Z&&((D=f==null?void 0:f.onUpdate)===null||D===void 0||D.call(f,p)),W&&((_=f==null?void 0:f.onStart)===null||_===void 0||_.call(f,p))},destroy:()=>{var g;p&&((g=f==null?void 0:f.onExit)===null||g===void 0||g.call(f,p))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(g,y,x,v){const{isEditable:b}=e,{composing:w}=e.view,{selection:k}=g,{empty:D,from:_}=k,S={...y};if(S.composing=w,b&&(D||e.view.composing)){(_<y.range.from||_>y.range.to)&&!w&&!y.composing&&(S.active=!1);const R=h({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:k.$from}),H=`id_${Math.floor(Math.random()*4294967295)}`;R&&d({editor:e,state:v,range:R.range,isActive:y.active})?(S.active=!0,S.decorationId=y.decorationId?y.decorationId:H,S.range=R.range,S.query=R.query,S.text=R.text):S.active=!1}else S.active=!1;return S.active||(S.decorationId=null,S.range={from:0,to:0},S.query=null,S.text=null),S}},props:{handleKeyDown(g,y){var x;const{active:v,range:b}=m.getState(g.state);return v&&((x=f==null?void 0:f.onKeyDown)===null||x===void 0?void 0:x.call(f,{view:g,event:y,range:b}))||!1},decorations(g){const{active:y,range:x,decorationId:v}=m.getState(g);return y?ie.create(g.doc,[_e.inline(x.from,x.to,{nodeName:s,class:u,"data-decoration-id":v})]):null}}});return m}const qh=(t,e)=>`command-list-${t}-item-${e}`,Bc=(t,e)=>{var n;return(n=document.getElementById(qh(t,e)))==null?void 0:n.scrollIntoView({block:"nearest"})},Vh=z.forwardRef(({items:t,command:e},n)=>{const r=z.useId(),[i,o]=z.useState(0),s=u=>{const a=t[u];a&&e(a)};return z.useEffect(()=>o(0),[t]),z.useImperativeHandle(n,()=>({onKeyDown:u=>{if(u.key==="ArrowUp"){const a=(i+t.length-1)%t.length;return o(a),Bc(r,a),!0}if(u.key==="ArrowDown"){const a=(i+1)%t.length;return o(a),Bc(r,a),!0}return u.key==="Enter"?(s(i),!0):!1}}),[i,t]),M.jsx(SC,{type:"hover",children:t.map((u,a)=>{const l=u.icon;return M.jsxs(AC,{id:qh(r,a),onClick:()=>s(a),onMouseEnter:()=>o(a),active:i===a,children:[M.jsx(l,{}),u.title]},u.title)})})});Vh.displayName="CommandList";const SC=Te(ap).withConfig({displayName:"CommandList__ScrollingList",componentId:"sc-218ff917-0"})(["background-color:",";border-radius:",";box-shadow:",";padding:1rem;max-height:min(50dvh,20rem);overflow-y:auto;display:flex;flex-direction:column;gap:0.5rem;align-items:flex-start;@supports (backdrop-filter:blur(5px)){background-color:",";backdrop-filter:blur(5px);}"],t=>t.theme.colors.bg,t=>t.theme.radius,t=>t.theme.boxShadowSoft,t=>Ou(.15,t.theme.colors.bg)),AC=Te.button.withConfig({displayName:"CommandList__ListItemButton",componentId:"sc-218ff917-1"})(["appearance:none;background:",";color:",";border:none;display:flex;align-items:center;gap:1ch;padding:0.5rem;border-radius:",";"],t=>t.active?t.theme.colors.main:"transparent",t=>t.active?t.theme.colors.bg:t.theme.colors.text,t=>t.theme.radius),DC=se.create({name:"slashCommands",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:n})=>{n.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[EC({editor:this.editor,...this.options.suggestion})]}}),TC={items:({query:t})=>[{title:"Bullet List",icon:lp,command:({editor:e,range:n})=>e.chain().focus().deleteRange(n).toggleBulletList().run()},{title:"Codeblock",icon:Mu,command:({editor:e,range:n})=>e.chain().focus().deleteRange(n).setNode("codeBlock").run()},{title:"Quote",icon:Hc,command:({editor:e,range:n})=>e.chain().focus().deleteRange(n).setBlockquote().run()},{title:"Image",icon:cp,command:({editor:e,range:n})=>e.chain().focus().deleteRange(n).setImage({src:""}).run()},{title:"Heading 1",icon:On,command:({editor:e,range:n})=>e.chain().focus().deleteRange(n).setNode("heading",{level:1}).run()},{title:"Heading 2",icon:On,command:({editor:e,range:n})=>e.chain().focus().deleteRange(n).setNode("heading",{level:2}).run()},{title:"Heading 3",icon:On,command:({editor:e,range:n})=>e.chain().focus().deleteRange(n).setNode("heading",{level:3}).run()},{title:"Heading 4",icon:On,command:({editor:e,range:n})=>e.chain().focus().deleteRange(n).setNode("heading",{level:4}).run()},{title:"Heading 5",icon:On,command:({editor:e,range:n})=>e.chain().focus().deleteRange(n).setNode("heading",{level:5}).run()},{title:"Heading 6",icon:On,command:({editor:e,range:n})=>e.chain().focus().deleteRange(n).setNode("heading",{level:6}).run()},{title:"Paragraph",icon:dp,command:({editor:e,range:n})=>e.chain().focus().deleteRange(n).setNode("paragraph").run()}].filter(e=>e.title.toLowerCase().includes(t.toLowerCase())),render:()=>{let t,e;return{onStart:n=>{t=new Zf(Vh,{props:n,editor:n.editor}),n.clientRect&&(e=En("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(n){t.updateProps(n),n.clientRect&&e[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){return n.event.key==="Escape"?(e[0].hide(),!0):t.ref?t.ref.onKeyDown(n.event):!1},onExit(){e[0].destroy(),t.destroy()}}}},MC=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,OC=G.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",ne(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Ef({find:MC,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),_C=OC.extend({addNodeView(){return cy(Wh)}}),Wh=z.forwardRef(({node:t,updateAttributes:e,selected:n,editor:r},i)=>{const o=fp(),[s,u]=z.useState(!1),[a,l]=z.useState(),[c,d]=z.useState(),[h,p]=z.useState(),[f,m]=jh(),g=()=>c?!0:f,y=async()=>{if(c){const x=await o.getResource(c);e({src:x.props.downloadUrl,alt:h})}else a&&e({src:a,alt:h});r.chain().focus().run()};return t.attrs.src?M.jsx(Zl,{children:M.jsx(NC,{ref:i,src:t.attrs.src,alt:"",selected:n})}):M.jsxs(Zl,{children:[M.jsx(IC,{ref:i,selected:n,children:M.jsxs($s,{justify:"flex-start",children:[M.jsxs(RC,{children:[M.jsxs($s,{children:[!c&&M.jsxs(M.Fragment,{children:[M.jsx(LC,{children:M.jsx($c,{autoFocus:!0,ref:m,type:"url",required:!0,placeholder:"Enter a URL...",value:a,onChange:x=>l(x.target.value)})}),M.jsx("span",{children:"Or"})]}),M.jsx(hp,{onButtonClick:()=>u(!0),subject:c,onClear:x=>{x===pp.Subject&&d(void 0)}})]}),M.jsx(FC,{placeholder:"Alt text",value:h,onChange:x=>p(x.target.value)})]}),M.jsx(Du,{justify:"flex-end",children:M.jsx(Hs,{disabled:!g(),onClick:y,children:"Save"})})]})}),M.jsx(mp,{noUpload:!0,show:s,onShowChange:u,onResourcePicked:d,onNewFilePicked:()=>{},allowedMimes:gp})]})});Wh.displayName="MarkdownEditorImage";const NC=Te.img.withConfig({displayName:"ImagePicker__StyledImage",componentId:"sc-8f904e4d-0"})(["max-width:100%;height:auto;border-radius:",";margin-bottom:","rem;"," .tiptap:focus-within &{box-shadow:0 0 0 2px ",";filter:",";}"],t=>t.theme.radius,t=>t.theme.margin,Tu("box-shadow","filter"),t=>t.selected?t.theme.colors.main:"transparent",t=>t.selected?"brightness(0.9)":"none"),IC=Te.div.withConfig({displayName:"ImagePicker__Wrapper",componentId:"sc-8f904e4d-1"})(["border:2px dashed ",";border-radius:",";padding:","rem;margin-bottom:","rem;"],t=>t.selected?t.theme.colors.main:t.theme.colors.bg2,t=>t.theme.radius,t=>t.theme.margin,t=>t.theme.margin),RC=Te.div.withConfig({displayName:"ImagePicker__ColumnGrid",componentId:"sc-8f904e4d-2"})(["display:grid;grid-template-columns:1fr 1fr;gap:","rem;"],t=>t.theme.margin),FC=Te.textarea.withConfig({displayName:"ImagePicker__TextArea",componentId:"sc-8f904e4d-3"})(["width:100%;color:",";background-color:",";padding:","rem;border-radius:",";border:1px solid ",";font-size:1rem;font-family:inherit;resize:vertical;min-height:5rem;"],t=>t.theme.colors.text,t=>t.theme.colors.bg,t=>t.theme.margin/2,t=>t.theme.radius,t=>t.theme.colors.bg2),LC=Te(zc).withConfig({displayName:"ImagePicker__StyledInputWrapper",componentId:"sc-8f904e4d-4"})(["flex:unset;&:has(:user-invalid){border-color:"," !important;}"],t=>t.theme.colors.alert),Au="10rem",PC=1.15;function KC({placeholder:t,initialContent:e,id:n,labelId:r,onChange:i,onBlur:o}){const[s]=z.useState(()=>[cx,dC,i3,Rx.configure({protocols:["http","https","mailto",{scheme:"tel",optionalSlashes:!0}],HTMLAttributes:{class:"tiptap-link",rel:"noopener noreferrer",target:"_blank"}}),_C.configure({HTMLAttributes:{class:"tiptap-image"}}),Fx.configure({placeholder:t??"Start typing..."}),DC.configure({suggestion:TC})]),[u,a]=z.useState(e??""),[l,c]=z.useState(!1),d=ry({extensions:s,content:u,onBlur:o,editorProps:{attributes:{...n&&{id:n},...r&&{"aria-labelledby":r},"data-testid":"markdown-editor"}}}),h=z.useCallback(f=>{a(f),i==null||i(f)},[i]),p=f=>{c(f),f||d==null||d.commands.setContent(u)};return M.jsx(fC,{editor:d,children:M.jsxs(zC,{hideEditor:l,children:[l&&M.jsx($C,{placeholder:t??"Start typing...",onChange:f=>h(f.target.value),value:u}),M.jsxs(G2,{editor:d,children:[M.jsx(oy,{editor:d??null,children:M.jsx(HC,{children:"Type '/' for options"})}),M.jsx(xC,{}),M.jsx(hC,{onChange:h})]},"rich-editor"),M.jsx(jC,{type:"button",$active:l,title:"Edit raw markdown",onClick:()=>p(!l),children:M.jsx(Mu,{})})]})})}const BC=t=>`calc(${t.split(`
`).length*PC}em + 5px)`,zC=Te.div.withConfig({displayName:"AsyncMarkdownEditor__EditorWrapper",componentId:"sc-1a5ae803-0"})(["position:relative;background-color:",";padding:","rem;border-radius:",";box-shadow:0 0 0 1px ",";min-height:",";"," &:focus-within{box-shadow:0 0 0 2px ",";}&:not(:focus-within){& .tiptap p.is-editor-empty:first-child::before{color:",";content:attr(data-placeholder);float:left;height:0;pointer-events:none;}}& .tiptap{display:",";outline:none;width:min(100%,75ch);min-height:",";.tiptap-image{max-width:100%;height:auto;}pre{padding:0.75rem 1rem;background-color:",";border-radius:",";font-family:monospace;code{white-space:pre;color:inherit;padding:0;background:none;font-size:0.8rem;}}blockquote{margin-inline-start:0;border-inline-start:3px solid ",";color:",";padding-inline-start:1rem;}}"],t=>t.theme.colors.bg,t=>t.theme.margin,t=>t.theme.radius,t=>t.theme.colors.bg2,Au,Tu("box-shadow"),t=>t.theme.colors.main,t=>t.theme.colors.textLight,t=>t.hideEditor?"none":"block",Au,t=>t.theme.colors.bg1,t=>t.theme.radius,t=>t.theme.colors.textLight2,t=>t.theme.colors.textLight),$C=Te.textarea.attrs(t=>({style:{height:BC(t.value??"")}})).withConfig({displayName:"AsyncMarkdownEditor__RawEditor",componentId:"sc-1a5ae803-1"})(["border:none;width:100%;min-height:",";outline:none;overflow:visible;height:fit-content;background-color:transparent;color:",";resize:none;"],Au,t=>t.theme.colors.text),HC=Te.span.withConfig({displayName:"AsyncMarkdownEditor__FloatingMenuText",componentId:"sc-1a5ae803-2"})(["color:",";"],t=>t.theme.colors.textLight),jC=Te(on).withConfig({displayName:"AsyncMarkdownEditor__FloatingCodeButton",componentId:"sc-1a5ae803-3"})(["position:absolute;top:0.5rem;right:0.5rem;"]);export{KC as default};
//# sourceMappingURL=chunk_AsyncMarkdownEditor.js.map