vue-spear-tip 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +42 -32
- package/dist/{Button-CgV8TKSe.js → Button-AT1tkLRU.js} +1 -1
- package/dist/{Button-CHi5q2B8.cjs → Button-D8_z61Ku.cjs} +1 -1
- package/dist/{CodeHighlight-qlVamFnM.js → CodeHighlight-DyDayHRK.js} +1 -1
- package/dist/{CodeHighlight-DAFFU7u2.cjs → CodeHighlight-UMxs9Vkf.cjs} +1 -1
- package/dist/{DateField-D0Ilkfym.js → DateField-Bh8myc_m.js} +106 -109
- package/dist/{DateField-BQYZQsBb.cjs → DateField-C39--66z.cjs} +3 -3
- package/dist/{FieldComponent.vue_vue_type_script_lang-hfVg8AIM.js → FieldComponent.vue_vue_type_script_lang-ByNypXQJ.js} +1 -1
- package/dist/{FieldComponent.vue_vue_type_script_lang-C9JoaDDS.cjs → FieldComponent.vue_vue_type_script_lang-CKIGPh72.cjs} +1 -1
- package/dist/Interfaces/IVueClass.d.ts +1 -1
- package/dist/{SelectField-BXQn9OAW.js → SelectField-BYCLVi2Z.js} +2 -2
- package/dist/{SelectField-lpNn-0fg.cjs → SelectField-kLPwlp6_.cjs} +1 -1
- package/dist/{StringField-C9YQH_Va.cjs → StringField-LKU8BrFg.cjs} +1 -1
- package/dist/{StringField-BMGdDwHw.js → StringField-dhAukChr.js} +16 -15
- package/dist/SwitchField-B9X9s4oC.cjs +1 -0
- package/dist/{SwitchField-C2rvdoqS.js → SwitchField-Cx0ih-Pq.js} +18 -18
- package/dist/{Tabs-B76h25-X.js → Tabs-B9ceJt8G.js} +1 -1
- package/dist/{Tabs-BnfWPt_y.cjs → Tabs-CeC1C4GS.cjs} +1 -1
- package/dist/TextField-9rvZGnMh.js +24354 -0
- package/dist/TextField-DA1nC21o.cjs +169 -0
- package/dist/_commonjsHelpers-DqS8WYlY.cjs +1 -0
- package/dist/_commonjsHelpers-VXLwngCN.js +9 -0
- package/dist/core/VueClass.d.ts +1 -1
- package/dist/core/index.d.ts +2 -1
- package/dist/{index-BhdXUlye.js → index-BYxsEEyC.js} +5 -5
- package/dist/{index-CWmP8TIW.cjs → index-Bx8MBlOo.cjs} +1 -1
- package/dist/replaceable/FieldComponent.vue +2 -2
- package/dist/vue-spear-tip.cjs.js +1 -1
- package/dist/vue-spear-tip.css +1 -1
- package/dist/vue-spear-tip.es.js +1 -1
- package/docs/index.html +2 -2
- package/docs/static/{Button-Bunv2LWC.js → Button-Wcmhg4_A.js} +1 -1
- package/docs/static/{CodeHighlight-DQBcinnM.js → CodeHighlight-4bpHBQbZ.js} +1 -1
- package/docs/static/{DateField-CsIlYupR.js → DateField-Cmifejky.js} +2 -2
- package/docs/static/{FieldComponent.vue_vue_type_script_lang-CQ-4feGL.js → FieldComponent.vue_vue_type_script_lang-DNMlGnCe.js} +1 -1
- package/docs/static/{NoSymbolIcon-BbyqUoRs.js → NoSymbolIcon-joZpMvQg.js} +1 -1
- package/docs/static/{SelectField-CViiMPQ4.js → SelectField-uk0sMTaD.js} +1 -1
- package/docs/static/{StringField-FTm4hPIh.css → StringField-BJ5e1NcF.css} +1 -1
- package/docs/static/{StringField-CCJHJt0B.js → StringField-DeFFxwy7.js} +1 -1
- package/docs/static/SwitchField-Ct85pbvZ.css +1 -0
- package/docs/static/SwitchField-DUj2uIpj.js +1 -0
- package/docs/static/{Tabs-CtPaTerA.js → Tabs-CcgvVEoC.js} +1 -1
- package/docs/static/TextField-vLqdts6S.js +169 -0
- package/docs/static/_commonjsHelpers-CV2jkJYL.js +1 -0
- package/docs/static/index-BRwSOXEK.js +2 -0
- package/docs/static/{main-C0xMdd--.js → main-fCY1fm9G.js} +14 -3
- package/docs/static/main-kVqkj31w.css +1 -0
- package/package.json +1 -1
- package/dist/SwitchField-CaTcotfe.cjs +0 -1
- package/dist/TextField-BbNAxetT.cjs +0 -145
- package/dist/TextField-SGxKqPAt.js +0 -19557
- package/docs/static/SwitchField-DTAyMrZv.js +0 -1
- package/docs/static/SwitchField-igvaNnA4.css +0 -1
- package/docs/static/TextField--uApzzsN.js +0 -145
- package/docs/static/index-DVVP040D.js +0 -2
- package/docs/static/main-CKD4jD7A.css +0 -1
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
var U0=Object.defineProperty;var a=(t,e)=>U0(t,"name",{value:e,configurable:!0});import{h as xf,j as ku,r as W0,D as K0,E as kf,F as J0,G as G0,H as wf,I as Z0,J as X0,e as Y0,T as Q0,K as em,L as tm,P as fs,W as nm,V as rm,k as vr,c as Is,o as Ar,m as dc,l as Rs,p as De,a as G,v as qe,n as at,x as Fs,s as im,z as om,M as sm,y as um,b as lm}from"./main-fCY1fm9G.js";import{F as am}from"./FieldComponent.vue_vue_type_script_lang-DNMlGnCe.js";import{g as cm}from"./_commonjsHelpers-CV2jkJYL.js";import{r as dm}from"./NoSymbolIcon-joZpMvQg.js";function se(t){this.content=t}a(se,"OrderedMap");se.prototype={constructor:se,find:a(function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},"find"),get:a(function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},"get"),update:a(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 se(o)},"update"),remove:a(function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new se(n)},"remove"),addToStart:a(function(t,e){return new se([t,e].concat(this.remove(t).content))},"addToStart"),addToEnd:a(function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new se(n)},"addToEnd"),addBefore:a(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 se(i)},"addBefore"),forEach:a(function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},"forEach"),prepend:a(function(t){return t=se.from(t),t.size?new se(t.content.concat(this.subtract(t).content)):this},"prepend"),append:a(function(t){return t=se.from(t),t.size?new se(this.subtract(t).content.concat(t.content)):this},"append"),subtract:a(function(t){var e=this;t=se.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},"subtract"),toObject:a(function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},"toObject"),get size(){return this.content.length>>1}};se.from=function(t){if(t instanceof se)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new se(e)};function Cf(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=Cf(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}a(Cf,"findDiffStart");function Ef(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),l=s.nodeSize;if(s==u){n-=l,r-=l;continue}if(!s.sameMarkup(u))return{a:n,b:r};if(s.isText&&s.text!=u.text){let c=0,d=Math.min(s.text.length,u.text.length);for(;c<d&&s.text[s.text.length-c-1]==u.text[u.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||u.content.size){let c=Ef(s.content,u.content,n-1,r-1);if(c)return c}n-=l,r-=l}}a(Ef,"findDiffEnd");const oe=class oe{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 l=this.content[s],c=u+l.nodeSize;if(c>e&&r(l,i+u,o||null,s)!==!1&&l.content.size){let d=u+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,i+d)}u=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(u,l)=>{let c=u.isText?u.text.slice(Math.max(e,l)-l,n-l):u.isLeaf?i?typeof i=="function"?i(u):i:u.type.spec.leafText?u.type.spec.leafText(u):"":"";u.isBlock&&(u.isLeaf&&c||u.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},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 oe(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],l=s+u.nodeSize;l>e&&((s<e||l>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=l}return new oe(r,i)}cutByIndex(e,n){return e==n?oe.empty:e==0&&n==this.content.length?this:new oe(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 oe(i,o)}addToStart(e){return new oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new oe(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 Cf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ef(this,e,n,r)}findIndex(e){if(e==0)return Si(0,e);if(e==this.size)return Si(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=e)return o==e?Si(n+1,o):Si(n,r);r=o}}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 oe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new oe(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return oe.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 oe(n||e,r)}static from(e){if(!e)return oe.empty;if(e instanceof oe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new oe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};a(oe,"Fragment");let A=oe;A.empty=new A([],0);const Ls={index:0,offset:0};function Si(t,e){return Ls.index=t,Ls.offset=e,Ls}a(Si,"retIndex");function Ui(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(!Ui(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ui(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}a(Ui,"compareDeep");var jt;let B=(jt=class{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&&Ui(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 jt.none;if(e instanceof jt)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}},a(jt,"Mark"),jt);B.none=[];const Ma=class Ma extends Error{};a(Ma,"ReplaceError");let sr=Ma;const _t=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=vf(this.content,e+this.openStart,n);return r&&new _t(r,this.openStart,this.openEnd)}removeBetween(e,n){return new _t(Sf(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(A.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)}};a(_t,"Slice");let M=_t;M.empty=new M(A.empty,0,0);function Sf(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(Sf(o.content,e-i-1,n-i-1)))}a(Sf,"removeRange");function vf(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let u=vf(s.content,e-o-1,n,s);return u&&t.replaceChild(i,s.copy(u))}a(vf,"insertInto");function fm(t,e,n){if(n.openStart>t.depth)throw new sr("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new sr("Inconsistent open depths");return Af(t,e,n,0)}a(fm,"replace$1");function Af(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=Af(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 mn(s,u.cut(0,t.parentOffset).append(n.content).append(u.cut(e.parentOffset)))}else{let{start:s,end:u}=hm(n,t);return mn(o,Tf(t,s,u,e,r))}else return mn(o,Wi(t,e,r))}a(Af,"replaceOuter");function Mf(t,e){if(!e.type.compatibleContent(t.type))throw new sr("Cannot join "+e.type.name+" onto "+t.type.name)}a(Mf,"checkJoin");function wu(t,e,n){let r=t.node(n);return Mf(r,e.node(n)),r}a(wu,"joinable$1");function pn(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)}a(pn,"addNode");function Ir(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&&(pn(t.nodeAfter,r),o++));for(let u=o;u<s;u++)pn(i.child(u),r);e&&e.depth==n&&e.textOffset&&pn(e.nodeBefore,r)}a(Ir,"addRange");function mn(t,e){return t.type.checkContent(e),t.copy(e)}a(mn,"close");function Tf(t,e,n,r,i){let o=t.depth>i&&wu(t,e,i+1),s=r.depth>i&&wu(n,r,i+1),u=[];return Ir(null,t,i,u),o&&s&&e.index(i)==n.index(i)?(Mf(o,s),pn(mn(o,Tf(t,e,n,r,i+1)),u)):(o&&pn(mn(o,Wi(t,e,i+1)),u),Ir(e,n,i,u),s&&pn(mn(s,Wi(n,r,i+1)),u)),Ir(r,null,i,u),new A(u)}a(Tf,"replaceThreeWay");function Wi(t,e,n){let r=[];if(Ir(null,t,n,r),t.depth>n){let i=wu(t,e,n+1);pn(mn(i,Wi(t,e,n+1)),r)}return Ir(e,null,n,r),new A(r)}a(Wi,"replaceTwoWay");function hm(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(A.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}a(hm,"prepareSliceForReplace");const qr=class qr{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 B.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 ur(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:l}=s.content.findIndex(o),c=o-l;if(r.push(s,u,i+l),!c||(s=s.child(u),s.isText))break;o=c-1,i+=l+1}return new qr(n,r,o)}static resolveCached(e,n){let r=fc.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 fc.set(e,r=new Cu);let i=r.elts[r.i]=qr.resolve(e,n);return r.i=(r.i+1)%pm,i}};a(qr,"ResolvedPos");let Ki=qr;const Ta=class Ta{constructor(){this.elts=[],this.i=0}};a(Ta,"ResolveCache");let Cu=Ta;const pm=12,fc=new WeakMap,Da=class Da{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)}};a(Da,"NodeRange");let ur=Da;const mm=Object.create(null);var qt;let zt=(qt=class{constructor(e,n,r,i=B.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||A.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,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&&Ui(this.attrs,n||e.defaultAttrs||mm)&&B.sameSet(this.marks,r||B.none)}copy(e=null){return e==this.content?this:new qt(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new qt(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 M.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),u=i.start(s),c=i.node(s).content.cut(i.pos-u,o.pos-u);return new M(c,i.depth-s,o.depth-s)}replace(e,n,r){return fm(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 Ki.resolveCached(this,e)}resolveNoCache(e){return Ki.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()+")"),Df(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=A.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 l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=B.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(!B.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=A.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}},a(qt,"Node"),qt);zt.prototype.text=void 0;const Ur=class Ur extends zt{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):Df(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 Ur(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ur(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}};a(Ur,"TextNode");let Eu=Ur;function Df(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}a(Df,"wrapMarks");const es=class es{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Su(e,n);if(r.next==null)return es.empty;let i=Of(r);r.next&&r.err("Unexpected trailing text");let o=Cm(wm(i));return Em(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 l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return A.from(u.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:d,next:f}=s.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let p=o(f,u.concat(d));if(p)return p}}return null}return a(o,"search"),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:l}=o.next[s];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in n)&&(!i.type||l.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 a(n,"scan"),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(`
|
|
2
|
+
`)}};a(es,"ContentMatch");let vn=es;vn.empty=new vn(!0);const Oa=class Oa{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+"')")}};a(Oa,"TokenStream");let Su=Oa;function Of(t){let e=[];do e.push(gm(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}a(Of,"parseExpr");function gm(t){let e=[];do e.push(bm(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}a(gm,"parseExprSeq");function bm(t){let e=km(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=ym(t,e);else break;return e}a(bm,"parseExprSubscript");function hc(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}a(hc,"parseNum");function ym(t,e){let n=hc(t),r=n;return t.eat(",")&&(t.next!="}"?r=hc(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}a(ym,"parseExprRange");function xm(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.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}a(xm,"resolveName");function km(t){if(t.eat("(")){let e=Of(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=xm(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}}}a(km,"parseExprAtom");function wm(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}a(n,"node");function r(s,u,l){let c={term:l,to:u};return e[s].push(c),c}a(r,"edge");function i(s,u){s.forEach(l=>l.to=u)}a(i,"connect");function o(s,u){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,u)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],u);if(l==s.exprs.length-1)return c;i(c,u=n())}else if(s.type=="star"){let l=n();return r(u,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,u),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(u)].concat(o(s.expr,u));if(s.type=="range"){let l=u;for(let c=0;c<s.min;c++){let d=n();i(o(s.expr,l),d),l=d}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let d=n();r(l,d),i(o(s.expr,l),d),l=d}return[r(l)]}else{if(s.type=="name")return[r(u,void 0,s.value)];throw new Error("Unknown expr type")}}}a(o,"compile")}a(wm,"nfa");function _f(t,e){return e-t}a(_f,"cmp");function pc(t,e){let n=[];return r(e),n.sort(_f);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:l}=o[s];!u&&n.indexOf(l)==-1&&r(l)}}a(r,"scan")}a(pc,"nullFrom");function Cm(t){let e=Object.create(null);return n(pc(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:u,to:l})=>{if(!u)return;let c;for(let d=0;d<i.length;d++)i[d][0]==u&&(c=i[d][1]);pc(t,l).forEach(d=>{c||i.push([u,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let o=e[r.join(",")]=new vn(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let u=i[s][1].sort(_f);o.next.push({type:i[s][0],next:e[u.join(",")]||n(u)})}return o}}a(Cm,"dfa");function Em(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:l,next:c}=i.next[u];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}a(Em,"checkForDeadEnds");function Nf(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}a(Nf,"defaultAttrs");function If(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}a(If,"computeAttrs");function Rf(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])}}a(Rf,"checkAttrs");function Ff(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new vu(t,r,e[r]);return n}a(Ff,"initAttrs");var kn;let mc=(kn=class{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=Ff(e,r.attrs),this.defaultAttrs=Nf(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==vn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:If(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new zt(this,this.computeAttrs(e),A.from(n),B.setFrom(r))}createChecked(e=null,n,r){return n=A.from(n),this.checkContent(n),new zt(this,this.computeAttrs(e),n,B.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=A.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(A.empty,!0);return o?new zt(this,e,n.append(o),B.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){Rf(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:B.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new kn(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}},a(kn,"NodeType"),kn);function Sm(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}`)}}a(Sm,"validateType");const _a=class _a{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Sm(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}};a(_a,"Attribute");let vu=_a;const ts=class ts{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Ff(e,i.attrs),this.excluded=null;let o=Nf(this.attrs);this.instance=o?new B(this,o):null}create(e=null){return!e&&this.instance?this.instance:new B(this,If(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new ts(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){Rf(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}};a(ts,"MarkType");let Ji=ts;const Na=class Na{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=se.from(e.nodes),n.marks=se.from(e.marks||{}),this.nodes=mc.compile(this.spec.nodes,this),this.marks=Ji.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",u=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=vn.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?gc(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==""?[]:gc(this,s.split(" "))}this.nodeFromJSON=i=>zt.fromJSON(this,i),this.markFromJSON=i=>B.fromJSON(this,i),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 mc){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 Eu(r,r.defaultAttrs,e,B.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};a(Na,"Schema");let Yr=Na;function gc(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 l=t.marks[u];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}a(gc,"gatherMarks");function vm(t){return t.tag!=null}a(vm,"isTagRule");function Am(t){return t.style!=null}a(Am,"isStyleRule");const Wr=class Wr{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(vm(i))this.tags.push(i);else if(Am(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 Gi(this,n,!1);return r.addAll(e,B.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Gi(this,n,!0);return r.addAll(e,B.none,n.from,n.to),M.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(Dm(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 l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let u=n[s];if((u.priority==null?50:u.priority)<o)break}n.splice(s,0,i)}a(r,"insert");for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=yc(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=yc(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Wr(e,Wr.schemaRules(e)))}};a(Wr,"DOMParser");let $t=Wr;const Lf={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},Mm={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Pf={ol:!0,ul:!0},Qr=1,Au=2,Rr=4;function bc(t,e,n){return e!=null?(e?Qr:0)|(e==="full"?Au:0):t&&t.whitespace=="pre"?Qr|Au:n&~Rr}a(bc,"wsOptionsFor");const Ia=class Ia{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=B.none,this.match=o||(s&Rr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(A.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&Qr)){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=A.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(A.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&&!Lf.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}};a(Ia,"NodeContext");let Pn=Ia;const Ra=class Ra{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=bc(null,n.preserveWhitespace,0)|(r?Rr:0);i?o=new Pn(i.type,i.attrs,B.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new Pn(null,null,B.none,!0,null,s):o=new Pn(e.schema.topNodeType,null,B.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,o=i.options&Au?"full":this.localPreserveWS||(i.options&Qr)>0,{schema:s}=this.parser;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
|
|
3
|
+
`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let u=r.split(/\r?\n|\r/);for(let l=0;l<u.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),u[l]&&this.insertNode(s.text(u[l]),n,!/\S/.test(u[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let u=i.content[i.content.length-1],l=e.previousSibling;(!u||l&&l.nodeName=="BR"||u.isText&&/[ \t\r\n\u000c]$/.test(u.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),u;Pf.hasOwnProperty(s)&&this.parser.normalizeLists&&Tm(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(u=this.parser.matchTag(e,this,r));e:if(l?l.ignore:Mm.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,d=this.needsBlock;if(Lf.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=l&&l.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),c&&this.sync(o),this.needsBlock=d}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?u:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
|
+
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let 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 l=this.parser.matchStyle(o,s,this,u);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)u=l;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,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.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(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}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,r){let i,o;for(let s=this.open,u=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+u)&&(i=c,o=l,!c.length))break;if(l.solid){if(r)break;u+=2}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)n=this.enterInner(i[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let s=B.none;for(let u of i.concat(e.marks))(o.type?o.type.allowsMarkType(u.type):xc(u.type,e.type))&&(s=u.addToSet(s));return o.content.push(e.mark(s)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r,!1);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=bc(e,o,s.options);s.options&Rr&&s.content.length==0&&(u|=Rr);let l=B.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):xc(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Pn(e,n,l,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;this.localPreserveWS&&(this.nodes[n].options|=Qr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=a((u,l)=>{for(;u>=0;u--){let c=n[u];if(c==""){if(u==n.length-1||u==0)continue;for(;l>=o;l--)if(s(u-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0},"match");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}}};a(Ra,"ParseContext");let Gi=Ra;function Tm(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Pf.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}a(Tm,"normalizeList");function Dm(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}a(Dm,"matches");function yc(t){let e={};for(let n in t)e[n]=t[n];return e}a(yc,"copy");function xc(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a(u=>{o.push(u);for(let l=0;l<u.edgeCount;l++){let{type:c,next:d}=u.edge(l);if(c==e||o.indexOf(d)<0&&s(d))return!0}},"scan");if(s(i.contentMatch))return!0}}a(xc,"markMayApply");const ns=class ns{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Ps(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let u=0,l=0;for(;u<o.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[u][0])||c.type.spec.spanning===!1)break;u++,l++}for(;u<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],d=this.serializeMark(c,s.isInline,n);d&&(o.push([c,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=zi(Ps(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&&zi(Ps(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return zi(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ns(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=kc(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return kc(e.marks)}};a(ns,"DOMSerializer");let An=ns;function kc(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}a(kc,"gatherToDOM");function Ps(t){return t.document||window.document}a(Ps,"doc$1");const wc=new WeakMap;function Om(t){let e=wc.get(t);return e===void 0&&wc.set(t,e=_m(t)),e}a(Om,"suspiciousAttributes");function _m(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 a(n,"scan"),n(t),e}a(_m,"suspiciousAttributesInner");function zi(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=Om(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,l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let f in c)if(c[f]!=null){let p=f.indexOf(" ");p>0?l.setAttributeNS(f.slice(0,p),f.slice(p+1),c[f]):f=="style"&&l.style?l.style.cssText=c[f]:l.setAttribute(f,c[f])}}for(let f=d;f<e.length;f++){let p=e[f];if(p===0){if(f<e.length-1||f>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:m}=zi(t,p,n,r);if(l.appendChild(h),m){if(u)throw new RangeError("Multiple content holes");u=m}}}return{dom:l,contentDOM:u}}a(zi,"renderSpec");const Bf=65535,zf=Math.pow(2,16);function Nm(t,e){return t+e*zf}a(Nm,"makeRecover");function Cc(t){return t&Bf}a(Cc,"recoverIndex");function Im(t){return(t-(t&Bf))/zf}a(Im,"recoverOffset");const $f=1,Hf=2,$i=4,Vf=8,Fa=class Fa{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Vf)>0}get deletedBefore(){return(this.delInfo&($f|$i))>0}get deletedAfter(){return(this.delInfo&(Hf|$i))>0}get deletedAcross(){return(this.delInfo&$i)>0}};a(Fa,"MapResult");let ei=Fa;const Nt=class Nt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Nt.empty)return Nt.empty}recover(e){let n=0,r=Cc(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+Im(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 l=this.ranges[u]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[u+o],d=this.ranges[u+s],f=l+c;if(e<=f){let p=c?e==l?-1:e==f?1:n:n,h=l+i+(p<0?0:d);if(r)return h;let m=e==(n<0?l:f)?null:Nm(u/3,e-l),g=e==l?Hf:e==f?$f:$i;return(n<0?e!=l:e!=f)&&(g|=Vf),new ei(h,g,m)}i+=d-c}return r?e+i:new ei(e+i,0,null)}touches(e,n){let r=0,i=Cc(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let l=this.ranges[u]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[u+o],d=l+c;if(e<=d&&u==i*3)return!0;r+=this.ranges[u+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],u=s-(this.inverted?o:0),l=s+(this.inverted?0:o),c=this.ranges[i+n],d=this.ranges[i+r];e(u,u+c,l,l+d),o+=d-c}}invert(){return new Nt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Nt.empty:new Nt(e<0?[0,-e,0]:[0,0,e])}};a(Nt,"StepMap");let wt=Nt;wt.empty=new wt([]);const Kr=class Kr{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Kr(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let 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 Kr;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 l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this._maps[l].recover(u.recover);continue}}i|=u.delInfo,e=u.pos}return r?e:new ei(e,i,null)}};a(Kr,"Mapping");let Zi=Kr;const Bs=Object.create(null),La=class La{getMap(){return wt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Bs[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 Bs)throw new RangeError("Duplicate use of step JSON ID "+e);return Bs[e]=n,n.prototype.jsonID=e,n}};a(La,"Step");let ie=La;const tn=class tn{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new tn(e,null)}static fail(e){return new tn(null,e)}static fromReplace(e,n,r,i){try{return tn.ok(e.replace(n,r,i))}catch(o){if(o instanceof sr)return tn.fail(o.message);throw o}}};a(tn,"StepResult");let ae=tn;function Sl(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(Sl(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return A.fromArray(r)}a(Sl,"mapFragment");const nn=class nn extends ie{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 M(Sl(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 ae.fromReplace(e,this.from,this.to,o)}invert(){return new Ut(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 nn(n.pos,r.pos,this.mark)}merge(e){return e instanceof nn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new nn(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 nn(n.from,n.to,e.markFromJSON(n.mark))}};a(nn,"AddMarkStep");let ti=nn;ie.jsonID("addMark",ti);const rn=class rn extends ie{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 M(Sl(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return ae.fromReplace(e,this.from,this.to,r)}invert(){return new ti(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 rn(n.pos,r.pos,this.mark)}merge(e){return e instanceof rn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rn(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 rn(n.from,n.to,e.markFromJSON(n.mark))}};a(rn,"RemoveMarkStep");let Ut=rn;ie.jsonID("removeMark",Ut);const on=class on extends ie{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ae.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ae.fromReplace(e,this.pos,this.pos+1,new M(A.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 on(this.pos,n.marks[i]);return new on(this.pos,this.mark)}}return new lr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new on(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 on(n.pos,e.markFromJSON(n.mark))}};a(on,"AddNodeMarkStep");let ni=on;ie.jsonID("addNodeMark",ni);const Jr=class Jr extends ie{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ae.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return ae.fromReplace(e,this.pos,this.pos+1,new M(A.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ni(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Jr(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 Jr(n.pos,e.markFromJSON(n.mark))}};a(Jr,"RemoveNodeMarkStep");let lr=Jr;ie.jsonID("removeNodeMark",lr);const mt=class mt extends ie{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Mu(e,this.from,this.to)?ae.fail("Structure replace would overwrite content"):ae.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new wt([this.from,this.to-this.from,this.slice.size])}invert(e){return new mt(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 mt(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof mt)||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?M.empty:new M(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new mt(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?M.empty:new M(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new mt(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 mt(n.from,n.to,M.fromJSON(e,n.slice),!!n.structure)}};a(mt,"ReplaceStep");let Ae=mt;ie.jsonID("replace",Ae);const Bn=class Bn extends ie{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&&(Mu(e,this.from,this.gapFrom)||Mu(e,this.gapTo,this.to)))return ae.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return ae.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?ae.fromReplace(e,this.from,this.to,r):ae.fail("Content does not fit in gap")}getMap(){return new wt([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 Bn(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 Bn(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 Bn(n.from,n.to,n.gapFrom,n.gapTo,M.fromJSON(e,n.slice),n.insert,!!n.structure)}};a(Bn,"ReplaceAroundStep");let he=Bn;ie.jsonID("replaceAround",he);function Mu(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}a(Mu,"contentBetween");function Rm(t,e,n,r){let i=[],o=[],s,u;t.doc.nodesBetween(e,n,(l,c,d)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&d.type.allowsMarkType(r.type)){let p=Math.max(c,e),h=Math.min(c+l.nodeSize,n),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(s&&s.to==p&&s.mark.eq(f[g])?s.to=h:i.push(s=new Ut(p,h,f[g])));u&&u.to==p?u.to=h:o.push(u=new ti(p,h,r))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}a(Rm,"addMark");function Fm(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,u)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof Ji){let c=s.marks,d;for(;d=r.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(u+s.nodeSize,n);for(let d=0;d<l.length;d++){let f=l[d],p;for(let h=0;h<i.length;h++){let m=i[h];m.step==o-1&&f.eq(i[h].style)&&(p=m)}p?(p.to=c,p.step=o):i.push({style:f,from:Math.max(u,e),to:c,step:o})}}}),i.forEach(s=>t.step(new Ut(s.from,s.to,s.style)))}a(Fm,"removeMark");function vl(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],u=e+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),d=u+c.nodeSize,f=r.matchType(c.type);if(!f)s.push(new Ae(u,d,M.empty));else{r=f;for(let p=0;p<c.marks.length;p++)n.allowsMarkType(c.marks[p].type)||t.step(new Ut(u,d,c.marks[p]));if(i&&c.isText&&n.whitespace!="pre"){let p,h=/\r?\n|\r/g,m;for(;p=h.exec(c.text);)m||(m=new M(A.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new Ae(u+p.index,u+p.index+p[0].length,m))}}u=d}if(!r.validEnd){let l=r.fillBefore(A.empty,!0);t.replace(u,u,new M(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}a(vl,"clearIncompatible");function Lm(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}a(Lm,"canCut");function wr(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||!Lm(i,o,s))break}return null}a(wr,"liftTarget");function Pm(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),u=i.after(o+1),l=s,c=u,d=A.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,d=A.from(r.node(m).copy(d)),f++):l--;let p=A.empty,h=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,p=A.from(i.node(m).copy(p)),h++):c++;t.step(new he(l,c,s,u,new M(d.append(p),f,h),d.size-f,!0))}a(Pm,"lift$2");function Al(t,e,n=null,r=t){let i=Bm(t,e),o=i&&zm(r,e);return o?i.map(Ec).concat({type:e,attrs:n}).concat(o.map(Ec)):null}a(Al,"findWrapping");function Ec(t){return{type:t,attrs:null}}a(Ec,"withAttrs");function Bm(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}a(Bm,"findWrappingOutside");function zm(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}a(zm,"findWrappingInside");function $m(t,e,n){let r=A.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=A.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new he(i,o,i,o,new M(r,0,0),n.length,!0))}a($m,"wrap");function Hm(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 l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&Vm(t.doc,t.mapping.slice(o).map(u),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!m?c=!1:!h&&m&&(c=!0)}c===!1&&qf(t,s,u,o),vl(t,t.mapping.slice(o).map(u,1),r,void 0,c===null);let d=t.mapping.slice(o),f=d.map(u,1),p=d.map(u+s.nodeSize,1);return t.step(new he(f,p,f+1,p-1,new M(A.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&jf(t,s,u,o),!1}})}a(Hm,"setBlockType$1");function jf(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 l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}a(jf,"replaceNewlines");function qf(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(`
|
|
5
|
+
`))}})}a(qf,"replaceLinebreaks");function Vm(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}a(Vm,"canChangeType");function jm(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 he(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new M(A.from(s),0,0),1,!0))}a(jm,"setNodeMarkup");function xt(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,d=n-2;c>o;c--,d--){let f=i.node(c),p=i.index(c);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),m=r&&r[d+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[d]||f;if(!f.canReplace(p+1,f.childCount)||!g.type.validContent(h))return!1}let u=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(u,u,l?l.type:i.node(o+1).type)}a(xt,"canSplit");function qm(t,e,n=1,r){let i=t.doc.resolve(e),o=A.empty,s=A.empty;for(let u=i.depth,l=i.depth-n,c=n-1;u>l;u--,c--){o=A.from(i.node(u).copy(o));let d=r&&r[c];s=A.from(d?d.type.create(d.attrs,s):i.node(u).copy(s))}t.step(new Ae(e,e,new M(o.append(s),n,n),!0))}a(qm,"split");function Xt(t,e){let n=t.resolve(e),r=n.index();return Uf(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}a(Xt,"canJoin");function Um(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}a(Um,"canAppendWithSubstitutedLinebreaks");function Uf(t,e){return!!(t&&e&&!t.isLeaf&&Um(t,e))}a(Uf,"joinable");function hs(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&&Uf(o,s)&&r.node(i).canReplace(u,u+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}a(hs,"joinPoint");function Wm(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let d=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);d&&!f?r=!1:!d&&f&&(r=!0)}let u=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);qf(t,d.node(),d.before(),u)}s.inlineContent&&vl(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=t.mapping.slice(u),c=l.map(e-n);if(t.step(new Ae(c,l.map(e+n,-1),M.empty,!0)),r===!0){let d=t.doc.resolve(c);jf(t,d.node(),d.before(),t.steps.length)}return t}a(Wm,"join");function Km(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}a(Km,"insertPoint");function Wf(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,l=r.index(s)+(u>0?1:0),c=r.node(s),d=!1;if(o==1)d=c.canReplace(l,l,i);else{let f=c.contentMatchAt(l).findWrapping(i.firstChild.type);d=f&&c.canReplaceWith(l,l,f[0])}if(d)return u==0?r.pos:u<0?r.before(s+1):r.after(s+1)}return null}a(Wf,"dropPoint");function ps(t,e,n=e,r=M.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Kf(i,o,r)?new Ae(e,n,r):new Tu(i,o,r).fit()}a(ps,"replaceStep");function Kf(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}a(Kf,"fitsTrivially");const Pa=class Pa{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=A.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=A.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,u=i.depth;for(;s&&u&&o.childCount==1;)o=o.firstChild.content,s--,u--;let l=new M(o,s,u);return e>-1?new he(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Ae(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=zs(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:l,match:c}=this.frontier[u],d,f=null;if(n==1&&(s?c.matchType(s.type)||(f=c.fillBefore(A.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:u,parent:o,inject:f};if(n==2&&s&&(d=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:u,parent:o,wrap:d};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=zs(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new M(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=zs(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new M(Or(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new M(Or(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 g=0;g<o.length;g++)this.openFrontierNode(o[g]);let s=this.unplaced,u=r?r.content:s.content,l=s.openStart-e,c=0,d=[],{match:f,type:p}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)d.push(i.child(g));f=f.matchFragment(i)}let h=u.size+e-(s.content.size-s.openEnd);for(;c<u.childCount;){let g=u.child(c),b=f.matchType(g.type);if(!b)break;c++,(c>1||l==0||g.content.size)&&(f=b,d.push(Jf(g.mark(p.allowedMarks(g.marks)),c==1?l:0,c==u.childCount?h:-1)))}let m=c==u.childCount;m||(h=-1),this.placed=_r(this.placed,n,A.from(d)),this.frontier[n].match=f,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,b=u;g<h;g++){let y=b.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),b=y.content}this.unplaced=m?e==0?M.empty:new M(Or(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new M(Or(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!$s(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=$s(e,n,i,r,o);if(s){for(let u=n-1;u>=0;u--){let{match:l,type:c}=this.frontier[u],d=$s(e,u,c,l,!0);if(!d||d.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=_r(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=_r(this.placed,this.depth,A.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(A.empty,!0);n.childCount&&(this.placed=_r(this.placed,this.frontier.length,n))}};a(Pa,"Fitter");let Tu=Pa;function Or(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Or(t.firstChild.content,e-1,n)))}a(Or,"dropFromFragment");function _r(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(_r(t.lastChild.content,e-1,n)))}a(_r,"addToFragment");function zs(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}a(zs,"contentAt");function Jf(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Jf(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(A.empty,!0)))),t.copy(r)}a(Jf,"closeNodeStart");function $s(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&&!Jm(n,o.content,s)?u:null}a($s,"contentAfterFits");function Jm(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}a(Jm,"invalidMarks");function Gm(t){return t.spec.defining||t.spec.definingForContent}a(Gm,"definesContent");function Zm(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Kf(i,o,r))return t.step(new Ae(e,n,r));let s=Zf(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let u=-(i.depth+1);s.unshift(u);for(let p=i.depth,h=i.pos-1;p>0;p--,h--){let m=i.node(p).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(p)>-1?u=p:i.before(p)==h&&s.splice(1,0,-p)}let l=s.indexOf(u),c=[],d=r.openStart;for(let p=r.content,h=0;;h++){let m=p.firstChild;if(c.push(m),h==r.openStart)break;p=m.content}for(let p=d-1;p>=0;p--){let h=c[p],m=Gm(h.type);if(m&&!h.sameMarkup(i.node(Math.abs(u)-1)))d=p;else if(m||!h.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let h=(p+d+1)%(r.openStart+1),m=c[h];if(m)for(let g=0;g<s.length;g++){let b=s[(g+l)%s.length],y=!0;b<0&&(y=!1,b=-b);let x=i.node(b-1),k=i.index(b-1);if(x.canReplaceWith(k,k,m.type,m.marks))return t.replace(i.before(b),y?o.after(b):n,new M(Gf(r.content,0,r.openStart,h),h,r.openEnd))}}let f=t.steps.length;for(let p=s.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>f));p--){let h=s[p];h<0||(e=i.before(h),n=o.after(h))}}a(Zm,"replaceRange");function Gf(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Gf(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(A.empty,!0))}return t}a(Gf,"closeFragment");function Xm(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=Km(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new M(A.from(r),0,0))}a(Xm,"replaceRangeWith");function Ym(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Zf(r,i);for(let s=0;s<o.length;s++){let u=o[s],l=s==o.length-1;if(l&&u==0||r.node(u).type.contentMatch.validEnd)return t.delete(r.start(u),i.end(u));if(u>0&&(l||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&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}a(Ym,"deleteRange$1");function Zf(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}a(Zf,"coveredDepths");const zn=class zn extends ie{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 ae.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 ae.fromReplace(e,this.pos,this.pos+1,new M(A.from(i),0,n.isLeaf?0:1))}getMap(){return wt.empty}invert(e){return new zn(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 zn(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 zn(n.pos,n.attr,n.value)}};a(zn,"AttrStep");let Xi=zn;ie.jsonID("attr",Xi);const Gr=class Gr extends ie{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 ae.ok(r)}getMap(){return wt.empty}invert(e){return new Gr(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 Gr(n.attr,n.value)}};a(Gr,"DocAttrStep");let Yi=Gr;ie.jsonID("docAttr",Yi);var qn;let ar=(qn=class extends Error{},a(qn,"TransformError"),qn);ar=a(function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},"TransformError");ar.prototype=Object.create(Error.prototype);ar.prototype.constructor=ar;ar.prototype.name="TransformError";const Ba=class Ba{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Zi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ar(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=M.empty){let i=ps(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new M(A.from(r),0,0))}delete(e,n){return this.replace(e,n,M.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Zm(this,e,n,r),this}replaceRangeWith(e,n,r){return Xm(this,e,n,r),this}deleteRange(e,n){return Ym(this,e,n),this}lift(e,n){return Pm(this,e,n),this}join(e,n=1){return Wm(this,e,n),this}wrap(e,n){return $m(this,e,n),this}setBlockType(e,n=e,r,i=null){return Hm(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return jm(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Xi(e,n,r)),this}setDocAttribute(e,n){return this.step(new Yi(e,n)),this}addNodeMark(e,n){return this.step(new ni(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof B)n.isInSet(r.marks)&&this.step(new lr(e,n));else{let i=r.marks,o,s=[];for(;o=n.isInSet(i);)s.push(new lr(e,o)),i=o.removeFromSet(i);for(let u=s.length-1;u>=0;u--)this.step(s[u])}return this}split(e,n=1,r){return qm(this,e,n,r),this}addMark(e,n,r){return Rm(this,e,n,r),this}removeMark(e,n,r){return Fm(this,e,n,r),this}clearIncompatible(e,n,r){return vl(this,e,n,r),this}};a(Ba,"Transform");let Qi=Ba;const Hs=Object.create(null),za=class za{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new eo(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=M.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:l,$to:c}=s[u],d=e.mapping.slice(o);e.replaceRange(d.map(l.pos),d.map(c.pos),u?M.empty:n),u==0&&Ac(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],l=e.mapping.slice(r),c=l.map(s.pos),d=l.map(u.pos);o?e.deleteRange(c,d):(e.replaceRangeWith(c,d,n),Ac(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new R(e):Rn(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?Rn(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Rn(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 ze(e.node(0))}static atStart(e){return Rn(e,e,0,0,1)||new ze(e)}static atEnd(e){return Rn(e,e,e.content.size,e.childCount,-1)||new ze(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Hs[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 Hs)throw new RangeError("Duplicate use of selection JSON ID "+e);return Hs[e]=n,n.prototype.jsonID=e,n}getBookmark(){return R.between(this.$anchor,this.$head).getBookmark()}};a(za,"Selection");let I=za;I.prototype.visible=!0;const $a=class $a{constructor(e,n){this.$from=e,this.$to=n}};a($a,"SelectionRange");let eo=$a,Sc=!1;function vc(t){!Sc&&!t.parent.inlineContent&&(Sc=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}a(vc,"checkTextSelection");const sn=class sn extends I{constructor(e,n=e){vc(e),vc(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 I.near(r);let i=e.resolve(n.map(this.anchor));return new sn(i.parent.inlineContent?i:r,r)}replace(e,n=M.empty){if(super.replace(e,n),n==M.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof sn&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new to(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 sn(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=I.findFrom(n,r,!0)||I.findFrom(n,-r,!0);if(o)n=o.$head;else return I.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(I.findFrom(e,-r,!0)||I.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new sn(e,n)}};a(sn,"TextSelection");let R=sn;I.jsonID("text",R);const rs=class rs{constructor(e,n){this.anchor=e,this.head=n}map(e){return new rs(e.map(this.anchor),e.map(this.head))}resolve(e){return R.between(e.resolve(this.anchor),e.resolve(this.head))}};a(rs,"TextBookmark");let to=rs;const un=class un extends I{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?I.near(o):new un(o)}content(){return new M(A.from(this.node),0,0)}eq(e){return e instanceof un&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Du(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new un(e.resolve(n.anchor))}static create(e,n){return new un(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};a(un,"NodeSelection");let N=un;N.prototype.visible=!1;I.jsonID("node",N);const is=class is{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new to(r,r):new is(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&N.isSelectable(r)?new N(n):I.near(n)}};a(is,"NodeBookmark");let Du=is;const $n=class $n extends I{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=M.empty){if(n==M.empty){e.delete(0,e.doc.content.size);let r=I.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new $n(e)}map(e){return new $n(e)}eq(e){return e instanceof $n}getBookmark(){return Qm}};a($n,"AllSelection");let ze=$n;I.jsonID("all",ze);const Qm={map(){return this},resolve(t){return new ze(t)}};function Rn(t,e,n,r,i,o=!1){if(e.inlineContent)return R.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&&N.isSelectable(u))return N.create(t,n-(i<0?u.nodeSize:0))}else{let l=Rn(t,u,n+i,i<0?u.childCount:0,i,o);if(l)return l}n+=u.nodeSize*i}return null}a(Rn,"findSelectionIn");function Ac(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Ae||i instanceof he))return;let o=t.mapping.maps[r],s;o.forEach((u,l,c,d)=>{s==null&&(s=d)}),t.setSelection(I.near(t.doc.resolve(s),n))}a(Ac,"selectionToInsertionEnd$1");const Mc=1,vi=2,Tc=4,Ha=class Ha extends Qi{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|Mc)&~vi,this.storedMarks=null,this}get selectionSet(){return(this.updated&Mc)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=vi,this}ensureMarks(e){return B.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&vi)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~vi,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)||B.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(I.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|=Tc,this}get scrolledIntoView(){return(this.updated&Tc)>0}};a(Ha,"Transaction");let Ou=Ha;function Dc(t,e){return!e||!t?t:t.bind(e)}a(Dc,"bind");const Va=class Va{constructor(e,n,r){this.name=e,this.init=Dc(n.init,r),this.apply=Dc(n.apply,r)}};a(Va,"FieldDesc");let cn=Va;const e1=[new cn("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new cn("selection",{init(t,e){return t.selection||I.atStart(e.doc)},apply(t){return t.selection}}),new cn("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new cn("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],ja=class ja{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=e1.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 cn(r.key,r.spec.state,r))})}};a(ja,"Configuration");let Fr=ja;const ln=class ln{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 l=i?i[s].n:0,c=i?i[s].state:this,d=l<n.length&&u.spec.appendTransaction.call(u,l?n.slice(l):n,c,r);if(d&&r.filterTransaction(d,s)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),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 ln(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 Ou(this)}static create(e){let n=new Fr(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ln(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 Fr(this.schema,e.plugins),r=n.fields,i=new ln(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 Fr(e.schema,e.plugins),o=new ln(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=zt.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=I.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 l=r[u],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,u)){o[s.name]=c.fromJSON.call(l,e,n[u],o);return}}o[s.name]=s.init(e,o)}}),o}};a(ln,"EditorState");let _u=ln;function Xf(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Xf(i,e,{})),n[r]=i}return n}a(Xf,"bindProps");const qa=class qa{constructor(e){this.spec=e,this.props={},e.props&&Xf(e.props,this,this.props),this.key=e.key?e.key.key:Yf("plugin")}getState(e){return e[this.key]}};a(qa,"Plugin");let V=qa;const Vs=Object.create(null);function Yf(t){return t in Vs?t+"$"+ ++Vs[t]:(Vs[t]=0,t+"$")}a(Yf,"createKey");const Ua=class Ua{constructor(e="key"){this.key=Yf(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};a(Ua,"PluginKey");let U=Ua;const Ml=a((t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0),"deleteSelection$1");function Qf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}a(Qf,"atBlockStart");const eh=a((t,e,n)=>{let r=Qf(t,n);if(!r)return!1;let i=Tl(r);if(!i){let s=r.blockRange(),u=s&&wr(s);return u==null?!1:(e&&e(t.tr.lift(s,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(ah(t,i,e,-1))return!0;if(r.parent.content.size==0&&(cr(o,"end")||N.isSelectable(o)))for(let s=r.depth;;s--){let u=ps(t.doc,r.before(s),r.after(s),M.empty);if(u&&u.slice.size<u.to-u.from){if(e){let l=t.tr.step(u);l.setSelection(cr(o,"end")?I.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):N.create(l.doc,i.pos-o.nodeSize)),e(l.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},"joinBackward$1"),t1=a((t,e,n)=>{let r=Qf(t,n);if(!r)return!1;let i=Tl(r);return i?th(t,i,e):!1},"joinTextblockBackward$1"),n1=a((t,e,n)=>{let r=rh(t,n);if(!r)return!1;let i=Dl(r);return i?th(t,i,e):!1},"joinTextblockForward$1");function th(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 d=i.lastChild;if(!d)return!1;i=d}let s=e.nodeAfter,u=s,l=e.pos+1;for(;!u.isTextblock;l++){if(u.type.spec.isolating)return!1;let d=u.firstChild;if(!d)return!1;u=d}let c=ps(t.doc,o,l,M.empty);if(!c||c.from!=o||c instanceof Ae&&c.slice.size>=l-o)return!1;if(n){let d=t.tr.step(c);d.setSelection(R.create(d.doc,o)),n(d.scrollIntoView())}return!0}a(th,"joinTextblocksAround");function cr(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}a(cr,"textblockAt");const nh=a((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=Tl(r)}let s=o&&o.nodeBefore;return!s||!N.isSelectable(s)?!1:(e&&e(t.tr.setSelection(N.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)},"selectNodeBackward$1");function Tl(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}a(Tl,"findCutBefore");function rh(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}a(rh,"atBlockEnd");const ih=a((t,e,n)=>{let r=rh(t,n);if(!r)return!1;let i=Dl(r);if(!i)return!1;let o=i.nodeAfter;if(ah(t,i,e,1))return!0;if(r.parent.content.size==0&&(cr(o,"start")||N.isSelectable(o))){let s=ps(t.doc,r.before(),r.after(),M.empty);if(s&&s.slice.size<s.to-s.from){if(e){let u=t.tr.step(s);u.setSelection(cr(o,"start")?I.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):N.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},"joinForward$1"),oh=a((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=Dl(r)}let s=o&&o.nodeAfter;return!s||!N.isSelectable(s)?!1:(e&&e(t.tr.setSelection(N.create(t.doc,o.pos)).scrollIntoView()),!0)},"selectNodeForward$1");function Dl(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}a(Dl,"findCutAfter");const r1=a((t,e)=>{let n=t.selection,r=n instanceof N,i;if(r){if(n.node.isTextblock||!Xt(t.doc,n.from))return!1;i=n.from}else if(i=hs(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(N.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},"joinUp$1"),i1=a((t,e)=>{let n=t.selection,r;if(n instanceof N){if(n.node.isTextblock||!Xt(t.doc,n.to))return!1;r=n.to}else if(r=hs(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},"joinDown$1"),o1=a((t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&wr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},"lift$1"),sh=a((t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
6
|
+
`).scrollIntoView()),!0)},"newlineInCode$1");function Ol(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}a(Ol,"defaultBlockAt$1");const s1=a((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=Ol(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let u=n.after(),l=t.tr.replaceWith(u,u,s.createAndFill());l.setSelection(I.near(l.doc.resolve(u),1)),e(l.scrollIntoView())}return!0},"exitCode$1"),uh=a((t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof ze||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Ol(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(R.create(u.doc,s+1)),e(u.scrollIntoView())}return!0},"createParagraphNear$1"),lh=a((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(xt(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&wr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},"liftEmptyBlock$1");function u1(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof N&&e.selection.node.isBlock)return!r.parentOffset||!xt(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,u,l=!1,c=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){l=r.end(h)==r.pos+(r.depth-h),c=r.start(h)==r.pos-(r.depth-h),u=Ol(r.node(h-1).contentMatchAt(r.indexAfter(h-1))),o.unshift(l&&u?{type:u}:null),s=h;break}else{if(h==1)return!1;o.unshift(null)}let d=e.tr;(e.selection instanceof R||e.selection instanceof ze)&&d.deleteSelection();let f=d.mapping.map(r.pos),p=xt(d.doc,f,o.length,o);if(p||(o[0]=u?{type:u}:null,p=xt(d.doc,f,o.length,o)),!p)return!1;if(d.split(f,o.length,o),!l&&c&&r.node(s).type!=u){let h=d.mapping.map(r.before(s)),m=d.doc.resolve(h);u&&r.node(s-1).canReplaceWith(m.index(),m.index()+1,u)&&d.setNodeMarkup(d.mapping.map(r.before(s)),u)}return n&&n(d.scrollIntoView()),!0}}a(u1,"splitBlockAs");const l1=u1(),a1=a((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(N.create(t.doc,i))),!0)},"selectParentNode$1");function c1(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||Xt(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}a(c1,"joinMaybeClear");function ah(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,u,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&c1(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(u=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&u.matchType(s[0]||o.type).validEnd){if(n){let h=e.pos+o.nodeSize,m=A.empty;for(let y=s.length-1;y>=0;y--)m=A.from(s[y].create(null,m));m=A.from(i.copy(m));let g=t.tr.step(new he(e.pos-1,h,e.pos,h,new M(m,1,0),s.length,!0)),b=g.doc.resolve(h+2*s.length);b.nodeAfter&&b.nodeAfter.type==i.type&&Xt(g.doc,b.pos)&&g.join(b.pos),n(g.scrollIntoView())}return!0}let d=o.type.spec.isolating||r>0&&l?null:I.findFrom(e,1),f=d&&d.$from.blockRange(d.$to),p=f&&wr(f);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(f,p).scrollIntoView()),!0;if(c&&cr(o,"start",!0)&&cr(i,"end")){let h=i,m=[];for(;m.push(h),!h.isTextblock;)h=h.lastChild;let g=o,b=1;for(;!g.isTextblock;g=g.firstChild)b++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let y=A.empty;for(let k=m.length-1;k>=0;k--)y=A.from(m[k].copy(y));let x=t.tr.step(new he(e.pos-m.length,e.pos+o.nodeSize,e.pos+b,e.pos+o.nodeSize-b,new M(y,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}a(ah,"deleteBarrier");function ch(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(R.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}a(ch,"selectTextblockSide");const d1=ch(-1),f1=ch(1);function h1(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),u=s&&Al(s,t,e);return u?(r&&r(n.tr.wrap(s,u).scrollIntoView()),!0):!1}}a(h1,"wrapIn$1");function Oc(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,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let d=n.doc.resolve(c),f=d.index();i=d.parent.canReplaceWith(f,f+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:l}}=n.selection.ranges[s];o.setBlockType(u,l,t,e)}r(o.scrollIntoView())}return!0}}a(Oc,"setBlockType");function _l(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}a(_l,"chainCommands");_l(Ml,eh,nh);_l(Ml,ih,oh);_l(sh,uh,lh,l1);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function p1(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let u=r?n.tr:null;return m1(u,s,t,e)?(r&&r(u.scrollIntoView()),!0):!1}}a(p1,"wrapInList$1");function m1(t,e,n,r=null){let i=!1,o=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);o=new ur(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new ur(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let u=Al(o,n,r,e);return u?(t&&g1(t,e,u,i,n),!0):!1}a(m1,"wrapRangeInList");function g1(t,e,n,r,i){let o=A.empty;for(let d=n.length-1;d>=0;d--)o=A.from(n[d].type.create(n[d].attrs,o));t.step(new he(e.start-(r?2:0),e.end,e.start,e.end,new M(o,0,0),n.length,!0));let s=0;for(let d=0;d<n.length;d++)n[d].type==i&&(s=d+1);let u=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let d=e.startIndex,f=e.endIndex,p=!0;d<f;d++,p=!1)!p&&xt(t.doc,l,u)&&(t.split(l,u),l+=2*u),l+=c.child(d).nodeSize;return t}a(g1,"doWrapInList");function b1(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?y1(e,n,t,o):x1(e,n,o):!0:!1}}a(b1,"liftListItem$1");function y1(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new he(o-1,s,o,s,new M(A.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ur(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const u=wr(r);if(u==null)return!1;i.lift(r,u);let l=i.doc.resolve(i.mapping.map(o,-1)-1);return Xt(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}a(y1,"liftToOuterList");function x1(t,e,n){let r=t.tr,i=n.parent;for(let h=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)h-=i.child(m).nodeSize,r.delete(h-1,h+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,l=n.endIndex==i.childCount,c=o.node(-1),d=o.index(-1);if(!c.canReplace(d+(u?0:1),d+1,s.content.append(l?A.empty:A.from(i))))return!1;let f=o.pos,p=f+s.nodeSize;return r.step(new he(f-(u?1:0),p+(l?1:0),f+1,p-1,new M((u?A.empty:A.from(i.copy(A.empty))).append(l?A.empty:A.from(i.copy(A.empty))),u?0:1,l?0:1),u?0:1)),e(r.scrollIntoView()),!0}a(x1,"liftOutOfList");function k1(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let u=o.parent,l=u.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==u.type,d=A.from(c?t.create():null),f=new M(A.from(t.create(null,A.from(u.type.create(null,d)))),c?3:1,0),p=o.start,h=o.end;n(e.tr.step(new he(p-(c?3:1),h,p,h,f,1,!0)).scrollIntoView())}return!0}}a(k1,"sinkListItem$1");const ue=a(function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},"domIndex"),dr=a(function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},"parentNode");let Nu=null;const pt=a(function(t,e,n){let r=Nu||(Nu=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},"textRange"),w1=a(function(){Nu=null},"clearReusedRange"),Mn=a(function(t,e,n,r){return n&&(_c(t,e,n,r,-1)||_c(t,e,n,r,1))},"isEquivalentPosition"),C1=/^(img|br|input|textarea|hr)$/i;function _c(t,e,n,r,i){for(var o;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Ie(t))){let s=t.parentNode;if(!s||s.nodeType!=1||mi(t)||C1.test(t.nodeName)||t.contentEditable=="false")return!1;e=ue(t)+(i<0?0:1),t=s}else if(t.nodeType==1){let s=t.childNodes[e+(i<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((o=s.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)e+=i;else return!1;else t=s,e=i<0?Ie(t):0}else return!1}}a(_c,"scanFor");function Ie(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}a(Ie,"nodeSize");function E1(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Ie(t)}else if(t.parentNode&&!mi(t))e=ue(t),t=t.parentNode;else return null}}a(E1,"textNodeBefore$1");function S1(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&&!mi(t))e=ue(t)+1,t=t.parentNode;else return null}}a(S1,"textNodeAfter$1");function v1(t,e,n){for(let r=e==0,i=e==Ie(t);r||i;){if(t==n)return!0;let o=ue(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==Ie(t)}}a(v1,"isOnEdge");function mi(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)}a(mi,"hasBlockDesc");const ms=a(function(t){return t.focusNode&&Mn(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)},"selectionCollapsed");function en(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}a(en,"keyEvent");function A1(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}a(A1,"deepActiveElement");function M1(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Ie(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Ie(r.startContainer),r.startOffset)}}}a(M1,"caretFromPoint");const nt=typeof navigator<"u"?navigator:null,Nc=typeof document<"u"?document:null,Yt=nt&&nt.userAgent||"",Iu=/Edge\/(\d+)/.exec(Yt),dh=/MSIE \d/.exec(Yt),Ru=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Yt),we=!!(dh||Ru||Iu),Ht=dh?document.documentMode:Ru?+Ru[1]:Iu?+Iu[1]:0,Re=!we&&/gecko\/(\d+)/i.test(Yt);Re&&+(/Firefox\/(\d+)/.exec(Yt)||[0,0])[1];const Fu=!we&&/Chrome\/(\d+)/.exec(Yt),fe=!!Fu,fh=Fu?+Fu[1]:0,ge=!we&&!!nt&&/Apple Computer/.test(nt.vendor),fr=ge&&(/Mobile\/\w+/.test(Yt)||!!nt&&nt.maxTouchPoints>2),Ne=fr||(nt?/Mac/.test(nt.platform):!1),T1=nt?/Win/.test(nt.platform):!1,bt=/Android \d/.test(Yt),gi=!!Nc&&"webkitFontSmoothing"in Nc.documentElement.style,D1=gi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function O1(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}}a(O1,"windowRect");function ct(t,e){return typeof t=="number"?t:t[e]}a(ct,"getSide$1");function _1(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}}a(_1,"clientRect");function Ic(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;){if(s.nodeType!=1){s=dr(s);continue}let u=s,l=u==o.body,c=l?O1(o):_1(u),d=0,f=0;if(e.top<c.top+ct(r,"top")?f=-(c.top-e.top+ct(i,"top")):e.bottom>c.bottom-ct(r,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+ct(i,"top")-c.top:e.bottom-c.bottom+ct(i,"bottom")),e.left<c.left+ct(r,"left")?d=-(c.left-e.left+ct(i,"left")):e.right>c.right-ct(r,"right")&&(d=e.right-c.right+ct(i,"right")),d||f)if(l)o.defaultView.scrollBy(d,f);else{let h=u.scrollLeft,m=u.scrollTop;f&&(u.scrollTop+=f),d&&(u.scrollLeft+=d);let g=u.scrollLeft-h,b=u.scrollTop-m;e={left:e.left-g,top:e.top-b,right:e.right-g,bottom:e.bottom-b}}let p=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(p))break;s=p=="absolute"?s.offsetParent:dr(s)}}a(Ic,"scrollRectIntoView");function N1(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 l=u.getBoundingClientRect();if(l.top>=n-20){r=u,i=l.top;break}}return{refDOM:r,refTop:i,stack:hh(t.dom)}}a(N1,"storeScrollPos");function hh(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=dr(r));return e}a(hh,"scrollStack");function I1({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;ph(n,r==0?0:r-e)}a(I1,"resetScrollPos");function ph(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)}}a(ph,"restoreScrollStack");let _n=null;function R1(t){if(t.setActive)return t.setActive();if(_n)return t.focus(_n);let e=hh(t);t.focus(_n==null?{get preventScroll(){return _n={preventScroll:!0},!0}}:void 0),_n||(_n=!1,ph(e,0))}a(R1,"focusPreventScroll");function mh(t,e){let n,r=2e8,i,o=0,s=e.top,u=e.top,l,c;for(let d=t.firstChild,f=0;d;d=d.nextSibling,f++){let p;if(d.nodeType==1)p=d.getClientRects();else if(d.nodeType==3)p=pt(d).getClientRects();else continue;for(let h=0;h<p.length;h++){let m=p[h];if(m.top<=s&&m.bottom>=u){s=Math.max(m.bottom,s),u=Math.min(m.top,u);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=d,r=g,i=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,d.nodeType==1&&g&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=d,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?F1(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:mh(n,i)}a(mh,"findOffsetInNode");function F1(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=Mt(r,1);if(o.top!=o.bottom&&Nl(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}a(F1,"findOffsetInText");function Nl(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}a(Nl,"inRect");function L1(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}a(L1,"targetKludge");function P1(t,e,n){let{node:r,offset:i}=mh(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)}a(P1,"posFromElement");function B1(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let u=t.docView.nearestDesc(o,!0),l;if(!u)return null;if(u.dom.nodeType==1&&(u.node.isBlock&&u.parent||!u.contentDOM)&&((l=u.dom.getBoundingClientRect()).width||l.height)&&(u.node.isBlock&&u.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(u.dom.nodeName)&&(!s&&l.left>r.left||l.top>r.top?i=u.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(i=u.posAfter),s=!0),!u.contentDOM&&i<0&&!u.node.isText))return(u.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?u.posBefore:u.posAfter;o=u.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}a(B1,"posFromCaret");function gh(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 l=0;l<u.length;l++){let c=u[l];if(Nl(e,c))return gh(s,e,c)}}if((o=(o+1)%r)==i)break}return t}a(gh,"elementFromPoint");function z1(t,e){let n=t.dom.ownerDocument,r,i=0,o=M1(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 c=t.dom.getBoundingClientRect();if(!Nl(e,c)||(s=gh(t.dom,e,c),!s))return null}if(ge)for(let c=s;r&&c;c=dr(c))c.draggable&&(r=void 0);if(s=L1(s,e),r){if(Re&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],f;d.nodeName=="IMG"&&(f=d.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let c;gi&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.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=B1(t,r,i,e))}u==null&&(u=P1(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:u,inside:l?l.posAtStart-l.border:-1}}a(z1,"posAtCoords");function Rc(t){return t.top<t.bottom||t.left<t.right}a(Rc,"nonZero");function Mt(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Rc(r))return r}return Array.prototype.find.call(n,Rc)||t.getBoundingClientRect()}a(Mt,"singleRect");const $1=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function bh(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=gi||Re;if(r.nodeType==3)if(s&&($1.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=Mt(pt(r,i,i),n);if(Re&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=Mt(pt(r,i-1,i-1),-1);if(c.top==l.top){let d=Mt(pt(r,i,i+1),-1);if(d.top!=l.top)return Mr(d,d.left<c.left)}}return l}else{let l=i,c=i,d=n<0?1:-1;return n<0&&!i?(c++,d=-1):n>=0&&i==r.nodeValue.length?(l--,d=1):n<0?l--:c++,Mr(Mt(pt(r,l,c),d),d<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Ie(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return js(l.getBoundingClientRect(),!1)}if(o==null&&i<Ie(r)){let l=r.childNodes[i];if(l.nodeType==1)return js(l.getBoundingClientRect(),!0)}return js(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==Ie(r))){let l=r.childNodes[i-1],c=l.nodeType==3?pt(l,Ie(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Mr(Mt(c,1),!1)}if(o==null&&i<Ie(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?pt(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return Mr(Mt(c,-1),!0)}return Mr(Mt(r.nodeType==3?pt(r):r,-n),n>=0)}a(bh,"coordsAtPos");function Mr(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}}a(Mr,"flattenV");function js(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}}a(js,"flattenH");function yh(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()}}a(yh,"withFlushedState");function H1(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return yh(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=bh(t,i.pos,1);for(let u=o.firstChild;u;u=u.nextSibling){let l;if(u.nodeType==1)l=u.getClientRects();else if(u.nodeType==3)l=pt(u,0,u.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(n=="up"?s.top-d.top>(d.bottom-s.top)*2:d.bottom-s.bottom>(s.bottom-d.top)*2))return!1}}return!0})}a(H1,"endOfTextblockVertical");const V1=/[\u0590-\u08ac]/;function j1(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?!V1.test(r.parent.textContent)||!u.modify?n=="left"||n=="backward"?o:s:yh(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:f}=t.domSelectionRange(),p=u.caretBidiLevel;u.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),b=m&&!h.contains(m.nodeType==1?m:m.parentNode)||l==m&&c==g;try{u.collapse(d,f),l&&(l!=d||c!=f)&&u.extend&&u.extend(l,c)}catch{}return p!=null&&(u.caretBidiLevel=p),b}):r.pos==r.start()||r.pos==r.end()}a(j1,"endOfTextblockHorizontal");let Fc=null,Lc=null,Pc=!1;function q1(t,e,n){return Fc==e&&Lc==n?Pc:(Fc=e,Lc=n,Pc=n=="up"||n=="down"?H1(t,e,n):j1(t,e,n))}a(q1,"endOfTextblock");const Fe=0,Bc=1,dn=2,rt=3,Wa=class Wa{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Fe,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>ue(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;)for(let s=0;s<i.children.length;s++){let u=i.children[s];if(u.size){i=u;break}}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 io){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 no&&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?ue(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?ue(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 l=this.children[u],c=s+l.size;if(i==-1&&e<=c){let d=s+l.border;if(e>=d&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=s;for(let f=u;f>0;f--){let p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){i=ue(p.dom)+1;break}e-=p.size}i==-1&&(i=0)}if(i>-1&&(c>n||u==this.children.length-1)){n=c;for(let d=u+1;d<this.children.length;d++){let f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=ue(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let h=0,m=0;h<this.children.length;h++){let g=this.children[h],b=m+g.size;if(o>m&&s<b)return g.setSelection(e-m-g.border,n-m-g.border,r,i);m=b}let u=this.domFromPos(e,e?-1:1),l=n==e?u:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),d=r.domSelectionRange(),f=!1;if((Re||ge)&&e==n){let{node:h,offset:m}=u;if(h.nodeType==3){if(f=!!(m&&h.nodeValue[m-1]==`
|
|
7
|
+
`),f&&m==h.nodeValue.length)for(let g=h,b;g;g=g.parentNode){if(b=g.nextSibling){b.nodeName=="BR"&&(u=l={node:b.parentNode,offset:ue(b)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=h.childNodes[m-1];f=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(Re&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let h=d.focusNode.childNodes[d.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||f&&ge)&&Mn(u.node,u.offset,d.anchorNode,d.anchorOffset)&&Mn(l.node,l.offset,d.focusNode,d.focusOffset))return;let p=!1;if((c.extend||e==n)&&!(f&&Re)){c.collapse(u.node,u.offset);try{e!=n&&c.extend(l.node,l.offset),p=!0}catch{}}if(!p){if(e>n){let m=u;u=l,l=m}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(u.node,u.offset),c.removeAllRanges(),c.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,l=s-o.border;if(e>=u&&n<=l){this.dirty=e==r||n==s?dn:Bc,e==u&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=rt:o.markDirty(e-u,n-u);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?dn:rt}r=s}this.dirty=dn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?dn:Bc;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}};a(Wa,"ViewDesc");let Tn=Wa;const Ka=class Ka extends Tn{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==Fe&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}};a(Ka,"WidgetViewDesc");let no=Ka;const Ja=class Ja extends Tn{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}};a(Ja,"CompositionViewDesc");let Lu=Ja;const Zr=class Zr extends Tn{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=An.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Zr(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&rt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=rt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Fe){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Fe}}slice(e,n,r){let i=Zr.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=$u(o,n,s,r)),e>0&&(o=$u(o,0,e,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}};a(Zr,"MarkViewDesc");let hr=Zr;const ss=class ss extends Tn{constructor(e,n,r,i,o,s,u,l,c){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],l,c=u&&u(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),d=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:f}=An.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let p=d;return d=wh(d,r,n),c?l=new Pu(e,n,r,i,d,f||null,p,c,o,s+1):n.isText?new ro(e,n,r,i,d,p,o):new ss(e,n,r,i,d,f||null,p,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>A.empty)}return e}matchesNode(e,n,r){return this.dirty==Fe&&e.eq(this.node)&&oo(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,l=new zu(this,s&&s.node,e);J1(this.node,this.innerDeco,(c,d,f)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!f&&l.syncToMarks(d==this.node.childCount?B.none:this.node.child(d).marks,r,e),l.placeWidget(c,e,i)},(c,d,f,p)=>{l.syncToMarks(c.marks,r,e);let h;l.findNodeMatch(c,d,f,p)||u&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(h=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(c,d,f,h,e)||l.updateNextNode(c,d,f,e,p,i)||l.addNode(c,d,f,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==dn)&&(s&&this.protectLocalComposition(e,s),xh(this.contentDOM,this.children,e),fr&&G1(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof R)||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=Z1(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 Lu(this,o,n,i);e.input.compositionNodes.push(s),this.children=$u(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==rt||!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=Fe}updateOuterDeco(e){if(oo(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=kh(this.dom,this.nodeDOM,Bu(this.outerDeco,this.node,n),Bu(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};a(ss,"NodeViewDesc");let Vt=ss;function zc(t,e,n,r,i){wh(r,e,t);let o=new Vt(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}a(zc,"docViewDesc");const us=class us extends Vt{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==rt||this.dirty!=Fe&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Fe||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=Fe,!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 us(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=rt)}get domAtom(){return!1}isText(e){return this.node.text==e}};a(us,"TextViewDesc");let ro=us;const Ga=class Ga extends Tn{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Fe&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}};a(Ga,"TrailingHackViewDesc");let io=Ga;const Za=class Za extends Vt{constructor(e,n,r,i,o,s,u,l,c,d){super(e,n,r,i,o,s,u,c,d),this.spec=l}update(e,n,r,i){if(this.dirty==rt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){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.root):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)}};a(Za,"CustomNodeViewDesc");let Pu=Za;function xh(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=$c(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(u,r);if(s instanceof hr){let l=r?r.previousSibling:t.lastChild;xh(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=$c(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}a(xh,"renderDescs");const Lr=a(function(t){t&&(this.nodeName=t)},"OuterDecoLevel");Lr.prototype=Object.create(null);const fn=[new Lr];function Bu(t,e,n){if(t.length==0)return fn;let r=n?fn[0]:new Lr,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new Lr(s.nodeName));for(let u in s){let l=s[u];l!=null&&(n&&i.length==1&&i.push(r=new Lr(e.isInline?"span":"div")),u=="class"?r.class=(r.class?r.class+" ":"")+l:u=="style"?r.style=(r.style?r.style+";":"")+l:u!="nodeName"&&(r[u]=l))}}}return i}a(Bu,"computeOuterDeco");function kh(t,e,n,r){if(n==fn&&r==fn)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],u=n[o];if(o){let l;u&&u.nodeName==s.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),u=fn[0]),i=l}U1(i,u||fn[0],s)}return i}a(kh,"patchOuterDeco");function U1(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)}}a(U1,"patchAttributes");function wh(t,e,n){return kh(t,t,fn,Bu(e,n,t.nodeType!=1))}a(wh,"applyOuterDeco");function oo(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}a(oo,"sameOuterDeco");function $c(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}a($c,"rm");const Xa=class Xa{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=W1(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=Fe,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 l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[o])&&!this.isLocked(c.dom)){u=l;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let l=hr.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let u=this.index,l=Math.min(this.top.children.length,u+5);u<l;u++){let c=this.top.children[u];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){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==rt&&s.dom==s.contentDOM&&(s.dirty=dn),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 l=this.top.children[u];if(l instanceof Vt){let c=this.preMatch.matched.get(l);if(c!=null&&c!=o)return!1;let d=l.dom,f,p=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=rt&&oo(n,l.outerDeco));if(!p&&l.update(e,n,r,i))return this.destroyBetween(this.index,u),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!p&&(f=this.recreateWrapper(l,e,n,r,i,s)))return this.destroyBetween(this.index,u),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=dn,f.updateChildren(i,s+1),f.dirty=Fe),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)||!oo(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let u=Vt.create(this.top,n,r,i,o,s);if(u.contentDOM){u.children=e.children,e.children=[];for(let l of u.children)l.parent=u}return e.destroy(),u}addNode(e,n,r,i,o){let s=Vt.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 no(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 hr;)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))&&((ge||fe)&&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 io(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))}};a(Xa,"ViewTreeUpdater");let zu=Xa;function W1(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 c=n.children[r-1];if(c instanceof hr)n=c,r=c.children.length;else{u=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=u.node;if(l){if(l!=t.child(i-1))break;--i,o.set(u,i),s.push(u)}}return{index:i,matched:o,matches:s.reverse()}}a(W1,"preMatch");function K1(t,e){return t.type.side-e.type.side}a(K1,"compareSide");function J1(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let d=t.child(c);r(d,i,e.forChild(o,d),c),o+=d.nodeSize}return}let s=0,u=[],l=null;for(let c=0;;){let d,f;for(;s<i.length&&i[s].to==o;){let b=i[s++];b.widget&&(d?(f||(f=[d])).push(b):d=b)}if(d)if(f){f.sort(K1);for(let b=0;b<f.length;b++)n(f[b],c,!!l)}else n(d,c,!!l);let p,h;if(l)h=-1,p=l,l=null;else if(c<t.childCount)h=c,p=t.child(c++);else break;for(let b=0;b<u.length;b++)u[b].to<=o&&u.splice(b--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)u.push(i[s++]);let m=o+p.nodeSize;if(p.isText){let b=m;s<i.length&&i[s].from<b&&(b=i[s].from);for(let y=0;y<u.length;y++)u[y].to<b&&(b=u[y].to);b<m&&(l=p.cut(b-o),p=p.cut(0,b-o),m=b,h=-1)}else for(;s<i.length&&i[s].to<m;)s++;let g=p.isInline&&!p.isLeaf?u.filter(b=>!b.inline):u.slice();r(p,g,e.forChild(o,p),h),o=m}}a(J1,"iterDeco");function G1(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}}a(G1,"iosHacks");function Z1(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 l=s.text;for(;i<t.childCount;){let c=t.child(i++);if(o+=c.nodeSize,!c.isText)break;l+=c.text}if(o>=n){if(o>=r&&l.slice(r-e.length-u,r-u)==e)return r-e.length;let c=u<r?l.lastIndexOf(e,r-u-1):-1;if(c>=0&&c+e.length+u>=n)return u+c;if(n==r&&l.length>=r+e.length-u&&l.slice(r-u,r-u+e.length)==e)return r}}return-1}a(Z1,"findTextInFragment");function $u(t,e,n,r,i){let o=[];for(let s=0,u=0;s<t.length;s++){let l=t[s],c=u,d=u+=l.size;c>=n||d<=e?o.push(l):(c<e&&o.push(l.slice(0,e-c,r)),i&&(o.push(i),i=void 0),d>n&&o.push(l.slice(n-c,l.size,r)))}return o}a($u,"replaceNodes");function Il(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),l,c;if(ms(n)){for(l=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&N.isSelectable(f)&&i.parent&&!(f.isInline&&v1(n.focusNode,n.focusOffset,i.dom))){let p=i.posBefore;c=new N(s==p?u:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,p=s;for(let h=0;h<n.rangeCount;h++){let m=n.getRangeAt(h);f=Math.min(f,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(f<0)return null;[l,s]=p==t.state.selection.anchor?[p,f]:[f,p],u=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!c){let f=e=="pointer"||t.state.selection.head<u.pos&&!o?1:-1;c=Rl(t,d,u,f)}return c}a(Il,"selectionFromDOM");function Ch(t){return t.editable?t.hasFocus():Sh(t)&&document.activeElement&&document.activeElement.contains(t.dom)}a(Ch,"editorOwnsSelection");function kt(t,e=!1){let n=t.state.selection;if(Eh(t,n),!!Ch(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&fe){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Mn(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)Y1(t);else{let{anchor:r,head:i}=n,o,s;Hc&&!(n instanceof R)&&(n.$from.parent.inlineContent||(o=Vc(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=Vc(t,n.to))),t.docView.setSelection(r,i,t,e),Hc&&(o&&jc(o),s&&jc(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&X1(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}a(kt,"selectionToDOM");const Hc=ge||fe&&fh<63;function Vc(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(ge&&i&&i.contentEditable=="false")return qs(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return qs(i);if(o)return qs(o)}}a(Vc,"temporarilyEditableNear");function qs(t){return t.contentEditable="true",ge&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}a(qs,"setEditable");function jc(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}a(jc,"resetEditable");function X1(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(()=>{(!Ch(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}a(X1,"removeClassOnSelectionChange");function Y1(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,ue(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&we&&Ht<=11&&(n.disabled=!0,n.disabled=!1)}a(Y1,"selectCursorWrapper");function Eh(t,e){if(e instanceof N){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(qc(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else qc(t)}a(Eh,"syncNodeSelection");function qc(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}a(qc,"clearNodeSelection");function Rl(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||R.between(e,n,r)}a(Rl,"selectionBetween");function Uc(t){return t.editable&&!t.hasFocus()?!1:Sh(t)}a(Uc,"hasFocusAndSelection");function Sh(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}}a(Sh,"hasSelection");function Q1(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Mn(e.node,e.offset,n.anchorNode,n.anchorOffset)}a(Q1,"anchorInRightPlace");function Hu(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&&I.findFrom(o,e)}a(Hu,"moveSelectionBlock");function Tt(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}a(Tt,"apply");function Wc(t,e,n){let r=t.state.selection;if(r instanceof R)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 Tt(t,new R(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Hu(t.state,e);return i&&i instanceof N?Tt(t,i):!1}else if(!(Ne&&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?N.isSelectable(o)?Tt(t,new N(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):gi?Tt(t,new R(t.state.doc.resolve(e<0?u:u+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof N&&r.node.isInline)return Tt(t,new R(e>0?r.$to:r.$from));{let i=Hu(t.state,e);return i?Tt(t,i):!1}}}a(Wc,"selectHorizontally");function so(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}a(so,"nodeLen");function Pr(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}a(Pr,"isIgnorable");function Nn(t,e){return e<0?eg(t):tg(t)}a(Nn,"skipIgnoredNodes");function eg(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(Re&&n.nodeType==1&&r<so(n)&&Pr(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(Pr(u,-1))i=n,o=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if(vh(n))break;{let u=n.previousSibling;for(;u&&Pr(u,-1);)i=n.parentNode,o=ue(u),u=u.previousSibling;if(u)n=u,r=so(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Vu(t,n,r):i&&Vu(t,i,o)}a(eg,"skipIgnoredNodesBefore");function tg(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=so(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let u=n.childNodes[r];if(Pr(u,1))o=n,s=++r;else break}else{if(vh(n))break;{let u=n.nextSibling;for(;u&&Pr(u,1);)o=u.parentNode,s=ue(u)+1,u=u.nextSibling;if(u)n=u,r=0,i=so(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&Vu(t,o,s)}a(tg,"skipIgnoredNodesAfter");function vh(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}a(vh,"isBlockNode");function ng(t,e){for(;t&&e==t.childNodes.length&&!mi(t);)e=ue(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}}a(ng,"textNodeAfter");function rg(t,e){for(;t&&!e&&!mi(t);)e=ue(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}}a(rg,"textNodeBefore");function Vu(t,e,n){if(e.nodeType!=3){let o,s;(s=ng(e,n))?(e=s,n=0):(o=rg(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(ms(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&&kt(t)},50)}a(Vu,"setSelFocus");function Kc(t,e){let n=t.state.doc.resolve(e);if(!(fe||T1)&&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"}a(Kc,"findDirection");function Jc(t,e,n){let r=t.state.selection;if(r instanceof R&&!r.empty||n.indexOf("s")>-1||Ne&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Hu(t.state,e);if(s&&s instanceof N)return Tt(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,u=r instanceof ze?I.near(s,e):I.findFrom(s,e);return u?Tt(t,u):!1}return!1}a(Jc,"selectVertically");function Gc(t,e){if(!(t.state.selection instanceof R))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}a(Gc,"stopNativeHorizontalDelete");function Zc(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}a(Zc,"switchEditable");function ig(t){if(!ge||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;Zc(t,r,"true"),setTimeout(()=>Zc(t,r,"false"),20)}return!1}a(ig,"safariDownArrowBug");function og(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}a(og,"getMods");function sg(t,e){let n=e.keyCode,r=og(e);if(n==8||Ne&&n==72&&r=="c")return Gc(t,-1)||Nn(t,-1);if(n==46&&!e.shiftKey||Ne&&n==68&&r=="c")return Gc(t,1)||Nn(t,1);if(n==13||n==27)return!0;if(n==37||Ne&&n==66&&r=="c"){let i=n==37?Kc(t,t.state.selection.from)=="ltr"?-1:1:-1;return Wc(t,i,r)||Nn(t,i)}else if(n==39||Ne&&n==70&&r=="c"){let i=n==39?Kc(t,t.state.selection.from)=="ltr"?1:-1:1;return Wc(t,i,r)||Nn(t,i)}else{if(n==38||Ne&&n==80&&r=="c")return Jc(t,-1,r)||Nn(t,-1);if(n==40||Ne&&n==78&&r=="c")return ig(t)||Jc(t,1,r)||Nn(t,1);if(r==(Ne?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}a(sg,"captureKeyDown");function Fl(t,e){t.someProp("transformCopied",h=>{e=h(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 h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=t.someProp("clipboardSerializer")||An.fromSchema(t.state.schema),u=_h(),l=u.createElement("div");l.appendChild(s.serializeFragment(r,{document:u}));let c=l.firstChild,d,f=0;for(;c&&c.nodeType==1&&(d=Oh[c.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let m=u.createElement(d[h]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
|
|
8
|
+
|
|
9
|
+
`);return{dom:l,text:p,slice:e}}a(Fl,"serializeForClipboard");function Ah(t,e,n,r,i){let o=i.parent.type.spec.code,s,u;if(!n&&!e)return null;let l=!!e&&(r||o||!n);if(l){if(t.someProp("transformPastedText",p=>{e=p(e,o||r,t)}),o)return u=new M(A.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
10
|
+
`))),0,0),t.someProp("transformPasted",p=>{u=p(u,t,!0)}),u;let f=t.someProp("clipboardTextParser",p=>p(e,i,r,t));if(f)u=f;else{let p=i.marks(),{schema:h}=t.state,m=An.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let b=s.appendChild(document.createElement("p"));g&&b.appendChild(m.serializeNode(h.text(g,p)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=cg(n),gi&&dg(s);let c=s&&s.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let f=+d[3];f>0;f--){let p=s.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;s=p}if(u||(u=(t.someProp("clipboardParser")||t.someProp("domParser")||$t.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!ug.test(p.parentNode.nodeName)?{ignore:!0}:null}})),d)u=fg(Xc(u,+d[1],+d[2]),d[4]);else if(u=M.maxOpen(lg(u.content,i),!0),u.openStart||u.openEnd){let f=0,p=0;for(let h=u.content.firstChild;f<u.openStart&&!h.type.spec.isolating;f++,h=h.firstChild);for(let h=u.content.lastChild;p<u.openEnd&&!h.type.spec.isolating;p++,h=h.lastChild);u=Xc(u,f,p)}return t.someProp("transformPasted",f=>{u=f(u,t,l)}),u}a(Ah,"parseFromClipboard");const ug=/^(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 lg(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 l=i.findWrapping(u.type),c;if(!l)return s=null;if(c=s.length&&o.length&&Th(l,o,u,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Dh(s[s.length-1],o.length));let d=Mh(u,l);s.push(d),i=i.matchType(d.type),o=l}}),s)return A.from(s)}return t}a(lg,"normalizeSiblings");function Mh(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,A.from(t));return t}a(Mh,"withWrappers");function Th(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Th(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(A.from(Mh(n,t,i+1))))}}a(Th,"addToSibling");function Dh(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Dh(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(A.empty,!0);return t.copy(n.append(r))}a(Dh,"closeRight");function ju(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=ju(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(A.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(u))}a(ju,"closeRange");function Xc(t,e,n){return e<t.openStart&&(t=new M(ju(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new M(ju(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}a(Xc,"closeSlice");const Oh={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 Yc=null;function _h(){return Yc||(Yc=document.implementation.createHTMLDocument("title"))}a(_h,"detachedDoc");let Us=null;function ag(t){let e=window.trustedTypes;return e?(Us||(Us=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:a(n=>n,"createHTML")})),Us.createHTML(t)):t}a(ag,"maybeWrapTrusted");function cg(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=_h().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Oh[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=ag(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}a(cg,"readHTML");function dg(t){let e=t.querySelectorAll(fe?"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)}}a(dg,"restoreReplacedSpaces");function fg(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 l=n.nodes[r[u]];if(!l||l.hasRequiredAttrs())break;i=A.from(l.create(r[u+1],i)),o++,s++}return new M(i,o,s)}a(fg,"addContext");const be={},ye={},hg={touchstart:!0,touchmove:!0},Ya=class Ya{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};a(Ya,"InputState");let qu=Ya;function pg(t){for(let e in be){let n=be[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{gg(t,r)&&!Ll(t,r)&&(t.editable||!(r.type in ye))&&n(t,r)},hg[e]?{passive:!0}:void 0)}ge&&t.dom.addEventListener("input",()=>null),Uu(t)}a(pg,"initInput");function Pt(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}a(Pt,"setSelectionOrigin");function mg(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)}a(mg,"destroyInput");function Uu(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Ll(t,r))})}a(Uu,"ensureListeners");function Ll(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}a(Ll,"runCustomHandler");function gg(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}a(gg,"eventBelongsToView");function bg(t,e){!Ll(t,e)&&be[e.type]&&(t.editable||!(e.type in ye))&&be[e.type](t,e)}a(bg,"dispatchEvent");ye.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Ih(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(bt&&fe&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),fr&&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,en(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||sg(t,n)?n.preventDefault():Pt(t,"key")};ye.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ye.keypress=(t,e)=>{let n=e;if(Ih(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ne&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof R)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),o=a(()=>t.state.tr.insertText(i).scrollIntoView(),"deflt");!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,i,o))&&t.dispatch(o()),n.preventDefault()}};function gs(t){return{left:t.clientX,top:t.clientY}}a(gs,"eventCoords");function yg(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}a(yg,"isNear");function Pl(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}a(Pl,"runHandlerOnContext");function Hn(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)}a(Hn,"updateSelection");function xg(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&N.isSelectable(r)?(Hn(t,new N(n)),!0):!1}a(xg,"selectClickedLeaf");function kg(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof N&&(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(N.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?(Hn(t,N.create(t.state.doc,i)),!0):!1}a(kg,"selectClickedNode");function wg(t,e,n,r,i){return Pl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?kg(t,n):xg(t,n))}a(wg,"handleSingleClick");function Cg(t,e,n,r){return Pl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}a(Cg,"handleDoubleClick");function Eg(t,e,n,r){return Pl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||Sg(t,n,r)}a(Eg,"handleTripleClick");function Sg(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Hn(t,R.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)Hn(t,R.create(r,u+1,u+1+s.content.size));else if(N.isSelectable(s))Hn(t,N.create(r,u));else continue;return!0}}a(Sg,"defaultTripleClick");function Bl(t){return uo(t)}a(Bl,"forceDOMFlush");const Nh=Ne?"metaKey":"ctrlKey";be.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Bl(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&yg(n,t.input.lastClick)&&!n[Nh]&&t.input.lastClick.button==n.button&&(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,button:n.button};let s=t.posAtCoords(gs(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Wu(t,s,n,!!r)):(o=="doubleClick"?Cg:Eg)(t,s.pos,s.inside,n)?n.preventDefault():Pt(t,"pointer"))};const Qa=class Qa{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[Nh],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let d=e.state.doc.resolve(n.pos);o=d.parent,s=d.depth?d.before():0}const u=i?null:r.target,l=u?e.docView.nearestDesc(u,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof N&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Re&&!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)),Pt(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(()=>kt(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(gs(e))),this.updateAllowDefault(e),this.allowDefault||!n?Pt(this.view,"pointer"):wg(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ge&&this.mightDrag&&!this.mightDrag.node.isAtom||fe&&!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)?(Hn(this.view,I.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Pt(this.view,"pointer")}move(e){this.updateAllowDefault(e),Pt(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)}};a(Qa,"MouseDown");let Wu=Qa;be.touchstart=t=>{t.input.lastTouch=Date.now(),Bl(t),Pt(t,"pointer")};be.touchmove=t=>{t.input.lastTouch=Date.now(),Pt(t,"pointer")};be.contextmenu=t=>Bl(t);function Ih(t,e){return t.composing?!0:ge&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}a(Ih,"inOrNearComposition");const vg=bt?5e3:-1;ye.compositionstart=ye.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof R&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),uo(t,!0),t.markCursor=null;else if(uo(t,!e.selection.empty),Re&&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}Rh(t,vg)};ye.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++,Rh(t,20))};function Rh(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>uo(t),e))}a(Rh,"scheduleComposeEnd");function Fh(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Mg());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}a(Fh,"clearComposition");function Ag(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=E1(e.focusNode,e.focusOffset),r=S1(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}a(Ag,"findCompositionNode");function Mg(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}a(Mg,"timestampFromCustomEvent");function uo(t,e=!1){if(!(bt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Fh(t),e||t.docView&&t.docView.dirty){let n=Il(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}a(uo,"endComposition");function Tg(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)}a(Tg,"captureCopy");const ri=we&&Ht<15||fr&&D1<604;be.copy=ye.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=ri?null:n.clipboardData,s=r.content(),{dom:u,text:l}=Fl(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",l)):Tg(t,u),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Dg(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}a(Dg,"sliceSingleNode");function Og(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?ii(t,r.value,null,i,e):ii(t,r.textContent,r.innerHTML,i,e)},50)}a(Og,"capturePaste");function ii(t,e,n,r,i){let o=Ah(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||M.empty)))return!0;if(!o)return!1;let s=Dg(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}a(ii,"doPaste");function Lh(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," "):""}a(Lh,"getText$1");ye.paste=(t,e)=>{let n=e;if(t.composing&&!bt)return;let r=ri?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ii(t,Lh(r),r.getData("text/html"),i,n)?n.preventDefault():Og(t,n)};const ec=class ec{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}};a(ec,"Dragging");let lo=ec;const _g=Ne?"altKey":"ctrlKey";function Ph(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[_g]}a(Ph,"dragMoves");be.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(gs(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof N?i.to-1:i.to))){if(r&&r.mightDrag)s=N.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=N.create(t.state.doc,f.posBefore))}}let u=(s||t.state.selection).content(),{dom:l,text:c,slice:d}=Fl(t,u);(!n.dataTransfer.files.length||!fe||fh>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ri?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",ri||n.dataTransfer.setData("text/plain",c),t.dragging=new lo(d,Ph(t,n),s)};be.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ye.dragover=ye.dragenter=(t,e)=>e.preventDefault();ye.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(gs(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",m=>{s=m(s,t,!1)}):s=Ah(t,Lh(n.dataTransfer),ri?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&Ph(t,n));if(t.someProp("handleDrop",m=>m(t,n,s||M.empty,u))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?Wf(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let c=t.state.tr;if(u){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let d=c.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=c.doc;if(f?c.replaceRangeWith(d,d,s.content.firstChild):c.replaceRange(d,d,s),c.doc.eq(p))return;let h=c.doc.resolve(d);if(f&&N.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new N(h));else{let m=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,b,y,x)=>m=x),c.setSelection(Rl(t,h,c.doc.resolve(m)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};be.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())&&kt(t)},20))};be.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)};be.beforeinput=(t,e)=>{if(fe&&bt&&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,en(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 ye)be[t]=ye[t];function oi(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}a(oi,"compareObjs");const ls=class ls{constructor(e,n){this.toDOM=e,this.spec=n||bn,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 Le(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ls&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&oi(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}};a(ls,"WidgetType");let ao=ls;const Xr=class Xr{constructor(e,n){this.attrs=e,this.spec=n||bn}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 Le(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Xr&&oi(this.attrs,e.attrs)&&oi(this.spec,e.spec)}static is(e){return e.type instanceof Xr}destroy(){}};a(Xr,"InlineType");let gn=Xr;const as=class as{constructor(e,n){this.attrs=e,this.spec=n||bn}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 Le(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 as&&oi(this.attrs,e.attrs)&&oi(this.spec,e.spec)}destroy(){}};a(as,"NodeType");let Ku=as;const an=class an{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new an(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 an(e,e,new ao(n,r))}static inline(e,n,r,i){return new an(e,n,new gn(r,i))}static node(e,n,r,i){return new an(e,n,new Ku(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof gn}get widget(){return this.type instanceof ao}};a(an,"Decoration");let Le=an;const Fn=[],bn={},Je=class Je{constructor(e,n){this.local=e.length?e:Fn,this.children=n.length?n:Fn}static create(e,n){return n.length?fo(n,e,0,bn):de}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==de||e.maps.length==0?this:this.mapInner(e,n,0,0,r||bn)}mapInner(e,n,r,i,o){let s;for(let u=0;u<this.local.length;u++){let l=this.local[u].map(e,r,i);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?Ng(this.children,s||[],e,n,r,i,o):s?new Je(s.sort(yn),Fn):de}add(e,n){return n.length?this==de?Je.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((u,l)=>{let c=l+r,d;if(d=zh(n,u,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(u,d,c+1):i.splice(o,0,l,l+u.nodeSize,fo(d,u,c+1,bn)),o+=3}});let s=Bh(o?$h(n):n,-r);for(let u=0;u<s.length;u++)s[u].type.valid(e,s[u])||s.splice(u--,1);return new Je(s.length?this.local.concat(s).sort(yn):this.local,i||this.children)}remove(e){return e.length==0||this==de?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,l=r[o+1]+n;for(let d=0,f;d<e.length;d++)(f=e[d])&&f.from>u&&f.to<l&&(e[d]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(s,u+1);c!=de?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let 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 Je(i,r):de}forChild(e,n){if(this==de)return this;if(n.isLeaf)return Je.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 l=this.local[u];if(l.from<s&&l.to>o&&l.type instanceof gn){let c=Math.max(o,l.from)-o,d=Math.min(s,l.to)-o;c<d&&(i||(i=[])).push(l.copy(c,d))}}if(i){let u=new Je(i.sort(yn),Fn);return r?new co([u,r]):u}return r||de}eq(e){if(this==e)return!0;if(!(e instanceof Je)||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 zl(this.localsInner(e))}localsInner(e){if(this==de)return Fn;if(e.inlineContent||!this.local.some(gn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof gn||n.push(this.local[r]);return n}forEachSet(e){e(this)}};a(Je,"DecorationSet");let ce=Je;ce.empty=new ce([],[]);ce.removeOverlap=zl;const de=ce.empty,It=class It{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,bn));return It.from(r)}forChild(e,n){if(n.isLeaf)return ce.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=de&&(o instanceof It?r=r.concat(o.members):r.push(o))}return It.from(r)}eq(e){if(!(e instanceof It)||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?zl(r?n:n.sort(yn)):Fn}static from(e){switch(e.length){case 0:return de;case 1:return e[0];default:return new It(e.every(n=>n instanceof ce)?e:e.reduce((n,r)=>n.concat(r instanceof ce?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}};a(It,"DecorationGroup");let co=It;function Ng(t,e,n,r,i,o,s){let u=t.slice();for(let c=0,d=o;c<n.maps.length;c++){let f=0;n.maps[c].forEach((p,h,m,g)=>{let b=g-m-(h-p);for(let y=0;y<u.length;y+=3){let x=u[y+1];if(x<0||p>x+d-f)continue;let k=u[y]+d-f;h>=k?u[y+1]=p<=k?-2:-1:p>=d&&b&&(u[y]+=b,u[y+1]+=b)}f+=b}),d=n.maps[c].map(d,-1)}let l=!1;for(let c=0;c<u.length;c+=3)if(u[c+1]<0){if(u[c+1]==-2){l=!0,u[c+1]=-1;continue}let d=n.map(t[c]+o),f=d-i;if(f<0||f>=r.content.size){l=!0;continue}let p=n.map(t[c+1]+o,-1),h=p-i,{index:m,offset:g}=r.content.findIndex(f),b=r.maybeChild(m);if(b&&g==f&&g+b.nodeSize==h){let y=u[c+2].mapInner(n,b,d+1,t[c]+o+1,s);y!=de?(u[c]=f,u[c+1]=h,u[c+2]=y):(u[c+1]=-2,l=!0)}else l=!0}if(l){let c=Ig(u,t,e,n,i,o,s),d=fo(c,r,0,s);e=d.local;for(let f=0;f<u.length;f+=3)u[f+1]<0&&(u.splice(f,3),f-=3);for(let f=0,p=0;f<d.children.length;f+=3){let h=d.children[f];for(;p<u.length&&u[p]<h;)p+=3;u.splice(p,0,d.children[f],d.children[f+1],d.children[f+2])}}return new ce(e.sort(yn),u)}a(Ng,"mapChildren");function Bh(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 Le(i.from+e,i.to+e,i.type))}return n}a(Bh,"moveSpans");function Ig(t,e,n,r,i,o,s){function u(l,c){for(let d=0;d<l.local.length;d++){let f=l.local[d].map(r,i,c);f?n.push(f):s.onRemove&&s.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)u(l.children[d+2],l.children[d]+c+1)}a(u,"gather");for(let l=0;l<t.length;l+=3)t[l+1]==-1&&u(t[l+2],e[l]+o+1);return n}a(Ig,"mapAndGatherRemainingDecorations");function zh(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}a(zh,"takeSpansForNode");function $h(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}a($h,"withoutNulls");function fo(t,e,n,r){let i=[],o=!1;e.forEach((u,l)=>{let c=zh(t,u,l+n);if(c){o=!0;let d=fo(c,u,n+l+1,r);d!=de&&i.push(l,l+u.nodeSize,d)}});let s=Bh(o?$h(t):t,-n).sort(yn);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 ce(s,i):de}a(fo,"buildTree");function yn(t,e){return t.from-e.from||t.to-e.to}a(yn,"byPos");function zl(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),Qc(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),Qc(e,i,r.copy(o.from,r.to)));break}}}return e}a(zl,"removeOverlap");function Qc(t,e,n){for(;e<t.length&&yn(n,t[e])>0;)e++;t.splice(e,0,n)}a(Qc,"insertAhead");function Ws(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=de&&e.push(r)}),t.cursorWrapper&&e.push(ce.create(t.state.doc,[t.cursorWrapper.deco])),co.from(e)}a(Ws,"viewDecorations");const Rg={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Fg=we&&Ht<=11,tc=class tc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}};a(tc,"SelectionState");let Ju=tc;const nc=class nc{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ju,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]);we&&Ht<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),Fg&&(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,Rg)),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(Uc(this.view)){if(this.suppressingSelectionUpdates)return kt(this.view);if(we&&Ht<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Mn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=dr(o))n.add(o);for(let o=e.anchorNode;o;o=dr(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)&&Uc(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,u=!1,l=[];if(e.editable)for(let d=0;d<n.length;d++){let f=this.registerMutation(n[d],l);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(u=!0))}if(Re&&l.length){let d=l.filter(f=>f.nodeName=="BR");if(d.length==2){let[f,p]=d;f.parentNode&&f.parentNode.parentNode==p.parentNode?p.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let p of d){let h=p.parentNode;h&&h.nodeName=="LI"&&(!f||Bg(e,f)!=h)&&p.remove()}}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ms(r)&&(c=Il(e))&&c.eq(I.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,kt(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),Lg(e)),this.handleDOMChange(o,s,u,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||kt(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 d=0;d<e.addedNodes.length;d++){let f=e.addedNodes[d];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(we&&Ht<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:f,nextSibling:p}=e.addedNodes[d];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(o=p)}let s=i&&i.parentNode==e.target?ue(i)+1:0,u=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?ue(o):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:u,to:c}}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})}};a(nc,"DOMObserver");let Gu=nc,ed=new WeakMap,td=!1;function Lg(t){if(!ed.has(t)&&(ed.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Re,td)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."),td=!0}}a(Lg,"checkCSS");function nd(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return Mn(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}a(nd,"rangeToSelectionRange");function Pg(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return nd(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return a(r,"read"),t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?nd(t,n):null}a(Pg,"safariShadowSelectionRange");function Bg(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}a(Bg,"blockParent");function zg(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:u}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],ms(l)||c.push({node:l.focusNode,offset:l.focusOffset})),fe&&t.input.lastKeyCode===8)for(let b=o;b>i;b--){let y=r.childNodes[b-1],x=y.pmViewDesc;if(y.nodeName=="BR"&&!x){o=b;break}if(!x||x.size)break}let f=t.state.doc,p=t.someProp("domParser")||$t.fromSchema(t.state.schema),h=f.resolve(s),m=null,g=p.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:o,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:$g,context:h});if(c&&c[0].pos!=null){let b=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=b),m={anchor:b+s,head:y+s}}return{doc:g,sel:m,from:s,to:u}}a(zg,"parseBetween");function $g(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(ge&&/^(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||ge&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}a($g,"ruleFromNode");const Hg=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Vg(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,T=Il(t,S);if(T&&!t.state.selection.eq(T)){if(fe&&bt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",_=>_(t,en(13,"Enter"))))return;let D=t.state.tr.setSelection(T);S=="pointer"?D.setMeta("pointer",!0):S=="key"&&D.scrollIntoView(),o&&D.setMeta("composition",o),t.dispatch(D)}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 l=t.state.selection,c=zg(t,e,n),d=t.state.doc,f=d.slice(c.from,c.to),p,h;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,h="end"):(p=t.state.selection.from,h="start"),t.input.lastKeyCode=null;let m=Ug(f.content,c.doc.content,c.from,p,h);if(m&&t.input.domChangeCount++,(fr&&t.input.lastIOSEnter>Date.now()-225||bt)&&i.some(S=>S.nodeType==1&&!Hg.test(S.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",S=>S(t,en(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof R&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let S=rd(t,t.state.doc,c.sel);if(S&&!S.eq(t.state.selection)){let T=t.state.tr.setSelection(S);o&&T.setMeta("composition",o),t.dispatch(T)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof R&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),we&&Ht<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)==" "&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),b=c.doc.resolveNoCache(m.endB-c.from),y=d.resolve(m.start),x=g.sameParent(b)&&g.parent.inlineContent&&y.end()>=m.endA;if((fr&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(S=>S.nodeName=="DIV"||S.nodeName=="P"))||!x&&g.pos<c.doc.content.size&&(!g.sameParent(b)||!g.parent.inlineContent)&&g.pos<b.pos&&!/\S/.test(c.doc.textBetween(g.pos,b.pos,"","")))&&t.someProp("handleKeyDown",S=>S(t,en(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&qg(d,m.start,m.endA,g,b)&&t.someProp("handleKeyDown",S=>S(t,en(8,"Backspace")))){bt&&fe&&t.domObserver.suppressSelectionUpdates();return}fe&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),bt&&!x&&g.start()!=b.start()&&b.parentOffset==0&&g.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,b=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(S){return S(t,en(13,"Enter"))})},20));let k=m.start,C=m.endA,w=a(S=>{let T=S||t.state.tr.replace(k,C,c.doc.slice(m.start-c.from,m.endB-c.from));if(c.sel){let D=rd(t,T.doc,c.sel);D&&!(fe&&t.composing&&D.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(D.head==k||D.head==T.mapping.map(C)-1)||we&&D.empty&&D.head==k)&&T.setSelection(D)}return o&&T.setMeta("composition",o),T.scrollIntoView()},"mkTr"),E;if(x)if(g.pos==b.pos){we&&Ht<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>kt(t),20));let S=w(t.state.tr.delete(k,C)),T=d.resolve(m.start).marksAcross(d.resolve(m.endA));T&&S.ensureMarks(T),t.dispatch(S)}else if(m.endA==m.endB&&(E=jg(g.parent.content.cut(g.parentOffset,b.parentOffset),y.parent.content.cut(y.parentOffset,m.endA-y.start())))){let S=w(t.state.tr);E.type=="add"?S.addMark(k,C,E.mark):S.removeMark(k,C,E.mark),t.dispatch(S)}else if(g.parent.child(g.index()).isText&&g.index()==b.index()-(b.textOffset?0:1)){let S=g.parent.textBetween(g.parentOffset,b.parentOffset),T=a(()=>w(t.state.tr.insertText(S,k,C)),"deflt");t.someProp("handleTextInput",D=>D(t,k,C,S,T))||t.dispatch(T())}else t.dispatch(w());else t.dispatch(w())}a(Vg,"readDOMChange");function rd(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Rl(t,e.resolve(n.anchor),e.resolve(n.head))}a(rd,"resolveSelection");function jg(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,u,l;for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);for(let d=0;d<n.length;d++)o=n[d].removeFromSet(o);if(i.length==1&&o.length==0)u=i[0],s="add",l=a(d=>d.mark(u.addToSet(d.marks)),"update");else if(i.length==0&&o.length==1)u=o[0],s="remove",l=a(d=>d.mark(u.removeFromSet(d.marks)),"update");else return null;let c=[];for(let d=0;d<e.childCount;d++)c.push(l(e.child(d)));if(A.from(c).eq(t))return{mark:u,type:s}}a(jg,"isMarkChange");function qg(t,e,n,r,i){if(n-e<=i.pos-r.pos||Ks(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(Ks(o,!0,!0));return!s.parent.isTextblock||s.pos>n||Ks(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}a(qg,"looksLikeBackspace");function Ks(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}a(Ks,"skipClosingAndOpening");function Ug(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 l=Math.max(0,o-Math.min(s,u));r-=s+l-o}if(s<o&&t.size<e.size){let l=r<=o&&r>=s?o-r:0;o-=l,o&&o<e.size&&id(e.textBetween(o-1,o+1))&&(o+=l?1:-1),u=o+(u-s),s=o}else if(u<o){let l=r<=o&&r>=u?o-r:0;o-=l,o&&o<t.size&&id(t.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-u),u=o}return{start:o,endA:s,endB:u}}a(Ug,"findDiff");function id(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}a(id,"isSurrogatePair");const rc=class rc{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 qu,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(ad),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=ud(this),sd(this),this.nodeViews=ld(this),this.docView=zc(this.state.doc,od(this),Ws(this),this.dom,this),this.domObserver=new Gu(this,(r,i,o,s)=>Vg(this,r,i,o,s)),this.domObserver.start(),pg(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&&Uu(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(ad),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&&(Fh(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 h=ld(this);Kg(h,this.nodeViews)&&(this.nodeViews=h,o=!0)}(u||n.handleDOMEvents!=this._props.handleDOMEvents)&&Uu(this),this.editable=ud(this),sd(this);let l=Ws(this),c=od(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,c,l);(f||!e.selection.eq(i.selection))&&(s=!0);let p=d=="preserve"&&s&&this.dom.style.overflowAnchor==null&&N1(this);if(s){this.domObserver.stop();let h=f&&(we||fe)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Wg(i.selection,e.selection);if(f){let m=fe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Ag(this)),(o||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=zc(e.doc,c,l,this.dom,this)),m&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Q1(this))?kt(this,h):(Eh(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),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():p&&I1(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof N){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Ic(this,n.getBoundingClientRect(),e)}else Ic(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 lo(e.slice,e.move,i<0?void 0:N.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(we){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&&R1(this.dom),kt(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 z1(this,e)}coordsAtPos(e,n=1){return bh(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 q1(this,n||this.state,e)}pasteHTML(e,n){return ii(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ii(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Fl(this,e)}destroy(){this.docView&&(mg(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ws(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,w1())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return bg(this,e)}domSelectionRange(){let e=this.domSelection();return e?ge&&this.root.nodeType===11&&A1(this.dom.ownerDocument)==this.dom&&Pg(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};a(rc,"EditorView");let ho=rc;ho.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function od(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"),[Le.node(0,t.state.doc.content.size,e)]}a(od,"computeDocDeco");function sd(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:Le.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}a(sd,"updateCursorWrapper");function ud(t){return!t.someProp("editable",e=>e(t.state)===!1)}a(ud,"getEditable");function Wg(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)}a(Wg,"selectionContextChanged");function ld(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 a(n,"add"),t.someProp("nodeViews",n),t.someProp("markViews",n),e}a(ld,"buildNodeViews");function Kg(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}a(Kg,"changedNodeViews");function ad(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")}a(ad,"checkStateComponent");var Wt={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:"'"},po={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Jg=typeof navigator<"u"&&/Mac/.test(navigator.platform),Gg=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var le=0;le<10;le++)Wt[48+le]=Wt[96+le]=String(le);for(var le=1;le<=24;le++)Wt[le+111]="F"+le;for(var le=65;le<=90;le++)Wt[le]=String.fromCharCode(le+32),po[le]=String.fromCharCode(le);for(var Js in Wt)po.hasOwnProperty(Js)||(po[Js]=Wt[Js]);function Zg(t){var e=Jg&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Gg&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?po:Wt)[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}a(Zg,"keyName");const Xg=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Yg=typeof navigator<"u"&&/Win/.test(navigator.platform);function Qg(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 l=e[u];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))Xg?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}a(Qg,"normalizeKeyName$1");function eb(t){let e=Object.create(null);for(let n in t)e[Qg(n)]=t[n];return e}a(eb,"normalize$1");function Gs(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}a(Gs,"modifiers");function tb(t){return new V({props:{handleKeyDown:$l(t)}})}a(tb,"keymap");function $l(t){let e=eb(t);return function(n,r){let i=Zg(r),o,s=e[Gs(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let u=e[Gs(i,r,!1)];if(u&&u(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(Yg&&r.ctrlKey&&r.altKey)&&(o=Wt[r.keyCode])&&o!=i){let u=e[Gs(o,r)];if(u&&u(n.state,n.dispatch,n))return!0}}return!1}}a($l,"keydownHandler");var nb=Object.defineProperty,Hl=a((t,e)=>{for(var n in e)nb(t,n,{get:e[n],enumerable:!0})},"__export$1");function bs(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}}}a(bs,"createChainableState");var Un,ys=(Un=class{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,l])=>[u,a((...d)=>{const f=l(...d)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f},"method")]))}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=[],l=!!e,c=e||o.tr,d=a(()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),u.every(p=>p===!0)),"run3"),f={...Object.fromEntries(Object.entries(r).map(([p,h])=>[p,a((...g)=>{const b=this.buildProps(c,n),y=h(...g)(b);return u.push(y),f},"chainedCommand")])),run:d};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...d)=>c(...d)({...s,dispatch:void 0})])),chain:a(()=>this.createChain(o,i),"chain")}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,u={tr:e,editor:i,view:s,state:bs({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:a(()=>this.createChain(e,n),"chain"),can:a(()=>this.createCan(e),"can"),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...d)=>c(...d)(u)]))}};return u}},a(Un,"CommandManager"),Un),Hh={};Hl(Hh,{blur:a(()=>rb,"blur"),clearContent:a(()=>ib,"clearContent"),clearNodes:a(()=>ob,"clearNodes"),command:a(()=>sb,"command"),createParagraphNear:a(()=>ub,"createParagraphNear"),cut:a(()=>lb,"cut"),deleteCurrentNode:a(()=>ab,"deleteCurrentNode"),deleteNode:a(()=>cb,"deleteNode"),deleteRange:a(()=>db,"deleteRange"),deleteSelection:a(()=>fb,"deleteSelection"),enter:a(()=>hb,"enter"),exitCode:a(()=>pb,"exitCode"),extendMarkRange:a(()=>mb,"extendMarkRange"),first:a(()=>gb,"first"),focus:a(()=>yb,"focus"),forEach:a(()=>xb,"forEach"),insertContent:a(()=>kb,"insertContent"),insertContentAt:a(()=>Eb,"insertContentAt"),joinBackward:a(()=>Ab,"joinBackward"),joinDown:a(()=>vb,"joinDown"),joinForward:a(()=>Mb,"joinForward"),joinItemBackward:a(()=>Tb,"joinItemBackward"),joinItemForward:a(()=>Db,"joinItemForward"),joinTextblockBackward:a(()=>Ob,"joinTextblockBackward"),joinTextblockForward:a(()=>_b,"joinTextblockForward"),joinUp:a(()=>Sb,"joinUp"),keyboardShortcut:a(()=>Ib,"keyboardShortcut"),lift:a(()=>Rb,"lift"),liftEmptyBlock:a(()=>Fb,"liftEmptyBlock"),liftListItem:a(()=>Lb,"liftListItem"),newlineInCode:a(()=>Pb,"newlineInCode"),resetAttributes:a(()=>Bb,"resetAttributes"),scrollIntoView:a(()=>zb,"scrollIntoView"),selectAll:a(()=>$b,"selectAll"),selectNodeBackward:a(()=>Hb,"selectNodeBackward"),selectNodeForward:a(()=>Vb,"selectNodeForward"),selectParentNode:a(()=>jb,"selectParentNode"),selectTextblockEnd:a(()=>qb,"selectTextblockEnd"),selectTextblockStart:a(()=>Ub,"selectTextblockStart"),setContent:a(()=>Wb,"setContent"),setMark:a(()=>a2,"setMark"),setMeta:a(()=>c2,"setMeta"),setNode:a(()=>d2,"setNode"),setNodeSelection:a(()=>f2,"setNodeSelection"),setTextSelection:a(()=>h2,"setTextSelection"),sinkListItem:a(()=>p2,"sinkListItem"),splitBlock:a(()=>m2,"splitBlock"),splitListItem:a(()=>g2,"splitListItem"),toggleList:a(()=>b2,"toggleList"),toggleMark:a(()=>y2,"toggleMark"),toggleNode:a(()=>x2,"toggleNode"),toggleWrap:a(()=>k2,"toggleWrap"),undoInputRule:a(()=>w2,"undoInputRule"),unsetAllMarks:a(()=>C2,"unsetAllMarks"),unsetMark:a(()=>E2,"unsetMark"),updateAttributes:a(()=>S2,"updateAttributes"),wrapIn:a(()=>v2,"wrapIn"),wrapInList:a(()=>A2,"wrapInList")});var rb=a(()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges())}),!0),"blur"),ib=a((t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),"clearContent"),ob=a(()=>({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,l)=>{if(u.type.isText)return;const{doc:c,mapping:d}=e,f=c.resolve(d.map(l)),p=c.resolve(d.map(l+u.nodeSize)),h=f.blockRange(p);if(!h)return;const m=wr(h);if(u.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,g)}(m||m===0)&&e.lift(h,m)})}),!0},"clearNodes"),sb=a(t=>e=>t(e),"command"),ub=a(()=>({state:t,dispatch:e})=>uh(t,e),"createParagraphNear"),lb=a((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 R(r.doc.resolve(Math.max(s-1,0)))),!0},"cut"),ab=a(()=>({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),l=i.after(o);t.delete(u,l).scrollIntoView()}return!0}return!1},"deleteCurrentNode");function Y(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}a(Y,"getNodeType");var cb=a(t=>({tr:e,state:n,dispatch:r})=>{const i=Y(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),c=o.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1},"deleteNode"),db=a(t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},"deleteRange"),fb=a(()=>({state:t,dispatch:e})=>Ml(t,e),"deleteSelection"),hb=a(()=>({commands:t})=>t.keyboardShortcut("Enter"),"enter"),pb=a(()=>({state:t,dispatch:e})=>s1(t,e),"exitCode");function Vl(t){return Object.prototype.toString.call(t)==="[object RegExp]"}a(Vl,"isRegExp$1");function mo(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Vl(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}a(mo,"objectIncludes");function Vh(t,e,n={}){return t.find(r=>r.type===e&&mo(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}a(Vh,"findMarkInSet");function cd(t,e,n={}){return!!Vh(t,e,n)}a(cd,"isMarkInSet");function jl(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(d=>d.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(d=>d.type===e)||(n=n||((r=i.node.marks[0])==null?void 0:r.attrs),!Vh([...i.node.marks],e,n)))return;let s=i.index,u=t.start()+i.offset,l=s+1,c=u+i.node.nodeSize;for(;s>0&&cd([...t.parent.child(s-1).marks],e,n);)s-=1,u-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&cd([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:u,to:c}}a(jl,"getMarkRange");function Ct(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}a(Ct,"getMarkType");var mb=a((t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=Ct(t,r.schema),{doc:s,selection:u}=n,{$from:l,from:c,to:d}=u;if(i){const f=jl(l,o,e);if(f&&f.from<=c&&f.to>=d){const p=R.create(s,f.from,f.to);n.setSelection(p)}}return!0},"extendMarkRange"),gb=a(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},"first");function ql(t){return t instanceof R}a(ql,"isTextSelection");function yt(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}a(yt,"minMax");function jh(t,e=null){if(!e)return null;const n=I.atStart(t),r=I.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?R.create(t,yt(0,i,o),yt(t.content.size,i,o)):R.create(t,yt(e,i,o),yt(e,i,o))}a(jh,"resolveFocusPosition");function bb(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}a(bb,"isAndroid");function Ul(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}a(Ul,"isiOS");var yb=a((t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=a(()=>{(Ul()||bb())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})},"delayedFocus");if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!ql(n.state.selection))return s(),!0;const u=jh(i.doc,t)||n.state.selection,l=n.state.selection.eq(u);return o&&(l||i.setSelection(u),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},"focus"),xb=a((t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),"forEach"),kb=a((t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),"insertContent"),qh=a(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&&qh(r)}return t},"removeWhitespaces");function Ai(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return qh(n)}a(Ai,"elementFromString$1");function si(t,e,n){if(t instanceof zt||t instanceof A)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return A.fromArray(t.map(u=>e.nodeFromJSON(u)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}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),si("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,u="";const l=new Yr({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:a(c=>(s=!0,u=typeof c=="string"?c:c.outerHTML,null),"getAttrs")}]}})});if(n.slice?$t.fromSchema(l).parseSlice(Ai(t),n.parseOptions):$t.fromSchema(l).parse(Ai(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${u}`)})}const o=$t.fromSchema(e);return n.slice?o.parseSlice(Ai(t),n.parseOptions).content:o.parse(Ai(t),n.parseOptions)}return si("",e,n)}a(si,"createNodeFromContent");function wb(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Ae||i instanceof he))return;const o=t.mapping.maps[r];let s=0;o.forEach((u,l,c,d)=>{s===0&&(s=d)}),t.setSelection(I.near(t.doc.resolve(s),n))}a(wb,"selectionToInsertionEnd");var Cb=a(t=>!("type"in t),"isFragment"),Eb=a((t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let u;const l=a(b=>{o.emit("contentError",{editor:o,error:b,disableCollaboration:a(()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)},"disableCollaboration")})},"emitContentError"),c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{si(e,o.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(b){l(b)}try{u=si(e,o.schema,{parseOptions:c,errorOnInvalidContent:(s=n.errorOnInvalidContent)!=null?s:o.options.enableContentCheck})}catch(b){return l(b),!1}let{from:d,to:f}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},p=!0,h=!0;if((Cb(u)?u:[u]).forEach(b=>{b.check(),p=p?b.isText&&b.marks.length===0:!1,h=h?b.isBlock:!1}),d===f&&h){const{parent:b}=r.doc.resolve(d);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(d-=1,f+=1)}let g;if(p){if(Array.isArray(e))g=e.map(b=>b.text||"").join("");else if(e instanceof A){let b="";e.forEach(y=>{y.text&&(b+=y.text)}),g=b}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,d,f)}else{g=u;const b=r.doc.resolve(d),y=b.node(),x=b.parentOffset===0,k=y.isText||y.isTextblock,C=y.content.size>0;x&&k&&C&&(d=Math.max(0,d-1)),r.replaceWith(d,f,g)}n.updateSelection&&wb(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:g})}return!0},"insertContentAt"),Sb=a(()=>({state:t,dispatch:e})=>r1(t,e),"joinUp"),vb=a(()=>({state:t,dispatch:e})=>i1(t,e),"joinDown"),Ab=a(()=>({state:t,dispatch:e})=>eh(t,e),"joinBackward"),Mb=a(()=>({state:t,dispatch:e})=>ih(t,e),"joinForward"),Tb=a(()=>({state:t,dispatch:e,tr:n})=>{try{const r=hs(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},"joinItemBackward"),Db=a(()=>({state:t,dispatch:e,tr:n})=>{try{const r=hs(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},"joinItemForward"),Ob=a(()=>({state:t,dispatch:e})=>t1(t,e),"joinTextblockBackward"),_b=a(()=>({state:t,dispatch:e})=>n1(t,e),"joinTextblockForward");function Uh(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}a(Uh,"isMacOS");function Nb(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 l=e[u];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))Ul()||Uh()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}a(Nb,"normalizeKeyName");var Ib=a(t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=Nb(t).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),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}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,u))});return l?.steps.forEach(c=>{const d=c.map(r.mapping);d&&i&&r.maybeStep(d)}),!0},"keyboardShortcut");function Kt(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Y(e,t.schema):null,u=[];t.doc.nodesBetween(r,i,(f,p)=>{if(f.isText)return;const h=Math.max(r,p),m=Math.min(i,p+f.nodeSize);u.push({node:f,from:h,to:m})});const l=i-r,c=u.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>mo(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,p)=>f+p.to-p.from,0)>=l}a(Kt,"isNodeActive");var Rb=a((t,e={})=>({state:n,dispatch:r})=>{const i=Y(t,n.schema);return Kt(n,i,e)?o1(n,r):!1},"lift"),Fb=a(()=>({state:t,dispatch:e})=>lh(t,e),"liftEmptyBlock"),Lb=a(t=>({state:e,dispatch:n})=>{const r=Y(t,e.schema);return b1(r)(e,n)},"liftListItem"),Pb=a(()=>({state:t,dispatch:e})=>sh(t,e),"newlineInCode");function xs(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}a(xs,"getSchemaTypeNameByName");function dd(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}a(dd,"deleteProps");var Bb=a((t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const u=xs(typeof t=="string"?t:t.name,r.schema);return u?(u==="node"&&(o=Y(t,r.schema)),u==="mark"&&(s=Ct(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,d)=>{o&&o===c.type&&n.setNodeMarkup(d,void 0,dd(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(f=>{s===f.type&&n.addMark(d,d+c.nodeSize,s.create(dd(f.attrs,e)))})})}),!0):!1},"resetAttributes"),zb=a(()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),"scrollIntoView"),$b=a(()=>({tr:t,dispatch:e})=>{if(e){const n=new ze(t.doc);t.setSelection(n)}return!0},"selectAll"),Hb=a(()=>({state:t,dispatch:e})=>nh(t,e),"selectNodeBackward"),Vb=a(()=>({state:t,dispatch:e})=>oh(t,e),"selectNodeForward"),jb=a(()=>({state:t,dispatch:e})=>a1(t,e),"selectParentNode"),qb=a(()=>({state:t,dispatch:e})=>f1(t,e),"selectTextblockEnd"),Ub=a(()=>({state:t,dispatch:e})=>d1(t,e),"selectTextblockStart");function Zu(t,e,n={},r={}){return si(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}a(Zu,"createDocument");var Wb=a((t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:u})=>{const{doc:l}=o;if(r.preserveWhitespace!=="full"){const c=Zu(t,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return s&&o.replaceWith(0,l.content.size,c).setMeta("preventUpdate",!n),!0}return s&&o.setMeta("preventUpdate",!n),u.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})},"setContent");function Wh(t,e){const n=Ct(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const u=s.find(l=>l.type.name===n.name);return u?{...u.attrs}:{}}a(Wh,"getMarkAttributes");function Kh(t,e){const n=new Qi(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}a(Kh,"combineTransactionSteps");function Kb(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}a(Kb,"defaultBlockAt");function Jb(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}a(Jb,"findChildrenInRange");function Gb(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}}}a(Gb,"findParentNodeClosestToPos");function bi(t){return e=>Gb(e.$from,t)}a(bi,"findParentNode");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]}a(O,"getExtensionField");function Wl(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=O(e,"addExtensions",n);return r?[e,...Wl(r())]:e}).flat(10)}a(Wl,"flattenExtensions");function yi(t,e){const n=An.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}a(yi,"getHTMLFromFragment");function Jh(t){return typeof t=="function"}a(Jh,"isFunction$1");function $(t,e=void 0,...n){return Jh(t)?e?t.bind(e)(...n):t(...n):t}a($,"callOrReturn");function Zb(t={}){return Object.keys(t).length===0&&t.constructor===Object}a(Zb,"isEmptyObject");function ui(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}}a(ui,"splitExtensions");function Gh(t){const e=[],{nodeExtensions:n,markExtensions:r}=ui(t),i=[...n,...r],o={default:null,validate:void 0,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},l=O(s,"addGlobalAttributes",u);if(!l)return;l().forEach(d=>{d.types.forEach(f=>{Object.entries(d.attributes).forEach(([p,h])=>{e.push({type:f,name:p,attribute:{...o,...h}})})})})}),i.forEach(s=>{const u={name:s.name,options:s.options,storage:s.storage},l=O(s,"addAttributes",u);if(!l)return;const c=l();Object.entries(c).forEach(([d,f])=>{const p={...o,...f};typeof p?.default=="function"&&(p.default=p.default()),p?.isRequired&&p?.default===void 0&&delete p.default,e.push({type:s.name,name:d,attribute:p})})}),e}a(Gh,"getAttributesFromExtensions");function Q(...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?String(o).split(" "):[],l=r[i]?r[i].split(" "):[],c=u.filter(d=>!l.includes(d));r[i]=[...l,...c].join(" ")}else if(i==="style"){const u=o?o.split(";").map(d=>d.trim()).filter(Boolean):[],l=r[i]?r[i].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{const[f,p]=d.split(":").map(h=>h.trim());c.set(f,p)}),u.forEach(d=>{const[f,p]=d.split(":").map(h=>h.trim());c.set(f,p)}),r[i]=Array.from(c.entries()).map(([d,f])=>`${d}: ${f}`).join("; ")}else r[i]=o}),r},{})}a(Q,"mergeAttributes");function go(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Q(n,r),{})}a(go,"getRenderedAttributes");function Xb(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}a(Xb,"fromString");function fd(t,e){return"style"in t?t:{...t,getAttrs:a(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):Xb(n.getAttribute(s.name));return u==null?o:{...o,[s.name]:u}},{});return{...r,...i}},"getAttrs")}}a(fd,"injectExtensionAttributesToParseRule");function hd(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&Zb(n)?!1:n!=null))}a(hd,"cleanUpSchemaItem");function Yb(t,e){var n;const r=Gh(t),{nodeExtensions:i,markExtensions:o}=ui(t),s=(n=i.find(c=>O(c,"topNode")))==null?void 0:n.name,u=Object.fromEntries(i.map(c=>{const d=r.filter(y=>y.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((y,x)=>{const k=O(x,"extendNodeSchema",f);return{...y,...k?k(c):{}}},{}),h=hd({...p,content:$(O(c,"content",f)),marks:$(O(c,"marks",f)),group:$(O(c,"group",f)),inline:$(O(c,"inline",f)),atom:$(O(c,"atom",f)),selectable:$(O(c,"selectable",f)),draggable:$(O(c,"draggable",f)),code:$(O(c,"code",f)),whitespace:$(O(c,"whitespace",f)),linebreakReplacement:$(O(c,"linebreakReplacement",f)),defining:$(O(c,"defining",f)),isolating:$(O(c,"isolating",f)),attrs:Object.fromEntries(d.map(y=>{var x,k;return[y.name,{default:(x=y?.attribute)==null?void 0:x.default,validate:(k=y?.attribute)==null?void 0:k.validate}]}))}),m=$(O(c,"parseHTML",f));m&&(h.parseDOM=m.map(y=>fd(y,d)));const g=O(c,"renderHTML",f);g&&(h.toDOM=y=>g({node:y,HTMLAttributes:go(y,d)}));const b=O(c,"renderText",f);return b&&(h.toText=b),[c.name,h]})),l=Object.fromEntries(o.map(c=>{const d=r.filter(b=>b.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((b,y)=>{const x=O(y,"extendMarkSchema",f);return{...b,...x?x(c):{}}},{}),h=hd({...p,inclusive:$(O(c,"inclusive",f)),excludes:$(O(c,"excludes",f)),group:$(O(c,"group",f)),spanning:$(O(c,"spanning",f)),code:$(O(c,"code",f)),attrs:Object.fromEntries(d.map(b=>{var y,x;return[b.name,{default:(y=b?.attribute)==null?void 0:y.default,validate:(x=b?.attribute)==null?void 0:x.validate}]}))}),m=$(O(c,"parseHTML",f));m&&(h.parseDOM=m.map(b=>fd(b,d)));const g=O(c,"renderHTML",f);return g&&(h.toDOM=b=>g({mark:b,HTMLAttributes:go(b,d)})),[c.name,h]}));return new Yr({topNode:s,nodes:u,marks:l})}a(Yb,"getSchemaByResolvedExtensions");function Qb(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}a(Qb,"findDuplicates");function Kl(t){return t.sort((n,r)=>{const i=O(n,"priority")||100,o=O(r,"priority")||100;return i>o?-1:i<o?1:0})}a(Kl,"sortExtensions");function Zh(t){const e=Kl(Wl(t)),n=Qb(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}a(Zh,"resolveExtensions");function Xh(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
|
|
11
|
+
|
|
12
|
+
`,textSerializers:s={}}=n||{};let u="";return t.nodesBetween(r,i,(l,c,d,f)=>{var p;l.isBlock&&c>r&&(u+=o);const h=s?.[l.type.name];if(h)return d&&(u+=h({node:l,pos:c,parent:d,index:f,range:e})),!1;l.isText&&(u+=(p=l?.text)==null?void 0:p.slice(Math.max(r,c)-c,i-c))}),u}a(Xh,"getTextBetween");function Yh(t,e){const n={from:0,to:t.content.size};return Xh(t,n,e)}a(Yh,"getText");function Jl(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}a(Jl,"getTextSerializersFromSchema");function e2(t,e){const n=Y(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}:{}}a(e2,"getNodeAttributes");function Qh(t,e){const n=xs(typeof e=="string"?e:e.name,t.schema);return n==="node"?e2(t,e):n==="mark"?Wh(t,e):{}}a(Qh,"getAttributes");function t2(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})}a(t2,"removeDuplicates");function n2(t){const e=t2(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))}a(n2,"simplifyChangedRanges");function ep(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((u,l)=>{s.push({from:u,to:l})});else{const{from:u,to:l}=n[o];if(u===void 0||l===void 0)return;s.push({from:u,to:l})}s.forEach(({from:u,to:l})=>{const c=e.slice(o).map(u,-1),d=e.slice(o).map(l),f=e.invert().map(c,-1),p=e.invert().map(d);r.push({oldRange:{from:f,to:p},newRange:{from:c,to:d}})})}),n2(r)}a(ep,"getChangedRanges");function Gl(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=jl(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}a(Gl,"getMarksBetween");var r2=a((t,e,n,r=20)=>{const i=t.doc.resolve(n);let o=r,s=null;for(;o>0&&s===null;){const u=i.node(o);u?.type.name===e?s=u:o-=1}return[s,o]},"getNodeAtPosition");function Zs(t,e){return e.nodes[t]||e.marks[t]||null}a(Zs,"getSchemaTypeByName");function Hi(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}a(Hi,"getSplittedAttributes");var i2=a((t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,u)=>{var l,c;const d=((c=(l=i.type.spec).toText)==null?void 0:c.call(l,{node:i,pos:o,parent:s,index:u}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,r-o))}),n},"getTextContentFromNodes");function Xu(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Ct(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>mo(f.attrs,n,{strict:!1}));let s=0;const u=[];if(i.forEach(({$from:f,$to:p})=>{const h=f.pos,m=p.pos;t.doc.nodesBetween(h,m,(g,b)=>{if(!g.isText&&!g.marks.length)return;const y=Math.max(h,b),x=Math.min(m,b+g.nodeSize),k=x-y;s+=k,u.push(...g.marks.map(C=>({mark:C,from:y,to:x})))})}),s===0)return!1;const l=u.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>mo(f.mark.attrs,n,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),c=u.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,p)=>f+p.to-p.from,0);return(l>0?l+c:l)>=s}a(Xu,"isMarkActive");function o2(t,e,n={}){if(!e)return Kt(t,null,n)||Xu(t,null,n);const r=xs(e,t.schema);return r==="node"?Kt(t,e,n):r==="mark"?Xu(t,e,n):!1}a(o2,"isActive");var s2=a((t,e)=>{const{$from:n,$to:r,$anchor:i}=t.selection;if(e){const o=bi(u=>u.type.name===e)(t.selection);if(!o)return!1;const s=t.doc.resolve(o.pos+1);return i.pos+1===s.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},"isAtEndOfNode"),u2=a(t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)},"isAtStartOfNode");function pd(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}a(pd,"isExtensionRulesEnabled");function md(t,e){const{nodeExtensions:n}=ui(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")}a(md,"isList");function ks(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:"")}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&&(ks(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}a(ks,"isNodeEmpty");function tp(t){return t instanceof N}a(tp,"isNodeSelection");function Zl(t,e,n){const i=t.state.doc.content.size,o=yt(e,0,i),s=yt(n,0,i),u=t.coordsAtPos(o),l=t.coordsAtPos(s,-1),c=Math.min(u.top,l.top),d=Math.max(u.bottom,l.bottom),f=Math.min(u.left,l.left),p=Math.max(u.right,l.right),h=p-f,m=d-c,y={top:c,bottom:d,left:f,right:p,width:h,height:m,x:f,y:c};return{...y,toJSON:a(()=>y,"toJSON")}}a(Zl,"posToDOMRect");function l2(t,e,n){var r;const{selection:i}=e;let o=null;if(ql(i)&&(o=i.$cursor),o){const u=(r=t.storedMarks)!=null?r:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(u)||!u.some(c=>c.type.excludes(n)))}const{ranges:s}=i;return s.some(({$from:u,$to:l})=>{let c=u.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(u.pos,l.pos,(d,f,p)=>{if(c)return!1;if(d.isInline){const h=!p||p.type.allowsMarkType(n),m=!!n.isInSet(d.marks)||!d.marks.some(g=>g.type.excludes(n));c=h&&m}return!c}),c})}a(l2,"canSetMark");var a2=a((t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:u}=o,l=Ct(t,r.schema);if(i)if(s){const c=Wh(r,l);n.addStoredMark(l.create({...c,...e}))}else u.forEach(c=>{const d=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(d,f,(p,h)=>{const m=Math.max(h,d),g=Math.min(h+p.nodeSize,f);p.marks.find(y=>y.type===l)?p.marks.forEach(y=>{l===y.type&&n.addMark(m,g,l.create({...y.attrs,...e}))}):n.addMark(m,g,l.create(e))})});return l2(r,n,l)},"setMark"),c2=a((t,e)=>({tr:n})=>(n.setMeta(t,e),!0),"setMeta"),d2=a((t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Y(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:u})=>Oc(o,{...s,...e})(n)?!0:u.clearNodes()).command(({state:u})=>Oc(o,{...s,...e})(u,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},"setNode"),f2=a(t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=yt(t,0,r.content.size),o=N.create(r,i);e.setSelection(o)}return!0},"setNodeSelection"),h2=a(t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=R.atStart(r).from,u=R.atEnd(r).to,l=yt(i,s,u),c=yt(o,s,u),d=R.create(r,l,c);e.setSelection(d)}return!0},"setTextSelection"),p2=a(t=>({state:e,dispatch:n})=>{const r=Y(t,e.schema);return k1(r)(e,n)},"sinkListItem");function gd(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}a(gd,"ensureMarks");var m2=a(({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:u,$to:l}=o,c=i.extensionManager.attributes,d=Hi(c,u.node().type.name,u.node().attrs);if(o instanceof N&&o.node.isBlock)return!u.parentOffset||!xt(s,u.pos)?!1:(r&&(t&&gd(n,i.extensionManager.splittableMarks),e.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,p=u.depth===0?void 0:Kb(u.node(-1).contentMatchAt(u.indexAfter(-1)));let h=f&&p?[{type:p,attrs:d}]:void 0,m=xt(e.doc,e.mapping.map(u.pos),1,h);if(!h&&!m&&xt(e.doc,e.mapping.map(u.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:d}]:void 0),r){if(m&&(o instanceof R&&e.deleteSelection(),e.split(e.mapping.map(u.pos),1,h),p&&!f&&!u.parentOffset&&u.parent.type!==p)){const g=e.mapping.map(u.before()),b=e.doc.resolve(g);u.node(-1).canReplaceWith(b.index(),b.index()+1,p)&&e.setNodeMarkup(e.mapping.map(u.before()),p)}t&&gd(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},"splitBlock"),g2=a((t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const u=Y(t,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const f=l.node(-1);if(f.type!==u)return!1;const p=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==u||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let y=A.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let T=l.depth-x;T>=l.depth-3;T-=1)y=A.from(l.node(T).copy(y));const k=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,C={...Hi(p,l.node().type.name,l.node().attrs),...e},w=((s=u.contentMatch.defaultType)==null?void 0:s.createAndFill(C))||void 0;y=y.append(A.from(u.createAndFill(null,w)||void 0));const E=l.before(l.depth-(x-1));n.replace(E,l.after(-k),new M(y,4-x,0));let S=-1;n.doc.nodesBetween(E,n.doc.content.size,(T,D)=>{if(S>-1)return!1;T.isTextblock&&T.content.size===0&&(S=D+1)}),S>-1&&n.setSelection(R.near(n.doc.resolve(S))),n.scrollIntoView()}return!0}const h=c.pos===l.end()?f.contentMatchAt(0).defaultType:null,m={...Hi(p,f.type.name,f.attrs),...e},g={...Hi(p,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const b=h?[{type:u,attrs:m},{type:h,attrs:g}]:[{type:u,attrs:m}];if(!xt(n.doc,l.pos,2))return!1;if(i){const{selection:y,storedMarks:x}=r,{splittableMarks:k}=o.extensionManager,C=x||y.$to.parentOffset&&y.$from.marks();if(n.split(l.pos,2,b).scrollIntoView(),!C||!i)return!0;const w=C.filter(E=>k.includes(E.type.name));n.ensureMarks(w)}return!0},"splitListItem"),Xs=a((t,e)=>{const n=bi(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?.type&&Xt(t.doc,n.pos)&&t.join(n.pos),!0},"joinListBackwards"),Ys=a((t,e)=>{const n=bi(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?.type&&Xt(t.doc,r)&&t.join(r),!0},"joinListForwards"),b2=a((t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:u,chain:l,commands:c,can:d})=>{const{extensions:f,splittableMarks:p}=i.extensionManager,h=Y(t,s.schema),m=Y(e,s.schema),{selection:g,storedMarks:b}=s,{$from:y,$to:x}=g,k=y.blockRange(x),C=b||g.$to.parentOffset&&g.$from.marks();if(!k)return!1;const w=bi(E=>md(E.type.name,f))(g);if(k.depth>=1&&w&&k.depth-w.depth<=1){if(w.node.type===h)return c.liftListItem(m);if(md(w.node.type.name,f)&&h.validContent(w.node.content)&&u)return l().command(()=>(o.setNodeMarkup(w.pos,h),!0)).command(()=>Xs(o,h)).command(()=>Ys(o,h)).run()}return!n||!C||!u?l().command(()=>d().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>Xs(o,h)).command(()=>Ys(o,h)).run():l().command(()=>{const E=d().wrapInList(h,r),S=C.filter(T=>p.includes(T.type.name));return o.ensureMarks(S),E?!0:c.clearNodes()}).wrapInList(h,r).command(()=>Xs(o,h)).command(()=>Ys(o,h)).run()},"toggleList"),y2=a((t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Ct(t,r.schema);return Xu(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},"toggleMark"),x2=a((t,e,n={})=>({state:r,commands:i})=>{const o=Y(t,r.schema),s=Y(e,r.schema),u=Kt(r,o,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),u?i.setNode(s,l):i.setNode(o,{...l,...n})},"toggleNode"),k2=a((t,e={})=>({state:n,commands:r})=>{const i=Y(t,n.schema);return Kt(n,i,e)?r.lift(i):r.wrapIn(i,e)},"toggleWrap"),w2=a(()=>({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 l=u.steps.length-1;l>=0;l-=1)s.step(u.steps[l].invert(u.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},"undoInputRule"),C2=a(()=>({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},"unsetAllMarks"),E2=a((t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:u}=n,l=Ct(t,r.schema),{$from:c,empty:d,ranges:f}=u;if(!i)return!0;if(d&&s){let{from:p,to:h}=u;const m=(o=c.marks().find(b=>b.type===l))==null?void 0:o.attrs,g=jl(c,l,m);g&&(p=g.from,h=g.to),n.removeMark(p,h,l)}else f.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,l)});return n.removeStoredMark(l),!0},"unsetMark"),S2=a((t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const u=xs(typeof t=="string"?t:t.name,r.schema);return u?(u==="node"&&(o=Y(t,r.schema)),u==="mark"&&(s=Ct(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,d=l.$to.pos;let f,p,h,m;n.selection.empty?r.doc.nodesBetween(c,d,(g,b)=>{o&&o===g.type&&(h=Math.max(b,c),m=Math.min(b+g.nodeSize,d),f=b,p=g)}):r.doc.nodesBetween(c,d,(g,b)=>{b<c&&o&&o===g.type&&(h=Math.max(b,c),m=Math.min(b+g.nodeSize,d),f=b,p=g),b>=c&&b<=d&&(o&&o===g.type&&n.setNodeMarkup(b,void 0,{...g.attrs,...e}),s&&g.marks.length&&g.marks.forEach(y=>{if(s===y.type){const x=Math.max(b,c),k=Math.min(b+g.nodeSize,d);n.addMark(x,k,s.create({...y.attrs,...e}))}}))}),p&&(f!==void 0&&n.setNodeMarkup(f,void 0,{...p.attrs,...e}),s&&p.marks.length&&p.marks.forEach(g=>{s===g.type&&n.addMark(h,m,s.create({...g.attrs,...e}))}))}),!0):!1},"updateAttributes"),v2=a((t,e={})=>({state:n,dispatch:r})=>{const i=Y(t,n.schema);return h1(i,e)(n,r)},"wrapIn"),A2=a((t,e={})=>({state:n,dispatch:r})=>{const i=Y(t,n.schema);return p1(i,e)(n,r)},"wrapInList"),Wn,M2=(Wn=class{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}once(e,n){const r=a((...i)=>{this.off(e,r),n.apply(this,i)},"onceFn");return this.on(e,r)}removeAllListeners(){this.callbacks={}}},a(Wn,"EventEmitter"),Wn),Kn,ws=(Kn=class{constructor(e){var n;this.find=e.find,this.handler=e.handler,this.undoable=(n=e.undoable)!=null?n:!0}},a(Kn,"InputRule"),Kn),T2=a((t,e)=>{if(Vl(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},"inputRuleMatcherHandler");function Mi(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:u}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(p=>p.type.spec.code))return!1;let d=!1;const f=i2(c)+o;return s.forEach(p=>{if(d)return;const h=T2(f,p.find);if(!h)return;const m=l.state.tr,g=bs({state:l.state,transaction:m}),b={from:r-(h[0].length-o.length),to:i},{commands:y,chain:x,can:k}=new ys({editor:n,state:g});p.handler({state:g,range:b,match:h,commands:y,chain:x,can:k})===null||!m.steps.length||(p.undoable&&m.setMeta(u,{transform:m,from:r,to:i,text:o}),l.dispatch(m),d=!0)}),d}a(Mi,"run$2");function D2(t){const{editor:e,rules:n}=t,r=new V({state:{init(){return null},apply(i,o,s){const u=i.getMeta(r);if(u)return u;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=yi(A.from(d),s.schema);const{from:f}=l,p=f+d.length;Mi({editor:e,from:f,to:p,text:d,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,u){return Mi({editor:e,from:o,to:s,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:a(i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Mi({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1),"compositionend")},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?Mi({editor:e,from:s.pos,to:s.pos,text:`
|
|
13
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}a(D2,"inputRulesPlugin");function O2(t){return Object.prototype.toString.call(t).slice(8,-1)}a(O2,"getType");function Ti(t){return O2(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}a(Ti,"isPlainObject");function np(t,e){const n={...t};return Ti(t)&&Ti(e)&&Object.keys(e).forEach(r=>{Ti(e[r])&&Ti(t[r])?n[r]=np(t[r],e[r]):n[r]=e[r]}),n}a(np,"mergeDeep");var Jn,Xl=(Jn=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...$(O(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...$(O(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const n=this.extend({...this.config,addOptions:a(()=>np(this.options,e),"addOptions")});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new this.constructor({...this.config,...e});return n.parent=this,this.child=n,n.name="name"in e?e.name:n.parent.name,n}},a(Jn,"Extendable"),Jn),wn,Te=(wn=class extends Xl{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new wn(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(c=>c?.type.name===n.name))return!1;const l=s.find(c=>c?.type.name===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},a(wn,"_Mark"),wn);function _2(t){return typeof t=="number"}a(_2,"isNumber$1");var Gn,N2=(Gn=class{constructor(e){this.find=e.find,this.handler=e.handler}},a(Gn,"PasteRule"),Gn),I2=a((t,e,n)=>{if(Vl(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}):[]},"pasteRuleMatcherHandler");function R2(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:u}=t,{commands:l,chain:c,can:d}=new ys({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,i,(h,m)=>{var g,b,y,x,k;if((b=(g=h.type)==null?void 0:g.spec)!=null&&b.code||!(h.isText||h.isTextblock||h.isInline))return;const C=(k=(x=(y=h.content)==null?void 0:y.size)!=null?x:h.nodeSize)!=null?k:0,w=Math.max(r,m),E=Math.min(i,m+C);if(w>=E)return;const S=h.isText?h.text||"":h.textBetween(w-m,E-m,void 0,"");I2(S,o.find,s).forEach(D=>{if(D.index===void 0)return;const _=w+D.index+1,z=_+D[0].length,j={from:n.tr.mapping.map(_),to:n.tr.mapping.map(z)},J=o.handler({state:n,range:j,match:D,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:u});f.push(J)})}),f.every(h=>h!==null)}a(R2,"run2");var Di=null,F2=a(t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n},"createClipboardPasteEvent");function L2(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,u;try{u=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{u=null}const l=a(({state:d,from:f,to:p,rule:h,pasteEvt:m})=>{const g=d.tr,b=bs({state:d,transaction:g});if(!(!R2({editor:e,state:b,from:Math.max(f-1,0),to:p.b-1,rule:h,pasteEvent:m,dropEvent:u})||!g.steps.length)){try{u=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{u=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}},"processEvent");return n.map(d=>new V({view(f){const p=a(m=>{var g;r=(g=f.dom.parentElement)!=null&&g.contains(m.target)?f.dom.parentElement:null,r&&(Di=e)},"handleDragstart"),h=a(()=>{Di&&(Di=null)},"handleDragend");return window.addEventListener("dragstart",p),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:a((f,p)=>{if(o=r===f.dom.parentElement,u=p,!o){const h=Di;h?.isEditable&&setTimeout(()=>{const m=h.state.selection;m&&h.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},"drop"),paste:a((f,p)=>{var h;const m=(h=p.clipboardData)==null?void 0:h.getData("text/html");return s=p,i=!!m?.includes("data-pm-slice"),!1},"paste")}},appendTransaction:a((f,p,h)=>{const m=f[0],g=m.getMeta("uiEvent")==="paste"&&!i,b=m.getMeta("uiEvent")==="drop"&&!o,y=m.getMeta("applyPasteRules"),x=!!y;if(!g&&!b&&!x)return;if(x){let{text:w}=y;typeof w=="string"?w=w:w=yi(A.from(w),h.schema);const{from:E}=y,S=E+w.length,T=F2(w);return l({rule:d,state:h,from:E,to:{b:S},pasteEvt:T})}const k=p.doc.content.findDiffStart(h.doc.content),C=p.doc.content.findDiffEnd(h.doc.content);if(!(!_2(k)||!C||k===C.b))return l({rule:d,state:h,from:k,to:C,pasteEvt:s})},"appendTransaction")}))}a(L2,"pasteRulesPlugin");var Zn,Cs=(Zn=class{constructor(e,n){this.splittableMarks=[],this.editor=n,this.baseExtensions=e,this.extensions=Zh(e),this.schema=Yb(this.extensions,n),this.setupExtensions()}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:this.editor,type:Zs(n.name,this.schema)},i=O(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this;return Kl([...this.extensions].reverse()).flatMap(i=>{const o={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:Zs(i.name,this.schema)},s=[],u=O(i,"addKeyboardShortcuts",o);let l={};if(i.type==="mark"&&O(i,"exitable",o)&&(l.ArrowRight=()=>Te.handleExit({editor:e,mark:i})),u){const h=Object.fromEntries(Object.entries(u()).map(([m,g])=>[m,()=>g({editor:e})]));l={...l,...h}}const c=tb(l);s.push(c);const d=O(i,"addInputRules",o);if(pd(i,e.options.enableInputRules)&&d){const h=d();if(h&&h.length){const m=D2({editor:e,rules:h}),g=Array.isArray(m)?m:[m];s.push(...g)}}const f=O(i,"addPasteRules",o);if(pd(i,e.options.enablePasteRules)&&f){const h=f();if(h&&h.length){const m=L2({editor:e,rules:h});s.push(...m)}}const p=O(i,"addProseMirrorPlugins",o);if(p){const h=p();s.push(...h)}return s})}get attributes(){return Gh(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=ui(this.extensions);return Object.fromEntries(n.filter(r=>!!O(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Y(r.name,this.schema)},s=O(r,"addNodeView",o);if(!s)return[];const u=a((l,c,d,f,p)=>{const h=go(l,i);return s()({node:l,view:c,getPos:d,decorations:f,innerDecorations:p,editor:e,extension:r,HTMLAttributes:h})},"nodeview");return[r.name,u]}))}get markViews(){const{editor:e}=this,{markExtensions:n}=ui(this.extensions);return Object.fromEntries(n.filter(r=>!!O(r,"addMarkView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Ct(r.name,this.schema)},s=O(r,"addMarkView",o);if(!s)return[];const u=a((l,c,d)=>{const f=go(l,i);return s()({mark:l,view:c,inline:d,editor:e,extension:r,HTMLAttributes:f,updateAttributes:a(p=>{G2(l,e,p)},"updateAttributes")})},"markView");return[r.name,u]}))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(n=>[n.name,n.storage])),e.forEach(n=>{var r;const i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:this.editor,type:Zs(n.name,this.schema)};n.type==="mark"&&((r=$(O(n,"keepOnSplit",i)))==null||r)&&this.splittableMarks.push(n.name);const o=O(n,"onBeforeCreate",i),s=O(n,"onCreate",i),u=O(n,"onUpdate",i),l=O(n,"onSelectionUpdate",i),c=O(n,"onTransaction",i),d=O(n,"onFocus",i),f=O(n,"onBlur",i),p=O(n,"onDestroy",i);o&&this.editor.on("beforeCreate",o),s&&this.editor.on("create",s),u&&this.editor.on("update",u),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),f&&this.editor.on("blur",f),p&&this.editor.on("destroy",p)})}},a(Zn,"ExtensionManager"),Zn);Cs.resolve=Zh;Cs.sort=Kl;Cs.flatten=Wl;var rp={};Hl(rp,{ClipboardTextSerializer:a(()=>ip,"ClipboardTextSerializer"),Commands:a(()=>op,"Commands"),Delete:a(()=>sp,"Delete"),Drop:a(()=>up,"Drop"),Editable:a(()=>lp,"Editable"),FocusEvents:a(()=>cp,"FocusEvents"),Keymap:a(()=>dp,"Keymap"),Paste:a(()=>fp,"Paste"),Tabindex:a(()=>hp,"Tabindex"),focusEventsPluginKey:a(()=>ap,"focusEventsPluginKey")});var Cn,K=(Cn=class extends Xl{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new Cn(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},a(Cn,"_Extension"),Cn),ip=K.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new V({key:new U("clipboardTextSerializer"),props:{clipboardTextSerializer:a(()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(d=>d.$from.pos)),u=Math.max(...o.map(d=>d.$to.pos)),l=Jl(n);return Xh(r,{from:s,to:u},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})},"clipboardTextSerializer")}})]}}),op=K.create({name:"commands",addCommands(){return{...Hh}}}),sp=K.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,i;const o=a(()=>{var s,u,l,c;if((c=(l=(u=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:u.filterTransaction)==null?void 0:l.call(u,t))!=null?c:t.getMeta("y-sync$"))return;const d=Kh(t.before,[t,...e]);ep(d).forEach(h=>{d.mapping.mapResult(h.oldRange.from).deletedAfter&&d.mapping.mapResult(h.oldRange.to).deletedBefore&&d.before.nodesBetween(h.oldRange.from,h.oldRange.to,(m,g)=>{const b=g+m.nodeSize-2,y=h.oldRange.from<=g&&b<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:g,to:b,newFrom:d.mapping.map(g),newTo:d.mapping.map(b),deletedRange:h.oldRange,newRange:h.newRange,partial:!y,editor:this.editor,transaction:t,combinedTransform:d})})});const p=d.mapping;d.steps.forEach((h,m)=>{var g,b;if(h instanceof Ut){const y=p.slice(m).map(h.from,-1),x=p.slice(m).map(h.to),k=p.invert().map(y,-1),C=p.invert().map(x),w=(g=d.doc.nodeAt(y-1))==null?void 0:g.marks.some(S=>S.eq(h.mark)),E=(b=d.doc.nodeAt(x))==null?void 0:b.marks.some(S=>S.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:k,to:C},newRange:{from:y,to:x},partial:!!(E||w),editor:this.editor,transaction:t,combinedTransform:d})}})},"callback");(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(o,0):o()}}),up=K.create({name:"drop",addProseMirrorPlugins(){return[new V({key:new U("tiptapDrop"),props:{handleDrop:a((t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})},"handleDrop")}})]}}),lp=K.create({name:"editable",addProseMirrorPlugins(){return[new V({key:new U("editable"),props:{editable:a(()=>this.editor.options.editable,"editable")}})]}}),ap=new U("focusEvents"),cp=K.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new V({key:ap,props:{handleDOMEvents:{focus:a((e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},"focus"),blur:a((e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},"blur")}}})]}}),dp=K.create({name:"keymap",addKeyboardShortcuts(){const t=a(()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:u})=>{const{selection:l,doc:c}=u,{empty:d,$anchor:f}=l,{pos:p,parent:h}=f,m=f.parent.isTextblock&&p>0?u.doc.resolve(p-1):f,g=m.parent.type.spec.isolating,b=f.pos-f.parentOffset,y=g&&m.parent.childCount===1?b===f.pos:I.atStart(c).from===p;return!d||!h.type.isTextblock||h.textContent.length||!y||y&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),"handleBackspace"),e=a(()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),"handleDelete"),r={Enter:a(()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"handleEnter"),"Mod-Enter":a(()=>this.editor.commands.exitCode(),"Mod-Enter"),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":a(()=>this.editor.commands.selectAll(),"Mod-a")},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":a(()=>this.editor.commands.selectTextblockStart(),"Ctrl-a"),"Ctrl-e":a(()=>this.editor.commands.selectTextblockEnd(),"Ctrl-e")};return Ul()||Uh()?o:i},addProseMirrorPlugins(){return[new V({key:new U("clearDocument"),appendTransaction:a((t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),i=t.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:u}=e.selection,l=I.atStart(e.doc).from,c=I.atEnd(e.doc).to;if(o||!(s===l&&u===c)||!ks(n.doc))return;const p=n.tr,h=bs({state:n,transaction:p}),{commands:m}=new ys({editor:this.editor,state:h});if(m.clearNodes(),!!p.steps.length)return p},"appendTransaction")})]}}),fp=K.create({name:"paste",addProseMirrorPlugins(){return[new V({key:new U("tiptapPaste"),props:{handlePaste:a((t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})},"handlePaste")}})]}}),hp=K.create({name:"tabindex",addProseMirrorPlugins(){return[new V({key:new U("tabindex"),props:{attributes:a(()=>this.editor.isEditable?{tabindex:"0"}:{},"attributes")}})]}}),Be,P2=(Be=class{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 name(){return this.node.type.name}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: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 Be(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 Be(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 Be(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;const u=this.resolvedPos.doc.resolve(s);if(!i&&u.depth<=this.depth)return;const l=new Be(u,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new Be(u,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 l=s[u];if(o[l]!==n[l])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(l=>n[l]===s.node.attrs[l])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},a(Be,"_NodePos"),Be),B2=`.ProseMirror {
|
|
14
|
+
position: relative;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ProseMirror {
|
|
18
|
+
word-wrap: break-word;
|
|
19
|
+
white-space: pre-wrap;
|
|
20
|
+
white-space: break-spaces;
|
|
21
|
+
-webkit-font-variant-ligatures: none;
|
|
22
|
+
font-variant-ligatures: none;
|
|
23
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ProseMirror [contenteditable="false"] {
|
|
27
|
+
white-space: normal;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
31
|
+
white-space: pre-wrap;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ProseMirror pre {
|
|
35
|
+
white-space: pre-wrap;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
img.ProseMirror-separator {
|
|
39
|
+
display: inline !important;
|
|
40
|
+
border: none !important;
|
|
41
|
+
margin: 0 !important;
|
|
42
|
+
width: 0 !important;
|
|
43
|
+
height: 0 !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ProseMirror-gapcursor {
|
|
47
|
+
display: none;
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
position: absolute;
|
|
50
|
+
margin: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ProseMirror-gapcursor:after {
|
|
54
|
+
content: "";
|
|
55
|
+
display: block;
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: -2px;
|
|
58
|
+
width: 20px;
|
|
59
|
+
border-top: 1px solid black;
|
|
60
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes ProseMirror-cursor-blink {
|
|
64
|
+
to {
|
|
65
|
+
visibility: hidden;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ProseMirror-hideselection *::selection {
|
|
70
|
+
background: transparent;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
74
|
+
background: transparent;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ProseMirror-hideselection * {
|
|
78
|
+
caret-color: transparent;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
82
|
+
display: block;
|
|
83
|
+
}`;function z2(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}a(z2,"createStyleTag");var Xn,$2=(Xn=class extends M2{constructor(e={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:a(()=>null,"onBeforeCreate"),onCreate:a(()=>null,"onCreate"),onMount:a(()=>null,"onMount"),onUnmount:a(()=>null,"onUnmount"),onUpdate:a(()=>null,"onUpdate"),onSelectionUpdate:a(()=>null,"onSelectionUpdate"),onTransaction:a(()=>null,"onTransaction"),onFocus:a(()=>null,"onFocus"),onBlur:a(()=>null,"onBlur"),onDestroy:a(()=>null,"onDestroy"),onContentError:a(({error:i})=>{throw i},"onContentError"),onPaste:a(()=>null,"onPaste"),onDrop:a(()=>null,"onDrop"),onDelete:a(()=>null,"onDelete")},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("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),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),this.on("drop",({event:i,slice:o,moved:s})=>this.options.onDrop(i,o,s)),this.on("paste",({event:i,slice:o})=>this.options.onPaste(i,o)),this.on("delete",this.options.onDelete);const n=this.createDoc(),r=jh(n,this.options.autofocus);this.editorState=_u.create({doc:n,schema:this.schema,selection:r||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}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&&typeof document<"u"&&(this.css=z2(B2,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!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,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:a(e=>{this.editorState=e},"updateState"),dispatch:a(e=>{this.dispatchTransaction(e)},"dispatch"),composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:a((e,n)=>{if(this.editorView)return this.editorView[n];if(n==="state")return this.editorState;if(n in e)return Reflect.get(e,n);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${n}']. The editor may not be mounted yet.`)},"get")})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,n){const r=Jh(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;r=r.filter(u=>!u.key.startsWith(s))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[lp,ip.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:n.blockSeparator}),op,cp,dp,hp,up,fp,sp].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new Cs(i,this)}createCommandManager(){this.commandManager=new ys({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Zu(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(n){if(!(n instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(n.message))throw n;this.emit("contentError",{editor:this,error:n,disableCollaboration:a(()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()},"disableCollaboration")}),e=Zu(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){var n;this.editorView=new ho(e,{...this.options.editorProps,attributes:{role:"textbox",...(n=this.options.editorProps)==null?void 0:n.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.prependClass(),this.injectCSS();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,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(d=>{var f;return(f=this.capturedTransaction)==null?void 0:f.step(d)});return}const{state:n,transactions:r}=this.state.applyTransaction(e),i=!this.state.selection.eq(n.selection),o=r.includes(e),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),!o)return;this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:r.slice(1)}),i&&this.emit("selectionUpdate",{editor:this,transaction:e});const u=r.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),l=u?.getMeta("focus"),c=u?.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:u}),c&&this.emit("blur",{editor:this,event:c.event,transaction:u}),!(e.getMeta("preventUpdate")||!r.some(d=>d.docChanged)||s.doc.eq(n.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:r.slice(1)})}getAttributes(e){return Qh(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return o2(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return yi(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
|
|
84
|
+
|
|
85
|
+
`,textSerializers:r={}}=e||{};return Yh(this.state.doc,{blockSeparator:n,textSerializers:{...Jl(this.schema),...r}})}get isEmpty(){return ks(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,n;return(n=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?n:!0}$node(e,n){var r;return((r=this.$doc)==null?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)==null?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new P2(n,this)}get $doc(){return this.$pos(0)}},a(Xn,"Editor"),Xn);function pr(t){return new ws({find:t.find,handler:a(({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 l=u.search(/\S/),c=n.from+u.indexOf(s),d=c+s.length;if(Gl(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===t.type&&g!==h.mark.type)).filter(h=>h.to>c).length)return null;d<n.to&&o.delete(d,n.to),c>n.from&&o.delete(n.from+l,c);const p=n.from+l+s.length;o.addMark(n.from+l,p,t.type.create(i||{})),o.removeStoredMark(t.type)}},"handler"),undoable:t.undoable})}a(pr,"markInputRule");function H2(t){return new ws({find:t.find,handler:a(({state:e,range:n,match:r})=>{const i=$(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let u=n.to;const l=t.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let d=s+c;d>u?d=u:u=d+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(d,u,l)}else if(r[0]){const c=t.type.isInline?s:s-1;o.insert(c,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(u))}o.scrollIntoView()},"handler"),undoable:t.undoable})}a(H2,"nodeInputRule");function Yu(t){return new ws({find:t.find,handler:a(({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)},"handler"),undoable:t.undoable})}a(Yu,"textblockTypeInputRule");function mr(t){return new ws({find:t.find,handler:a(({state:e,range:n,match:r,chain:i})=>{const o=$(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&Al(l,t.type,o);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:f,storedMarks:p}=e,{splittableMarks:h}=t.editor.extensionManager,m=p||f.$to.parentOffset&&f.$from.marks();if(m){const g=m.filter(b=>h.includes(b.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&Xt(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&s.join(n.from-1)},"handler"),undoable:t.undoable})}a(mr,"wrappingInputRule");function V2(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof N){const o=r.index();return r.parent.canReplaceWith(o,o+1,e)}let i=r.depth;for(;i>=0;){const o=r.index(i);if(r.node(i).contentMatchAt(o).matchType(e))return!0;i-=1}return!1}a(V2,"canInsertNode");var j2={};Hl(j2,{createAtomBlockMarkdownSpec:a(()=>q2,"createAtomBlockMarkdownSpec"),createBlockMarkdownSpec:a(()=>U2,"createBlockMarkdownSpec"),createInlineMarkdownSpec:a(()=>J2,"createInlineMarkdownSpec"),parseAttributes:a(()=>Yl,"parseAttributes"),parseIndentedBlocks:a(()=>Qu,"parseIndentedBlocks"),renderNestedMarkdownContent:a(()=>ea,"renderNestedMarkdownContent"),serializeAttributes:a(()=>Ql,"serializeAttributes")});function Yl(t){if(!t?.trim())return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,c=>(n.push(c),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const c=i.map(d=>d.trim().slice(1));e.class=c.join(" ")}const o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(e.id=o[1]);const s=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(s)).forEach(([,c,d])=>{var f;const p=parseInt(((f=d.match(/__QUOTED_(\d+)__/))==null?void 0:f[1])||"0",10),h=n[p];h&&(e[c]=h.slice(1,-1))});const l=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(e[d]=!0)}),e}a(Yl,"parseAttributes");function Ql(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}a(Ql,"serializeAttributes");function q2(t){const{nodeName:e,name:n,parseAttributes:r=Yl,serializeAttributes:i=Ql,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:u}=t,l=n||e,c=a(d=>{if(!u)return d;const f={};return u.forEach(p=>{p in d&&(f[p]=d[p])}),f},"filterAttributes");return{parseMarkdown:a((d,f)=>{const p={...o,...d.attributes};return f.createNode(e,p,[])},"parseMarkdown"),markdownTokenizer:{name:e,level:"block",start(d){var f;const p=new RegExp(`^:::${l}(?:\\s|$)`,"m"),h=(f=d.match(p))==null?void 0:f.index;return h!==void 0?h:-1},tokenize(d,f,p){const h=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),m=d.match(h);if(!m)return;const g=m[1]||"",b=r(g);if(!s.find(x=>!(x in b)))return{type:e,raw:m[0],attributes:b}}},renderMarkdown:a(d=>{const f=c(d.attrs||{}),p=i(f),h=p?` {${p}}`:"";return`:::${l}${h} :::`},"renderMarkdown")}}a(q2,"createAtomBlockMarkdownSpec");function U2(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=Yl,serializeAttributes:o=Ql,defaultAttributes:s={},content:u="block",allowedAttributes:l}=t,c=n||e,d=a(f=>{if(!l)return f;const p={};return l.forEach(h=>{h in f&&(p[h]=f[h])}),p},"filterAttributes");return{parseMarkdown:a((f,p)=>{let h;if(r){const g=r(f);h=typeof g=="string"?[{type:"text",text:g}]:g}else u==="block"?h=p.parseChildren(f.tokens||[]):h=p.parseInline(f.tokens||[]);const m={...s,...f.attributes};return p.createNode(e,m,h)},"parseMarkdown"),markdownTokenizer:{name:e,level:"block",start(f){var p;const h=new RegExp(`^:::${c}`,"m"),m=(p=f.match(h))==null?void 0:p.index;return m!==void 0?m:-1},tokenize(f,p,h){var m;const g=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),b=f.match(g);if(!b)return;const[y,x=""]=b,k=i(x);let C=1;const w=y.length;let E="";const S=/^:::([\w-]*)(\s.*)?/gm,T=f.slice(w);for(S.lastIndex=0;;){const D=S.exec(T);if(D===null)break;const _=D.index,z=D[1];if(!((m=D[2])!=null&&m.endsWith(":::"))){if(z)C+=1;else if(C-=1,C===0){const j=T.slice(0,_);E=j.trim();const J=f.slice(0,w+_+D[0].length);let L=[];if(E)if(u==="block")for(L=h.blockTokens(j),L.forEach(P=>{P.text&&(!P.tokens||P.tokens.length===0)&&(P.tokens=h.inlineTokens(P.text))});L.length>0;){const P=L[L.length-1];if(P.type==="paragraph"&&(!P.text||P.text.trim()===""))L.pop();else break}else L=h.inlineTokens(E);return{type:e,raw:J,attributes:k,content:E,tokens:L}}}}}},renderMarkdown:a((f,p)=>{const h=d(f.attrs||{}),m=o(h),g=m?` {${m}}`:"",b=p.renderChildren(f.content||[],`
|
|
86
|
+
|
|
87
|
+
`);return`:::${c}${g}
|
|
88
|
+
|
|
89
|
+
${b}
|
|
90
|
+
|
|
91
|
+
:::`},"renderMarkdown")}}a(U2,"createBlockMarkdownSpec");function W2(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,i,o,s]=r;e[i]=o||s,r=n.exec(t)}return e}a(W2,"parseShortcodeAttributes");function K2(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}a(K2,"serializeShortcodeAttributes");function J2(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=W2,serializeAttributes:o=K2,defaultAttributes:s={},selfClosing:u=!1,allowedAttributes:l}=t,c=n||e,d=a(p=>{if(!l)return p;const h={};return l.forEach(m=>{m in p&&(h[m]=p[m])}),h},"filterAttributes"),f=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:a((p,h)=>{const m={...s,...p.attributes};if(u)return h.createNode(e,m);const g=r?r(p):p.content||"";return g?h.createNode(e,m,[h.createTextNode(g)]):h.createNode(e,m,[])},"parseMarkdown"),markdownTokenizer:{name:e,level:"inline",start(p){const h=u?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),m=p.match(h),g=m?.index;return g!==void 0?g:-1},tokenize(p,h,m){const g=u?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),b=p.match(g);if(!b)return;let y="",x="";if(u){const[,C]=b;x=C}else{const[,C,w]=b;x=C,y=w||""}const k=i(x.trim());return{type:e,raw:b[0],content:y.trim(),attributes:k}}},renderMarkdown:a(p=>{let h="";r?h=r(p):p.content&&p.content.length>0&&(h=p.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const m=d(p.attrs||{}),g=o(m),b=g?` ${g}`:"";return u?`[${c}${b}]`:`[${c}${b}]${h}[/${c}]`},"renderMarkdown")}}a(J2,"createInlineMarkdownSpec");function Qu(t,e,n){var r,i,o,s;const u=t.split(`
|
|
92
|
+
`),l=[];let c="",d=0;const f=e.baseIndentSize||2;for(;d<u.length;){const p=u[d],h=p.match(e.itemPattern);if(!h){if(l.length>0)break;if(p.trim()===""){d+=1;continue}else return}const m=e.extractItemData(h),{indentLevel:g,mainContent:b}=m;c=`${c}${p}
|
|
93
|
+
`;const y=[b];for(d+=1;d<u.length;){const w=u[d];if(w.trim()===""){const S=u.slice(d+1).findIndex(_=>_.trim()!=="");if(S===-1)break;if((((i=(r=u[d+1+S].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>g){y.push(w),c=`${c}${w}
|
|
94
|
+
`,d+=1;continue}else break}if((((s=(o=w.match(/^(\s*)/))==null?void 0:o[1])==null?void 0:s.length)||0)>g)y.push(w),c=`${c}${w}
|
|
95
|
+
`,d+=1;else break}let x;const k=y.slice(1);if(k.length>0){const w=k.map(E=>E.slice(g+f)).join(`
|
|
96
|
+
`);w.trim()&&(e.customNestedParser?x=e.customNestedParser(w):x=n.blockTokens(w))}const C=e.createToken(m,x);l.push(C)}if(l.length!==0)return{items:l,raw:c.trim()}}a(Qu,"parseIndentedBlocks");function ea(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const i=typeof n=="function"?n(r):n,[o,...s]=t.content,u=e.renderChildren([o]),l=[`${i}${u}`];return s&&s.length>0&&s.forEach(c=>{const d=e.renderChildren([c]);if(d){const f=d.split(`
|
|
97
|
+
`).map(p=>p?e.indent(p):"").join(`
|
|
98
|
+
`);l.push(f)}}),l.join(`
|
|
99
|
+
`)}a(ea,"renderNestedMarkdownContent");function G2(t,e,n={}){const{state:r}=e,{doc:i,tr:o}=r,s=t;i.descendants((u,l)=>{const c=o.mapping.map(l),d=o.mapping.map(l)+u.nodeSize;let f=null;if(u.marks.forEach(h=>{if(h!==s)return!1;f=h}),!f)return;let p=!1;if(Object.keys(n).forEach(h=>{n[h]!==f.attrs[h]&&(p=!0)}),p){const h=t.type.create({...t.attrs,...n});o.removeMark(c,d,t.type),o.addMark(c,d,h)}}),o.docChanged&&e.view.dispatch(o)}a(G2,"updateMarkViewAttributes");var En,H=(En=class extends Xl{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new En(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},a(En,"_Node"),En);function Dn(t){return new N2({find:t.find,handler:a(({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],l=r[0];let c=n.to;if(u){const d=l.search(/\S/),f=n.from+l.indexOf(u),p=f+u.length;if(Gl(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(b=>b===t.type&&b!==m.mark.type)).filter(m=>m.to>f).length)return null;p<n.to&&s.delete(p,n.to),f>n.from&&s.delete(n.from+d,f),c=n.from+d+u.length,s.addMark(n.from+d,c,t.type.create(o||{})),s.removeStoredMark(t.type)}},"handler")})}a(Dn,"markPasteRule");var bo=a((t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},"h"),Z2=/^\s*>\s$/,X2=H.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return bo("blockquote",{...Q(this.options.HTMLAttributes,t),children:bo("slot",{})})},parseMarkdown:a((t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),"parseMarkdown"),renderMarkdown:a((t,e)=>{if(!t.content)return"";const n=[];return t.content.forEach(i=>{const s=e.renderChildren(i).split(`
|
|
100
|
+
`).map(u=>`> ${u}`).join(`
|
|
101
|
+
`);n.push(s)}),n.flatMap(i=>[i,"> "]).slice(0,-1).join(`
|
|
102
|
+
`)},"renderMarkdown"),addCommands(){return{setBlockquote:a(()=>({commands:t})=>t.wrapIn(this.name),"setBlockquote"),toggleBlockquote:a(()=>({commands:t})=>t.toggleWrap(this.name),"toggleBlockquote"),unsetBlockquote:a(()=>({commands:t})=>t.lift(this.name),"unsetBlockquote")}},addKeyboardShortcuts(){return{"Mod-Shift-b":a(()=>this.editor.commands.toggleBlockquote(),"Mod-Shift-b")}},addInputRules(){return[mr({find:Z2,type:this.type})]}}),Y2=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Q2=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,ey=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,ty=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,ny=Te.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:a(t=>t.style.fontWeight!=="normal"&&null,"getAttrs")},{style:"font-weight=400",clearMark:a(t=>t.type.name===this.name,"clearMark")},{style:"font-weight",getAttrs:a(t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null,"getAttrs")}]},renderHTML({HTMLAttributes:t}){return bo("strong",{...Q(this.options.HTMLAttributes,t),children:bo("slot",{})})},markdownTokenName:"strong",parseMarkdown:a((t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),"parseMarkdown"),renderMarkdown:a((t,e)=>`**${e.renderChildren(t)}**`,"renderMarkdown"),addCommands(){return{setBold:a(()=>({commands:t})=>t.setMark(this.name),"setBold"),toggleBold:a(()=>({commands:t})=>t.toggleMark(this.name),"toggleBold"),unsetBold:a(()=>({commands:t})=>t.unsetMark(this.name),"unsetBold")}},addKeyboardShortcuts(){return{"Mod-b":a(()=>this.editor.commands.toggleBold(),"Mod-b"),"Mod-B":a(()=>this.editor.commands.toggleBold(),"Mod-B")}},addInputRules(){return[pr({find:Y2,type:this.type}),pr({find:ey,type:this.type})]},addPasteRules(){return[Dn({find:Q2,type:this.type}),Dn({find:ty,type:this.type})]}}),ry=/(^|[^`])`([^`]+)`(?!`)$/,iy=/(^|[^`])`([^`]+)`(?!`)/g,oy=Te.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Q(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:a((t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),"parseMarkdown"),renderMarkdown:a((t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"","renderMarkdown"),addCommands(){return{setCode:a(()=>({commands:t})=>t.setMark(this.name),"setCode"),toggleCode:a(()=>({commands:t})=>t.toggleMark(this.name),"toggleCode"),unsetCode:a(()=>({commands:t})=>t.unsetMark(this.name),"unsetCode")}},addKeyboardShortcuts(){return{"Mod-e":a(()=>this.editor.commands.toggleCode(),"Mod-e")}},addInputRules(){return[pr({find:ry,type:this.type})]},addPasteRules(){return[Dn({find:iy,type:this.type})]}}),Qs=4,sy=/^```([a-z]+)?[\s\n]$/,uy=/^~~~([a-z]+)?[\s\n]$/,ly=H.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Qs,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:a(t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const o=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},"parseHTML"),rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Q(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:a((t,e)=>{var n;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},"parseMarkdown"),renderMarkdown:a((t,e)=>{var n;let r="";const i=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(`
|
|
103
|
+
`):r=`\`\`\`${i}
|
|
104
|
+
|
|
105
|
+
\`\`\``,r},"renderMarkdown"),addCommands(){return{setCodeBlock:a(t=>({commands:e})=>e.setNode(this.name,t),"setCodeBlock"),toggleCodeBlock:a(t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t),"toggleCodeBlock")}},addKeyboardShortcuts(){return{"Mod-Alt-c":a(()=>this.editor.commands.toggleCodeBlock(),"Mod-Alt-c"),Backspace:a(()=>{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},"Backspace"),Tab:a(({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Qs,{state:r}=t,{selection:i}=r,{$from:o,empty:s}=i;if(o.parent.type!==this.type)return!1;const u=" ".repeat(n);return s?t.commands.insertContent(u):t.commands.command(({tr:l})=>{const{from:c,to:d}=i,h=r.doc.textBetween(c,d,`
|
|
106
|
+
`,`
|
|
107
|
+
`).split(`
|
|
108
|
+
`).map(m=>u+m).join(`
|
|
109
|
+
`);return l.replaceWith(c,d,r.schema.text(h)),!0})},"Tab"),"Shift-Tab":a(({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Qs,{state:r}=t,{selection:i}=r,{$from:o,empty:s}=i;return o.parent.type!==this.type?!1:s?t.commands.command(({tr:u})=>{var l;const{pos:c}=o,d=o.start(),f=o.end(),h=r.doc.textBetween(d,f,`
|
|
110
|
+
`,`
|
|
111
|
+
`).split(`
|
|
112
|
+
`);let m=0,g=0;const b=c-d;for(let E=0;E<h.length;E+=1){if(g+h[E].length>=b){m=E;break}g+=h[E].length+1}const x=((l=h[m].match(/^ */))==null?void 0:l[0])||"",k=Math.min(x.length,n);if(k===0)return!0;let C=d;for(let E=0;E<m;E+=1)C+=h[E].length+1;return u.delete(C,C+k),c-C<=k&&u.setSelection(R.create(u.doc,C)),!0}):t.commands.command(({tr:u})=>{const{from:l,to:c}=i,p=r.doc.textBetween(l,c,`
|
|
113
|
+
`,`
|
|
114
|
+
`).split(`
|
|
115
|
+
`).map(h=>{var m;const g=((m=h.match(/^ */))==null?void 0:m[0])||"",b=Math.min(g.length,n);return h.slice(b)}).join(`
|
|
116
|
+
`);return u.replaceWith(l,c,r.schema.text(p)),!0})},"Shift-Tab"),Enter:a(({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(`
|
|
117
|
+
|
|
118
|
+
`);return!o||!s?!1:t.chain().command(({tr:u})=>(u.delete(r.pos-2,r.pos),!0)).exitCode().run()},"Enter"),ArrowDown:a(({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:c})=>(c.setSelection(I.near(r.resolve(u))),!0)):t.commands.exitCode()},"ArrowDown")}},addInputRules(){return[Yu({find:sy,type:this.type,getAttributes:a(t=>({language:t[1]}),"getAttributes")}),Yu({find:uy,type:this.type,getAttributes:a(t=>({language:t[1]}),"getAttributes")})]},addProseMirrorPlugins(){return[new V({key:new U("codeBlockVSCodeHandler"),props:{handlePaste:a((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?.mode;if(!n||!o)return!1;const{tr:s,schema:u}=t.state,l=u.text(n.replace(/\r\n?/g,`
|
|
119
|
+
`));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(R.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0},"handlePaste")}})]}}),ay=H.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:a((t,e)=>t.content?e.renderChildren(t.content,`
|
|
120
|
+
|
|
121
|
+
`):"","renderMarkdown")}),cy=H.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Q(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
122
|
+
`},renderMarkdown:a((t,e)=>e.indent(`
|
|
123
|
+
`),"renderMarkdown"),addCommands(){return{setHardBreak:a(()=>({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,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&s){const f=l.filter(p=>u.includes(p.type.name));c.ensureMarks(f)}return!0}).run()})]),"setHardBreak")}},addKeyboardShortcuts(){return{"Mod-Enter":a(()=>this.editor.commands.setHardBreak(),"Mod-Enter"),"Shift-Enter":a(()=>this.editor.commands.setHardBreak(),"Shift-Enter")}}}),dy=H.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]}`,Q(this.options.HTMLAttributes,e),0]},parseMarkdown:a((t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),"parseMarkdown"),renderMarkdown:a((t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,i="#".repeat(r);return t.content?`${i} ${e.renderChildren(t.content)}`:""},"renderMarkdown"),addCommands(){return{setHeading:a(t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,"setHeading"),toggleHeading:a(t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1,"toggleHeading")}},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=>Yu({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),fy=H.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Q(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:a((t,e)=>e.createNode("horizontalRule"),"parseMarkdown"),renderMarkdown:a(()=>"---","renderMarkdown"),addCommands(){return{setHorizontalRule:a(()=>({chain:t,state:e})=>{if(!V2(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,i=t();return tp(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:o,tr:s,dispatch:u})=>{if(u){const{$to:l}=s.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?s.setSelection(R.create(s.doc,l.pos+1)):l.nodeAfter.isBlock?s.setSelection(N.create(s.doc,l.pos)):s.setSelection(R.create(s.doc,l.pos));else{const d=o.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,f=d?.create();f&&(s.insert(c,f),s.setSelection(R.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()},"setHorizontalRule")}},addInputRules(){return[H2({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),hy=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,py=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,my=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,gy=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,by=Te.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:a(t=>t.style.fontStyle!=="normal"&&null,"getAttrs")},{style:"font-style=normal",clearMark:a(t=>t.type.name===this.name,"clearMark")},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:a(()=>({commands:t})=>t.setMark(this.name),"setItalic"),toggleItalic:a(()=>({commands:t})=>t.toggleMark(this.name),"toggleItalic"),unsetItalic:a(()=>({commands:t})=>t.unsetMark(this.name),"unsetItalic")}},markdownTokenName:"em",parseMarkdown:a((t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),"parseMarkdown"),renderMarkdown:a((t,e)=>`*${e.renderChildren(t)}*`,"renderMarkdown"),addKeyboardShortcuts(){return{"Mod-i":a(()=>this.editor.commands.toggleItalic(),"Mod-i"),"Mod-I":a(()=>this.editor.commands.toggleItalic(),"Mod-I")}},addInputRules(){return[pr({find:hy,type:this.type}),pr({find:my,type:this.type})]},addPasteRules(){return[Dn({find:py,type:this.type}),Dn({find:gy,type:this.type})]}});const yy="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",xy="ελ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",el="numeric",tl="ascii",nl="alpha",Br="asciinumeric",Nr="alphanumeric",rl="domain",pp="emoji",ky="scheme",wy="slashscheme",eu="whitespace";function Cy(t,e){return t in e||(e[t]=[]),e[t]}a(Cy,"registerGroup");function hn(t,e,n){e[el]&&(e[Br]=!0,e[Nr]=!0),e[tl]&&(e[Br]=!0,e[nl]=!0),e[Br]&&(e[Nr]=!0),e[nl]&&(e[Nr]=!0),e[Nr]&&(e[rl]=!0),e[pp]&&(e[rl]=!0);for(const r in e){const i=Cy(r,n);i.indexOf(t)<0&&i.push(t)}}a(hn,"addToGroups");function Ey(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}a(Ey,"flagsForToken");function ke(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}a(ke,"State");ke.groups={};ke.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=!1){return 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||ke.groups;let i;return e&&e.j?i=e:(i=new ke(e),n&&r&&hn(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||ke.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 ke,Object.assign(s.j,u.j),s.jr.push.apply(s.jr,u.jr),s.jd=u.jd,s.t=u.t):s=new ke,o){if(r)if(s.t&&typeof s.t=="string"){const l=Object.assign(Ey(s.t,r),n);hn(o,l,r)}else n&&hn(o,n,r);s.t=o}return i.j[t]=s,s}};const F=a((t,e,n,r,i)=>t.ta(e,n,r,i),"ta"),Z=a((t,e,n,r,i)=>t.tr(e,n,r,i),"tr"),bd=a((t,e,n,r,i)=>t.ts(e,n,r,i),"ts"),v=a((t,e,n,r,i)=>t.tt(e,n,r,i),"tt"),ht="WORD",il="UWORD",mp="ASCIINUMERICAL",gp="ALPHANUMERICAL",li="LOCALHOST",ol="TLD",sl="UTLD",Vi="SCHEME",Ln="SLASH_SCHEME",ta="NUM",ul="WS",na="NL",zr="OPENBRACE",$r="CLOSEBRACE",yo="OPENBRACKET",xo="CLOSEBRACKET",ko="OPENPAREN",wo="CLOSEPAREN",Co="OPENANGLEBRACKET",Eo="CLOSEANGLEBRACKET",So="FULLWIDTHLEFTPAREN",vo="FULLWIDTHRIGHTPAREN",Ao="LEFTCORNERBRACKET",Mo="RIGHTCORNERBRACKET",To="LEFTWHITECORNERBRACKET",Do="RIGHTWHITECORNERBRACKET",Oo="FULLWIDTHLESSTHAN",_o="FULLWIDTHGREATERTHAN",No="AMPERSAND",Io="APOSTROPHE",Ro="ASTERISK",Dt="AT",Fo="BACKSLASH",Lo="BACKTICK",Po="CARET",Ft="COLON",ra="COMMA",Bo="DOLLAR",Ue="DOT",zo="EQUALS",ia="EXCLAMATION",_e="HYPHEN",Hr="PERCENT",$o="PIPE",Ho="PLUS",Vo="POUND",Vr="QUERY",oa="QUOTE",bp="FULLWIDTHMIDDLEDOT",sa="SEMI",We="SLASH",jr="TILDE",jo="UNDERSCORE",yp="EMOJI",qo="SYM";var xp=Object.freeze({__proto__:null,ALPHANUMERICAL:gp,AMPERSAND:No,APOSTROPHE:Io,ASCIINUMERICAL:mp,ASTERISK:Ro,AT:Dt,BACKSLASH:Fo,BACKTICK:Lo,CARET:Po,CLOSEANGLEBRACKET:Eo,CLOSEBRACE:$r,CLOSEBRACKET:xo,CLOSEPAREN:wo,COLON:Ft,COMMA:ra,DOLLAR:Bo,DOT:Ue,EMOJI:yp,EQUALS:zo,EXCLAMATION:ia,FULLWIDTHGREATERTHAN:_o,FULLWIDTHLEFTPAREN:So,FULLWIDTHLESSTHAN:Oo,FULLWIDTHMIDDLEDOT:bp,FULLWIDTHRIGHTPAREN:vo,HYPHEN:_e,LEFTCORNERBRACKET:Ao,LEFTWHITECORNERBRACKET:To,LOCALHOST:li,NL:na,NUM:ta,OPENANGLEBRACKET:Co,OPENBRACE:zr,OPENBRACKET:yo,OPENPAREN:ko,PERCENT:Hr,PIPE:$o,PLUS:Ho,POUND:Vo,QUERY:Vr,QUOTE:oa,RIGHTCORNERBRACKET:Mo,RIGHTWHITECORNERBRACKET:Do,SCHEME:Vi,SEMI:sa,SLASH:We,SLASH_SCHEME:Ln,SYM:qo,TILDE:jr,TLD:ol,UNDERSCORE:jo,UTLD:sl,UWORD:il,WORD:ht,WS:ul});const dt=/[a-z]/,Tr=new RegExp("\\p{L}","u"),tu=new RegExp("\\p{Emoji}","u"),ft=/\d/,nu=/\s/,yd="\r",ru=`
|
|
124
|
+
`,Sy="️",vy="",iu="";let Oi=null,_i=null;function Ay(t=[]){const e={};ke.groups=e;const n=new ke;Oi==null&&(Oi=xd(yy)),_i==null&&(_i=xd(xy)),v(n,"'",Io),v(n,"{",zr),v(n,"}",$r),v(n,"[",yo),v(n,"]",xo),v(n,"(",ko),v(n,")",wo),v(n,"<",Co),v(n,">",Eo),v(n,"(",So),v(n,")",vo),v(n,"「",Ao),v(n,"」",Mo),v(n,"『",To),v(n,"』",Do),v(n,"<",Oo),v(n,">",_o),v(n,"&",No),v(n,"*",Ro),v(n,"@",Dt),v(n,"`",Lo),v(n,"^",Po),v(n,":",Ft),v(n,",",ra),v(n,"$",Bo),v(n,".",Ue),v(n,"=",zo),v(n,"!",ia),v(n,"-",_e),v(n,"%",Hr),v(n,"|",$o),v(n,"+",Ho),v(n,"#",Vo),v(n,"?",Vr),v(n,'"',oa),v(n,"/",We),v(n,";",sa),v(n,"~",jr),v(n,"_",jo),v(n,"\\",Fo),v(n,"・",bp);const r=Z(n,ft,ta,{[el]:!0});Z(r,ft,r);const i=Z(r,dt,mp,{[Br]:!0}),o=Z(r,Tr,gp,{[Nr]:!0}),s=Z(n,dt,ht,{[tl]:!0});Z(s,ft,i),Z(s,dt,s),Z(i,ft,i),Z(i,dt,i);const u=Z(n,Tr,il,{[nl]:!0});Z(u,dt),Z(u,ft,o),Z(u,Tr,u),Z(o,ft,o),Z(o,dt),Z(o,Tr,o);const l=v(n,ru,na,{[eu]:!0}),c=v(n,yd,ul,{[eu]:!0}),d=Z(n,nu,ul,{[eu]:!0});v(n,iu,d),v(c,ru,l),v(c,iu,d),Z(c,nu,d),v(d,yd),v(d,ru),Z(d,nu,d),v(d,iu,d);const f=Z(n,tu,yp,{[pp]:!0});v(f,"#"),Z(f,tu,f),v(f,Sy,f);const p=v(f,vy);v(p,"#"),Z(p,tu,f);const h=[[dt,s],[ft,i]],m=[[dt,null],[Tr,u],[ft,o]];for(let g=0;g<Oi.length;g++)At(n,Oi[g],ol,ht,h);for(let g=0;g<_i.length;g++)At(n,_i[g],sl,il,m);hn(ol,{tld:!0,ascii:!0},e),hn(sl,{utld:!0,alpha:!0},e),At(n,"file",Vi,ht,h),At(n,"mailto",Vi,ht,h),At(n,"http",Ln,ht,h),At(n,"https",Ln,ht,h),At(n,"ftp",Ln,ht,h),At(n,"ftps",Ln,ht,h),hn(Vi,{scheme:!0,ascii:!0},e),hn(Ln,{slashscheme:!0,ascii:!0},e),t=t.sort((g,b)=>g[0]>b[0]?1:-1);for(let g=0;g<t.length;g++){const b=t[g][0],x=t[g][1]?{[ky]:!0}:{[wy]:!0};b.indexOf("-")>=0?x[rl]=!0:dt.test(b)?ft.test(b)?x[Br]=!0:x[tl]=!0:x[el]=!0,bd(n,b,b,x)}return bd(n,"localhost",li,{ascii:!0}),n.jd=new ke(qo),{start:n,tokens:Object.assign({groups:e},xp)}}a(Ay,"init$2");function kp(t,e){const n=My(e.replace(/[A-Z]/g,u=>u.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let u=t,l=null,c=0,d=null,f=-1,p=-1;for(;s<r&&(l=u.go(n[s]));)u=l,u.accepts()?(f=0,p=0,d=u):f>=0&&(f+=n[s].length,p++),c+=n[s].length,o+=n[s].length,s++;o-=f,s-=p,c-=f,i.push({t:d.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}a(kp,"run$1");function My(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}a(My,"stringToArray");function At(t,e,n,r,i){let o;const s=e.length;for(let u=0;u<s-1;u++){const l=e[u];t.j[l]?o=t.j[l]:(o=new ke(r),o.jr=i.slice(),t.j[l]=o),t=o}return o=new ke(n),o.jr=i.slice(),t.j[e[s-1]]=o,o}a(At,"fastts");function xd(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}a(xd,"decodeTlds");const ai={defaultProtocol:"http",events:null,format:kd,formatHref:kd,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function ua(t,e=null){let n=Object.assign({},ai);t&&(n=Object.assign(n,t instanceof ua?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}a(ua,"Options");ua.prototype={o:ai,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]:ai[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 kd(t){return t}a(kd,"noop");function wp(t,e){this.t="token",this.v=t,this.tk=e}a(wp,"MultiToken");wp.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=ai.defaultProtocol){return{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),l=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return s.href=r,u&&(s.class=u),l&&(s.target=l),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:i,attributes:s,content:o,eventListeners:f}}};function Es(t,e){const r=class r extends wp{constructor(o,s){super(o,s),this.t=t}};a(r,"Token");let n=r;for(const i in e)n.prototype[i]=e[i];return n.t=t,n}a(Es,"createTokenClass");const wd=Es("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Cd=Es("text"),Ty=Es("nl"),Ni=Es("url",{isLink:!0,toHref(t=ai.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==li&&t[1].t===Ft}}),Oe=a(t=>new ke(t),"makeState");function Dy({groups:t}){const e=t.domain.concat([No,Ro,Dt,Fo,Lo,Po,Bo,zo,_e,ta,Hr,$o,Ho,Vo,We,qo,jr,jo]),n=[Io,Ft,ra,Ue,ia,Hr,Vr,oa,sa,Co,Eo,zr,$r,xo,yo,ko,wo,So,vo,Ao,Mo,To,Do,Oo,_o],r=[No,Io,Ro,Fo,Lo,Po,Bo,zo,_e,zr,$r,Hr,$o,Ho,Vo,Vr,We,qo,jr,jo],i=Oe(),o=v(i,jr);F(o,r,o),F(o,t.domain,o);const s=Oe(),u=Oe(),l=Oe();F(i,t.domain,s),F(i,t.scheme,u),F(i,t.slashscheme,l),F(s,r,o),F(s,t.domain,s);const c=v(s,Dt);v(o,Dt,c),v(u,Dt,c),v(l,Dt,c);const d=v(o,Ue);F(d,r,o),F(d,t.domain,o);const f=Oe();F(c,t.domain,f),F(f,t.domain,f);const p=v(f,Ue);F(p,t.domain,f);const h=Oe(wd);F(p,t.tld,h),F(p,t.utld,h),v(c,li,h);const m=v(f,_e);v(m,_e,m),F(m,t.domain,f),F(h,t.domain,f),v(h,Ue,p),v(h,_e,m);const g=v(h,Ft);F(g,t.numeric,wd);const b=v(s,_e),y=v(s,Ue);v(b,_e,b),F(b,t.domain,s),F(y,r,o),F(y,t.domain,s);const x=Oe(Ni);F(y,t.tld,x),F(y,t.utld,x),F(x,t.domain,s),F(x,r,o),v(x,Ue,y),v(x,_e,b),v(x,Dt,c);const k=v(x,Ft),C=Oe(Ni);F(k,t.numeric,C);const w=Oe(Ni),E=Oe();F(w,e,w),F(w,n,E),F(E,e,w),F(E,n,E),v(x,We,w),v(C,We,w);const S=v(u,Ft),T=v(l,Ft),D=v(T,We),_=v(D,We);F(u,t.domain,s),v(u,Ue,y),v(u,_e,b),F(l,t.domain,s),v(l,Ue,y),v(l,_e,b),F(S,t.domain,w),v(S,We,w),v(S,Vr,w),F(_,t.domain,w),F(_,e,w),v(_,We,w);const z=[[zr,$r],[yo,xo],[ko,wo],[Co,Eo],[So,vo],[Ao,Mo],[To,Do],[Oo,_o]];for(let j=0;j<z.length;j++){const[J,L]=z[j],P=v(w,J);v(E,J,P),v(P,L,w);const X=Oe(Ni);F(P,e,X);const ee=Oe();F(P,n),F(X,e,X),F(X,n,ee),F(ee,e,X),F(ee,n,ee),v(X,L,w),v(ee,L,w)}return v(i,li,x),v(i,na,Ty),{start:i,tokens:xp}}a(Dy,"init$1");function Oy(t,e,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let u=t,l=null,c=null,d=0,f=null,p=-1;for(;i<r&&!(l=u.go(n[i].t));)s.push(n[i++]);for(;i<r&&(c=l||u.go(n[i].t));)l=null,u=c,u.accepts()?(p=0,f=u):p>=0&&p++,i++,d++;if(p<0)i-=d,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(ou(Cd,e,s)),s=[]),i-=p,d-=p;const h=f.t,m=n.slice(i-d,i);o.push(ou(h,e,m))}}return s.length>0&&o.push(ou(Cd,e,s)),o}a(Oy,"run");function ou(t,e,n){const r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}a(ou,"initMultiToken");const _y=typeof console<"u"&&console&&console.warn||(()=>{}),Ny="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",W={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Iy(){return ke.groups={},W.scanner=null,W.parser=null,W.tokenQueue=[],W.pluginQueue=[],W.customSchemes=[],W.initialized=!1,W}a(Iy,"reset");function Ed(t,e=!1){if(W.initialized&&_y(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Ny}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
125
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
126
|
+
2. Cannot start or end with "-"
|
|
127
|
+
3. "-" cannot repeat`);W.customSchemes.push([t,e])}a(Ed,"registerCustomProtocol");function Ry(){W.scanner=Ay(W.customSchemes);for(let t=0;t<W.tokenQueue.length;t++)W.tokenQueue[t][1]({scanner:W.scanner});W.parser=Dy(W.scanner.tokens);for(let t=0;t<W.pluginQueue.length;t++)W.pluginQueue[t][1]({scanner:W.scanner,parser:W.parser});return W.initialized=!0,W}a(Ry,"init");function la(t){return W.initialized||Ry(),Oy(W.parser.start,t,kp(W.scanner.start,t))}a(la,"tokenize");la.scan=kp;function Cp(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new ua(n),i=la(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}a(Cp,"find");var aa="[\0- -\u2029 ]",Fy=new RegExp(aa),Ly=new RegExp(`${aa}$`),Py=new RegExp(aa,"g");function By(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}a(By,"isValidLinkStructure");function zy(t){return new V({key:new U("autolink"),appendTransaction:a((e,n,r)=>{const i=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,u=Kh(n.doc,[...e]);if(ep(u).forEach(({newRange:c})=>{const d=Jb(r.doc,c,h=>h.isTextblock);let f,p;if(d.length>1)f=d[0],p=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(d.length){const h=r.doc.textBetween(c.from,c.to," "," ");if(!Ly.test(h))return;f=d[0],p=r.doc.textBetween(f.pos,c.to,void 0," ")}if(f&&p){const h=p.split(Fy).filter(Boolean);if(h.length<=0)return!1;const m=h[h.length-1],g=f.pos+p.lastIndexOf(m);if(!m)return!1;const b=la(m).map(y=>y.toObject(t.defaultProtocol));if(!By(b))return!1;b.filter(y=>y.isLink).map(y=>({...y,from:g+y.start+1,to:g+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)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{Gl(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},"appendTransaction")})}a(zy,"autolink$1");function $y(t){return new V({key:new U("handleClickLink"),props:{handleClick:a((e,n,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{let d=r.target;const f=[];for(;d.nodeName!=="DIV";)f.push(d),d=d.parentNode;s=f.find(p=>p.nodeName==="A")}if(!s)return!1;const u=Qh(e.state,t.type.name),l=(i=s?.href)!=null?i:u.href,c=(o=s?.target)!=null?o:u.target;return t.enableClickSelection&&t.editor.commands.extendMarkRange(t.type.name),s&&l?(window.open(l,c),!0):!1},"handleClick")}})}a($y,"clickHandler");function Hy(t){return new V({key:new U("handlePasteLink"),props:{handlePaste:a((e,n,r)=>{const{shouldAutoLink:i}=t,{state:o}=e,{selection:s}=o,{empty:u}=s;if(u)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});const c=Cp(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!c||i!==void 0&&!i(c.href)?!1:t.editor.commands.setMark(t.type,{href:c.href})},"handlePaste")}})}a(Hy,"pasteHandler");function Qt(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(Py,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}a(Qt,"isAllowedUri");var Ep=Te.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){Ed(t);return}Ed(t.scheme,t.optionalSlashes)})},onDestroy(){Iy()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:a((t,e)=>!!Qt(t,e.protocols),"isAllowedUri"),validate:a(t=>!!t,"validate"),shouldAutoLink:a(t=>!!t,"shouldAutoLink")}},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:a(t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:a(n=>!!Qt(n,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null},"getAttrs")}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:a(e=>!!Qt(e,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Q(this.options.HTMLAttributes,t),0]:["a",Q(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:a((t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),"parseMarkdown"),renderMarkdown:a((t,e)=>{var n;const r=((n=t.attrs)==null?void 0:n.href)||"";return`[${e.renderChildren(t)}](${r})`},"renderMarkdown"),addCommands(){return{setLink:a(t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:a(r=>!!Qt(r,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},"setLink"),toggleLink:a(t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:a(r=>!!Qt(r,this.options.protocols),"defaultValidate"),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},"toggleLink"),unsetLink:a(()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),"unsetLink")}},addPasteRules(){return[Dn({find:a(t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=Cp(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:a(s=>!!Qt(s,n),"defaultValidate"),protocols:n,defaultProtocol:r}));i.length&&i.forEach(o=>{this.options.shouldAutoLink(o.value)&&e.push({text:o.value,data:{href:o.href},index:o.start})})}return e},"find"),type:this.type,getAttributes:a(t=>{var e;return{href:(e=t.data)==null?void 0:e.href}},"getAttributes")})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(zy({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:a(r=>this.options.isAllowedUri(r,{defaultValidate:a(i=>!!Qt(i,e),"defaultValidate"),protocols:e,defaultProtocol:n}),"validate"),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push($y({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(Hy({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),Vy=Object.defineProperty,jy=a((t,e)=>{for(var n in e)Vy(t,n,{get:e[n],enumerable:!0})},"__export"),qy="listItem",Sd="textStyle",vd=/^\s*([-+*])\s$/,Sp=H.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",Q(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:a((t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},"parseMarkdown"),renderMarkdown:a((t,e)=>t.content?e.renderChildren(t.content,`
|
|
128
|
+
`):"","renderMarkdown"),markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:a(()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(qy,this.editor.getAttributes(Sd)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks),"toggleBulletList")}},addKeyboardShortcuts(){return{"Mod-Shift-8":a(()=>this.editor.commands.toggleBulletList(),"Mod-Shift-8")}},addInputRules(){let t=mr({find:vd,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=mr({find:vd,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:a(()=>this.editor.getAttributes(Sd),"getAttributes"),editor:this.editor})),[t]}}),vp=H.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Q(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:a((t,e)=>{if(t.type!=="list_item")return[];let n=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(i=>i.type==="paragraph"))n=e.parseChildren(t.tokens);else{const i=t.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(i.tokens)}],t.tokens.length>1){const s=t.tokens.slice(1),u=e.parseChildren(s);n.push(...u)}}else n=e.parseChildren(t.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},"parseMarkdown"),renderMarkdown:a((t,e,n)=>ea(t,e,r=>r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${r.index+1}. `:"- ",n),"renderMarkdown"),addKeyboardShortcuts(){return{Enter:a(()=>this.editor.commands.splitListItem(this.name),"Enter"),Tab:a(()=>this.editor.commands.sinkListItem(this.name),"Tab"),"Shift-Tab":a(()=>this.editor.commands.liftListItem(this.name),"Shift-Tab")}}}),Uy={};jy(Uy,{findListItemPos:a(()=>xi,"findListItemPos"),getNextListDepth:a(()=>ca,"getNextListDepth"),handleBackspace:a(()=>ll,"handleBackspace"),handleDelete:a(()=>al,"handleDelete"),hasListBefore:a(()=>Ap,"hasListBefore"),hasListItemAfter:a(()=>Wy,"hasListItemAfter"),hasListItemBefore:a(()=>Mp,"hasListItemBefore"),listItemHasSubList:a(()=>Tp,"listItemHasSubList"),nextListIsDeeper:a(()=>Dp,"nextListIsDeeper"),nextListIsHigher:a(()=>Op,"nextListIsHigher")});var xi=a((t,e)=>{const{$from:n}=e.selection,r=Y(t,e.schema);let i=null,o=n.depth,s=n.pos,u=null;for(;o>0&&u===null;)i=n.node(o),i.type===r?u=o:(o-=1,s-=1);return u===null?null:{$pos:e.doc.resolve(s),depth:u}},"findListItemPos"),ca=a((t,e)=>{const n=xi(t,e);if(!n)return!1;const[,r]=r2(e,t,n.$pos.pos+4);return r},"getNextListDepth"),Ap=a((t,e,n)=>{const{$anchor:r}=t.selection,i=Math.max(0,r.pos-2),o=t.doc.resolve(i).node();return!(!o||!n.includes(o.type.name))},"hasListBefore"),Mp=a((t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==t)},"hasListItemBefore"),Tp=a((t,e,n)=>{if(!n)return!1;const r=Y(t,e.schema);let i=!1;return n.descendants(o=>{o.type===r&&(i=!0)}),i},"listItemHasSubList"),ll=a((t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Kt(t.state,e)&&Ap(t.state,e,n)){const{$anchor:u}=t.state.selection,l=t.state.doc.resolve(u.before()-1),c=[];l.node().descendants((p,h)=>{p.type.name===e&&c.push({node:p,pos:h})});const d=c.at(-1);if(!d)return!1;const f=t.state.doc.resolve(l.start()+d.pos+1);return t.chain().cut({from:u.start()-1,to:u.end()+1},f.end()).joinForward().run()}if(!Kt(t.state,e)||!u2(t.state))return!1;const r=xi(e,t.state);if(!r)return!1;const o=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=Tp(e,t.state,o);return Mp(e,t.state)&&!s?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},"handleBackspace"),Dp=a((t,e)=>{const n=ca(t,e),r=xi(t,e);return!r||!n?!1:n>r.depth},"nextListIsDeeper"),Op=a((t,e)=>{const n=ca(t,e),r=xi(t,e);return!r||!n?!1:n<r.depth},"nextListIsHigher"),al=a((t,e)=>{if(!Kt(t.state,e)||!s2(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:Dp(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():Op(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},"handleDelete"),Wy=a((t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==t)},"hasListItemAfter"),_p=K.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:a(({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&al(t,n)&&(e=!0)}),e},"Delete"),"Mod-Delete":a(({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&al(t,n)&&(e=!0)}),e},"Mod-Delete"),Backspace:a(({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&ll(t,n,r)&&(e=!0)}),e},"Backspace"),"Mod-Backspace":a(({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&ll(t,n,r)&&(e=!0)}),e},"Mod-Backspace")}}}),Ad=/^(\s*)(\d+)\.\s+(.*)$/,Ky=/^\s/;function Jy(t){const e=[];let n=0,r=0;for(;n<t.length;){const i=t[n],o=i.match(Ad);if(!o)break;const[,s,u,l]=o,c=s.length;let d=l,f=n+1;const p=[i];for(;f<t.length;){const h=t[f];if(h.match(Ad))break;if(h.trim()==="")p.push(h),d+=`
|
|
129
|
+
`,f+=1;else if(h.match(Ky))p.push(h),d+=`
|
|
130
|
+
${h.slice(c+2)}`,f+=1;else break}e.push({indent:c,number:parseInt(u,10),content:d.trim(),raw:p.join(`
|
|
131
|
+
`)}),r=f,n=f}return[e,r]}a(Jy,"collectOrderedListItems");function Np(t,e,n){var r;const i=[];let o=0;for(;o<t.length;){const s=t[o];if(s.indent===e){const u=s.content.split(`
|
|
132
|
+
`),l=((r=u[0])==null?void 0:r.trim())||"",c=[];l&&c.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const d=u.slice(1).join(`
|
|
133
|
+
`).trim();if(d){const h=n.blockTokens(d);c.push(...h)}let f=o+1;const p=[];for(;f<t.length&&t[f].indent>e;)p.push(t[f]),f+=1;if(p.length>0){const h=Math.min(...p.map(g=>g.indent)),m=Np(p,h,n);c.push({type:"list",ordered:!0,start:p[0].number,items:m,raw:p.map(g=>g.raw).join(`
|
|
134
|
+
`)})}i.push({type:"list_item",raw:s.raw,tokens:c}),o=f}else o+=1}return i}a(Np,"buildNestedStructure");function Gy(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const o=e.parseChildren([i]);r.push({type:"paragraph",content:o})}else{const o=e.parseChildren([i]);o.length>0&&r.push(...o)}}),{type:"listItem",content:r}})}a(Gy,"parseListItems");var Zy="listItem",Md="textStyle",Td=/^(\d+)\.\s$/,Ip=H.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:a(t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1,"parseHTML")},type:{default:null,parseHTML:a(t=>t.getAttribute("type"),"parseHTML")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Q(this.options.HTMLAttributes,n),0]:["ol",Q(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:a((t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.items?Gy(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},"parseMarkdown"),renderMarkdown:a((t,e)=>t.content?e.renderChildren(t.content,`
|
|
135
|
+
`):"","renderMarkdown"),markdownTokenizer:{name:"orderedList",level:"block",start:a(t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e?.index;return n!==void 0?n:-1},"start"),tokenize:a((t,e,n)=>{var r;const i=t.split(`
|
|
136
|
+
`),[o,s]=Jy(i);if(o.length===0)return;const u=Np(o,0,n);return u.length===0?void 0:{type:"list",ordered:!0,start:((r=o[0])==null?void 0:r.number)||1,items:u,raw:i.slice(0,s).join(`
|
|
137
|
+
`)}},"tokenize")},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:a(()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Zy,this.editor.getAttributes(Md)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks),"toggleOrderedList")}},addKeyboardShortcuts(){return{"Mod-Shift-7":a(()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-7")}},addInputRules(){let t=mr({find:Td,type:this.type,getAttributes:a(e=>({start:+e[1]}),"getAttributes"),joinPredicate:a((e,n)=>n.childCount+n.attrs.start===+e[1],"joinPredicate")});return(this.options.keepMarks||this.options.keepAttributes)&&(t=mr({find:Td,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:a(e=>({start:+e[1],...this.editor.getAttributes(Md)}),"getAttributes"),joinPredicate:a((e,n)=>n.childCount+n.attrs.start===+e[1],"joinPredicate"),editor:this.editor})),[t]}}),Xy=/^\s*(\[([( |x])?\])\s$/,Yy=H.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:a(t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},"parseHTML"),renderHTML:a(t=>({"data-checked":t.checked}),"renderHTML")}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Q(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:a((t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},"parseMarkdown"),renderMarkdown:a((t,e)=>{var n;const i=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return ea(t,e,i)},"renderMarkdown"),addKeyboardShortcuts(){const t={Enter:a(()=>this.editor.commands.splitListItem(this.name),"Enter"),"Shift-Tab":a(()=>this.editor.commands.liftListItem(this.name),"Shift-Tab")};return this.options.nested?{...t,Tab:a(()=>this.editor.commands.sinkListItem(this.name),"Tab")}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),u=document.createElement("input"),l=document.createElement("div"),c=a(d=>{var f,p;u.ariaLabel=((p=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:p.call(f,d,u.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`},"updateA11Y");return c(t),o.contentEditable="false",u.type="checkbox",u.addEventListener("mousedown",d=>d.preventDefault()),u.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){u.checked=!u.checked;return}const{checked:f}=d.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const h=n();if(typeof h!="number")return!1;const m=p.doc.nodeAt(h);return p.setNodeMarkup(h,void 0,{...m?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(u.checked=!u.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{i.setAttribute(d,f)}),i.dataset.checked=t.attrs.checked,u.checked=t.attrs.checked,o.append(u,s),i.append(o,l),Object.entries(e).forEach(([d,f])=>{i.setAttribute(d,f)}),{dom:i,contentDOM:l,update:a(d=>d.type!==this.type?!1:(i.dataset.checked=d.attrs.checked,u.checked=d.attrs.checked,c(d),!0),"update")}}},addInputRules(){return[mr({find:Xy,type:this.type,getAttributes:a(t=>({checked:t[t.length-1]==="x"}),"getAttributes")})]}}),Qy=H.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Q(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:a((t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),"parseMarkdown"),renderMarkdown:a((t,e)=>t.content?e.renderChildren(t.content,`
|
|
138
|
+
`):"","renderMarkdown"),markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=a(o=>{const s=Qu(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a(u=>({indentLevel:u[1].length,mainContent:u[4],checked:u[3].toLowerCase()==="x"}),"extractItemData"),createToken:a((u,l)=>({type:"taskItem",raw:"",mainContent:u.mainContent,indentLevel:u.indentLevel,checked:u.checked,text:u.mainContent,tokens:n.inlineTokens(u.mainContent),nestedTokens:l}),"createToken"),customNestedParser:r},n);return s?[{type:"taskList",raw:s.raw,items:s.items}]:n.blockTokens(o)},"parseTaskListContent"),i=Qu(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a(o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),"extractItemData"),createToken:a((o,s)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:s}),"createToken"),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:a(()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName),"toggleTaskList")}},addKeyboardShortcuts(){return{"Mod-Shift-9":a(()=>this.editor.commands.toggleTaskList(),"Mod-Shift-9")}}});K.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(Sp.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(vp.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(_p.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Ip.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(Yy.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(Qy.configure(this.options.taskList)),t}});var ex=H.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Q(this.options.HTMLAttributes,t),0]},parseMarkdown:a((t,e)=>{const n=t.tokens||[];return n.length===1&&n[0].type==="image"?e.parseChildren([n[0]]):e.createNode("paragraph",void 0,e.parseInline(n))},"parseMarkdown"),renderMarkdown:a((t,e)=>!t||!Array.isArray(t.content)?"":e.renderChildren(t.content),"renderMarkdown"),addCommands(){return{setParagraph:a(()=>({commands:t})=>t.setNode(this.name),"setParagraph")}},addKeyboardShortcuts(){return{"Mod-Alt-0":a(()=>this.editor.commands.setParagraph(),"Mod-Alt-0")}}}),tx=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,nx=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,rx=Te.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:a(t=>t.includes("line-through")?{}:!1,"getAttrs")}]},renderHTML({HTMLAttributes:t}){return["s",Q(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:a((t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),"parseMarkdown"),renderMarkdown:a((t,e)=>`~~${e.renderChildren(t)}~~`,"renderMarkdown"),addCommands(){return{setStrike:a(()=>({commands:t})=>t.setMark(this.name),"setStrike"),toggleStrike:a(()=>({commands:t})=>t.toggleMark(this.name),"toggleStrike"),unsetStrike:a(()=>({commands:t})=>t.unsetMark(this.name),"unsetStrike")}},addKeyboardShortcuts(){return{"Mod-Shift-s":a(()=>this.editor.commands.toggleStrike(),"Mod-Shift-s")}},addInputRules(){return[pr({find:tx,type:this.type})]},addPasteRules(){return[Dn({find:nx,type:this.type})]}}),ix=H.create({name:"text",group:"inline",parseMarkdown:a(t=>({type:"text",text:t.text||""}),"parseMarkdown"),renderMarkdown:a(t=>t.text||"","renderMarkdown")}),ox=Te.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:a(t=>t.includes("underline")?{}:!1,"getAttrs")}]},renderHTML({HTMLAttributes:t}){return["u",Q(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!i)return;const o=i[2].trim();return{type:"underline",raw:i[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:a(()=>({commands:t})=>t.setMark(this.name),"setUnderline"),toggleUnderline:a(()=>({commands:t})=>t.toggleMark(this.name),"toggleUnderline"),unsetUnderline:a(()=>({commands:t})=>t.unsetMark(this.name),"unsetUnderline")}},addKeyboardShortcuts(){return{"Mod-u":a(()=>this.editor.commands.toggleUnderline(),"Mod-u"),"Mod-U":a(()=>this.editor.commands.toggleUnderline(),"Mod-U")}}});function sx(t={}){return new V({view(e){return new cl(e,t)}})}a(sx,"dropCursor");const ic=class ic{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=a(s=>{this[i](s)},"handler");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,i=this.editorView.dom,o=i.getBoundingClientRect(),s=o.width/i.offsetWidth,u=o.height/i.offsetHeight;if(n){let f=e.nodeBefore,p=e.nodeAfter;if(f||p){let h=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(h){let m=h.getBoundingClientRect(),g=f?m.bottom:m.top;f&&p&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let b=this.width/2*u;r={left:m.left,right:m.right,top:g-b,bottom:g+b}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),p=this.width/2*s;r={left:f.left-p,right:f.left+p,top:f.top,bottom:f.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.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 c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let f=l.getBoundingClientRect(),p=f.width/l.offsetWidth,h=f.height/l.offsetHeight;c=f.left-l.scrollLeft*p,d=f.top-l.scrollTop*h}this.element.style.left=(r.left-c)/s+"px",this.element.style.top=(r.top-d)/u+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/u+"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=Wf(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){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}};a(ic,"DropCursorView");let cl=ic;const Ge=class Ge extends I{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ge.valid(r)?new Ge(r):I.near(r)}content(){return M.empty}eq(e){return e instanceof Ge&&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 Ge(e.resolve(n.pos))}getBookmark(){return new dl(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!ux(e)||!lx(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&&Ge.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 l=e.doc.resolve(i);if(Ge.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!N.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(Ge.valid(u))return u}return null}}};a(Ge,"GapCursor");let pe=Ge;pe.prototype.visible=!1;pe.findFrom=pe.findGapCursorFrom;I.jsonID("gapcursor",pe);const cs=class cs{constructor(e){this.pos=e}map(e){return new cs(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return pe.valid(n)?new pe(n):I.near(n)}};a(cs,"GapBookmark");let dl=cs;function Rp(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}a(Rp,"needsGap");function ux(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||Rp(i.type))return!0;if(i.inlineContent)return!1}}return!0}a(ux,"closedBefore");function lx(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||Rp(i.type))return!0;if(i.inlineContent)return!1}}return!0}a(lx,"closedAfter");function ax(){return new V({props:{decorations:hx,createSelectionBetween(t,e,n){return e.pos==n.pos&&pe.valid(n)?new pe(n):null},handleClick:dx,handleKeyDown:cx,handleDOMEvents:{beforeinput:fx}}})}a(ax,"gapCursor");const cx=$l({ArrowLeft:Ii("horiz",-1),ArrowRight:Ii("horiz",1),ArrowUp:Ii("vert",-1),ArrowDown:Ii("vert",1)});function Ii(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,l=s.empty;if(s instanceof R){if(!o.endOfTextblock(n)||u.depth==0)return!1;l=!1,u=r.doc.resolve(e>0?u.after():u.before())}let c=pe.findGapCursorFrom(u,e,l);return c?(i&&i(r.tr.setSelection(new pe(c))),!0):!1}}a(Ii,"arrow$3");function dx(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!pe.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&N.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new pe(r))),!0)}a(dx,"handleClick");function fx(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof pe))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=A.empty;for(let s=r.length-1;s>=0;s--)i=A.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new M(i,0,0));return o.setSelection(R.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}a(fx,"beforeinput");function hx(t){if(!(t.selection instanceof pe))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ce.create(t.doc,[Le.widget(t.selection.head,e,{key:"gapcursor"})])}a(hx,"drawGapCursor");var Uo=200,re=a(function(){},"RopeSequence");re.prototype.append=a(function(e){return e.length?(e=re.from(e),!this.length&&e||e.length<Uo&&this.leafAppend(e)||this.length<Uo&&e.leafPrepend(this)||this.appendInner(e)):this},"append");re.prototype.prepend=a(function(e){return e.length?re.from(e).append(this):this},"prepend");re.prototype.appendInner=a(function(e){return new px(this,e)},"appendInner");re.prototype.slice=a(function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?re.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},"slice");re.prototype.get=a(function(e){if(!(e<0||e>=this.length))return this.getInner(e)},"get");re.prototype.forEach=a(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)},"forEach");re.prototype.map=a(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},"map");re.from=a(function(e){return e instanceof re?e:e&&e.length?new Fp(e):re.empty},"from");var Fp=(function(t){function e(r){t.call(this),this.values=r}a(e,"Leaf"),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=a(function(){return this.values},"flatten"),e.prototype.sliceInner=a(function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},"sliceInner"),e.prototype.getInner=a(function(i){return this.values[i]},"getInner"),e.prototype.forEachInner=a(function(i,o,s,u){for(var l=o;l<s;l++)if(i(this.values[l],u+l)===!1)return!1},"forEachInner"),e.prototype.forEachInvertedInner=a(function(i,o,s,u){for(var l=o-1;l>=s;l--)if(i(this.values[l],u+l)===!1)return!1},"forEachInvertedInner"),e.prototype.leafAppend=a(function(i){if(this.length+i.length<=Uo)return new e(this.values.concat(i.flatten()))},"leafAppend"),e.prototype.leafPrepend=a(function(i){if(this.length+i.length<=Uo)return new e(i.flatten().concat(this.values))},"leafPrepend"),n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(re);re.empty=new Fp([]);var px=(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 a(e,"Append"),t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=a(function(){return this.left.flatten().concat(this.right.flatten())},"flatten"),e.prototype.getInner=a(function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},"getInner"),e.prototype.forEachInner=a(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},"forEachInner"),e.prototype.forEachInvertedInner=a(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},"forEachInvertedInner"),e.prototype.sliceInner=a(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))},"sliceInner"),e.prototype.leafAppend=a(function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},"leafAppend"),e.prototype.leafPrepend=a(function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},"leafPrepend"),e.prototype.appendInner=a(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)},"appendInner"),e})(re);const mx=500,Rt=class Rt{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,l,c=[],d=[];return this.items.forEach((f,p)=>{if(!f.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,d.push(f);return}if(i){d.push(new Ke(f.map));let h=f.step.map(i.slice(o)),m;h&&s.maybeStep(h).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],c.push(new Ke(m,void 0,void 0,c.length+d.length))),o--,m&&i.appendMap(m,o)}else s.maybeStep(f.step);if(f.selection)return u=i?f.selection.map(i.slice(o)):f.selection,l=new Rt(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:u}}addTransform(e,n,r,i){let o=[],s=this.eventCount,u=this.items,l=!i&&u.length?u.get(u.length-1):null;for(let d=0;d<e.steps.length;d++){let f=e.steps[d].invert(e.docs[d]),p=new Ke(e.mapping.maps[d],f,n),h;(h=l&&l.merge(p))&&(p=h,d?o.pop():u=u.slice(0,u.length-1)),o.push(p),n&&(s++,n=void 0),i||(l=p)}let c=s-r.depth;return c>bx&&(u=gx(u,c),s-=c),new Rt(u.append(o),s)}remapping(e,n){let r=new Zi;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 Rt(this.items.append(e.map(n=>new Ke(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(p=>{p.selection&&u--},i);let l=n;this.items.forEach(p=>{let h=o.getMirror(--l);if(h==null)return;s=Math.min(s,h);let m=o.maps[h];if(p.step){let g=e.steps[h].invert(e.docs[h]),b=p.selection&&p.selection.map(o.slice(l+1,h));b&&u++,r.push(new Ke(m,g,b))}else r.push(new Ke(m))},i);let c=[];for(let p=n;p<s;p++)c.push(new Ke(o.maps[p]));let d=this.items.slice(0,i).append(c).append(r),f=new Rt(d,u);return f.emptyItemCount()>mx&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,u)=>{if(u>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let d=s.selection&&s.selection.map(n.slice(r));d&&o++;let f=new Ke(c.invert(),l,d),p,h=i.length-1;(p=i.length&&i[h].merge(f))?i[h]=p:i.push(f)}}else s.map&&r--},this.items.length,0),new Rt(re.from(i.reverse()),o)}};a(Rt,"Branch");let On=Rt;On.empty=new On(re.empty,0);function gx(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}a(gx,"cutOffEvents");const ds=class ds{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 ds(n.getMap().invert(),n,this.selection)}}};a(ds,"Item");let Ke=ds;const oc=class oc{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}};a(oc,"HistoryState");let Ze=oc;const bx=20;function yx(t,e,n,r){let i=n.getMeta(xn),o;if(i)return i.historyState;n.getMeta(wx)&&(t=new Ze(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(xn))return s.getMeta(xn).redo?new Ze(t.done.addTransform(n,void 0,r,ji(e)),t.undone,Dd(n.mapping.maps),t.prevTime,t.prevComposition):new Ze(t.done,t.undone.addTransform(n,void 0,r,ji(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let u=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=u&&(t.prevTime<(n.time||0)-r.newGroupDelay||!xx(n,t.prevRanges)),c=s?su(t.prevRanges,n.mapping):Dd(n.mapping.maps);return new Ze(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,ji(e)),On.empty,c,n.time,u??t.prevComposition)}else return(o=n.getMeta("rebased"))?new Ze(t.done.rebased(n,o),t.undone.rebased(n,o),su(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ze(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),su(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}a(yx,"applyTransaction");function xx(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}a(xx,"isAdjacentTo");function Dd(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}a(Dd,"rangesFor");function su(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}a(su,"mapRanges");function kx(t,e,n){let r=ji(e),i=xn.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),l=new Ze(n?u:o.remaining,n?o.remaining:u,null,0,-1);return o.transform.setSelection(s).setMeta(xn,{redo:n,historyState:l})}a(kx,"histTransaction");let uu=!1,Od=null;function ji(t){let e=t.plugins;if(Od!=e){uu=!1,Od=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){uu=!0;break}}return uu}a(ji,"mustPreserveItems");const xn=new U("history"),wx=new U("closeHistory");function Cx(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new V({key:xn,state:{init(){return new Ze(On.empty,On.empty,null,0,-1)},apply(e,n,r){return yx(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Pp:r=="historyRedo"?Bp:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}a(Cx,"history");function Lp(t,e){return(n,r)=>{let i=xn.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=kx(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}a(Lp,"buildCommand");const Pp=Lp(!1,!0),Bp=Lp(!0,!0);K.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:a(t=>t.length,"textCounter"),wordCounter:a(t=>t.split(" ").filter(e=>e!=="").length,"wordCounter")}},addStorage(){return{characters:a(()=>0,"characters"),words:a(()=>0,"words")}},onBeforeCreate(){this.storage.characters=t=>{const e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=t?.node||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new V({key:new U("characterCount"),appendTransaction:a((e,n,r)=>{if(t)return;const i=this.options.limit;if(i==null||i===0){t=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const s=o-i,u=0,l=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(u,l);return t=!0,c}t=!0},"appendTransaction"),filterTransaction:a((e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),o=this.storage.characters({node:e.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!e.getMeta("paste"))return!1;const u=e.selection.$head.pos,l=o-r,c=u-l,d=u;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>r)},"filterTransaction")})]}});var Ex=K.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[sx(this.options)]}});K.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new V({key:new U("focus"),props:{decorations:a(({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,o=[];if(!n||!r)return ce.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;s+=1});let u=0;return t.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(u+=1,this.options.mode==="deepest"&&s-u>0||this.options.mode==="shallowest"&&u>1)return this.options.mode==="deepest";o.push(Le.node(c,c+l.nodeSize,{class:this.options.className}))}),ce.create(t,o)},"decorations")}})]}});var Sx=K.create({name:"gapCursor",addProseMirrorPlugins(){return[ax()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=$(O(t,"allowGapCursor",n)))!=null?e:null}}}),vx=K.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new V({key:new U("placeholder"),props:{decorations:a(({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 l=r>=u&&r<=u+s.nodeSize,c=!s.isLeaf&&ks(s);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];o&&d.push(this.options.emptyEditorClass);const f=Le.node(u,u+s.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:u,hasAnchor:l}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),ce.create(t,i)},"decorations")}})]}});K.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new V({key:new U("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||tp(n.selection)||t.view.dragging?null:ce.create(n.doc,[Le.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function _d({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}a(_d,"nodeEqualsType");var Ax=K.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new U(this.name),n=((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||this.options.node||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new V({key:e,appendTransaction:a((i,o,s)=>{const{doc:u,tr:l,schema:c}=s,d=e.getState(s),f=u.content.size,p=c.nodes[n];if(d)return l.insert(f,p.create())},"appendTransaction"),state:{init:a((i,o)=>{const s=o.tr.doc.lastChild;return!_d({node:s,types:r})},"init"),apply:a((i,o)=>{if(!i.docChanged)return o;const s=i.doc.lastChild;return!_d({node:s,types:r})},"apply")}})]}}),Mx=K.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:a(()=>({state:t,dispatch:e})=>Pp(t,e),"undo"),redo:a(()=>({state:t,dispatch:e})=>Bp(t,e),"redo")}},addProseMirrorPlugins(){return[Cx(this.options)]},addKeyboardShortcuts(){return{"Mod-z":a(()=>this.editor.commands.undo(),"Mod-z"),"Shift-Mod-z":a(()=>this.editor.commands.redo(),"Shift-Mod-z"),"Mod-y":a(()=>this.editor.commands.redo(),"Mod-y"),"Mod-я":a(()=>this.editor.commands.undo(),"Mod-я"),"Shift-Mod-я":a(()=>this.editor.commands.redo(),"Shift-Mod-я")}}}),Tx=K.create({name:"starterKit",addExtensions(){var t,e,n,r;const i=[];return this.options.bold!==!1&&i.push(ny.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(X2.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(Sp.configure(this.options.bulletList)),this.options.code!==!1&&i.push(oy.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(ly.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(ay.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(Ex.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(Sx.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(cy.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(dy.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(Mx.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(fy.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(by.configure(this.options.italic)),this.options.listItem!==!1&&i.push(vp.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(_p.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(Ep.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(Ip.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(ex.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(rx.configure(this.options.strike)),this.options.text!==!1&&i.push(ix.configure(this.options.text)),this.options.underline!==!1&&i.push(ox.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(Ax.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),Dx=Tx;function Nd(t){return G0((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}a(Nd,"useDebouncedRef");var Yn,Ox=(Yn=class extends $2{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=Nd(this.view.state),this.reactiveExtensionStorage=Nd(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),J0(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){const r=super.registerPlugin(e,n);return this.reactiveState&&(this.reactiveState.value=r),r}unregisterPlugin(e){const n=super.unregisterPlugin(e);return this.reactiveState&&n&&(this.reactiveState.value=n),n}},a(Yn,"Editor"),Yn),_x=xf({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=W0(),n=X0();return K0(()=>{const r=t.editor;r&&r.options.element&&e.value&&wf(()=>{var i;if(!e.value||!((i=r.view.dom)!=null&&i.firstChild))return;const o=Z0(e.value);e.value.append(r.view.dom),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:o}),r.createNodeViews()})}),kf(()=>{const r=t.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return ku("div",{ref:a(t=>{this.rootEl=t},"ref")})}});const zp=["top","right","bottom","left"],Id=["start","end"],Rd=zp.reduce((t,e)=>t.concat(e,e+"-"+Id[0],e+"-"+Id[1]),[]),it=Math.min,me=Math.max,Wo=Math.round,et=a(t=>({x:t,y:t}),"createCoords"),Nx={left:"right",right:"left",bottom:"top",top:"bottom"},Ix={start:"end",end:"start"};function fl(t,e,n){return me(t,it(e,n))}a(fl,"clamp");function Et(t,e){return typeof t=="function"?t(e):t}a(Et,"evaluate");function Pe(t){return t.split("-")[0]}a(Pe,"getSide");function $e(t){return t.split("-")[1]}a($e,"getAlignment");function $p(t){return t==="x"?"y":"x"}a($p,"getOppositeAxis");function da(t){return t==="y"?"height":"width"}a(da,"getAxisLength");const Rx=new Set(["top","bottom"]);function Xe(t){return Rx.has(Pe(t))?"y":"x"}a(Xe,"getSideAxis");function fa(t){return $p(Xe(t))}a(fa,"getAlignmentAxis");function Hp(t,e,n){n===void 0&&(n=!1);const r=$e(t),i=fa(t),o=da(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Jo(s)),[s,Jo(s)]}a(Hp,"getAlignmentSides");function Fx(t){const e=Jo(t);return[Ko(t),e,Ko(e)]}a(Fx,"getExpandedPlacements");function Ko(t){return t.replace(/start|end/g,e=>Ix[e])}a(Ko,"getOppositeAlignmentPlacement");const Fd=["left","right"],Ld=["right","left"],Lx=["top","bottom"],Px=["bottom","top"];function Bx(t,e,n){switch(t){case"top":case"bottom":return n?e?Ld:Fd:e?Fd:Ld;case"left":case"right":return e?Lx:Px;default:return[]}}a(Bx,"getSideList");function zx(t,e,n,r){const i=$e(t);let o=Bx(Pe(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Ko)))),o}a(zx,"getOppositeAxisPlacements");function Jo(t){return t.replace(/left|right|bottom|top/g,e=>Nx[e])}a(Jo,"getOppositePlacement");function $x(t){return{top:0,right:0,bottom:0,left:0,...t}}a($x,"expandPaddingObject");function ha(t){return typeof t!="number"?$x(t):{top:t,right:t,bottom:t,left:t}}a(ha,"getPaddingObject");function gr(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}a(gr,"rectToClientRect");function Pd(t,e,n){let{reference:r,floating:i}=t;const o=Xe(e),s=fa(e),u=da(s),l=Pe(e),c=o==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,p=r[u]/2-i[u]/2;let h;switch(l){case"top":h={x:d,y:r.y-i.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}switch($e(e)){case"start":h[s]-=p*(n&&c?-1:1);break;case"end":h[s]+=p*(n&&c?-1:1);break}return h}a(Pd,"computeCoordsFromPlacement");const Hx=a(async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,u=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:f}=Pd(c,r,l),p=r,h={},m=0;for(let g=0;g<u.length;g++){const{name:b,fn:y}=u[g],{x,y:k,data:C,reset:w}=await y({x:d,y:f,initialPlacement:r,placement:p,strategy:i,middlewareData:h,rects:c,platform:s,elements:{reference:t,floating:e}});d=x??d,f=k??f,h={...h,[b]:{...h[b],...C}},w&&m<=50&&(m++,typeof w=="object"&&(w.placement&&(p=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):w.rects),{x:d,y:f}=Pd(c,p,l)),g=-1)}return{x:d,y:f,placement:p,strategy:i,middlewareData:h}},"computePosition$1");async function br(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:u,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=Et(e,t),m=ha(h),b=u[p?f==="floating"?"reference":"floating":f],y=gr(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:c,rootBoundary:d,strategy:l})),x=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),C=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},w=gr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:x,offsetParent:k,strategy:l}):x);return{top:(y.top-w.top+m.top)/C.y,bottom:(w.bottom-y.bottom+m.bottom)/C.y,left:(y.left-w.left+m.left)/C.x,right:(w.right-y.right+m.right)/C.x}}a(br,"detectOverflow");const Vx=a(t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:u,middlewareData:l}=e,{element:c,padding:d=0}=Et(t,e)||{};if(c==null)return{};const f=ha(d),p={x:n,y:r},h=fa(i),m=da(h),g=await s.getDimensions(c),b=h==="y",y=b?"top":"left",x=b?"bottom":"right",k=b?"clientHeight":"clientWidth",C=o.reference[m]+o.reference[h]-p[h]-o.floating[m],w=p[h]-o.reference[h],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let S=E?E[k]:0;(!S||!await(s.isElement==null?void 0:s.isElement(E)))&&(S=u.floating[k]||o.floating[m]);const T=C/2-w/2,D=S/2-g[m]/2-1,_=it(f[y],D),z=it(f[x],D),j=_,J=S-g[m]-z,L=S/2-g[m]/2+T,P=fl(j,L,J),X=!l.arrow&&$e(i)!=null&&L!==P&&o.reference[m]/2-(L<j?_:z)-g[m]/2<0,ee=X?L<j?L-j:L-J:0;return{[h]:p[h]+ee,data:{[h]:P,centerOffset:L-P-ee,...X&&{alignmentOffset:ee}},reset:X}}}),"arrow$2");function jx(t,e,n){return(t?[...n.filter(i=>$e(i)===t),...n.filter(i=>$e(i)!==t)]:n.filter(i=>Pe(i)===i)).filter(i=>t?$e(i)===t||(e?Ko(i)!==i:!1):!0)}a(jx,"getPlacementList");const qx=a(function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,r,i;const{rects:o,middlewareData:s,placement:u,platform:l,elements:c}=e,{crossAxis:d=!1,alignment:f,allowedPlacements:p=Rd,autoAlignment:h=!0,...m}=Et(t,e),g=f!==void 0||p===Rd?jx(f||null,h,p):p,b=await br(e,m),y=((n=s.autoPlacement)==null?void 0:n.index)||0,x=g[y];if(x==null)return{};const k=Hp(x,o,await(l.isRTL==null?void 0:l.isRTL(c.floating)));if(u!==x)return{reset:{placement:g[0]}};const C=[b[Pe(x)],b[k[0]],b[k[1]]],w=[...((r=s.autoPlacement)==null?void 0:r.overflows)||[],{placement:x,overflows:C}],E=g[y+1];if(E)return{data:{index:y+1,overflows:w},reset:{placement:E}};const S=w.map(_=>{const z=$e(_.placement);return[_.placement,z&&d?_.overflows.slice(0,2).reduce((j,J)=>j+J,0):_.overflows[0],_.overflows]}).sort((_,z)=>_[1]-z[1]),D=((i=S.filter(_=>_[2].slice(0,$e(_[0])?2:3).every(z=>z<=0))[0])==null?void 0:i[0])||S[0][0];return D!==u?{data:{index:y+1,overflows:w},reset:{placement:D}}:{}}}},"autoPlacement$1"),Ux=a(function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:u,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...b}=Et(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const y=Pe(i),x=Xe(u),k=Pe(u)===u,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=p||(k||!g?[Jo(u)]:Fx(u)),E=m!=="none";!p&&E&&w.push(...zx(u,g,m,C));const S=[u,...w],T=await br(e,b),D=[];let _=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&D.push(T[y]),f){const L=Hp(i,s,C);D.push(T[L[0]],T[L[1]])}if(_=[..._,{placement:i,overflows:D}],!D.every(L=>L<=0)){var z,j;const L=(((z=o.flip)==null?void 0:z.index)||0)+1,P=S[L];if(P&&(!(f==="alignment"?x!==Xe(P):!1)||_.every(Se=>Xe(Se.placement)===x?Se.overflows[0]>0:!0)))return{data:{index:L,overflows:_},reset:{placement:P}};let X=(j=_.filter(ee=>ee.overflows[0]<=0).sort((ee,Se)=>ee.overflows[1]-Se.overflows[1])[0])==null?void 0:j.placement;if(!X)switch(h){case"bestFit":{var J;const ee=(J=_.filter(Se=>{if(E){const vt=Xe(Se.placement);return vt===x||vt==="y"}return!0}).map(Se=>[Se.placement,Se.overflows.filter(vt=>vt>0).reduce((vt,q0)=>vt+q0,0)]).sort((Se,vt)=>Se[1]-vt[1])[0])==null?void 0:J[0];ee&&(X=ee);break}case"initialPlacement":X=u;break}if(i!==X)return{reset:{placement:X}}}return{}}}},"flip$1");function Bd(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}a(Bd,"getSideOffsets");function zd(t){return zp.some(e=>t[e]>=0)}a(zd,"isAnySideFullyClipped");const Wx=a(function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Et(t,e);switch(r){case"referenceHidden":{const o=await br(e,{...i,elementContext:"reference"}),s=Bd(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:zd(s)}}}case"escaped":{const o=await br(e,{...i,altBoundary:!0}),s=Bd(o,n.floating);return{data:{escapedOffsets:s,escaped:zd(s)}}}default:return{}}}}},"hide$1");function Vp(t){const e=it(...t.map(o=>o.left)),n=it(...t.map(o=>o.top)),r=me(...t.map(o=>o.right)),i=me(...t.map(o=>o.bottom));return{x:e,y:n,width:r-e,height:i-n}}a(Vp,"getBoundingRect");function Kx(t){const e=t.slice().sort((i,o)=>i.y-o.y),n=[];let r=null;for(let i=0;i<e.length;i++){const o=e[i];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map(i=>gr(Vp(i)))}a(Kx,"getRectsByLine");const Jx=a(function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:r,rects:i,platform:o,strategy:s}=e,{padding:u=2,x:l,y:c}=Et(t,e),d=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(r.reference))||[]),f=Kx(d),p=gr(Vp(d)),h=ha(u);function m(){if(f.length===2&&f[0].left>f[1].right&&l!=null&&c!=null)return f.find(b=>l>b.left-h.left&&l<b.right+h.right&&c>b.top-h.top&&c<b.bottom+h.bottom)||p;if(f.length>=2){if(Xe(n)==="y"){const _=f[0],z=f[f.length-1],j=Pe(n)==="top",J=_.top,L=z.bottom,P=j?_.left:z.left,X=j?_.right:z.right,ee=X-P,Se=L-J;return{top:J,bottom:L,left:P,right:X,width:ee,height:Se,x:P,y:J}}const b=Pe(n)==="left",y=me(...f.map(_=>_.right)),x=it(...f.map(_=>_.left)),k=f.filter(_=>b?_.left===x:_.right===y),C=k[0].top,w=k[k.length-1].bottom,E=x,S=y,T=S-E,D=w-C;return{top:C,bottom:w,left:E,right:S,width:T,height:D,x:E,y:C}}return p}a(m,"getBoundingClientRect");const g=await o.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:s});return i.reference.x!==g.reference.x||i.reference.y!==g.reference.y||i.reference.width!==g.reference.width||i.reference.height!==g.reference.height?{reset:{rects:g}}:{}}}},"inline$2"),Gx=new Set(["left","top"]);async function Zx(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Pe(n),u=$e(n),l=Xe(n)==="y",c=Gx.has(s)?-1:1,d=o&&l?-1:1,f=Et(e,t);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return u&&typeof m=="number"&&(h=u==="end"?m*-1:m),l?{x:h*d,y:p*c}:{x:p*c,y:h*d}}a(Zx,"convertValueToCoords");const Xx=a(function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:u}=e,l=await Zx(e,t);return s===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},"offset$1"),Yx=a(function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:u={fn:a(b=>{let{x:y,y:x}=b;return{x:y,y:x}},"fn")},...l}=Et(t,e),c={x:n,y:r},d=await br(e,l),f=Xe(Pe(i)),p=$p(f);let h=c[p],m=c[f];if(o){const b=p==="y"?"top":"left",y=p==="y"?"bottom":"right",x=h+d[b],k=h-d[y];h=fl(x,h,k)}if(s){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",x=m+d[b],k=m-d[y];m=fl(x,m,k)}const g=u.fn({...e,[p]:h,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},"shift$1"),Qx=a(function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:o,platform:s,elements:u}=e,{apply:l=a(()=>{},"apply"),...c}=Et(t,e),d=await br(e,c),f=Pe(i),p=$e(i),h=Xe(i)==="y",{width:m,height:g}=o.floating;let b,y;f==="top"||f==="bottom"?(b=f,y=p===(await(s.isRTL==null?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(y=f,b=p==="end"?"top":"bottom");const x=g-d.top-d.bottom,k=m-d.left-d.right,C=it(g-d[b],x),w=it(m-d[y],k),E=!e.middlewareData.shift;let S=C,T=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(T=k),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(S=x),E&&!p){const _=me(d.left,0),z=me(d.right,0),j=me(d.top,0),J=me(d.bottom,0);h?T=m-2*(_!==0||z!==0?_+z:me(d.left,d.right)):S=g-2*(j!==0||J!==0?j+J:me(d.top,d.bottom))}await l({...e,availableWidth:T,availableHeight:S});const D=await s.getDimensions(u.floating);return m!==D.width||g!==D.height?{reset:{rects:!0}}:{}}}},"size$1");function Ss(){return typeof window<"u"}a(Ss,"hasWindow");function Cr(t){return jp(t)?(t.nodeName||"").toLowerCase():"#document"}a(Cr,"getNodeName");function ve(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}a(ve,"getWindow");function St(t){var e;return(e=(jp(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}a(St,"getDocumentElement");function jp(t){return Ss()?t instanceof Node||t instanceof ve(t).Node:!1}a(jp,"isNode");function He(t){return Ss()?t instanceof Element||t instanceof ve(t).Element:!1}a(He,"isElement");function ot(t){return Ss()?t instanceof HTMLElement||t instanceof ve(t).HTMLElement:!1}a(ot,"isHTMLElement");function $d(t){return!Ss()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ve(t).ShadowRoot}a($d,"isShadowRoot");const ek=new Set(["inline","contents"]);function ki(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Ve(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!ek.has(i)}a(ki,"isOverflowElement");const tk=new Set(["table","td","th"]);function nk(t){return tk.has(Cr(t))}a(nk,"isTableElement");const rk=[":popover-open",":modal"];function vs(t){return rk.some(e=>{try{return t.matches(e)}catch{return!1}})}a(vs,"isTopLayer");const ik=["transform","translate","scale","rotate","perspective"],ok=["transform","translate","scale","rotate","perspective","filter"],sk=["paint","layout","strict","content"];function pa(t){const e=ma(),n=He(t)?Ve(t):t;return ik.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||ok.some(r=>(n.willChange||"").includes(r))||sk.some(r=>(n.contain||"").includes(r))}a(pa,"isContainingBlock");function uk(t){let e=Jt(t);for(;ot(e)&&!yr(e);){if(pa(e))return e;if(vs(e))return null;e=Jt(e)}return null}a(uk,"getContainingBlock");function ma(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}a(ma,"isWebKit");const lk=new Set(["html","body","#document"]);function yr(t){return lk.has(Cr(t))}a(yr,"isLastTraversableNode");function Ve(t){return ve(t).getComputedStyle(t)}a(Ve,"getComputedStyle$1");function As(t){return He(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}a(As,"getNodeScroll");function Jt(t){if(Cr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||$d(t)&&t.host||St(t);return $d(e)?e.host:e}a(Jt,"getParentNode");function qp(t){const e=Jt(t);return yr(e)?t.ownerDocument?t.ownerDocument.body:t.body:ot(e)&&ki(e)?e:qp(e)}a(qp,"getNearestOverflowAncestor");function Up(t,e,n){var r;e===void 0&&(e=[]);const i=qp(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=ve(i);return o?(hl(s),e.concat(s,s.visualViewport||[],ki(i)?i:[],[])):e.concat(i,Up(i,[]))}a(Up,"getOverflowAncestors");function hl(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}a(hl,"getFrameElement");function Wp(t){const e=Ve(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=ot(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,u=Wo(n)!==o||Wo(r)!==s;return u&&(n=o,r=s),{width:n,height:r,$:u}}a(Wp,"getCssDimensions");function Kp(t){return He(t)?t:t.contextElement}a(Kp,"unwrapElement$1");function Vn(t){const e=Kp(t);if(!ot(e))return et(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Wp(e);let s=(o?Wo(n.width):n.width)/r,u=(o?Wo(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!u||!Number.isFinite(u))&&(u=1),{x:s,y:u}}a(Vn,"getScale");const ak=et(0);function Jp(t){const e=ve(t);return!ma()||!e.visualViewport?ak:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}a(Jp,"getVisualOffsets");function ck(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ve(t)?!1:e}a(ck,"shouldAddVisualOffsets");function ci(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Kp(t);let s=et(1);e&&(r?He(r)&&(s=Vn(r)):s=Vn(t));const u=ck(o,n,r)?Jp(o):et(0);let l=(i.left+u.x)/s.x,c=(i.top+u.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(o){const p=ve(o),h=r&&He(r)?ve(r):r;let m=p,g=hl(m);for(;g&&r&&h!==m;){const b=Vn(g),y=g.getBoundingClientRect(),x=Ve(g),k=y.left+(g.clientLeft+parseFloat(x.paddingLeft))*b.x,C=y.top+(g.clientTop+parseFloat(x.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,f*=b.y,l+=k,c+=C,m=ve(g),g=hl(m)}}return gr({width:d,height:f,x:l,y:c})}a(ci,"getBoundingClientRect");function Ms(t,e){const n=As(t).scrollLeft;return e?e.left+n:ci(St(t)).left+n}a(Ms,"getWindowScrollBarX");function Gp(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Ms(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}a(Gp,"getHTMLOffset");function dk(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=St(r),u=e?vs(e.floating):!1;if(r===s||u&&o)return n;let l={scrollLeft:0,scrollTop:0},c=et(1);const d=et(0),f=ot(r);if((f||!f&&!o)&&((Cr(r)!=="body"||ki(s))&&(l=As(r)),ot(r))){const h=ci(r);c=Vn(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=s&&!f&&!o?Gp(s,l):et(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}}a(dk,"convertOffsetParentRelativeRectToViewportRelativeRect");function fk(t){return Array.from(t.getClientRects())}a(fk,"getClientRects");function hk(t){const e=St(t),n=As(t),r=t.ownerDocument.body,i=me(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=me(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ms(t);const u=-n.scrollTop;return Ve(r).direction==="rtl"&&(s+=me(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:u}}a(hk,"getDocumentRect");const Hd=25;function pk(t,e){const n=ve(t),r=St(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,u=0,l=0;if(i){o=i.width,s=i.height;const d=ma();(!d||d&&e==="fixed")&&(u=i.offsetLeft,l=i.offsetTop)}const c=Ms(r);if(c<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(r.clientWidth-f.clientWidth-h);m<=Hd&&(o-=m)}else c<=Hd&&(o+=c);return{width:o,height:s,x:u,y:l}}a(pk,"getViewportRect");const mk=new Set(["absolute","fixed"]);function gk(t,e){const n=ci(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=ot(t)?Vn(t):et(1),s=t.clientWidth*o.x,u=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:u,x:l,y:c}}a(gk,"getInnerBoundingClientRect");function Vd(t,e,n){let r;if(e==="viewport")r=pk(t,n);else if(e==="document")r=hk(St(t));else if(He(e))r=gk(e,n);else{const i=Jp(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return gr(r)}a(Vd,"getClientRectFromClippingAncestor");function Zp(t,e){const n=Jt(t);return n===e||!He(n)||yr(n)?!1:Ve(n).position==="fixed"||Zp(n,e)}a(Zp,"hasFixedPositionAncestor");function bk(t,e){const n=e.get(t);if(n)return n;let r=Up(t,[]).filter(u=>He(u)&&Cr(u)!=="body"),i=null;const o=Ve(t).position==="fixed";let s=o?Jt(t):t;for(;He(s)&&!yr(s);){const u=Ve(s),l=pa(s);!l&&u.position==="fixed"&&(i=null),(o?!l&&!i:!l&&u.position==="static"&&!!i&&mk.has(i.position)||ki(s)&&!l&&Zp(t,s))?r=r.filter(d=>d!==s):i=u,s=Jt(s)}return e.set(t,r),r}a(bk,"getClippingElementAncestors");function yk(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?vs(e)?[]:bk(e,this._c):[].concat(n),r],u=s[0],l=s.reduce((c,d)=>{const f=Vd(e,d,i);return c.top=me(f.top,c.top),c.right=it(f.right,c.right),c.bottom=it(f.bottom,c.bottom),c.left=me(f.left,c.left),c},Vd(e,u,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}a(yk,"getClippingRect");function xk(t){const{width:e,height:n}=Wp(t);return{width:e,height:n}}a(xk,"getDimensions");function kk(t,e,n){const r=ot(e),i=St(e),o=n==="fixed",s=ci(t,!0,o,e);let u={scrollLeft:0,scrollTop:0};const l=et(0);function c(){l.x=Ms(i)}if(a(c,"setLeftRTLScrollbarOffset"),r||!r&&!o)if((Cr(e)!=="body"||ki(i))&&(u=As(e)),r){const h=ci(e,!0,o,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&c();o&&!r&&i&&c();const d=i&&!r&&!o?Gp(i,u):et(0),f=s.left+u.scrollLeft-l.x-d.x,p=s.top+u.scrollTop-l.y-d.y;return{x:f,y:p,width:s.width,height:s.height}}a(kk,"getRectRelativeToOffsetParent");function lu(t){return Ve(t).position==="static"}a(lu,"isStaticPositioned");function jd(t,e){if(!ot(t)||Ve(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return St(t)===n&&(n=n.ownerDocument.body),n}a(jd,"getTrueOffsetParent");function Xp(t,e){const n=ve(t);if(vs(t))return n;if(!ot(t)){let i=Jt(t);for(;i&&!yr(i);){if(He(i)&&!lu(i))return i;i=Jt(i)}return n}let r=jd(t,e);for(;r&&nk(r)&&lu(r);)r=jd(r,e);return r&&yr(r)&&lu(r)&&!pa(r)?n:r||uk(t)||n}a(Xp,"getOffsetParent");const wk=a(async function(t){const e=this.getOffsetParent||Xp,n=this.getDimensions,r=await n(t.floating);return{reference:kk(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},"getElementRects");function Ck(t){return Ve(t).direction==="rtl"}a(Ck,"isRTL");const Ek={convertOffsetParentRelativeRectToViewportRelativeRect:dk,getDocumentElement:St,getClippingRect:yk,getOffsetParent:Xp,getElementRects:wk,getClientRects:fk,getDimensions:xk,getScale:Vn,isElement:He,isRTL:Ck},Yp=Xx,Qp=qx,e0=Yx,t0=Ux,n0=Qx,r0=Wx,i0=Vx,o0=Jx,s0=a((t,e,n)=>{const r=new Map,i={platform:Ek,...n},o={...i.platform,_c:r};return Hx(t,e,{...i,platform:o})},"computePosition");var pl,ml;if(typeof WeakMap<"u"){let t=new WeakMap;pl=a(e=>t.get(e),"readFromCache"),ml=a((e,n)=>(t.set(e,n),n),"addToCache")}else{const t=[];let n=0;pl=a(r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},"readFromCache"),ml=a((r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i),"addToCache")}var Qn,gt=(Qn=class{constructor(e,n,r,i){this.width=e,this.height=n,this.map=r,this.problems=i}findCell(e){for(let n=0;n<this.map.length;n++){const r=this.map[n];if(r!=e)continue;const i=n%this.width,o=n/this.width|0;let s=i+1,u=o+1;for(let l=1;s<this.width&&this.map[n+l]==r;l++)s++;for(let l=1;u<this.height&&this.map[n+this.width*l]==r;l++)u++;return{left:i,top:o,right:s,bottom:u}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let n=0;n<this.map.length;n++)if(this.map[n]==e)return n%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,n,r){const{left:i,right:o,top:s,bottom:u}=this.findCell(e);return n=="horiz"?(r<0?i==0:o==this.width)?null:this.map[s*this.width+(r<0?i-1:o)]:(r<0?s==0:u==this.height)?null:this.map[i+this.width*(r<0?s-1:u)]}rectBetween(e,n){const{left:r,right:i,top:o,bottom:s}=this.findCell(e),{left:u,right:l,top:c,bottom:d}=this.findCell(n);return{left:Math.min(r,u),top:Math.min(o,c),right:Math.max(i,l),bottom:Math.max(s,d)}}cellsInRect(e){const n=[],r={};for(let i=e.top;i<e.bottom;i++)for(let o=e.left;o<e.right;o++){const s=i*this.width+o,u=this.map[s];r[u]||(r[u]=!0,!(o==e.left&&o&&this.map[s-1]==u||i==e.top&&i&&this.map[s-this.width]==u)&&n.push(u))}return n}positionAt(e,n,r){for(let i=0,o=0;;i++){const s=o+r.child(i).nodeSize;if(i==e){let u=n+e*this.width;const l=(e+1)*this.width;for(;u<l&&this.map[u]<o;)u++;return u==l?s-1:this.map[u]}o=s}}static get(e){return pl(e)||ml(e,Sk(e))}},a(Qn,"TableMap"),Qn);function Sk(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=vk(t),n=t.childCount,r=[];let i=0,o=null;const s=[];for(let c=0,d=e*n;c<d;c++)r[c]=0;for(let c=0,d=0;c<n;c++){const f=t.child(c);d++;for(let m=0;;m++){for(;i<r.length&&r[i]!=0;)i++;if(m==f.childCount)break;const g=f.child(m),{colspan:b,rowspan:y,colwidth:x}=g.attrs;for(let k=0;k<y;k++){if(k+c>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:d,n:y-k});break}const C=i+k*e;for(let w=0;w<b;w++){r[C+w]==0?r[C+w]=d:(o||(o=[])).push({type:"collision",row:c,pos:d,n:b-w});const E=x&&x[w];if(E){const S=(C+w)%e*2,T=s[S];T==null||T!=E&&s[S+1]==1?(s[S]=E,s[S+1]=1):T==E&&s[S+1]++}}}i+=b,d+=g.nodeSize}const p=(c+1)*e;let h=0;for(;i<p;)r[i++]==0&&h++;h&&(o||(o=[])).push({type:"missing",row:c,n:h}),d++}(e===0||n===0)&&(o||(o=[])).push({type:"zero_sized"});const u=new gt(e,n,r,o);let l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(l=!0);return l&&Ak(u,s,t),u}a(Sk,"computeMap");function vk(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const i=t.child(r);let o=0;if(n)for(let s=0;s<r;s++){const u=t.child(s);for(let l=0;l<u.childCount;l++){const c=u.child(l);s+c.attrs.rowspan>r&&(o+=c.attrs.colspan)}}for(let s=0;s<i.childCount;s++){const u=i.child(s);o+=u.attrs.colspan,u.attrs.rowspan>1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}a(vk,"findWidth");function Ak(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i<t.map.length;i++){const o=t.map[i];if(r[o])continue;r[o]=!0;const s=n.nodeAt(o);if(!s)throw new RangeError(`No cell with offset ${o} found`);let u=null;const l=s.attrs;for(let c=0;c<l.colspan;c++){const d=(i+c)%t.width,f=e[d*2];f!=null&&(!l.colwidth||l.colwidth[c]!=f)&&((u||(u=Mk(l)))[c]=f)}u&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:u})}}a(Ak,"findBadColWidths");function Mk(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}a(Mk,"freshColWidth");function ga(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}a(ga,"tableNodeTypes");new U("selectingCells");function Tk(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}a(Tk,"cellAround");function u0(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}a(u0,"isInTable");function Dk(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Tk(e.$head)||Ok(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}a(Dk,"selectionCell");function Ok(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}a(Ok,"cellNear");function qd(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}a(qd,"pointsAtCell");function l0(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}a(l0,"inSameTable");function a0(t,e,n){const r=t.node(-1),i=gt.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}a(a0,"nextCell");function Ud(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}a(Ud,"removeColSpan");var xe,tt=(xe=class extends I{constructor(e,n=e){const r=e.node(-1),i=gt.get(r),o=e.start(-1),s=i.rectBetween(e.pos-o,n.pos-o),u=e.node(0),l=i.cellsInRect(s).filter(d=>d!=n.pos-o);l.unshift(n.pos-o);const c=l.map(d=>{const f=r.nodeAt(d);if(!f)throw RangeError(`No cell with offset ${d} found`);const p=o+d+1;return new eo(u.resolve(p),u.resolve(p+f.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(qd(r)&&qd(i)&&l0(r,i)){const o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?xe.rowSelection(r,i):o&&this.isColSelection()?xe.colSelection(r,i):new xe(r,i)}return R.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=gt.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let l=i.top;l<i.bottom;l++){const c=[];for(let d=l*n.width+i.left,f=i.left;f<i.right;f++,d++){const p=n.map[d];if(o[p])continue;o[p]=!0;const h=n.findCell(p);let m=e.nodeAt(p);if(!m)throw RangeError(`No cell with offset ${p} found`);const g=i.left-h.left,b=h.right-i.right;if(g>0||b>0){let y=m.attrs;if(g>0&&(y=Ud(y,0,g)),b>0&&(y=Ud(y,y.colspan-b,b)),h.left<i.left){if(m=m.type.createAndFill(y),!m)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else m=m.type.create(y,m.content)}if(h.top<i.top||h.bottom>i.bottom){const y={...m.attrs,rowspan:Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top)};h.top<i.top?m=m.type.createAndFill(y):m=m.type.create(y,m.content)}c.push(m)}s.push(e.child(l).copy(A.from(c)))}const u=this.isColSelection()&&this.isRowSelection()?e:s;return new M(A.from(u),1,1)}replace(e,n=M.empty){const r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){const{$from:u,$to:l}=i[s],c=e.mapping.slice(r);e.replace(c.map(u.pos),c.map(l.pos),s?M.empty:n)}const o=I.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,n){this.replace(e,new M(A.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=gt.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let s=0;s<o.length;s++)e(n.nodeAt(o[s]),i+o[s])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),i=gt.get(r),o=e.start(-1),s=i.findCell(e.pos-o),u=i.findCell(n.pos-o),l=e.node(0);return s.top<=u.top?(s.top>0&&(e=l.resolve(o+i.map[s.left])),u.bottom<i.height&&(n=l.resolve(o+i.map[i.width*(i.height-1)+u.right-1]))):(u.top>0&&(n=l.resolve(o+i.map[u.left])),s.bottom<i.height&&(e=l.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new xe(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=gt.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return!1;const s=i+this.$anchorCell.nodeAfter.attrs.colspan,u=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,u)==n.width}eq(e){return e instanceof xe&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=gt.get(r),o=e.start(-1),s=i.findCell(e.pos-o),u=i.findCell(n.pos-o),l=e.node(0);return s.left<=u.left?(s.left>0&&(e=l.resolve(o+i.map[s.top*i.width])),u.right<i.width&&(n=l.resolve(o+i.map[i.width*(u.top+1)-1]))):(u.left>0&&(n=l.resolve(o+i.map[u.top*i.width])),s.right<i.width&&(e=l.resolve(o+i.map[i.width*(s.top+1)-1]))),new xe(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new xe(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new xe(e.resolve(n),e.resolve(r))}getBookmark(){return new _k(this.$anchorCell.pos,this.$headCell.pos)}},a(xe,"_CellSelection"),xe);tt.prototype.visible=!1;I.jsonID("cell",tt);var Sn,_k=(Sn=class{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Sn(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&l0(n,r)?new tt(n,r):I.near(r,1)}},a(Sn,"_CellBookmark"),Sn);new U("fix-tables");function c0(t){const e=t.selection,n=Dk(t),r=n.node(-1),i=n.start(-1),o=gt.get(r);return{...e instanceof tt?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}a(c0,"selectedRect");function Nk(t){return function(e,n){if(!u0(e))return!1;if(n){const r=ga(e.schema),i=c0(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),u=s.map(l=>i.table.nodeAt(l));for(let l=0;l<s.length;l++)u[l].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[l],r.cell,u[l].attrs);if(o.steps.length==0)for(let l=0;l<s.length;l++)o.setNodeMarkup(i.tableStart+s[l],r.header_cell,u[l].attrs);n(o)}return!0}}a(Nk,"deprecated_toggleHeader");function Wd(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const o=e.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}a(Wd,"isHeaderEnabledByType");function ba(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Nk(t):function(n,r){if(!u0(n))return!1;if(r){const i=ga(n.schema),o=c0(n),s=n.tr,u=Wd("row",o,i),l=Wd("column",o,i),d=(t==="column"?u:t==="row"?l:!1)?1:0,f=t=="column"?{left:0,top:d,right:1,bottom:o.map.height}:t=="row"?{left:d,top:0,right:o.map.width,bottom:1}:o,p=t=="column"?l?i.cell:i.header_cell:t=="row"?u?i.cell:i.header_cell:i.cell;o.map.cellsInRect(f).forEach(h=>{const m=h+o.tableStart,g=s.doc.nodeAt(m);g&&s.setNodeMarkup(m,p,g.attrs)}),r(s)}return!0}}a(ba,"toggleHeader");ba("row",{useDeprecatedLogic:!0});ba("column",{useDeprecatedLogic:!0});ba("cell",{useDeprecatedLogic:!0});function Ri(t,e){const n=t.selection;if(!(n instanceof tt))return!1;if(e){const r=t.tr,i=ga(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new M(i,0,0))}),r.docChanged&&e(r)}return!0}a(Ri,"deleteCellSelection");$l({ArrowLeft:Fi("horiz",-1),ArrowRight:Fi("horiz",1),ArrowUp:Fi("vert",-1),ArrowDown:Fi("vert",1),"Shift-ArrowLeft":Li("horiz",-1),"Shift-ArrowRight":Li("horiz",1),"Shift-ArrowUp":Li("vert",-1),"Shift-ArrowDown":Li("vert",1),Backspace:Ri,"Mod-Backspace":Ri,Delete:Ri,"Mod-Delete":Ri});function qi(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}a(qi,"maybeSetSelection");function Fi(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;if(o instanceof tt)return qi(n,r,I.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;const s=d0(i,t,e);if(s==null)return!1;if(t=="horiz")return qi(n,r,I.near(n.doc.resolve(o.head+e),e));{const u=n.doc.resolve(s),l=a0(u,t,e);let c;return l?c=I.near(l,1):e<0?c=I.near(n.doc.resolve(u.before(-1)),-1):c=I.near(n.doc.resolve(u.after(-1)),1),qi(n,r,c)}}}a(Fi,"arrow");function Li(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let s;if(o instanceof tt)s=o;else{const l=d0(i,t,e);if(l==null)return!1;s=new tt(n.doc.resolve(l))}const u=a0(s.$headCell,t,e);return u?qi(n,r,new tt(s.$anchorCell,u)):!1}}a(Li,"shiftArrow");function d0(t,e,n){if(!(t.state.selection instanceof R))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const u=r.before(i),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?u:null}}return null}a(d0,"atEndOfCell");new U("tableColumnResizing");function Ik(t,e){const n=Math.min(t.top,e.top),r=Math.max(t.bottom,e.bottom),i=Math.min(t.left,e.left),s=Math.max(t.right,e.right)-i,u=r-n,l=i,c=n;return new DOMRect(l,c,s,u)}a(Ik,"combineDOMRects");var er,Rk=(er=class{constructor({editor:e,element:n,view:r,updateDelay:i=250,resizeDelay:o=60,shouldShow:s,appendTo:u,getReferencedVirtualElement:l,options:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:f,state:p,from:h,to:m})=>{const{doc:g,selection:b}=p,{empty:y}=b,x=!g.textBetween(h,m).length&&ql(p.selection),k=this.element.contains(document.activeElement);return!(!(f.hasFocus()||k)||y||x||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:f})=>{var p;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}f?.relatedTarget&&((p=this.element.parentNode)!=null&&p.contains(f.relatedTarget))||f?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(f,p)=>{const h=!p?.selection.eq(f.state.selection),m=!p?.doc.eq(f.state.doc);!h&&!m||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(f,h,m,p)},this.updateDelay))},this.updateHandler=(f,p,h,m)=>{const{composing:g}=f;if(g||!p&&!h)return;if(!this.getShouldShow(m)){this.hide();return}this.updatePosition(),this.show()},this.transactionHandler=({transaction:f})=>{f.getMeta("bubbleMenu")==="updatePosition"&&this.updatePosition()};var d;this.editor=e,this.element=n,this.view=r,this.updateDelay=i,this.resizeDelay=o,this.appendTo=u,this.scrollTarget=(d=c?.scrollTarget)!=null?d:window,this.getReferencedVirtualElement=l,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,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.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(r,r.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(t0(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(e0(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Yp(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(i0(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(n0(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Qp(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(r0(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(o0(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e;const{selection:n}=this.editor.state,r=(e=this.getReferencedVirtualElement)==null?void 0:e.call(this);if(r)return r;const i=Zl(this.view,n.from,n.to);let o={getBoundingClientRect:a(()=>i,"getBoundingClientRect"),getClientRects:a(()=>[i],"getClientRects")};if(n instanceof N){let s=this.view.nodeDOM(n.from);const u=s.dataset.nodeViewWrapper?s:s.querySelector("[data-node-view-wrapper]");u&&(s=u),s&&(o={getBoundingClientRect:a(()=>s.getBoundingClientRect(),"getBoundingClientRect"),getClientRects:a(()=>[s.getBoundingClientRect()],"getClientRects")})}if(n instanceof tt){const{$anchorCell:s,$headCell:u}=n,l=s?s.pos:u.pos,c=u?u.pos:s.pos,d=this.view.nodeDOM(l),f=this.view.nodeDOM(c);if(!d||!f)return;const p=d===f?d.getBoundingClientRect():Ik(d.getBoundingClientRect(),f.getBoundingClientRect());o={getBoundingClientRect:a(()=>p,"getBoundingClientRect"),getClientRects:a(()=>[p],"getClientRects")}}return o}updatePosition(){const e=this.virtualElement;e&&s0(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:n,y:r,strategy:i})=>{this.element.style.width="max-content",this.element.style.position=i,this.element.style.left=`${n}px`,this.element.style.top=`${r}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}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?.selection.eq(e.state.selection),s=!n?.doc.eq(e.state.doc);this.updateHandler(e,o,s,n)}getShouldShow(e){var n;const{state:r}=this.view,{selection:i}=r,{ranges:o}=i,s=Math.min(...o.map(c=>c.$from.pos)),u=Math.max(...o.map(c=>c.$to.pos));return((n=this.shouldShow)==null?void 0:n.call(this,{editor:this.editor,element:this.element,view:this.view,state:r,oldState:e,from:s,to:u}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const n=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=n??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},a(er,"BubbleMenuView"),er),f0=a(t=>new V({key:typeof t.pluginKey=="string"?new U(t.pluginKey):t.pluginKey,view:a(e=>new Rk({view:e,...t}),"view")}),"BubbleMenuPlugin");K.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[f0({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var Fk=xf({name:"BubbleMenu",inheritAttrs:!1,props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},resizeDelay:{type:Number,default:void 0},options:{type:Object,default:a(()=>({}),"default")},appendTo:{type:Object,default:void 0},shouldShow:{type:Function,default:null},getReferencedVirtualElement:{type:Function,default:void 0}},setup(t,{slots:e,attrs:n}){const r=document.createElement("div");return Y0(()=>{const{editor:i,options:o,pluginKey:s,resizeDelay:u,appendTo:l,shouldShow:c,getReferencedVirtualElement:d,updateDelay:f}=t;r.style.visibility="hidden",r.style.position="absolute",r.remove(),wf(()=>{i.registerPlugin(f0({editor:i,element:r,options:o,pluginKey:s,resizeDelay:u,appendTo:l,shouldShow:c,getReferencedVirtualElement:d,updateDelay:f}))})}),kf(()=>{const{pluginKey:i,editor:o}=t;o.unregisterPlugin(i)}),()=>{var i;return ku(Q0,{to:r},ku("div",{...n,ref:"root"},(i=e.default)==null?void 0:i.call(e)))}}}),tr,Lk=(tr=class{constructor({editor:e,element:n,view:r,options:i,appendTo:o,shouldShow:s}){this.preventHide=!1,this.isVisible=!1,this.shouldShow=({view:u,state:l})=>{const{selection:c}=l,{$anchor:d,empty:f}=c,p=d.depth===1,h=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent&&d.parent.childCount===0&&!this.getTextContent(d.parent);return!(!u.hasFocus()||!f||!p||!h||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,l,c,d)=>{const{composing:f}=u;if(f||!l&&!c)return;if(!this.getShouldShow(d)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var l;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&((l=this.element.parentNode)!=null&&l.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.editor=e,this.element=n,this.view=r,this.appendTo=o,this.floatingUIOptions={...this.floatingUIOptions,...i},this.element.tabIndex=0,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.update(r,r.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return Yh(e,{textSerializers:Jl(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(t0(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(e0(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Yp(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(i0(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(n0(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Qp(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(r0(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(o0(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}getShouldShow(e){var n;const{state:r}=this.view,{selection:i}=r,{ranges:o}=i,s=Math.min(...o.map(c=>c.$from.pos)),u=Math.max(...o.map(c=>c.$to.pos));return(n=this.shouldShow)==null?void 0:n.call(this,{editor:this.editor,view:this.view,state:r,oldState:e,from:s,to:u})}updatePosition(){const{selection:e}=this.editor.state,n=Zl(this.view,e.from,e.to);s0({getBoundingClientRect:a(()=>n,"getBoundingClientRect"),getClientRects:a(()=>[n],"getClientRects")},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:i,y:o,strategy:s})=>{this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${i}px`,this.element.style.top=`${o}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,n){const r=!n?.selection.eq(e.state.selection),i=!n?.doc.eq(e.state.doc);this.updateHandler(e,r,i,n)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const n=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=n??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},a(tr,"FloatingMenuView"),tr),Pk=a(t=>new V({key:typeof t.pluginKey=="string"?new U(t.pluginKey):t.pluginKey,view:a(e=>new Lk({view:e,...t}),"view")}),"FloatingMenuPlugin");K.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Pk({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});const Kd={};function Bk(t){let e=Kd[t];if(e)return e;e=Kd[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}a(Bk,"getDecodeCache");function xr(t,e){typeof e!="string"&&(e=xr.defaultChars);const n=Bk(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 l=parseInt(r.slice(o+4,o+6),16);if((l&192)===128){const c=u<<6&1984|l&63;c<128?i+="��":i+=String.fromCharCode(c),o+=3;continue}}if((u&240)===224&&o+6<s){const l=parseInt(r.slice(o+4,o+6),16),c=parseInt(r.slice(o+7,o+9),16);if((l&192)===128&&(c&192)===128){const d=u<<12&61440|l<<6&4032|c&63;d<2048||d>=55296&&d<=57343?i+="���":i+=String.fromCharCode(d),o+=6;continue}}if((u&248)===240&&o+9<s){const l=parseInt(r.slice(o+4,o+6),16),c=parseInt(r.slice(o+7,o+9),16),d=parseInt(r.slice(o+10,o+12),16);if((l&192)===128&&(c&192)===128&&(d&192)===128){let f=u<<18&1835008|l<<12&258048|c<<6&4032|d&63;f<65536||f>1114111?i+="����":(f-=65536,i+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}i+="�"}return i})}a(xr,"decode$1");xr.defaultChars=";/?:@&=+$,#";xr.componentChars="";const Jd={};function zk(t){let e=Jd[t];if(e)return e;e=Jd[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}a(zk,"getEncodeCache");function wi(t,e,n){typeof e!="string"&&(n=e,e=wi.defaultChars),typeof n>"u"&&(n=!0);const r=zk(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 l=t.charCodeAt(o+1);if(l>=56320&&l<=57343){i+=encodeURIComponent(t[o]+t[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(t[o])}return i}a(wi,"encode$1");wi.defaultChars=";/?:@&=+$,-_.!~*'()#";wi.componentChars="-_.!~*'()";function ya(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}a(ya,"format");function Go(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}a(Go,"Url");const $k=/^([a-z0-9.+-]+:)/i,Hk=/:[0-9]*$/,Vk=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,jk=["<",">",'"',"`"," ","\r",`
|
|
139
|
+
`," "],qk=["{","}","|","\\","^","`"].concat(jk),Uk=["'"].concat(qk),Gd=["%","/","?",";","#"].concat(Uk),Zd=["/","?","#"],Wk=255,Xd=/^[+a-z0-9A-Z_-]{0,63}$/,Kk=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Yd={javascript:!0,"javascript:":!0},Qd={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function xa(t,e){if(t&&t instanceof Go)return t;const n=new Go;return n.parse(t,e),n}a(xa,"urlParse");Go.prototype.parse=function(t,e){let n,r,i,o=t;if(o=o.trim(),!e&&t.split("#").length===1){const c=Vk.exec(o);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let s=$k.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&&Yd[s])&&(o=o.substr(2),this.slashes=!0)),!Yd[s]&&(i||s&&!Qd[s])){let c=-1;for(let m=0;m<Zd.length;m++)r=o.indexOf(Zd[m]),r!==-1&&(c===-1||r<c)&&(c=r);let d,f;c===-1?f=o.lastIndexOf("@"):f=o.lastIndexOf("@",c),f!==-1&&(d=o.slice(0,f),o=o.slice(f+1),this.auth=d),c=-1;for(let m=0;m<Gd.length;m++)r=o.indexOf(Gd[m]),r!==-1&&(c===-1||r<c)&&(c=r);c===-1&&(c=o.length),o[c-1]===":"&&c--;const p=o.slice(0,c);o=o.slice(c),this.parseHost(p),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const m=this.hostname.split(/\./);for(let g=0,b=m.length;g<b;g++){const y=m[g];if(y&&!y.match(Xd)){let x="";for(let k=0,C=y.length;k<C;k++)y.charCodeAt(k)>127?x+="x":x+=y[k];if(!x.match(Xd)){const k=m.slice(0,g),C=m.slice(g+1),w=y.match(Kk);w&&(k.push(w[1]),C.unshift(w[2])),C.length&&(o=C.join(".")+o),this.hostname=k.join(".");break}}}}this.hostname.length>Wk&&(this.hostname=""),h&&(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 l=o.indexOf("?");return l!==-1&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),Qd[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Go.prototype.parseHost=function(t){let e=Hk.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 Jk=Object.freeze(Object.defineProperty({__proto__:null,decode:xr,encode:wi,format:ya,parse:xa},Symbol.toStringTag,{value:"Module"})),h0=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,p0=/[\0-\x1F\x7F-\x9F]/,Gk=/[\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]/,ka=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,m0=/[\$\+<->\^`\|~\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]/,g0=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Zk=Object.freeze(Object.defineProperty({__proto__:null,Any:h0,Cc:p0,Cf:Gk,P:ka,S:m0,Z:g0},Symbol.toStringTag,{value:"Module"})),Xk=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୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢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;怳Ādpuct;戏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ǣጓ\0y;䐎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Ā;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀ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Ā;elƀ;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\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»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ↄⅪ←ٖ↛ǰ↉\0proø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;䅓Ācrir;榿;쀀𝔬ͯ\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\0m;櫳;櫽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))),Yk=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var au;const Qk=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]]),e3=(au=String.fromCodePoint)!==null&&au!==void 0?au: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 t3(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=Qk.get(t))!==null&&e!==void 0?e:t}a(t3,"replaceCodePoint");var ne;(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"})(ne||(ne={}));const n3=32;var Bt;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Bt||(Bt={}));function gl(t){return t>=ne.ZERO&&t<=ne.NINE}a(gl,"isNumber");function r3(t){return t>=ne.UPPER_A&&t<=ne.UPPER_F||t>=ne.LOWER_A&&t<=ne.LOWER_F}a(r3,"isHexadecimalCharacter");function i3(t){return t>=ne.UPPER_A&&t<=ne.UPPER_Z||t>=ne.LOWER_A&&t<=ne.LOWER_Z||gl(t)}a(i3,"isAsciiAlphaNumeric");function o3(t){return t===ne.EQUALS||i3(t)}a(o3,"isEntityInAttributeInvalidEnd");var te;(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"})(te||(te={}));var Lt;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Lt||(Lt={}));const sc=class sc{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=te.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Lt.Strict}startEntity(e){this.decodeMode=e,this.state=te.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case te.EntityStart:return e.charCodeAt(n)===ne.NUM?(this.state=te.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=te.NamedEntity,this.stateNamedEntity(e,n));case te.NumericStart:return this.stateNumericStart(e,n);case te.NumericDecimal:return this.stateNumericDecimal(e,n);case te.NumericHex:return this.stateNumericHex(e,n);case te.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|n3)===ne.LOWER_X?(this.state=te.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=te.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(gl(i)||r3(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(gl(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===ne.SEMI)this.consumed+=1;else if(this.decodeMode===Lt.Strict)return 0;return this.emitCodePoint(t3(this.result),this.consumed),this.errors&&(e!==ne.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&Bt.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const s=e.charCodeAt(n);if(this.treeIndex=s3(r,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===Lt.Attribute&&(o===0||o3(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],o=(i&Bt.VALUE_LENGTH)>>14,o!==0){if(s===ne.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Lt.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]&Bt.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]&~Bt.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case te.NamedEntity:return this.result!==0&&(this.decodeMode!==Lt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case te.NumericDecimal:return this.emitNumericEntity(0,2);case te.NumericHex:return this.emitNumericEntity(0,3);case te.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case te.EntityStart:return 0}}};a(sc,"EntityDecoder");let bl=sc;function b0(t){let e="";const n=new bl(t,r=>e+=e3(r));return a(function(i,o){let s=0,u=0;for(;(u=i.indexOf("&",u))>=0;){e+=i.slice(s,u),n.startEntity(o);const c=n.write(i,u+1);if(c<0){s=u+n.end();break}s=u+c,u=c===0?s+1:s}const l=e+i.slice(s);return e="",l},"decodeWithTrie")}a(b0,"getDecoder");function s3(t,e,n,r){const i=(e&Bt.BRANCH_LENGTH)>>7,o=e&Bt.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){const l=r-o;return l<0||l>=i?-1:t[n+l]-1}let s=n,u=s+i-1;for(;s<=u;){const l=s+u>>>1,c=t[l];if(c<r)s=l+1;else if(c>r)u=l-1;else return t[l+i]}return-1}a(s3,"determineBranch");const u3=b0(Xk);b0(Yk);function y0(t,e=Lt.Legacy){return u3(t,e)}a(y0,"decodeHTML");function l3(t){return Object.prototype.toString.call(t)}a(l3,"_class$1");function wa(t){return l3(t)==="[object String]"}a(wa,"isString$1");const a3=Object.prototype.hasOwnProperty;function c3(t,e){return a3.call(t,e)}a(c3,"has");function Ts(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}a(Ts,"assign$1");function x0(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}a(x0,"arrayReplaceAt");function Ca(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)}a(Ca,"isValidEntityCode");function Zo(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}a(Zo,"fromCodePoint");const k0=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,d3=/&([a-z#][a-z0-9]{1,31});/gi,f3=new RegExp(k0.source+"|"+d3.source,"gi"),h3=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function p3(t,e){if(e.charCodeAt(0)===35&&h3.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return Ca(r)?Zo(r):t}const n=y0(t);return n!==t?n:t}a(p3,"replaceEntityPattern");function m3(t){return t.indexOf("\\")<0?t:t.replace(k0,"$1")}a(m3,"unescapeMd");function kr(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(f3,function(e,n,r){return n||p3(e,r)})}a(kr,"unescapeAll");const g3=/[&<>"]/,b3=/[&<>"]/g,y3={"&":"&","<":"<",">":">",'"':"""};function x3(t){return y3[t]}a(x3,"replaceUnsafeChar");function Gt(t){return g3.test(t)?t.replace(b3,x3):t}a(Gt,"escapeHtml");const k3=/[.?*+^$[\]\\(){}|-]/g;function w3(t){return t.replace(k3,"\\$&")}a(w3,"escapeRE$1");function q(t){switch(t){case 9:case 32:return!0}return!1}a(q,"isSpace");function di(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}a(di,"isWhiteSpace");function fi(t){return ka.test(t)||m0.test(t)}a(fi,"isPunctChar");function hi(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}}a(hi,"isMdAsciiPunct");function Ds(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}a(Ds,"normalizeReference");const C3={mdurl:Jk,ucmicro:Zk},E3=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:x0,assign:Ts,escapeHtml:Gt,escapeRE:w3,fromCodePoint:Zo,has:c3,isMdAsciiPunct:hi,isPunctChar:fi,isSpace:q,isString:wa,isValidEntityCode:Ca,isWhiteSpace:di,lib:C3,normalizeReference:Ds,unescapeAll:kr,unescapeMd:m3},Symbol.toStringTag,{value:"Module"}));function S3(t,e,n){let r,i,o,s;const u=t.posMax,l=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=l,-1}}let c=-1;return i&&(c=t.pos),t.pos=l,c}a(S3,"parseLinkLabel");function v3(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=kr(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=kr(t.slice(e,i)),o.pos=i,o.ok=!0),o}a(v3,"parseLinkDestination");function A3(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+=kr(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+=kr(t.slice(e,o)),s}a(A3,"parseLinkTitle");const M3=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:v3,parseLinkLabel:S3,parseLinkTitle:A3},Symbol.toStringTag,{value:"Module"})),st={};st.code_inline=function(t,e,n,r,i){const o=t[e];return"<code"+i.renderAttrs(o)+">"+Gt(o.content)+"</code>"};st.code_block=function(t,e,n,r,i){const o=t[e];return"<pre"+i.renderAttrs(o)+"><code>"+Gt(t[e].content)+`</code></pre>
|
|
140
|
+
`};st.fence=function(t,e,n,r,i){const o=t[e],s=o.info?kr(o.info).trim():"";let u="",l="";if(s){const d=s.split(/(\s+)/g);u=d[0],l=d.slice(2).join("")}let c;if(n.highlight?c=n.highlight(o.content,u,l)||Gt(o.content):c=Gt(o.content),c.indexOf("<pre")===0)return c+`
|
|
141
|
+
`;if(s){const d=o.attrIndex("class"),f=o.attrs?o.attrs.slice():[];d<0?f.push(["class",n.langPrefix+u]):(f[d]=f[d].slice(),f[d][1]+=" "+n.langPrefix+u);const p={attrs:f};return`<pre><code${i.renderAttrs(p)}>${c}</code></pre>
|
|
142
|
+
`}return`<pre><code${i.renderAttrs(o)}>${c}</code></pre>
|
|
143
|
+
`};st.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)};st.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
|
|
144
|
+
`:`<br>
|
|
145
|
+
`};st.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
|
|
146
|
+
`:`<br>
|
|
147
|
+
`:`
|
|
148
|
+
`};st.text=function(t,e){return Gt(t[e].content)};st.html_block=function(t,e){return t[e].content};st.html_inline=function(t,e){return t[e].content};function Er(){this.rules=Ts({},st)}a(Er,"Renderer");Er.prototype.renderAttrs=a(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},"renderAttrs");Er.prototype.renderToken=a(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+=`
|
|
149
|
+
`),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?`>
|
|
150
|
+
`:">",o},"renderToken");Er.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};Er.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+=`
|
|
151
|
+
`;break}return r};Er.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 Ce(){this.__rules__=[],this.__cache__=null}a(Ce,"Ruler");Ce.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};Ce.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))})})};Ce.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};Ce.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};Ce.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};Ce.prototype.push=function(t,e,n){const r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};Ce.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};Ce.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};Ce.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};Ce.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function je(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}a(je,"Token");je.prototype.attrIndex=a(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},"attrIndex");je.prototype.attrPush=a(function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},"attrPush");je.prototype.attrSet=a(function(e,n){const r=this.attrIndex(e),i=[e,n];r<0?this.attrPush(i):this.attrs[r]=i},"attrSet");je.prototype.attrGet=a(function(e){const n=this.attrIndex(e);let r=null;return n>=0&&(r=this.attrs[n][1]),r},"attrGet");je.prototype.attrJoin=a(function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n},"attrJoin");function w0(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}a(w0,"StateCore");w0.prototype.Token=je;const T3=/\r\n?|\n/g,D3=/\0/g;function O3(t){let e;e=t.src.replace(T3,`
|
|
152
|
+
`),e=e.replace(D3,"�"),t.src=e}a(O3,"normalize");function _3(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)}a(_3,"block");function N3(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)}}a(N3,"inline");function I3(t){return/^<a[>\s]/i.test(t)}a(I3,"isLinkOpen$1");function R3(t){return/^<\/a\s*>/i.test(t)}a(R3,"isLinkClose$1");function F3(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"&&(I3(u.content)&&o>0&&o--,R3(u.content)&&o++),!(o>0)&&u.type==="text"&&t.md.linkify.test(u.content)){const l=u.content;let c=t.md.linkify.match(l);const d=[];let f=u.level,p=0;c.length>0&&c[0].index===0&&s>0&&i[s-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const m=c[h].url,g=t.md.normalizeLink(m);if(!t.md.validateLink(g))continue;let b=c[h].text;c[h].schema?c[h].schema==="mailto:"&&!/^mailto:/i.test(b)?b=t.md.normalizeLinkText("mailto:"+b).replace(/^mailto:/,""):b=t.md.normalizeLinkText(b):b=t.md.normalizeLinkText("http://"+b).replace(/^http:\/\//,"");const y=c[h].index;if(y>p){const w=new t.Token("text","",0);w.content=l.slice(p,y),w.level=f,d.push(w)}const x=new t.Token("link_open","a",1);x.attrs=[["href",g]],x.level=f++,x.markup="linkify",x.info="auto",d.push(x);const k=new t.Token("text","",0);k.content=b,k.level=f,d.push(k);const C=new t.Token("link_close","a",-1);C.level=--f,C.markup="linkify",C.info="auto",d.push(C),p=c[h].lastIndex}if(p<l.length){const h=new t.Token("text","",0);h.content=l.slice(p),h.level=f,d.push(h)}e[n].children=i=x0(i,s,d)}}}}a(F3,"linkify$1");const C0=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,L3=/\((c|tm|r)\)/i,P3=/\((c|tm|r)\)/ig,B3={c:"©",r:"®",tm:"™"};function z3(t,e){return B3[e.toLowerCase()]}a(z3,"replaceFn");function $3(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(P3,z3)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}a($3,"replace_scoped");function H3(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&C0.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++}}a(H3,"replace_rare");function V3(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(L3.test(t.tokens[e].content)&&$3(t.tokens[e].children),C0.test(t.tokens[e].content)&&H3(t.tokens[e].children))}a(V3,"replace");const j3=/['"]/,ef=/['"]/g,tf="’";function Pi(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}a(Pi,"replaceAt");function q3(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,l=0,c=u.length;e:for(;l<c;){ef.lastIndex=l;const d=ef.exec(u);if(!d)break;let f=!0,p=!0;l=d.index+1;const h=d[0]==="'";let m=32;if(d.index-1>=0)m=u.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){m=t[n].content.charCodeAt(t[n].content.length-1);break}let g=32;if(l<c)g=u.charCodeAt(l);else for(n=i+1;n<t.length&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n++)if(t[n].content){g=t[n].content.charCodeAt(0);break}const b=hi(m)||fi(String.fromCharCode(m)),y=hi(g)||fi(String.fromCharCode(g)),x=di(m),k=di(g);if(k?f=!1:y&&(x||b||(f=!1)),x?p=!1:b&&(k||y||(p=!1)),g===34&&d[0]==='"'&&m>=48&&m<=57&&(p=f=!1),f&&p&&(f=b,p=y),!f&&!p){h&&(o.content=Pi(o.content,d.index,tf));continue}if(p)for(n=r.length-1;n>=0;n--){let C=r[n];if(r[n].level<s)break;if(C.single===h&&r[n].level===s){C=r[n];let w,E;h?(w=e.md.options.quotes[2],E=e.md.options.quotes[3]):(w=e.md.options.quotes[0],E=e.md.options.quotes[1]),o.content=Pi(o.content,d.index,E),t[C.token].content=Pi(t[C.token].content,C.pos,w),l+=E.length-1,C.token===i&&(l+=w.length-1),u=o.content,c=u.length,r.length=n;continue e}}f?r.push({token:i,pos:d.index,single:h,level:s}):p&&h&&(o.content=Pi(o.content,d.index,tf))}}}a(q3,"process_inlines");function U3(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)t.tokens[e].type!=="inline"||!j3.test(t.tokens[e].content)||q3(t.tokens[e].children,t)}a(U3,"smartquotes");function W3(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)}}a(W3,"text_join");const cu=[["normalize",O3],["block",_3],["inline",N3],["linkify",F3],["replacements",V3],["smartquotes",U3],["text_join",W3]];function Ea(){this.ruler=new Ce;for(let t=0;t<cu.length;t++)this.ruler.push(cu[t][0],cu[t][1])}a(Ea,"Core");Ea.prototype.process=function(t){const e=this.ruler.getRules("");for(let n=0,r=e.length;n<r;n++)e[n](t)};Ea.prototype.State=w0;function ut(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,l=0,c=i.length,d=!1;s<c;s++){const f=i.charCodeAt(s);if(!d)if(q(f)){u++,f===9?l+=4-l%4:l++;continue}else d=!0;(f===10||s===c-1)&&(f!==10&&s++,this.bMarks.push(o),this.eMarks.push(s),this.tShift.push(u),this.sCount.push(l),this.bsCount.push(0),d=!1,u=0,l=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}a(ut,"StateBlock");ut.prototype.push=function(t,e,n){const r=new je(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};ut.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");ut.prototype.skipEmptyLines=a(function(e){for(let n=this.lineMax;e<n&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},"skipEmptyLines");ut.prototype.skipSpaces=a(function(e){for(let n=this.src.length;e<n;e++){const r=this.src.charCodeAt(e);if(!q(r))break}return e},"skipSpaces");ut.prototype.skipSpacesBack=a(function(e,n){if(e<=n)return e;for(;e>n;)if(!q(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");ut.prototype.skipChars=a(function(e,n){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===n;e++);return e},"skipChars");ut.prototype.skipCharsBack=a(function(e,n,r){if(e<=r)return e;for(;e>r;)if(n!==this.src.charCodeAt(--e))return e+1;return e},"skipCharsBack");ut.prototype.getLines=a(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 l=0;const c=this.bMarks[u];let d=c,f;for(u+1<n||i?f=this.eMarks[u]+1:f=this.eMarks[u];d<f&&l<r;){const p=this.src.charCodeAt(d);if(q(p))p===9?l+=4-(l+this.bsCount[u])%4:l++;else if(d-c<this.tShift[u])l++;else break;d++}l>r?o[s]=new Array(l-r+1).join(" ")+this.src.slice(d,f):o[s]=this.src.slice(d,f)}return o.join("")},"getLines");ut.prototype.Token=je;const K3=65536;function du(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}a(du,"getLine");function nf(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}a(nf,"escapedSplit");function J3(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&&!q(u)||s===45&&q(u))return!1;for(;o<t.eMarks[i];){const C=t.src.charCodeAt(o);if(C!==124&&C!==45&&C!==58&&!q(C))return!1;o++}let l=du(t,e+1),c=l.split("|");const d=[];for(let C=0;C<c.length;C++){const w=c[C].trim();if(!w){if(C===0||C===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(w))return!1;w.charCodeAt(w.length-1)===58?d.push(w.charCodeAt(0)===58?"center":"right"):w.charCodeAt(0)===58?d.push("left"):d.push("")}if(l=du(t,e).trim(),l.indexOf("|")===-1||t.sCount[e]-t.blkIndent>=4)return!1;c=nf(l),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const f=c.length;if(f===0||f!==d.length)return!1;if(r)return!0;const p=t.parentType;t.parentType="table";const h=t.md.block.ruler.getRules("blockquote"),m=t.push("table_open","table",1),g=[e,0];m.map=g;const b=t.push("thead_open","thead",1);b.map=[e,e+1];const y=t.push("tr_open","tr",1);y.map=[e,e+1];for(let C=0;C<c.length;C++){const w=t.push("th_open","th",1);d[C]&&(w.attrs=[["style","text-align:"+d[C]]]);const E=t.push("inline","",0);E.content=c[C].trim(),E.children=[],t.push("th_close","th",-1)}t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let x,k=0;for(i=e+2;i<n&&!(t.sCount[i]<t.blkIndent);i++){let C=!1;for(let E=0,S=h.length;E<S;E++)if(h[E](t,i,n,!0)){C=!0;break}if(C||(l=du(t,i).trim(),!l)||t.sCount[i]-t.blkIndent>=4||(c=nf(l),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),k+=f-c.length,k>K3))break;if(i===e+2){const E=t.push("tbody_open","tbody",1);E.map=x=[e+2,0]}const w=t.push("tr_open","tr",1);w.map=[i,i+1];for(let E=0;E<f;E++){const S=t.push("td_open","td",1);d[E]&&(S.attrs=[["style","text-align:"+d[E]]]);const T=t.push("inline","",0);T.content=c[E]?c[E].trim():"",T.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),g[1]=i,t.parentType=p,t.line=i,!0}a(J3,"table");function G3(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)+`
|
|
153
|
+
`,o.map=[e,t.line],!0}a(G3,"code");function Z3(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 l=i-u;if(l<3)return!1;const c=t.src.slice(u,i),d=t.src.slice(i,o);if(s===96&&d.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let f=e,p=!1;for(;f++,!(f>=n||(i=u=t.bMarks[f]+t.tShift[f],o=t.eMarks[f],i<o&&t.sCount[f]<t.blkIndent));)if(t.src.charCodeAt(i)===s&&!(t.sCount[f]-t.blkIndent>=4)&&(i=t.skipChars(i,s),!(i-u<l)&&(i=t.skipSpaces(i),!(i<o)))){p=!0;break}l=t.sCount[e],t.line=f+(p?1:0);const h=t.push("fence","code",0);return h.info=d,h.content=t.getLines(e+1,f,l,!0),h.markup=c,h.map=[e,t.line],!0}a(Z3,"fence");function X3(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=[],l=[],c=[],d=[],f=t.md.block.ruler.getRules("blockquote"),p=t.parentType;t.parentType="blockquote";let h=!1,m;for(m=e;m<n;m++){const k=t.sCount[m]<t.blkIndent;if(i=t.bMarks[m]+t.tShift[m],o=t.eMarks[m],i>=o)break;if(t.src.charCodeAt(i++)===62&&!k){let w=t.sCount[m]+1,E,S;t.src.charCodeAt(i)===32?(i++,w++,S=!1,E=!0):t.src.charCodeAt(i)===9?(E=!0,(t.bsCount[m]+w)%4===3?(i++,w++,S=!1):S=!0):E=!1;let T=w;for(u.push(t.bMarks[m]),t.bMarks[m]=i;i<o;){const D=t.src.charCodeAt(i);if(q(D))D===9?T+=4-(T+t.bsCount[m]+(S?1:0))%4:T++;else break;i++}h=i>=o,l.push(t.bsCount[m]),t.bsCount[m]=t.sCount[m]+1+(E?1:0),c.push(t.sCount[m]),t.sCount[m]=T-w,d.push(t.tShift[m]),t.tShift[m]=i-t.bMarks[m];continue}if(h)break;let C=!1;for(let w=0,E=f.length;w<E;w++)if(f[w](t,m,n,!0)){C=!0;break}if(C){t.lineMax=m,t.blkIndent!==0&&(u.push(t.bMarks[m]),l.push(t.bsCount[m]),d.push(t.tShift[m]),c.push(t.sCount[m]),t.sCount[m]-=t.blkIndent);break}u.push(t.bMarks[m]),l.push(t.bsCount[m]),d.push(t.tShift[m]),c.push(t.sCount[m]),t.sCount[m]=-1}const g=t.blkIndent;t.blkIndent=0;const b=t.push("blockquote_open","blockquote",1);b.markup=">";const y=[e,0];b.map=y,t.md.block.tokenize(t,e,m);const x=t.push("blockquote_close","blockquote",-1);x.markup=">",t.lineMax=s,t.parentType=p,y[1]=t.line;for(let k=0;k<d.length;k++)t.bMarks[k+e]=u[k],t.tShift[k+e]=d[k],t.sCount[k+e]=c[k],t.bsCount[k+e]=l[k];return t.blkIndent=g,!0}a(X3,"blockquote");function Y3(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 c=t.src.charCodeAt(o++);if(c!==s&&!q(c))return!1;c===s&&u++}if(u<3)return!1;if(r)return!0;t.line=e+1;const l=t.push("hr","hr",0);return l.map=[e,t.line],l.markup=Array(u+1).join(String.fromCharCode(s)),!0}a(Y3,"hr");function rf(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(!q(o))return-1}return r}a(rf,"skipBulletListMarker");function of(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),!q(o))?-1:i}a(of,"skipOrderedListMarker");function Q3(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)}a(Q3,"markTightParagraphs");function e6(t,e,n,r){let i,o,s,u,l=e,c=!0;if(t.sCount[l]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]<t.blkIndent)return!1;let d=!1;r&&t.parentType==="paragraph"&&t.sCount[l]>=t.blkIndent&&(d=!0);let f,p,h;if((h=of(t,l))>=0){if(f=!0,s=t.bMarks[l]+t.tShift[l],p=Number(t.src.slice(s,h-1)),d&&p!==1)return!1}else if((h=rf(t,l))>=0)f=!1;else return!1;if(d&&t.skipSpaces(h)>=t.eMarks[l])return!1;if(r)return!0;const m=t.src.charCodeAt(h-1),g=t.tokens.length;f?(u=t.push("ordered_list_open","ol",1),p!==1&&(u.attrs=[["start",p]])):u=t.push("bullet_list_open","ul",1);const b=[l,0];u.map=b,u.markup=String.fromCharCode(m);let y=!1;const x=t.md.block.ruler.getRules("list"),k=t.parentType;for(t.parentType="list";l<n;){o=h,i=t.eMarks[l];const C=t.sCount[l]+h-(t.bMarks[l]+t.tShift[l]);let w=C;for(;o<i;){const P=t.src.charCodeAt(o);if(P===9)w+=4-(w+t.bsCount[l])%4;else if(P===32)w++;else break;o++}const E=o;let S;E>=i?S=1:S=w-C,S>4&&(S=1);const T=C+S;u=t.push("list_item_open","li",1),u.markup=String.fromCharCode(m);const D=[l,0];u.map=D,f&&(u.info=t.src.slice(s,h-1));const _=t.tight,z=t.tShift[l],j=t.sCount[l],J=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=T,t.tight=!0,t.tShift[l]=E-t.bMarks[l],t.sCount[l]=w,E>=i&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,l,n,!0),(!t.tight||y)&&(c=!1),y=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=J,t.tShift[l]=z,t.sCount[l]=j,t.tight=_,u=t.push("list_item_close","li",-1),u.markup=String.fromCharCode(m),l=t.line,D[1]=l,l>=n||t.sCount[l]<t.blkIndent||t.sCount[l]-t.blkIndent>=4)break;let L=!1;for(let P=0,X=x.length;P<X;P++)if(x[P](t,l,n,!0)){L=!0;break}if(L)break;if(f){if(h=of(t,l),h<0)break;s=t.bMarks[l]+t.tShift[l]}else if(h=rf(t,l),h<0)break;if(m!==t.src.charCodeAt(h-1))break}return f?u=t.push("ordered_list_close","ol",-1):u=t.push("bullet_list_close","ul",-1),u.markup=String.fromCharCode(m),b[1]=l,t.line=l,t.parentType=k,c&&Q3(t,g),!0}a(e6,"list");function t6(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 k=t.lineMax;if(x>=k||t.isEmpty(x))return null;let C=!1;if(t.sCount[x]-t.blkIndent>3&&(C=!0),t.sCount[x]<0&&(C=!0),!C){const S=t.md.block.ruler.getRules("reference"),T=t.parentType;t.parentType="reference";let D=!1;for(let _=0,z=S.length;_<z;_++)if(S[_](t,x,k,!0)){D=!0;break}if(t.parentType=T,D)return null}const w=t.bMarks[x]+t.tShift[x],E=t.eMarks[x];return t.src.slice(w,E+1)}a(u,"getNextLine");let l=t.src.slice(i,o+1);o=l.length;let c=-1;for(i=1;i<o;i++){const x=l.charCodeAt(i);if(x===91)return!1;if(x===93){c=i;break}else if(x===10){const k=u(s);k!==null&&(l+=k,o=l.length,s++)}else if(x===92&&(i++,i<o&&l.charCodeAt(i)===10)){const k=u(s);k!==null&&(l+=k,o=l.length,s++)}}if(c<0||l.charCodeAt(c+1)!==58)return!1;for(i=c+2;i<o;i++){const x=l.charCodeAt(i);if(x===10){const k=u(s);k!==null&&(l+=k,o=l.length,s++)}else if(!q(x))break}const d=t.md.helpers.parseLinkDestination(l,i,o);if(!d.ok)return!1;const f=t.md.normalizeLink(d.str);if(!t.md.validateLink(f))return!1;i=d.pos;const p=i,h=s,m=i;for(;i<o;i++){const x=l.charCodeAt(i);if(x===10){const k=u(s);k!==null&&(l+=k,o=l.length,s++)}else if(!q(x))break}let g=t.md.helpers.parseLinkTitle(l,i,o);for(;g.can_continue;){const x=u(s);if(x===null)break;l+=x,i=o,o=l.length,s++,g=t.md.helpers.parseLinkTitle(l,i,o,g)}let b;for(i<o&&m!==i&&g.ok?(b=g.str,i=g.pos):(b="",i=p,s=h);i<o;){const x=l.charCodeAt(i);if(!q(x))break;i++}if(i<o&&l.charCodeAt(i)!==10&&b)for(b="",i=p,s=h;i<o;){const x=l.charCodeAt(i);if(!q(x))break;i++}if(i<o&&l.charCodeAt(i)!==10)return!1;const y=Ds(l.slice(1,c));return y?(r||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[y]>"u"&&(t.env.references[y]={title:b,href:f}),t.line=s),!0):!1}a(t6,"reference");const n6=["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"],r6="[a-zA-Z_:][a-zA-Z0-9:._-]*",i6="[^\"'=<>`\\x00-\\x20]+",o6="'[^']*'",s6='"[^"]*"',u6="(?:"+i6+"|"+o6+"|"+s6+")",l6="(?:\\s+"+r6+"(?:\\s*=\\s*"+u6+")?)",E0="<[A-Za-z][A-Za-z0-9\\-]*"+l6+"*\\s*\\/?>",S0="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",a6="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",c6="<[?][\\s\\S]*?[?]>",d6="<![A-Za-z][^>]*>",f6="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",h6=new RegExp("^(?:"+E0+"|"+S0+"|"+a6+"|"+c6+"|"+d6+"|"+f6+")"),p6=new RegExp("^(?:"+E0+"|"+S0+")"),In=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+n6.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(p6.source+"\\s*$"),/^$/,!1]];function m6(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<In.length&&!In[u][0].test(s);u++);if(u===In.length)return!1;if(r)return In[u][2];let l=e+1;if(!In[u][1].test(s)){for(;l<n&&!(t.sCount[l]<t.blkIndent);l++)if(i=t.bMarks[l]+t.tShift[l],o=t.eMarks[l],s=t.src.slice(i,o),In[u][1].test(s)){s.length!==0&&l++;break}}t.line=l;const c=t.push("html_block","",0);return c.map=[e,l],c.content=t.getLines(e,l,t.blkIndent,!0),!0}a(m6,"html_block");function g6(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&&!q(s))return!1;if(r)return!0;o=t.skipSpacesBack(o,i);const l=t.skipCharsBack(o,35,i);l>i&&q(t.src.charCodeAt(l-1))&&(o=l),t.line=e+1;const c=t.push("heading_open","h"+String(u),1);c.markup="########".slice(0,u),c.map=[e,t.line];const d=t.push("inline","",0);d.content=t.src.slice(i,o).trim(),d.map=[e,t.line],d.children=[];const f=t.push("heading_close","h"+String(u),-1);return f.markup="########".slice(0,u),!0}a(g6,"heading");function b6(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 h=t.bMarks[u]+t.tShift[u];const m=t.eMarks[u];if(h<m&&(s=t.src.charCodeAt(h),(s===45||s===61)&&(h=t.skipChars(h,s),h=t.skipSpaces(h),h>=m))){o=s===61?1:2;break}}if(t.sCount[u]<0)continue;let p=!1;for(let h=0,m=r.length;h<m;h++)if(r[h](t,u,n,!0)){p=!0;break}if(p)break}if(!o)return!1;const l=t.getLines(e,u,t.blkIndent,!1).trim();t.line=u+1;const c=t.push("heading_open","h"+String(o),1);c.markup=String.fromCharCode(s),c.map=[e,t.line];const d=t.push("inline","",0);d.content=l,d.map=[e,t.line-1],d.children=[];const f=t.push("heading_close","h"+String(o),-1);return f.markup=String.fromCharCode(s),t.parentType=i,!0}a(b6,"lheading");function y6(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 c=!1;for(let d=0,f=r.length;d<f;d++)if(r[d](t,o,n,!0)){c=!0;break}if(c)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 l=t.push("inline","",0);return l.content=s,l.map=[e,t.line],l.children=[],t.push("paragraph_close","p",-1),t.parentType=i,!0}a(y6,"paragraph");const Bi=[["table",J3,["paragraph","reference"]],["code",G3],["fence",Z3,["paragraph","reference","blockquote","list"]],["blockquote",X3,["paragraph","reference","blockquote","list"]],["hr",Y3,["paragraph","reference","blockquote","list"]],["list",e6,["paragraph","reference","blockquote"]],["reference",t6],["html_block",m6,["paragraph","reference","blockquote"]],["heading",g6,["paragraph","reference","blockquote"]],["lheading",b6],["paragraph",y6]];function Os(){this.ruler=new Ce;for(let t=0;t<Bi.length;t++)this.ruler.push(Bi[t][0],Bi[t][1],{alt:(Bi[t][2]||[]).slice()})}a(Os,"ParserBlock");Os.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 l=t.line;let c=!1;for(let d=0;d<i;d++)if(c=r[d](t,s,n,!1),c){if(l>=t.line)throw new Error("block rule didn't increment state.line");break}if(!c)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)}};Os.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)};Os.prototype.State=ut;function Ci(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}a(Ci,"StateInline");Ci.prototype.pushPending=function(){const t=new je("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t};Ci.prototype.push=function(t,e,n){this.pending&&this.pushPending();const r=new je(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};Ci.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,l=hi(i)||fi(String.fromCharCode(i)),c=hi(u)||fi(String.fromCharCode(u)),d=di(i),f=di(u),p=!f&&(!c||d||l),h=!d&&(!l||f||c);return{can_open:p&&(e||!h||l),can_close:h&&(e||!p||c),length:s}};Ci.prototype.Token=je;function x6(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}}a(x6,"isTerminatorChar");function k6(t,e){let n=t.pos;for(;n<t.posMax&&!x6(t.src.charCodeAt(n));)n++;return n===t.pos?!1:(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}a(k6,"text");const w6=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function C6(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(w6);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 l=t.md.normalizeLink(u);if(!t.md.validateLink(l))return!1;if(!e){t.pending=t.pending.slice(0,-o.length);const c=t.push("link_open","a",1);c.attrs=[["href",l]],c.markup="linkify",c.info="auto";const d=t.push("text","",0);d.content=t.md.normalizeLinkText(u);const f=t.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return t.pos+=u.length-o.length,!0}a(C6,"linkify");function E6(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&&q(t.src.charCodeAt(n));)n++;return t.pos=n,!0}a(E6,"newline");const Sa=[];for(let t=0;t<256;t++)Sa.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){Sa[t.charCodeAt(0)]=1});function S6(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),!!q(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&&Sa[i]!==0?u.content=o:u.content=s,u.markup=s,u.info="escape"}return t.pos=n+1,!0}a(S6,"escape");function v6(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 l=n,c;for(;(c=t.src.indexOf("`",l))!==-1;){for(l=c+1;l<o&&t.src.charCodeAt(l)===96;)l++;const d=l-c;if(d===u){if(!e){const f=t.push("code_inline","code",0);f.markup=s,f.content=t.src.slice(n,c).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=l,!0}t.backticks[d]=c}return t.backticksScanned=!0,e||(t.pending+=s),t.pos+=u,!0}a(v6,"backtick");function A6(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 l=0;l<o;l+=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}a(A6,"strikethrough_tokenize");function sf(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)}}a(sf,"postProcess$1");function M6(t){const e=t.tokens_meta,n=t.tokens_meta.length;sf(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&sf(t,e[r].delimiters)}a(M6,"strikethrough_postProcess");const v0={tokenize:A6,postProcess:M6};function T6(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}a(T6,"emphasis_tokenize");function uf(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),l=t.tokens[i.token];l.type=s?"strong_open":"em_open",l.tag=s?"strong":"em",l.nesting=1,l.markup=s?u+u:u,l.content="";const c=t.tokens[o.token];c.type=s?"strong_close":"em_close",c.tag=s?"strong":"em",c.nesting=-1,c.markup=s?u+u:u,c.content="",s&&(t.tokens[e[r-1].token].content="",t.tokens[e[i.end+1].token].content="",r--)}}a(uf,"postProcess");function D6(t){const e=t.tokens_meta,n=t.tokens_meta.length;uf(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&uf(t,e[r].delimiters)}a(D6,"emphasis_post_process");const A0={tokenize:T6,postProcess:D6};function O6(t,e){let n,r,i,o,s="",u="",l=t.pos,c=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;const d=t.pos,f=t.posMax,p=t.pos+1,h=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(h<0)return!1;let m=h+1;if(m<f&&t.src.charCodeAt(m)===40){for(c=!1,m++;m<f&&(n=t.src.charCodeAt(m),!(!q(n)&&n!==10));m++);if(m>=f)return!1;if(l=m,i=t.md.helpers.parseLinkDestination(t.src,m,t.posMax),i.ok){for(s=t.md.normalizeLink(i.str),t.md.validateLink(s)?m=i.pos:s="",l=m;m<f&&(n=t.src.charCodeAt(m),!(!q(n)&&n!==10));m++);if(i=t.md.helpers.parseLinkTitle(t.src,m,t.posMax),m<f&&l!==m&&i.ok)for(u=i.str,m=i.pos;m<f&&(n=t.src.charCodeAt(m),!(!q(n)&&n!==10));m++);}(m>=f||t.src.charCodeAt(m)!==41)&&(c=!0),m++}if(c){if(typeof t.env.references>"u")return!1;if(m<f&&t.src.charCodeAt(m)===91?(l=m+1,m=t.md.helpers.parseLinkLabel(t,m),m>=0?r=t.src.slice(l,m++):m=h+1):m=h+1,r||(r=t.src.slice(p,h)),o=t.env.references[Ds(r)],!o)return t.pos=d,!1;s=o.href,u=o.title}if(!e){t.pos=p,t.posMax=h;const g=t.push("link_open","a",1),b=[["href",s]];g.attrs=b,u&&b.push(["title",u]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=m,t.posMax=f,!0}a(O6,"link");function _6(t,e){let n,r,i,o,s,u,l,c,d="";const f=t.pos,p=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const h=t.pos+2,m=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(m<0)return!1;if(o=m+1,o<p&&t.src.charCodeAt(o)===40){for(o++;o<p&&(n=t.src.charCodeAt(o),!(!q(n)&&n!==10));o++);if(o>=p)return!1;for(c=o,u=t.md.helpers.parseLinkDestination(t.src,o,t.posMax),u.ok&&(d=t.md.normalizeLink(u.str),t.md.validateLink(d)?o=u.pos:d=""),c=o;o<p&&(n=t.src.charCodeAt(o),!(!q(n)&&n!==10));o++);if(u=t.md.helpers.parseLinkTitle(t.src,o,t.posMax),o<p&&c!==o&&u.ok)for(l=u.str,o=u.pos;o<p&&(n=t.src.charCodeAt(o),!(!q(n)&&n!==10));o++);else l="";if(o>=p||t.src.charCodeAt(o)!==41)return t.pos=f,!1;o++}else{if(typeof t.env.references>"u")return!1;if(o<p&&t.src.charCodeAt(o)===91?(c=o+1,o=t.md.helpers.parseLinkLabel(t,o),o>=0?i=t.src.slice(c,o++):o=m+1):o=m+1,i||(i=t.src.slice(h,m)),s=t.env.references[Ds(i)],!s)return t.pos=f,!1;d=s.href,l=s.title}if(!e){r=t.src.slice(h,m);const g=[];t.md.inline.parse(r,t.md,t.env,g);const b=t.push("image","img",0),y=[["src",d],["alt",""]];b.attrs=y,b.children=g,b.content=r,l&&y.push(["title",l])}return t.pos=o,t.posMax=p,!0}a(_6,"image");const N6=/^([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])?)*)$/,I6=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function R6(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(I6.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 l=t.push("text","",0);l.content=t.md.normalizeLinkText(o);const c=t.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return t.pos+=o.length+2,!0}if(N6.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 l=t.push("text","",0);l.content=t.md.normalizeLinkText(o);const c=t.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return t.pos+=o.length+2,!0}return!1}a(R6,"autolink");function F6(t){return/^<a[>\s]/i.test(t)}a(F6,"isLinkOpen");function L6(t){return/^<\/a\s*>/i.test(t)}a(L6,"isLinkClose");function P6(t){const e=t|32;return e>=97&&e<=122}a(P6,"isLetter");function B6(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&&!P6(i))return!1;const o=t.src.slice(r).match(h6);if(!o)return!1;if(!e){const s=t.push("html_inline","",0);s.content=o[0],F6(s.content)&&t.linkLevel++,L6(s.content)&&t.linkLevel--}return t.pos+=o[0].length,!0}a(B6,"html_inline");const z6=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,$6=/^&([a-z][a-z0-9]{1,31});/i;function H6(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(z6);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=Ca(s)?Zo(s):Zo(65533),u.markup=o[0],u.info="entity"}return t.pos+=o[0].length,!0}}else{const o=t.src.slice(n).match($6);if(o){const s=y0(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}a(H6,"entity");function lf(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 l=e[u.marker][(u.open?3:0)+u.length%3];let c=r-o[r]-1,d=c;for(;c>l;c-=o[c]+1){const f=t[c];if(f.marker===u.marker&&f.open&&f.end<0){let p=!1;if((f.close||u.open)&&(f.length+u.length)%3===0&&(f.length%3!==0||u.length%3!==0)&&(p=!0),!p){const h=c>0&&!t[c-1].open?o[c-1]+1:0;o[s]=s-c+h,o[c]=h,u.open=!1,f.end=s,f.close=!1,d=-1,i=-2;break}}}d!==-1&&(e[u.marker][(u.open?3:0)+(u.length||0)%3]=d)}}a(lf,"processDelimiters");function V6(t){const e=t.tokens_meta,n=t.tokens_meta.length;lf(t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&lf(e[r].delimiters)}a(V6,"link_pairs");function j6(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)}a(j6,"fragments_join");const fu=[["text",k6],["linkify",C6],["newline",E6],["escape",S6],["backticks",v6],["strikethrough",v0.tokenize],["emphasis",A0.tokenize],["link",O6],["image",_6],["autolink",R6],["html_inline",B6],["entity",H6]],hu=[["balance_pairs",V6],["strikethrough",v0.postProcess],["emphasis",A0.postProcess],["fragments_join",j6]];function Ei(){this.ruler=new Ce;for(let t=0;t<fu.length;t++)this.ruler.push(fu[t][0],fu[t][1]);this.ruler2=new Ce;for(let t=0;t<hu.length;t++)this.ruler2.push(hu[t][0],hu[t][1])}a(Ei,"ParserInline");Ei.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};Ei.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()};Ei.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)};Ei.prototype.State=Ci;function q6(t){const e={};t=t||{},e.src_Any=h0.source,e.src_Cc=p0.source,e.src_Z=g0.source,e.src_P=ka.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}a(q6,"reFactory");function yl(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}a(yl,"assign");function _s(t){return Object.prototype.toString.call(t)}a(_s,"_class");function U6(t){return _s(t)==="[object String]"}a(U6,"isString");function W6(t){return _s(t)==="[object Object]"}a(W6,"isObject");function K6(t){return _s(t)==="[object RegExp]"}a(K6,"isRegExp");function af(t){return _s(t)==="[object Function]"}a(af,"isFunction");function J6(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(J6,"escapeRE");const M0={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function G6(t){return Object.keys(t||{}).reduce(function(e,n){return e||M0.hasOwnProperty(n)},!1)}a(G6,"isOptionsObj");const Z6={"http:":{validate:a(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},"validate")},"https:":"http:","ftp:":"http:","//":{validate:a(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},"validate")},"mailto:":{validate:a(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},"validate")}},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]",Y6="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Q6(t){t.__index__=-1,t.__text_cache__=""}a(Q6,"resetScanCache");function ew(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}a(ew,"createValidator");function cf(){return function(t,e){e.normalize(t)}}a(cf,"createNormalizer");function Xo(t){const e=t.re=q6(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)}a(r,"untpl"),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,l){throw new Error('(LinkifyIt) Invalid schema "'+u+'": '+l)}a(o,"schemaError"),Object.keys(t.__schemas__).forEach(function(u){const l=t.__schemas__[u];if(l===null)return;const c={validate:null,link:null};if(t.__compiled__[u]=c,W6(l)){K6(l.validate)?c.validate=ew(l.validate):af(l.validate)?c.validate=l.validate:o(u,l),af(l.normalize)?c.normalize=l.normalize:l.normalize?o(u,l):c.normalize=cf();return}if(U6(l)){i.push(u);return}o(u,l)}),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:cf()};const s=Object.keys(t.__compiled__).filter(function(u){return u.length>0&&t.__compiled__[u]}).map(J6).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"),Q6(t)}a(Xo,"compile");function tw(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}a(tw,"Match");function xl(t,e){const n=new tw(t,e);return t.__compiled__[n.schema].normalize(n,t),n}a(xl,"createMatch");function Me(t,e){if(!(this instanceof Me))return new Me(t,e);e||G6(t)&&(e=t,t={}),this.__opts__=yl({},M0,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=yl({},Z6,t),this.__compiled__={},this.__tlds__=Y6,this.__tlds_replaced__=!1,this.re={},Xo(this)}a(Me,"LinkifyIt");Me.prototype.add=a(function(e,n){return this.__schemas__[e]=n,Xo(this),this},"add");Me.prototype.set=a(function(e){return this.__opts__=yl(this.__opts__,e),this},"set");Me.prototype.test=a(function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let n,r,i,o,s,u,l,c,d;if(this.re.schema_test.test(e)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(e))!==null;)if(o=this.testSchemaAt(e,n[2],l.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:"]&&(c=e.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<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:"]&&(d=e.indexOf("@"),d>=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},"test");Me.prototype.pretest=a(function(e){return this.re.pretest.test(e)},"pretest");Me.prototype.testSchemaAt=a(function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0},"testSchemaAt");Me.prototype.match=a(function(e){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===e&&(n.push(xl(this,r)),r=this.__last_index__);let i=r?e.slice(r):e;for(;this.test(i);)n.push(xl(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null},"match");Me.prototype.matchAtStart=a(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,xl(this,0)):null},"matchAtStart");Me.prototype.tlds=a(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(),Xo(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Xo(this),this)},"tlds");Me.prototype.normalize=a(function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)},"normalize");Me.prototype.onCompile=a(function(){},"onCompile");const jn=2147483647,Ye=36,va=1,pi=26,nw=38,rw=700,T0=72,D0=128,O0="-",iw=/^xn--/,ow=/[^\0-\x7F]/,sw=/[\x2E\u3002\uFF0E\uFF61]/g,uw={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},pu=Ye-va,Qe=Math.floor,mu=String.fromCharCode;function Ot(t){throw new RangeError(uw[t])}a(Ot,"error");function lw(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}a(lw,"map");function _0(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(sw,".");const i=t.split("."),o=lw(i,e).join(".");return r+o}a(_0,"mapDomain");function N0(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}a(N0,"ucs2decode");const aw=a(t=>String.fromCodePoint(...t),"ucs2encode"),cw=a(function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:Ye},"basicToDigit"),df=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),I0=a(function(t,e,n){let r=0;for(t=n?Qe(t/rw):t>>1,t+=Qe(t/e);t>pu*pi>>1;r+=Ye)t=Qe(t/pu);return Qe(r+(pu+1)*t/(t+nw))},"adapt"),R0=a(function(t){const e=[],n=t.length;let r=0,i=D0,o=T0,s=t.lastIndexOf(O0);s<0&&(s=0);for(let u=0;u<s;++u)t.charCodeAt(u)>=128&&Ot("not-basic"),e.push(t.charCodeAt(u));for(let u=s>0?s+1:0;u<n;){const l=r;for(let d=1,f=Ye;;f+=Ye){u>=n&&Ot("invalid-input");const p=cw(t.charCodeAt(u++));p>=Ye&&Ot("invalid-input"),p>Qe((jn-r)/d)&&Ot("overflow"),r+=p*d;const h=f<=o?va:f>=o+pi?pi:f-o;if(p<h)break;const m=Ye-h;d>Qe(jn/m)&&Ot("overflow"),d*=m}const c=e.length+1;o=I0(r-l,c,l==0),Qe(r/c)>jn-i&&Ot("overflow"),i+=Qe(r/c),r%=c,e.splice(r++,0,i)}return String.fromCodePoint(...e)},"decode"),F0=a(function(t){const e=[];t=N0(t);const n=t.length;let r=D0,i=0,o=T0;for(const l of t)l<128&&e.push(mu(l));const s=e.length;let u=s;for(s&&e.push(O0);u<n;){let l=jn;for(const d of t)d>=r&&d<l&&(l=d);const c=u+1;l-r>Qe((jn-i)/c)&&Ot("overflow"),i+=(l-r)*c,r=l;for(const d of t)if(d<r&&++i>jn&&Ot("overflow"),d===r){let f=i;for(let p=Ye;;p+=Ye){const h=p<=o?va:p>=o+pi?pi:p-o;if(f<h)break;const m=f-h,g=Ye-h;e.push(mu(df(h+m%g,0))),f=Qe(m/g)}e.push(mu(df(f,0))),o=I0(i,c,u===s),i=0,++u}++i,++r}return e.join("")},"encode"),dw=a(function(t){return _0(t,function(e){return iw.test(e)?R0(e.slice(4).toLowerCase()):e})},"toUnicode"),fw=a(function(t){return _0(t,function(e){return ow.test(e)?"xn--"+F0(e):e})},"toASCII"),L0={version:"2.3.1",ucs2:{decode:N0,encode:aw},decode:R0,encode:F0,toASCII:fw,toUnicode:dw},hw={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},pw={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"]}}},mw={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"]}}},gw={default:hw,zero:pw,commonmark:mw},bw=/^(vbscript|javascript|file|data):/,yw=/^data:image\/(gif|png|jpeg|webp);/;function xw(t){const e=t.trim().toLowerCase();return bw.test(e)?yw.test(e):!0}a(xw,"validateLink");const P0=["http:","https:","mailto:"];function kw(t){const e=xa(t,!0);if(e.hostname&&(!e.protocol||P0.indexOf(e.protocol)>=0))try{e.hostname=L0.toASCII(e.hostname)}catch{}return wi(ya(e))}a(kw,"normalizeLink");function ww(t){const e=xa(t,!0);if(e.hostname&&(!e.protocol||P0.indexOf(e.protocol)>=0))try{e.hostname=L0.toUnicode(e.hostname)}catch{}return xr(ya(e),xr.defaultChars+"%")}a(ww,"normalizeLinkText");function Ee(t,e){if(!(this instanceof Ee))return new Ee(t,e);e||wa(t)||(e=t||{},t="default"),this.inline=new Ei,this.block=new Os,this.core=new Ea,this.renderer=new Er,this.linkify=new Me,this.validateLink=xw,this.normalizeLink=kw,this.normalizeLinkText=ww,this.utils=E3,this.helpers=Ts({},M3),this.options={},this.configure(t),e&&this.set(e)}a(Ee,"MarkdownIt");Ee.prototype.set=function(t){return Ts(this.options,t),this};Ee.prototype.configure=function(t){const e=this;if(wa(t)){const n=t;if(t=gw[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};Ee.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};Ee.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};Ee.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};Ee.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};Ee.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};Ee.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};Ee.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const Cw=new Yr({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:a(t=>({params:t.getAttribute("data-params")||""}),"getAttrs")}],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:a(t=>({tight:t.hasAttribute("data-tight")}),"getAttrs")}],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:a(t=>t.type.name=="em","clearMark")}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:a(t=>t.style.fontWeight!="normal"&&null,"getAttrs")},{style:"font-weight=400",clearMark:a(t=>t.type.name=="strong","clearMark")},{style:"font-weight",getAttrs:a(t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null,"getAttrs")}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){return["a",t.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function Ew(t,e){if(t.isText&&e.isText&&B.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}a(Ew,"maybeMerge");const uc=class uc{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:B.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=Ew(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:B.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}};a(uc,"MarkdownParseState");let kl=uc;function Dr(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}a(Dr,"attrs");function gu(t,e){return t.noCloseToken||e=="code_inline"||e=="code_block"||e=="fence"}a(gu,"noCloseToken");function ff(t){return t[t.length-1]==`
|
|
154
|
+
`?t.slice(0,t.length-1):t}a(ff,"withoutTrailingNewline");function bu(){}a(bu,"noOp");function Sw(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);gu(i,r)?n[r]=(s,u,l,c)=>{s.openNode(o,Dr(i,u,l,c)),s.addText(ff(u.content)),s.closeNode()}:(n[r+"_open"]=(s,u,l,c)=>s.openNode(o,Dr(i,u,l,c)),n[r+"_close"]=s=>s.closeNode())}else if(i.node){let o=t.nodeType(i.node);n[r]=(s,u,l,c)=>s.addNode(o,Dr(i,u,l,c))}else if(i.mark){let o=t.marks[i.mark];gu(i,r)?n[r]=(s,u,l,c)=>{s.openMark(o.create(Dr(i,u,l,c))),s.addText(ff(u.content)),s.closeMark(o)}:(n[r+"_open"]=(s,u,l,c)=>s.openMark(o.create(Dr(i,u,l,c))),n[r+"_close"]=s=>s.closeMark(o))}else if(i.ignore)gu(i,r)?n[r]=bu:(n[r+"_open"]=bu,n[r+"_close"]=bu);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}a(Sw,"tokenHandlers");var nr;let vw=(nr=class{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=Sw(e,r)}parse(e,n={}){let r=new kl(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()}},a(nr,"MarkdownParser"),nr);function hf(t,e){for(;++e<t.length;)if(t[e].type!="list_item_open")return t[e].hidden;return!1}a(hf,"listIsTight");new vw(Cw,Ee("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:a((t,e,n)=>({tight:hf(e,n)}),"getAttrs")},ordered_list:{block:"ordered_list",getAttrs:a((t,e,n)=>({order:+t.attrGet("start")||1,tight:hf(e,n)}),"getAttrs")},heading:{block:"heading",getAttrs:a(t=>({level:+t.tag.slice(1)}),"getAttrs")},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:a(t=>({params:t.info||""}),"getAttrs"),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:a(t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null}),"getAttrs")},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:a(t=>({href:t.attrGet("href"),title:t.attrGet("title")||null}),"getAttrs")},code_inline:{mark:"code",noCloseToken:!0}});const Aw={open:"",close:"",mixable:!0};var rr;let Mw=(rr=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 B0(this.nodes,this.marks,n);return r.renderContent(e),r.out}},a(rr,"MarkdownSerializer"),rr);const lt=new Mw({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||"")+`
|
|
155
|
+
`),t.text(e.textContent,!1),t.write(`
|
|
156
|
+
`),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("]/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(`\\
|
|
157
|
+
`);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=Tw(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 pf(n.child(r),-1)},close(t,e,n,r){return pf(n.child(r-1),1)},escape:!1}});function pf(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}a(pf,"backticksFor");function Tw(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)}a(Tw,"isPlainURL");var ir;let B0=(ir=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+=`
|
|
158
|
+
`),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+`
|
|
159
|
+
`}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=Aw}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+=`
|
|
160
|
+
`)}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(`
|
|
161
|
+
`);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+=`
|
|
162
|
+
`)}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=a((s,u,l)=>{let c=s?s.marks:[];s&&s.type.name===this.options.hardBreakNodeName&&(c=c.filter(g=>{if(l+1==e.childCount)return!1;let b=e.child(l+1);return g.isInSet(b.marks)&&(!b.isText||/\S/.test(b.text))}));let d=i;if(i="",s&&s.isText&&c.some(g=>{let b=this.getMark(g.type.name);return b&&b.expelEnclosingWhitespace&&!g.isInSet(r)})){let[g,b,y]=/^(\s*)(.*)$/m.exec(s.text);b&&(d+=b,s=y?s.withText(y):null,s||(c=r))}if(s&&s.isText&&c.some(g=>{let b=this.getMark(g.type.name);return b&&b.expelEnclosingWhitespace&&(l==e.childCount-1||!g.isInSet(e.child(l+1).marks))})){let[g,b,y]=/^(.*?)(\s*)$/m.exec(s.text);y&&(i=y,s=b?s.withText(b):null,s||(c=r))}let f=c.length?c[c.length-1]:null,p=f&&this.getMark(f.type.name).escape===!1,h=c.length-(p?1:0);e:for(let g=0;g<h;g++){let b=c[g];if(!this.getMark(b.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(b.eq(x)){g>y?c=c.slice(0,y).concat(b).concat(c.slice(y,g)).concat(c.slice(g+1,h)):y>g&&(c=c.slice(0,g).concat(c.slice(g+1,y)).concat(b).concat(c.slice(y,h)));continue e}}}let m=0;for(;m<Math.min(r.length,h)&&c[m].eq(r[m]);)++m;for(;m<r.length;)this.text(this.markString(r.pop(),!1,e,l),!1);if(d&&this.text(d),s){for(;r.length<h;){let g=c[r.length];r.push(g),this.text(this.markString(g,!0,e,l),!1),this.atBlockStart=!1}p&&s.isText?this.text(this.markString(f,!0,e,l)+s.text+this.markString(f,!1,e,l+1),!1):this.render(s,e,l),this.atBlockStart=!1}s?.isText&&s.nodeSize>0&&(this.atBlockStart=!1)},"progress");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,l)=>{l&&i&&this.flushClose(1),this.wrapBlock(n,r(l),e,()=>this.render(s,e,l))}),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]}}},a(ir,"MarkdownSerializerState"),ir);var yu,mf;function Dw(){if(mf)return yu;mf=1;var t=!0,e=!1,n=!1;yu=a(function(g,b){b&&(t=!b.enabled,e=!!b.label,n=!!b.labelAfter),g.core.ruler.after("inline","github-task-lists",function(y){for(var x=y.tokens,k=2;k<x.length;k++)o(x,k)&&(s(x[k],y.Token),r(x[k-2],"class","task-list-item"+(t?"":" enabled")),r(x[i(x,k-2)],"class","contains-task-list"))})},"markdownItTaskLists");function r(g,b,y){var x=g.attrIndex(b),k=[b,y];x<0?g.attrPush(k):g.attrs[x]=k}a(r,"attrSet");function i(g,b){for(var y=g[b].level-1,x=b-1;x>=0;x--)if(g[x].level===y)return x;return-1}a(i,"parentToken");function o(g,b){return f(g[b])&&p(g[b-1])&&h(g[b-2])&&m(g[b])}a(o,"isTodoItem");function s(g,b){if(g.children.unshift(u(g,b)),g.children[1].content=g.children[1].content.slice(3),g.content=g.content.slice(3),e)if(n){g.children.pop();var y="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);g.children[0].content=g.children[0].content.slice(0,-1)+' id="'+y+'">',g.children.push(d(g.content,y,b))}else g.children.unshift(l(b)),g.children.push(c(b))}a(s,"todoify");function u(g,b){var y=new b("html_inline","",0),x=t?' disabled="" ':"";return g.content.indexOf("[ ] ")===0?y.content='<input class="task-list-item-checkbox"'+x+'type="checkbox">':(g.content.indexOf("[x] ")===0||g.content.indexOf("[X] ")===0)&&(y.content='<input class="task-list-item-checkbox" checked=""'+x+'type="checkbox">'),y}a(u,"makeCheckbox");function l(g){var b=new g("html_inline","",0);return b.content="<label>",b}a(l,"beginLabel");function c(g){var b=new g("html_inline","",0);return b.content="</label>",b}a(c,"endLabel");function d(g,b,y){var x=new y("html_inline","",0);return x.content='<label class="task-list-item-label" for="'+b+'">'+g+"</label>",x.attrs=[{for:b}],x}a(d,"afterLabel");function f(g){return g.type==="inline"}a(f,"isInline");function p(g){return g.type==="paragraph_open"}a(p,"isParagraph");function h(g){return g.type==="list_item_open"}a(h,"isListItem");function m(g){return g.content.indexOf("[ ] ")===0||g.content.indexOf("[x] ")===0||g.content.indexOf("[X] ")===0}return a(m,"startsWithTodoMarkdown"),yu}a(Dw,"requireMarkdownItTaskLists");var Ow=Dw();const _w=cm(Ow);var Nw=Object.defineProperty,Iw=a((t,e,n)=>e in t?Nw(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,"__defNormalProp"),Yo=a((t,e,n)=>(Iw(t,typeof e!="symbol"?e+"":e,n),n),"__publicField");const Rw=K.create({name:"markdownTightLists",addOptions:a(()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),"addOptions"),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:a(t=>t.getAttribute("data-tight")==="true"||!t.querySelector("p"),"parseHTML"),renderHTML:a(t=>({class:t.tight?this.options.tightClass:null,"data-tight":t.tight?"true":null}),"renderHTML")}}}]},addCommands(){var t=this;return{toggleTight:a(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 a(o,"toggleTight"),t.options.listTypes.some(s=>o(s))}},"toggleTight")}}}),gf=Ee();function z0(t,e){return gf.inline.State.prototype.scanDelims.call({src:t,posMax:t.length}),new gf.inline.State(t,null,null,[]).scanDelims(e,!0)}a(z0,"scanDelims");function $0(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}a($0,"shiftDelim");function Fw(t,e,n,r){let i=n,o=t;for(;i<r&&!z0(o,i).can_open;)o=$0(o,e,i,1),i++;return{text:o,from:i,to:r}}a(Fw,"trimStart");function Lw(t,e,n,r){let i=r,o=t;for(;i>n&&!z0(o,i).can_close;)o=$0(o,e,i,-1),i--;return{text:o,from:n,to:i}}a(Lw,"trimEnd");function Pw(t,e,n,r){let i={text:t,from:n,to:r};return i=Fw(i.text,e,i.from,i.to),i=Lw(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}a(Pw,"trimInline");const lc=class lc extends B0{constructor(e,n,r){super(e,n,r??{}),Yo(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=Pw(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}}};a(lc,"MarkdownSerializerState");let wl=lc;const H0=Te.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(t,e){var n,r;return this.editor.storage.markdown.options.html?(n=(r=bf(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=bf(e))===null||r===void 0?void 0:r[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function bf(t){const e=t.type.schema,n=e.text(" ",[t]),i=yi(A.from(n),e).match(/^(<.*?>) (<\/.*?>)$/);return i?[i[1],i[2]]:null}a(bf,"getMarkTags");function Aa(t){const e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}a(Aa,"elementFromString");function Bw(t){return t?.replace(/</g,"<").replace(/>/g,">")}a(Bw,"escapeHTML");function zw(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()}a(zw,"extractElement");function $w(t){const e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}a($w,"unwrapElement");const Ns=H.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(t,e,n){this.editor.storage.markdown.options.html?t.write(Hw(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 Hw(t,e){const n=t.type.schema,r=yi(A.from(t),n);return t.isBlock&&(e instanceof A||e.type.name===n.topNodeType.name)?Vw(r):r}a(Hw,"serializeHTML");function Vw(t){const n=Aa(t).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
|
|
163
|
+
${n.innerHTML}
|
|
164
|
+
`:`
|
|
165
|
+
`,n.outerHTML}a(Vw,"formatBlock");const jw=H.create({name:"blockquote"}),qw=jw.extend({addStorage(){return{markdown:{serialize:lt.nodes.blockquote,parse:{}}}}}),Uw=H.create({name:"bulletList"}),V0=Uw.extend({addStorage(){return{markdown:{serialize(t,e){return t.renderList(e," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),Ww=H.create({name:"codeBlock"}),Kw=Ww.extend({addStorage(){return{markdown:{serialize(t,e){t.write("```"+(e.attrs.language||"")+`
|
|
166
|
+
`),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>")}}}}}}),Jw=H.create({name:"hardBreak"}),j0=Jw.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?Ns.storage.markdown.serialize.call(this,t,e,n):`\\
|
|
167
|
+
`);return}},parse:{}}}}}),Gw=H.create({name:"heading"}),Zw=Gw.extend({addStorage(){return{markdown:{serialize:lt.nodes.heading,parse:{}}}}}),Xw=H.create({name:"horizontalRule"}),Yw=Xw.extend({addStorage(){return{markdown:{serialize:lt.nodes.horizontal_rule,parse:{}}}}}),Qw=H.create({name:"image"}),eC=Qw.extend({addStorage(){return{markdown:{serialize:lt.nodes.image,parse:{}}}}}),tC=H.create({name:"listItem"}),nC=tC.extend({addStorage(){return{markdown:{serialize:lt.nodes.list_item,parse:{}}}}}),rC=H.create({name:"orderedList"});function iC(t,e,n){let r=0;for(;n-r>0&&e.child(n-r-1).type.name===t.type.name;r++);return r}a(iC,"findIndexOfAdjacentNode");const oC=rC.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),l=iC(e,n,r)%2?") ":". ";t.renderList(e,s,c=>{const d=String(i+c);return t.repeat(" ",o-d.length)+d+l})},parse:{}}}}}),sC=H.create({name:"paragraph"}),uC=sC.extend({addStorage(){return{markdown:{serialize:lt.nodes.paragraph,parse:{}}}}});function xu(t){var e,n;return(e=t==null||(n=t.content)===null||n===void 0?void 0:n.content)!==null&&e!==void 0?e:[]}a(xu,"childNodes");const lC=H.create({name:"table"}),aC=lC.extend({addStorage(){return{markdown:{serialize(t,e,n){if(!cC(e)){Ns.storage.markdown.serialize.call(this,t,e,n);return}t.inTable=!0,e.forEach((r,i,o)=>{if(t.write("| "),r.forEach((s,u,l)=>{l&&t.write(" | ");const c=s.firstChild;c.textContent.trim()&&t.renderInline(c)}),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 yf(t){return t.attrs.colspan>1||t.attrs.rowspan>1}a(yf,"hasSpan");function cC(t){const e=xu(t),n=e[0],r=e.slice(1);return!(xu(n).some(i=>i.type.name!=="tableHeader"||yf(i)||i.childCount>1)||r.some(i=>xu(i).some(o=>o.type.name==="tableHeader"||yf(o)||o.childCount>1)))}a(cC,"isMarkdownSerializable");const dC=H.create({name:"taskItem"}),fC=dC.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())})}}}}}}),hC=H.create({name:"taskList"}),pC=hC.extend({addStorage(){return{markdown:{serialize:V0.storage.markdown.serialize,parse:{setup(t){t.use(_w)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),mC=H.create({name:"text"}),gC=mC.extend({addStorage(){return{markdown:{serialize(t,e){t.text(Bw(e.text))},parse:{}}}}}),bC=Te.create({name:"bold"}),yC=bC.extend({addStorage(){return{markdown:{serialize:lt.marks.strong,parse:{}}}}}),xC=Te.create({name:"code"}),kC=xC.extend({addStorage(){return{markdown:{serialize:lt.marks.code,parse:{}}}}}),wC=Te.create({name:"italic"}),CC=wC.extend({addStorage(){return{markdown:{serialize:lt.marks.em,parse:{}}}}}),EC=Te.create({name:"link"}),SC=EC.extend({addStorage(){return{markdown:{serialize:lt.marks.link,parse:{}}}}}),vC=Te.create({name:"strike"}),AC=vC.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),MC=[qw,V0,Kw,j0,Zw,Yw,Ns,eC,nC,oC,uC,aC,fC,pC,gC,yC,kC,H0,CC,SC,AC];function Qo(t){var e,n;const r=(e=t.storage)===null||e===void 0?void 0:e.markdown,i=(n=MC.find(o=>o.name===t.name))===null||n===void 0?void 0:n.storage.markdown;return r||i?{...i,...r}:null}a(Qo,"getMarkdownSpec");const ac=class ac{constructor(e){Yo(this,"editor",null),this.editor=e}serialize(e){const n=new wl(this.nodes,this.marks,{hardBreakNodeName:j0.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(Ns)])),...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(H0)])),...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=Qo(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=Qo(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}};a(ac,"MarkdownSerializer");let Cl=ac;const cc=class cc{constructor(e,n){Yo(this,"editor",null),Yo(this,"md",null);let{html:r,linkify:i,breaks:o}=n;this.editor=e,this.md=this.withPatchedRenderer(Ee({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=Qo(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=Aa(r);return this.editor.extensionManager.extensions.forEach(o=>{var s;return(s=Qo(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")&&zw(i)})}normalizeInline(e,n){var r;if((r=e.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var i,o,s,u;const l=e.firstElementChild,{nextElementSibling:c}=l,d=(i=(o=n.match(/^\s+/))===null||o===void 0?void 0:o[0])!==null&&i!==void 0?i:"",f=c?"":(s=(u=n.match(/\s+$/))===null||u===void 0?void 0:u[0])!==null&&s!==void 0?s:"";if(n.match(/^\n\n/)){l.innerHTML=`${l.innerHTML}${f}`;return}$w(l),e.innerHTML=`${d}${e.innerHTML}${f}`}}withPatchedRenderer(e){const n=a(r=>function(){const i=r(...arguments);return i===`
|
|
168
|
+
`?i:i[i.length-1]===`
|
|
169
|
+
`?i.slice(0,-1):i},"withoutNewLine");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}};a(cc,"MarkdownParser");let El=cc;const TC=K.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new V({key:new U("markdownClipboard"),props:{clipboardTextParser:a((t,e,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(t,{inline:!0});return $t.fromSchema(this.editor.schema).parseSlice(Aa(r),{preserveWhitespace:!0,context:e})},"clipboardTextParser"),clipboardTextSerializer:a(t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null,"clipboardTextSerializer")}})]}}),DC=K.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=rp.Commands.config.addCommands();return{setContent:a((e,n)=>r=>t.setContent(r.editor.storage.markdown.parser.parse(e),n)(r),"setContent"),insertContentAt:a((e,n,r)=>i=>t.insertContentAt(e,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i),"insertContentAt")}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new El(this.editor,this.options),serializer:new Cl(this.editor),getMarkdown:a(()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc),"getMarkdown")},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[Rw.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),TC.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});var OC=vx,_C=Object.defineProperty,NC=Object.getOwnPropertyDescriptor,Sr=a((t,e,n,r)=>{for(var i=r>1?void 0:r?NC(e,n):e,o=t.length-1,s;o>=0;o--)(s=t[o])&&(i=(r?s(e,n,i):s(i))||i);return r&&i&&_C(e,n,i),i},"__decorateClass"),or;let Zt=(or=class extends am{outputFormat="markdown";defaultButtonsTheme="pink";activeButtonsTheme="purple";placeholder="";components={EditorContent:_x,BubbleMenu:Fk,VSTButton:tm,VSTStringField:em,NoSymbolIcon:dm};editor=void 0;isEditable=!0;showMenu=!0;vstTextId="";showLinkModal=!1;linkUrl="";beforeMount(){this.vstTextId=`vst-text-field-${this.VST.generateRandomKey()}`}mounted(){this.value=this.modelValue||this.inputValue||"",this.editor=new Ox({extensions:[Dx,OC.configure({placeholder:this.placeholder?this.placeholder:"Введите текст"}),Ep.configure({openOnClick:!1,autolink:!0,defaultProtocol:"https"}),DC.configure({html:!0,breaks:!0,linkify:!0,transformPastedText:!0,transformCopiedText:this.outputFormat==="markdown"})],content:this.value})}getValue(){return this.outputFormat==="markdown"?this.editor.storage.markdown.getMarkdown():this.editor.getHTML()}addLink(){this.editor.chain().focus().setLink({href:this.linkUrl}).run(),this.showLinkModal=!1,this.linkUrl=""}beforeUnmount(){}getListVirtualElement(){const e=this.editor,n=bi(r=>r.type.name==="bulletList"||r.type.name==="orderedList")(e.state.selection);if(n){const r=Zl(e.view,n.start,n.start+n.node.nodeSize);return{getBoundingClientRect:a(()=>r,"getBoundingClientRect"),getClientRects:a(()=>[r],"getClientRects")}}return null}toggleListType(){const e=this.editor,n=e.chain().focus();e.isActive("bulletList")?n.toggleOrderedList():n.toggleBulletList(),n.run()}_isEditableWatch(e){this.editor.setEditable(e)}},a(or,"TextField"),or);Sr([fs(String)],Zt.prototype,"outputFormat",2);Sr([fs(String)],Zt.prototype,"defaultButtonsTheme",2);Sr([fs(String)],Zt.prototype,"activeButtonsTheme",2);Sr([fs(String)],Zt.prototype,"placeholder",2);Sr([nm("isEditable")],Zt.prototype,"_isEditableWatch",1);Zt=Sr([rm],Zt);const IC=["id"],RC={class:"bubble-menu"};function FC(t,e,n,r,i,o){const s=vr("VSTButton"),u=vr("BubbleMenu"),l=vr("EditorContent"),c=vr("NoSymbolIcon"),d=vr("VSTStringField");return Ar(),Is("div",{class:"vst-field-editor container relative",id:t.vstTextId},[t.editor&&t.showMenu?(Ar(),dc(u,{key:0,class:"bubble-menu",editor:t.editor,options:{placement:"bottom",offset:8}},{default:qe(()=>[G("div",RC,[De(s,{theme:t.editor.isActive("bold")?t.activeButtonsTheme:t.defaultButtonsTheme,onClick:e[0]||(e[0]=f=>t.editor.chain().focus().toggleBold().run())},{default:qe(()=>[G("div",{class:at(["h18px mt-0",{"fw-bold":t.editor.isActive("bold")}])},"B",2)]),_:1},8,["theme"]),De(s,{theme:t.editor.isActive("italic")?t.activeButtonsTheme:t.defaultButtonsTheme,onClick:e[1]||(e[1]=f=>t.editor.chain().focus().toggleItalic().run())},{default:qe(()=>[G("div",{class:at(["h18px mt-0",{italic:t.editor.isActive("italic")}])},"I",2)]),_:1},8,["theme"]),De(s,{theme:t.editor.isActive("underline")?t.activeButtonsTheme:t.defaultButtonsTheme,onClick:e[2]||(e[2]=f=>t.editor.chain().focus().toggleUnderline().run())},{default:qe(()=>[G("div",{class:at(["h18px mt-0",{underline:t.editor.isActive("underline")}])},"U",2)]),_:1},8,["theme"]),De(s,{onClick:e[3]||(e[3]=f=>t.showLinkModal=!0)},{default:qe(()=>[...e[13]||(e[13]=[Fs("Link",-1)])]),_:1}),De(s,{class:"p-0",theme:t.editor.isActive("strike")?t.activeButtonsTheme:t.defaultButtonsTheme,onClick:e[4]||(e[4]=f=>t.editor.chain().focus().toggleStrike().run())},{default:qe(()=>[G("div",{class:at(["h18px mt-0",{italic:t.editor.isActive("strike")}]),style:im({textDecoration:t.editor.isActive("strike")?"line-through":void 0,textDecorationColor:t.editor.isActive("strike")?"#fff":void 0})},"S",6)]),_:1},8,["theme"]),De(s,{theme:t.editor.isActive("bulletList")?t.activeButtonsTheme:t.defaultButtonsTheme,onClick:e[5]||(e[5]=f=>t.editor.chain().focus().toggleBulletList().run()),class:at({"fw-bold!":t.editor.isActive("bulletList")})},{default:qe(()=>[...e[14]||(e[14]=[G("svg",{class:"icon icon-tabler icons-tabler-outline icon-tabler-list fs-1rem",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[G("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),G("path",{d:"M9 6l11 0"}),G("path",{d:"M9 12l11 0"}),G("path",{d:"M9 18l11 0"}),G("path",{d:"M5 6l0 .01"}),G("path",{d:"M5 12l0 .01"}),G("path",{d:"M5 18l0 .01"})],-1)])]),_:1},8,["theme","class"]),De(s,{theme:t.editor.isActive("orderedList")?t.activeButtonsTheme:t.defaultButtonsTheme,onClick:e[6]||(e[6]=f=>t.editor.chain().focus().toggleOrderedList().run()),class:at({"fw-bold!":t.editor.isActive("orderedList"),"text-white! fill-white! stroke-white!":!0})},{default:qe(()=>[...e[15]||(e[15]=[G("svg",{class:"icon icon-tabler icons-tabler-outline icon-tabler-list-numbers fs-1rem",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[G("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),G("path",{d:"M11 6h9",stroke:"currentColor",fill:"none"}),G("path",{d:"M11 12h9",stroke:"currentColor",fill:"none"}),G("path",{d:"M12 18h8",stroke:"currentColor",fill:"none"}),G("path",{d:"M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4",stroke:"currentColor",fill:"none"}),G("path",{d:"M6 10v-6l-2 2",stroke:"currentColor",fill:"none"})],-1)])]),_:1},8,["theme","class"]),De(s,{onClick:e[7]||(e[7]=f=>t.editor.chain().focus().toggleHeading({level:1}).run()),class:at({"is-active":t.editor.isActive("heading",{level:1})})},{default:qe(()=>[...e[16]||(e[16]=[Fs("H1",-1)])]),_:1},8,["class"]),De(s,{onClick:e[8]||(e[8]=f=>t.editor.chain().focus().toggleHeading({level:2}).run()),class:at({"is-active":t.editor.isActive("heading",{level:2})})},{default:qe(()=>[...e[17]||(e[17]=[Fs("H2",-1)])]),_:1},8,["class"])])]),_:1},8,["editor"])):Rs("",!0),De(l,{editor:t.editor},null,8,["editor"]),!t.disabled&&t.value?(Ar(),Is("div",{key:1,class:at(["w25px h25px text-stone absolute t-10px r-12px z4 cursor-pointer hover:scale-130",{}])},[De(c,{onClick:e[9]||(e[9]=f=>t._onInput(""))})])):Rs("",!0),t.showLinkModal?(Ar(),Is("div",{key:2,onClose:e[12]||(e[12]=f=>t.showLinkModal=!1)},[om(G("input",{"onUpdate:modelValue":e[10]||(e[10]=f=>t.linkUrl=f),placeholder:"URL"},null,512),[[sm,t.linkUrl]]),G("button",{onClick:e[11]||(e[11]=(...f)=>t.addLink&&t.addLink(...f))},"Вставить ссылку")],32)):Rs("",!0),(Ar(),dc(um("style"))),G("div",null,[De(d,{inputValue:"Для ссылок, например"})])],8,IC)}a(FC,"render");const HC=lm(Zt,[["render",FC]]);export{HC as default};
|