1function e(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}var t,n={},r=[],o=()=>{},s=()=>!1,i=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),l=e=>e.startsWith("onUpdate:"),a=Object.assign,c=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,h=(e,t)=>d.call(e,t),u=Array.isArray,p=e=>"[object Map]"===x(e),f=e=>"[object Set]"===x(e),m=e=>"[object Date]"===x(e),g=e=>"function"==typeof e,y=e=>"string"==typeof e,v=e=>"symbol"==typeof e,b=e=>null!==e&&"object"==typeof e,k=e=>(b(e)||g(e))&&g(e.then)&&g(e.catch),w=Object.prototype.toString,x=e=>w.call(e),S=e=>"[object Object]"===x(e),C=e=>y(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,M=e(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),T=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},O=/-\w/g,E=T(e=>e.replace(O,e=>e.slice(1).toUpperCase())),A=/\B([A-Z])/g,N=T(e=>e.replace(A,"-$1").toLowerCase()),D=T(e=>e.charAt(0).toUpperCase()+e.slice(1)),R=T(e=>e?`on${D(e)}`:""),I=(e,t)=>!Object.is(e,t),_=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},P=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},L=e=>{const t=parseFloat(e);return isNaN(t)?e:t},$=e=>{const t=y(e)?Number(e):NaN;return isNaN(t)?e:t},z=()=>t||(t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function B(e){if(u(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=y(r)?H(r):B(r);if(o)for(const e in o)t[e]=o[e]}return t}if(y(e)||b(e))return e}var F=/;(?![^(]*\))/g,j=/:([^]+)/,V=/\/\*[^]*?\*\//g;function H(e){const t={};return e.replace(V,"").split(F).forEach(e=>{if(e){const n=e.split(j);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function W(e){let t="";if(y(e))t=e;else if(u(e))for(let n=0;n<e.length;n++){const r=W(e[n]);r&&(t+=r+" ")}else if(b(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function U(e){if(!e)return null;let{class:t,style:n}=e;return t&&!y(t)&&(e.class=W(t)),n&&(e.style=B(n)),e}var q="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",K=e(q);function J(e){return!!e||""===e}function G(e,t){if(e===t)return!0;let n=m(e),r=m(t);if(n||r)return!(!n||!r)&&e.getTime()===t.getTime();if(n=v(e),r=v(t),n||r)return e===t;if(n=u(e),r=u(t),n||r)return!(!n||!r)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=G(e[r],t[r]);return n}(e,t);if(n=b(e),r=b(t),n||r){if(!n||!r)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const r=e.hasOwnProperty(n),o=t.hasOwnProperty(n);if(r&&!o||!r&&o||!G(e[n],t[n]))return!1}}return String(e)===String(t)}function Q(e,t){return e.findIndex(e=>G(e,t))}var X,Y=e=>!(!e||!0!==e.__v_isRef),Z=e=>y(e)?e:null==e?"":u(e)||b(e)&&(e.toString===w||!g(e.toString))?Y(e)?Z(e.value):JSON.stringify(e,ee,2):String(e),ee=(e,t)=>
1Y(t)?ee(e,t.value):p(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[te(t,r)+" =>"]=n,e),{})}:f(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>te(e))}:v(t)?te(t):!b(t)||u(t)||S(t)?t:String(t),te=(e,t="")=>{var n;return v(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};function ne(e){return null==e?"initial":"string"==typeof e?""===e?" ":e:("number"!=typeof e||Number.isFinite(e),String(e))}var re,oe=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&X&&(X.active?(this.parent=X,this.index=(X.scopes||(X.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes){const n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes){const n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}const n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){const t=X;try{return X=this,e()}finally{X=t}}}on(){1===++this._on&&(this.prevScope=X,X=this)}off(){if(this._on>0&&0===--this._on){if(X===this)X=this.prevScope;else{let e=X;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){let t,n;for(this._active=!1,t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){const e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function se(e){return new oe(e)}function ie(){return X}function le(e,t=!1){X&&X.cleanups.push(e)}var ae,ce,de=new WeakSet,he=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,X&&(X.active?X.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,de.has(this)&&(de.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||pe(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,Te(this),ge(this);const e=re,t=xe;re=this,xe=!0;try{return this.fn()}finally{ye(this),re=e,xe=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)ke(e);this.deps=this.depsTail=void 0,Te(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?de.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ve(this)&&this.run()}get dirty(){return ve(this)}},ue=0;function pe(e,t=!1){if(e.flags|=8,t)return e.next=ce,void(ce=e);e.next=ae,ae=e}function fe(){ue++}function me(){if(--ue>0)return;if(ce){let e=ce;for(ce=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;ae;){let n=ae;for(ae=void 0;n;){const r=n.next;if(n.next=void 0,n.flags&=-9,1&n.flags)try{n.trigger()}catch(t){e||(e=t)}n=r}}if(e)throw e}function ge(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ye(e){let t,n=e.depsTail,r=n;for(;r;){const e=r.prevDep;-1===r.version?(r===n&&(n=e),ke(r),we(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function ve(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(be(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function be(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===Oe)return;if(e.globalVersion=Oe,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!ve(e)))return;e.flags|=2;const t=e.dep,n=re,r=xe;re=e,xe=!0;try{ge(e);const n=e.fn(e._value);(0===t.version||I(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(o){throw t.version++,o}finally{re=n,xe=r,ye(e),e.flags&=-3}}function ke(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)ke(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function we(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var xe=!0,Se=[];function Ce(){Se.push(xe),xe=!1}function Me(){const e=Se.pop();xe=void 0===e||e}function Te(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=re;re=void 0;try{t()}finally{re=e}}}var Oe=0,Ee=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Ae=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!re||!xe||re===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==re)t=this.activeLink=new Ee(re,this),re.deps?(t.prevDep=re.depsTail,re.depsTail.nextDep=t,re.depsTail=t):re.deps=re.depsTail=t,Ne(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=re.depsTail,t.nextDep=void 0,re.depsTail.nextDep=t,re.depsTail=t,re.deps===t&&(re.deps=e)}return t}trigger(e){this.version++,Oe++,this.notify(e)}notify(e){fe();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{me()}}};function Ne(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Ne(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var De=new WeakMap,Re=Symbol(""),Ie=Symbol(""),_e=Symbol("");function Pe(e,t,n){if(xe&&re){let t=De.get(e);t||De.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Ae),r.map=t,r.key=n),r.track()}}function Le(e,t,n,r,o,s){const i=De.get(e);if(!i)return void Oe++;const l=e=>{e&&e.trigger()};if(fe(),"clear"===t)i.forEach(l);else{const o=u(e),s=o&&C(n);if(o&&"length"===n){const e=Number(r);
1i.forEach((t,n)=>{("length"===n||n===_e||!v(n)&&n>=e)&&l(t)})}else switch((void 0!==n||i.has(void 0))&&l(i.get(n)),s&&l(i.get(_e)),t){case"add":o?s&&l(i.get("length")):(l(i.get(Re)),p(e)&&l(i.get(Ie)));break;case"delete":o||(l(i.get(Re)),p(e)&&l(i.get(Ie)));break;case"set":p(e)&&l(i.get(Re))}}me()}function $e(e){const t=Mt(e);return t===e?t:(Pe(t,0,_e),St(e)?t:t.map(Ot))}function ze(e){return Pe(e=Mt(e),0,_e),e}function Be(e,t){return xt(e)?Et(wt(e)?Ot(t):t):Ot(t)}var Fe={__proto__:null,[Symbol.iterator](){return je(this,Symbol.iterator,e=>Be(this,e))},concat(...e){return $e(this).concat(...e.map(e=>u(e)?$e(e):e))},entries(){return je(this,"entries",e=>(e[1]=Be(this,e[1]),e))},every(e,t){return He(this,"every",e,t,void 0,arguments)},filter(e,t){return He(this,"filter",e,t,e=>e.map(e=>Be(this,e)),arguments)},find(e,t){return He(this,"find",e,t,e=>Be(this,e),arguments)},findIndex(e,t){return He(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return He(this,"findLast",e,t,e=>Be(this,e),arguments)},findLastIndex(e,t){return He(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return He(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ue(this,"includes",e)},indexOf(...e){return Ue(this,"indexOf",e)},join(e){return $e(this).join(e)},lastIndexOf(...e){return Ue(this,"lastIndexOf",e)},map(e,t){return He(this,"map",e,t,void 0,arguments)},pop(){return qe(this,"pop")},push(...e){return qe(this,"push",e)},reduce(e,...t){return We(this,"reduce",e,t)},reduceRight(e,...t){return We(this,"reduceRight",e,t)},shift(){return qe(this,"shift")},some(e,t){return He(this,"some",e,t,void 0,arguments)},splice(...e){return qe(this,"splice",e)},toReversed(){return $e(this).toReversed()},toSorted(e){return $e(this).toSorted(e)},toSpliced(...e){return $e(this).toSpliced(...e)},unshift(...e){return qe(this,"unshift",e)},values(){return je(this,"values",e=>Be(this,e))}};function je(e,t,n){const r=ze(e),o=r[t]();return r===e||St(e)||(o._next=o.next,o.next=()=>{const e=o._next();return e.done||(e.value=n(e.value)),e}),o}var Ve=Array.prototype;function He(e,t,n,r,o,s){const i=ze(e),l=i!==e&&!St(e),a=i[t];if(a!==Ve[t]){const t=a.apply(e,s);return l?Ot(t):t}let c=n;i!==e&&(l?c=function(t,r){return n.call(this,Be(e,t),r,e)}:n.length>2&&(c=function(t,r){return n.call(this,t,r,e)}));const d=a.call(i,c,r);return l&&o?o(d):d}function We(e,t,n,r){const o=ze(e);let s=n,i=!1;o!==e&&(o!==e&&!St(e)?(i=0===r.length,s=function(t,r,o){return i&&(i=!1,t=Be(e,t)),n.call(this,t,Be(e,r),o,e)}):n.length>3&&(s=function(t,r,o){return n.call(this,t,r,o,e)}));const l=o[t](s,...r);return i?Be(e,l):l}function Ue(e,t,n){const r=Mt(e);Pe(r,0,_e);const o=r[t](...n);return-1!==o&&!1!==o||!Ct(n[0])?o:(n[0]=Mt(n[0]),r[t](...n))}function qe(e,t,n=[]){Ce(),fe();const r=Mt(e)[t].apply(e,n);return me(),Me(),r}var Ke=e("__proto__,__v_isRef,__isVue"),Je=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(v));function Ge(e){v(e)||(e=String(e));const t=Mt(this);return Pe(t,0,e),t.hasOwnProperty(e)}var Qe=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const r=this._isReadonly,o=this._isShallow;if("__v_isReactive"===t)return!r;if("__v_isReadonly"===t)return r;if("__v_isShallow"===t)return o;if("__v_raw"===t)return n===(r?o?mt:ft:o?pt:ut).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const s=u(e);if(!r){let e;if(s&&(e=Fe[t]))return e;if("hasOwnProperty"===t)return Ge}const i=Reflect.get(e,t,At(e)?e:n);if(v(t)?Je.has(t):Ke(t))return i;if(r||Pe(e,0,t),o)return i;if(At(i)){const e=s&&C(t)?i:i.value;return r&&b(e)?vt(e):e}return b(i)?r?vt(i):gt(i):i}},Xe=class extends Qe{constructor(e=!1){super(!1,e)}set(e,t,n,r){let o=e[t];const s=u(e)&&C(t);if(!this._isShallow){const e=xt(o);if(St(n)||xt(n)||(o=Mt(o),n=Mt(n)),!s&&At(o)&&!At(n))return e||(o.value=n),!0}const i=s?Number(t)<e.length:h(e,t),l=Reflect.set(e,t,n,At(e)?e:r);return e===Mt(r)&&l&&(i?I(n,o)&&Le(e,"set",t,n):Le(e,"add",t,n)),l}deleteProperty(e,t){const n=h(e,t),r=(e[t],Reflect.deleteProperty(e,t));return r&&n&&Le(e,"delete",t,void 0),r}has(e,t){const n=Reflect.has(e,t);return v(t)&&Je.has(t)||Pe(e,0,t),n}ownKeys(e){return Pe(e,0,u(e)?"length":Re),Reflect.ownKeys(e)}},Ye=class extends Qe{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},Ze=new Xe,et=new Ye,tt=new Xe(!0),nt=new Ye(!0),rt=e=>e,ot=e=>Reflect.getPrototypeOf(e);function st(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function it(e,t){const n={get(n){const r=this.__v_raw,o=Mt(r),s=Mt(n);e||(I(n,s)&&Pe(o,0,n),Pe(o,0,s));const{has:i}=ot(o),l=t?rt:e?Et:Ot;return i.call(o,n)?l(r.get(n)):i.call(o,s)?l(r.get(s)):void(r!==o&&r.get(n))},get size(){const t=this.__v_raw;return!e&&Pe(Mt(t),0,Re),t.size},has(t){const n=this.__v_raw,r=Mt(n),o=Mt(t);return e||(I(t,o)&&Pe(r,0,t),Pe(r,0,o)),t===o?n.has(t):n.has(t)||n.has(o)}
1,forEach(n,r){const o=this,s=o.__v_raw,i=t?rt:e?Et:Ot;return!e&&Pe(Mt(s),0,Re),s.forEach((e,t)=>n.call(r,i(e),i(t),o))}};return a(n,e?{add:st("add"),set:st("set"),delete:st("delete"),clear:st("clear")}:{add(e){const n=Mt(this),r=ot(n),o=Mt(e),s=t||St(e)||xt(e)?e:o;return r.has.call(n,s)||I(e,s)&&r.has.call(n,e)||I(o,s)&&r.has.call(n,o)||(n.add(s),Le(n,"add",s,s)),this},set(e,n){t||St(n)||xt(n)||(n=Mt(n));const r=Mt(this),{has:o,get:s}=ot(r);let i=o.call(r,e);i||(e=Mt(e),i=o.call(r,e));const l=s.call(r,e);return r.set(e,n),i?I(n,l)&&Le(r,"set",e,n):Le(r,"add",e,n),this},delete(e){const t=Mt(this),{has:n,get:r}=ot(t);let o=n.call(t,e);o||(e=Mt(e),o=n.call(t,e));r&&r.call(t,e);const s=t.delete(e);return o&&Le(t,"delete",e,void 0),s},clear(){const e=Mt(this),t=0!==e.size,n=e.clear();return t&&Le(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=function(e,t,n){return function(...r){const o=this.__v_raw,s=Mt(o),i=p(s),l="entries"===e||e===Symbol.iterator&&i,c="keys"===e&&i,d=o[e](...r),h=n?rt:t?Et:Ot;return!t&&Pe(s,0,c?Ie:Re),a(Object.create(d),{next(){const{value:e,done:t}=d.next();return t?{value:e,done:t}:{value:l?[h(e[0]),h(e[1])]:h(e),done:t}}})}}(r,e,t)}),n}function lt(e,t){const n=it(e,t);return(t,r,o)=>"__v_isReactive"===r?!e:"__v_isReadonly"===r?e:"__v_raw"===r?t:Reflect.get(h(n,r)&&r in t?n:t,r,o)}var at={get:lt(!1,!1)},ct={get:lt(!1,!0)},dt={get:lt(!0,!1)},ht={get:lt(!0,!0)},ut=new WeakMap,pt=new WeakMap,ft=new WeakMap,mt=new WeakMap;function gt(e){return xt(e)?e:kt(e,!1,Ze,at,ut)}function yt(e){return kt(e,!1,tt,ct,pt)}function vt(e){return kt(e,!0,et,dt,ft)}function bt(e){return kt(e,!0,nt,ht,mt)}function kt(e,t,n,r,o){if(!b(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;if(e.__v_skip||!Object.isExtensible(e))return e;const s=o.get(e);if(s)return s;const i=function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(x(e).slice(8,-1));if(0===i)return e;const l=new Proxy(e,2===i?r:n);return o.set(e,l),l}function wt(e){return xt(e)?wt(e.__v_raw):!(!e||!e.__v_isReactive)}function xt(e){return!(!e||!e.__v_isReadonly)}function St(e){return!(!e||!e.__v_isShallow)}function Ct(e){return!!e&&!!e.__v_raw}function Mt(e){const t=e&&e.__v_raw;return t?Mt(t):e}function Tt(e){return!h(e,"__v_skip")&&Object.isExtensible(e)&&P(e,"__v_skip",!0),e}var Ot=e=>b(e)?gt(e):e,Et=e=>b(e)?vt(e):e;function At(e){return!!e&&!0===e.__v_isRef}function Nt(e){return Rt(e,!1)}function Dt(e){return Rt(e,!0)}function Rt(e,t){return At(e)?e:new It(e,t)}var It=class{constructor(e,t){this.dep=new Ae,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Mt(e),this._value=t?e:Ot(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||St(e)||xt(e);I(e=n?e:Mt(e),t)&&(this._rawValue=e,this._value=n?e:Ot(e),this.dep.trigger())}};function _t(e){return At(e)?e.value:e}function Pt(e){return g(e)?e():_t(e)}var Lt={get:(e,t,n)=>"__v_raw"===t?e:_t(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return At(o)&&!At(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function $t(e){return wt(e)?e:new Proxy(e,Lt)}var zt=class{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new Ae,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}};function Bt(e){return new zt(e)}function Ft(e){const t=u(e)?new Array(e.length):{};for(const n in e)t[n]=Wt(e,n);return t}var jt=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=v(t)?t:String(t),this._raw=Mt(e);let r=!0,o=e;if(!u(e)||v(this._key)||!C(this._key))do{r=!Ct(o)||St(o)}while(r&&(o=o.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=_t(e)),this._value=void 0===e?this._defaultValue:e}set value(e){if(this._shallow&&At(this._raw[this._key])){const t=this._object[this._key];if(At(t))return void(t.value=e)}this._object[this._key]=e}get dep(){return function(e,t){const n=De.get(e);return n&&n.get(t)}(this._raw,this._key)}},Vt=class{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}};function Ht(e,t,n){return At(e)?e:g(e)?new Vt(e):b(e)&&arguments.length>1?Wt(e,t,n):Nt(e)}function Wt(e,t,n){return new jt(e,t,n)}var Ut=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Ae(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Oe-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&re!==this)return pe(this,!0),!0}get value(){const e=this.dep.track();return be(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};var qt={},Kt=new WeakMap,Jt=void 0;function Gt(e,t,r=n){const{immediate:s,deep:i,once:l,scheduler:a,augmentJob:d,call:h}=r,p=e=>i?e:St(e)||!1===i||0===i?Qt(e,1):Qt(e);let f,m,y,v,b=!1,k=!1;if(At(e)?(m=()=>e.value,b=St(e)):wt(e)?(m=()=>p(e),b=!0):u(e)?(k=!0,b=e.some(e=>wt(e)||St(e)),m=()=>e.map(e=>
1At(e)?e.value:wt(e)?p(e):g(e)?h?h(e,2):e():void 0)):m=g(e)?t?h?()=>h(e,2):e:()=>{if(y){Ce();try{y()}finally{Me()}}const t=Jt;Jt=f;try{return h?h(e,3,[v]):e(v)}finally{Jt=t}}:o,t&&i){const e=m,t=!0===i?1/0:i;m=()=>Qt(e(),t)}const w=ie(),x=()=>{f.stop(),w&&w.active&&c(w.effects,f)};if(l&&t){const e=t;t=(...t)=>{const n=e(...t);return x(),n}}let S=k?new Array(e.length).fill(qt):qt;const C=e=>{if(1&f.flags&&(f.dirty||e))if(t){const n=f.run();if(e||i||b||(k?n.some((e,t)=>I(e,S[t])):I(n,S))){y&&y();const e=Jt;Jt=f;try{const e=[n,S===qt?void 0:k&&S[0]===qt?[]:S,v];S=n,h?h(t,3,e):t(...e)}finally{Jt=e}}}else f.run()};return d&&d(C),f=new he(m),f.scheduler=a?()=>a(C,!1):C,v=e=>function(e,t=!1,n=Jt){if(n){let t=Kt.get(n);t||Kt.set(n,t=[]),t.push(e)}}(e,!1,f),y=f.onStop=()=>{const e=Kt.get(f);if(e){if(h)h(e,4);else for(const t of e)t();Kt.delete(f)}},t?s?C(!0):S=f.run():a?a(C.bind(null,!0),!0):f.run(),x.pause=f.pause.bind(f),x.resume=f.resume.bind(f),x.stop=x,x}function Qt(e,t=1/0,n){if(t<=0||!b(e)||e.__v_skip)return e;if(((n=n||new Map).get(e)||0)>=t)return e;if(n.set(e,t),t--,At(e))Qt(e.value,t,n);else if(u(e))for(let r=0;r<e.length;r++)Qt(e[r],t,n);else if(f(e)||p(e))e.forEach(e=>{Qt(e,t,n)});else if(S(e)){for(const r in e)Qt(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Qt(e[r],t,n)}return e}function Xt(e,t,n,r){try{return r?e(...r):e()}catch(o){Zt(o,t,n)}}function Yt(e,t,n,r){if(g(e)){const o=Xt(e,t,n,r);return o&&k(o)&&o.catch(e=>{Zt(e,t,n)}),o}if(u(e)){const o=[];for(let s=0;s<e.length;s++)o.push(Yt(e[s],t,n,r));return o}}function Zt(e,t,r,o=!0){t&&t.vnode;const{errorHandler:s,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||n;if(t){let n=t.parent;const o=t.proxy,i=`https://vuejs.org/error-reference/#runtime-${r}`;for(;n;){const t=n.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,o,i))return;n=n.parent}if(s)return Ce(),Xt(s,null,10,[e,o,i]),void Me()}!function(e,t,n,r=!0,o=!1){if(o)throw e}(e,0,0,o,i)}var en=[],tn=-1,nn=[],rn=null,on=0,sn=Promise.resolve(),ln=null;function an(e){const t=ln||sn;return e?t.then(this?e.bind(this):e):t}function cn(e){if(!(1&e.flags)){const t=fn(e),n=en[en.length-1];!n||!(2&e.flags)&&t>=fn(n)?en.push(e):en.splice(function(e){let t=tn+1,n=en.length;for(;t<n;){const r=t+n>>>1,o=en[r],s=fn(o);s<e||s===e&&2&o.flags?t=r+1:n=r}return t}(t),0,e),e.flags|=1,dn()}}function dn(){ln||(ln=sn.then(mn))}function hn(e){u(e)?nn.push(...e):rn&&-1===e.id?rn.splice(on+1,0,e):1&e.flags||(nn.push(e),e.flags|=1),dn()}function un(e,t,n=tn+1){for(;n<en.length;n++){const t=en[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;en.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function pn(e){if(nn.length){const e=[...new Set(nn)].sort((e,t)=>fn(e)-fn(t));if(nn.length=0,rn)return void rn.push(...e);for(rn=e,on=0;on<rn.length;on++){const e=rn[on];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}rn=null,on=0}}var fn=e=>null==e.id?2&e.flags?-1:1/0:e.id;function mn(e){try{for(tn=0;tn<en.length;tn++){const e=en[tn];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),Xt(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;tn<en.length;tn++){const e=en[tn];e&&(e.flags&=-2)}tn=-1,en.length=0,pn(),ln=null,(en.length||nn.length)&&mn(e)}}var gn=null,yn=null;function vn(e){const t=gn;return gn=e,yn=e&&e.type.__scopeId||null,t}function bn(e,t=gn,n){if(!t)return e;if(e._n)return e;const r=(...n)=>{r._d&&Ls(-1);const o=vn(t),s=Ds.length;let i;try{i=e(...n)}finally{for(let e=Ds.length;e>s;e--)_s();vn(o),r._d&&Ls(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function kn(e,t){if(null===gn)return e;const r=vi(gn),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[e,i,l,a=n]=t[s];e&&(g(e)&&(e={mounted:e,updated:e}),e.deep&&Qt(i),o.push({dir:e,instance:r,value:i,oldValue:void 0,arg:l,modifiers:a}))}return e}function wn(e,t,n,r){const o=e.dirs,s=t&&t.dirs;for(let i=0;i<o.length;i++){const l=o[i];s&&(l.oldValue=s[i].value);let a=l.dir[r];a&&(Ce(),Yt(a,n,8,[e.el,l,e,t]),Me())}}function xn(e,t){if(ii){let n=ii.provides;const r=ii.parent&&ii.parent.provides;r===n&&(n=ii.provides=Object.create(r)),n[e]=t}}function Sn(e,t,n=!1){const r=li();
1if(r||_o){let o=_o?_o._context.provides:r?null==r.parent||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&g(t)?t.call(r&&r.proxy):t}}function Cn(){return!(!li()&&!_o)}var Mn=Symbol.for("v-scx");function Tn(e,t){return En(e,null,t)}function On(e,t,n){return En(e,t,n)}function En(e,t,r=n){const{immediate:s,deep:i,flush:l,once:c}=r,d=a({},r),h=t&&s||!t&&"post"!==l;let u;if(pi)if("sync"===l){const e=Sn(Mn);u=e.__watcherHandles||(e.__watcherHandles=[])}else if(!h){const e=()=>{};return e.stop=o,e.resume=o,e.pause=o,e}const p=ii;d.call=(e,t,n)=>Yt(e,p,t,n);let f=!1;"post"===l?d.scheduler=e=>{as(e,p&&p.suspense)}:"sync"!==l&&(f=!0,d.scheduler=(e,t)=>{t?e():cn(e)}),d.augmentJob=e=>{t&&(e.flags|=4),f&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};const m=Gt(e,t,d);return pi&&(u?u.push(m):h&&m()),m}function An(e,t,n){const r=this.proxy,o=y(e)?e.includes(".")?Nn(r,e):()=>r[e]:e.bind(r,r);let s;g(t)?s=t:(s=t.handler,n=t);const i=ai(this),l=En(o,s.bind(r),n);return i(),l}function Nn(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var Dn=new WeakMap,Rn=Symbol("_vte"),In=e=>e.__isTeleport,_n=e=>e&&(e.disabled||""===e.disabled),Pn=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,Ln=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,$n=(e,t)=>{const n=e&&e.to;return y(n)?t?t(n):null:n},zn={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,s,i,l,a,c){const{mc:d,pc:h,pbc:u,o:{insert:p,querySelector:f,createText:m,createComment:g,parentNode:y}}=c,v=_n(t.props);let{dynamicChildren:b}=t;const k=(e,t,n)=>{16&e.shapeFlag&&d(e.children,t,n,o,s,i,l,a)},w=(e=t)=>{const n=_n(e.props),r=e.target=$n(e.props,f),s=Vn(r,e,m,p);r&&("svg"!==i&&Pn(r)?i="svg":"mathml"!==i&&Ln(r)&&(i="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(r),n||(k(e,r,s),jn(e,!1)))},x=e=>{const t=()=>{if(Dn.get(e)===t){if(Dn.delete(e),_n(e.props)){const t=y(e.el)||n;k(e,t,e.anchor),jn(e,!0)}w(e)}};Dn.set(e,t),as(t,s)};if(null==e){const e=t.el=m(""),o=t.anchor=m("");if(p(e,n,r),p(o,n,r),(S=t.props)&&(S.defer||""===S.defer)||s&&s.pendingBranch)return void x(t);v&&(k(t,n,o),jn(t,!0)),w()}else{t.el=e.el;const r=t.anchor=e.anchor,d=Dn.get(e);if(d)return d.flags|=8,Dn.delete(e),void x(t);t.targetStart=e.targetStart;const p=t.target=e.target,m=t.targetAnchor=e.targetAnchor,g=_n(e.props),y=g?n:p,k=g?r:m;if("svg"===i||Pn(p)?i="svg":("mathml"===i||Ln(p))&&(i="mathml"),b?(u(e.dynamicChildren,b,y,o,s,i,l),ms(e,t,!0)):a||h(e,t,y,k,o,s,i,l,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Bn(t,n,r,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=$n(t.props,f);e&&(t.target=e,Bn(t,e,null,c,0))}else g&&Bn(t,p,m,c,1);jn(t,v)}var S},remove(e,t,n,{um:r,o:{remove:o}},s){const{shapeFlag:i,children:l,anchor:a,targetStart:c,targetAnchor:d,target:h,props:u}=e,p=_n(u),f=s||!p,m=Dn.get(e);if(m&&(m.flags|=8,Dn.delete(e)),h&&(o(c),o(d)),s&&o(a),!m&&(p||h)&&16&i)for(let g=0;g<l.length;g++){const e=l[g];r(e,t,n,f,!!e.dynamicChildren)}},move:Bn,hydrate:function(e,t,n,r,o,s,{o:{nextSibling:i,parentNode:l,querySelector:a,insert:c,createText:d}},h){function u(e,n){let r=n;for(;r;){if(r&&8===r.nodeType)if("teleport start anchor"===r.data)t.targetStart=r;else if("teleport anchor"===r.data){t.targetAnchor=r,e._lpa=t.targetAnchor&&i(t.targetAnchor);break}r=i(r)}}function p(e,t){t.anchor=h(i(e),t,l(e),n,r,o,s)}const f=t.target=$n(t.props,a),m=_n(t.props);if(f){const a=f._lpa||f.firstChild;16&t.shapeFlag&&(m?(p(e,t),u(f,a),t.targetAnchor||Vn(f,t,d,c,l(e)===f?e:null)):(t.anchor=i(e),u(f,a),t.targetAnchor||Vn(f,t,d,c),h(a&&i(a),t,f,n,r,o,s))),jn(t,m)}else m&&16&t.shapeFlag&&(p(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}};function Bn(e,t,n,{o:{insert:r},m:o},s=2){0===s&&r(e.targetAnchor,t,n);const{el:i,anchor:l,shapeFlag:a,children:c,props:d}=e,h=2===s;if(h&&r(i,t,n),!Dn.has(e)&&(!h||_n(d))&&16&a)for(let u=0;u<c.length;u++)o(c[u],t,n,2);h&&r(l,t,n)}var Fn=zn;function jn(e,t){const n=e.ctx;if(n&&n.ut){let r,o;for(t?(r=e.el,o=e.anchor):(r=e.targetStart,o=e.targetAnchor);r&&r!==o;)1===r.nodeType&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Vn(e,t,n,r,o=null){const s=t.targetStart=n(""),i=t.targetAnchor=n("");return s[Rn]=i,e&&(r(s,e,o),r(i,e,o)),i}var Hn=Symbol("_leaveCb"),Wn=Symbol("_enterCb");function Un(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leav
1ingVNodes:new Map};return jr(()=>{e.isMounted=!0}),Wr(()=>{e.isUnmounting=!0}),e}var qn=[Function,Array],Kn={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:qn,onEnter:qn,onAfterEnter:qn,onEnterCancelled:qn,onBeforeLeave:qn,onLeave:qn,onAfterLeave:qn,onLeaveCancelled:qn,onBeforeAppear:qn,onAppear:qn,onAfterAppear:qn,onAppearCancelled:qn},Jn=e=>{const t=e.subTree;return t.component?Jn(t.component):t};function Gn(e){let t=e[0];if(e.length>1)for(const n of e)if(n.type!==As){t=n;break}return t}var Qn={name:"BaseTransition",props:Kn,setup(e,{slots:t}){const n=li(),r=Un();return()=>{const o=t.default&&nr(t.default(),!0),s=o&&o.length?Gn(o):n.subTree?Qs():void 0;if(!s)return;const i=Mt(e),{mode:l}=i;if(r.isLeaving)return Zn(s);const a=er(s);if(!a)return Zn(s);let c=Yn(a,i,r,n,e=>c=e);a.type!==As&&tr(a,c);let d=n.subTree&&er(n.subTree);if(d&&d.type!==As&&!js(d,a)&&Jn(n).type!==As){let e=Yn(d,i,r,n);if(tr(d,e),"out-in"===l&&a.type!==As)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,d=void 0},Zn(s);"in-out"===l&&a.type!==As?e.delayLeave=(e,t,n)=>{Xn(r,d)[String(d.key)]=d,e[Hn]=()=>{t(),e[Hn]=void 0,delete c.delayedLeave,d=void 0},c.delayedLeave=()=>{n(),delete c.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return s}}};function Xn(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Yn(e,t,n,r,o){const{appear:s,mode:i,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:d,onEnterCancelled:h,onBeforeLeave:p,onLeave:f,onAfterLeave:m,onLeaveCancelled:g,onBeforeAppear:y,onAppear:v,onAfterAppear:b,onAppearCancelled:k}=t,w=String(e.key),x=Xn(n,e),S=(e,t)=>{e&&Yt(e,r,9,t)},C=(e,t)=>{const n=t[1];S(e,t),u(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},M={mode:i,persisted:l,beforeEnter(t){let r=a;if(!n.isMounted){if(!s)return;r=y||a}t[Hn]&&t[Hn](!0);const o=x[w];o&&js(e,o)&&o.el[Hn]&&o.el[Hn](),S(r,[t])},enter(t){if(x[w]===e)return;let r=c,o=d,i=h;if(!n.isMounted){if(!s)return;r=v||c,o=b||d,i=k||h}let l=!1;t[Wn]=e=>{l||(l=!0,S(e?i:o,[t]),M.delayedLeave&&M.delayedLeave(),t[Wn]=void 0)};const a=t[Wn].bind(null,!1);r?C(r,[t,a]):a()},leave(t,r){const o=String(e.key);if(t[Wn]&&t[Wn](!0),n.isUnmounting)return r();S(p,[t]);let s=!1;t[Hn]=n=>{s||(s=!0,r(),S(n?g:m,[t]),t[Hn]=void 0,x[o]===e&&delete x[o])};const i=t[Hn].bind(null,!1);x[o]=e,f?C(f,[t,i]):i()},clone(e){const s=Yn(e,t,n,r,o);return o&&o(s),s}};return M}function Zn(e){if(Ar(e))return(e=Ks(e)).children=null,e}function er(e){if(!Ar(e))return In(e.type)&&e.children?Gn(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&g(n.default))return n.default()}}function tr(e,t){6&e.shapeFlag&&e.component?(e.transition=t,tr(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function nr(e,t=!1,n){let r=[],o=0;for(let s=0;s<e.length;s++){let i=e[s];const l=null==n?i.key:String(n)+String(null!=i.key?i.key:s);i.type===Os?(128&i.patchFlag&&o++,r=r.concat(nr(i.children,t,l))):(t||i.type!==As)&&r.push(null!=l?Ks(i,{key:l}):i)}if(o>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function rr(e,t){return g(e)?(()=>a({name:e.name},t,{setup:e}))():e}function or(){const e=li();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function sr(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ir(e){const t=li(),r=Dt(null);if(t){const o=t.refs===n?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>r.value,set:e=>r.value=e})}return r}function lr(e,t){let n;return!(!(n=Object.getOwnPropertyDescriptor(e,t))||n.configurable)}var ar=new WeakMap;function cr(e,t,r,o,i=!1){if(u(e))return void e.forEach((e,n)=>cr(e,t&&(u(t)?t[n]:t),r,o,i));if(Tr(o)&&!i)return void(512&o.shapeFlag&&o.type.__asyncResolved&&o.component.subTree.component&&cr(e,t,r,o.component.subTree));const l=4&o.shapeFlag?vi(o.component):o.el,a=i?null:l,{i:d,r:p}=e,f=t&&t.r,m=d.refs===n?d.refs={}:d.refs,v=d.setupState,b=Mt(v),k=v===n?s:e=>!lr(m,e)&&h(b,e),w=(e,t)=>!t||!lr(m,t);if(null!=f&&f!==p)if(dr(t),y(f))m[f]=null,k(f)&&(v[f]=null);else if(At(f)){const e=t;w(0,e.k)&&(f.value=null),e.k&&(m[e.k]=null)}if(g(p))Xt(p,d,12,[a,m]);
1else{const t=y(p),n=At(p);if(t||n){const o=()=>{if(e.f){const n=t?k(p)?v[p]:m[p]:w()||!e.k?p.value:m[e.k];if(i)u(n)&&c(n,l);else if(u(n))n.includes(l)||n.push(l);else if(t)m[p]=[l],k(p)&&(v[p]=m[p]);else{const t=[l];w(0,e.k)&&(p.value=t),e.k&&(m[e.k]=t)}}else t?(m[p]=a,k(p)&&(v[p]=a)):n&&(w(0,e.k)&&(p.value=a),e.k&&(m[e.k]=a))};if(a){const t=()=>{o(),ar.delete(e)};t.id=-1,ar.set(e,t),as(t,r)}else dr(e),o()}}}function dr(e){const t=ar.get(e);t&&(t.flags|=8,ar.delete(e))}var hr=!1,ur=()=>{hr||(hr=!0)},pr=e=>{if(1===e.nodeType)return(e=>e.namespaceURI.includes("svg")&&"foreignObject"!==e.tagName)(e)?"svg":(e=>e.namespaceURI.includes("MathML"))(e)?"mathml":void 0},fr=e=>8===e.nodeType;function mr(e){const{mt:t,p:n,o:{patchProp:r,createText:o,nextSibling:s,parentNode:l,remove:a,insert:c,createComment:d}}=e,h=(n,r,i,a,d,b=!1)=>{b=b||!!r.dynamicChildren;const k=fr(n)&&"["===n.data,w=()=>m(n,r,i,a,d,k),{type:x,ref:S,shapeFlag:C,patchFlag:M}=r;let T=n.nodeType;r.el=n,-2===M&&(b=!1,r.dynamicChildren=null);let O=null;switch(x){case Es:3!==T?""===r.children?(c(r.el=o(""),l(n),n),O=n):O=w():(n.data!==r.children&&(ur(),n.data=r.children),O=s(n));break;case As:v(n)?(O=s(n),y(r.el=n.content.firstChild,n,i)):O=8!==T||k?w():s(n);break;case Ns:if(k&&(T=(n=s(n)).nodeType),1===T||3===T){O=n;const e=!r.children.length;for(let t=0;t<r.staticCount;t++)e&&(r.children+=1===O.nodeType?O.outerHTML:O.data),t===r.staticCount-1&&(r.anchor=O),O=s(O);return k?s(O):O}w();break;case Os:O=k?f(n,r,i,a,d,b):w();break;default:if(1&C)O=1===T&&r.type.toLowerCase()===n.tagName.toLowerCase()||v(n)?u(n,r,i,a,d,b):w();else if(6&C){r.slotScopeIds=d;const e=l(n);if(O=k?g(n):fr(n)&&"teleport start"===n.data?g(n,n.data,"teleport end"):s(n),t(r,e,null,i,a,pr(e),b),Tr(r)&&!r.type.__asyncResolved){let t;k?(t=Us(Os),t.anchor=O?O.previousSibling:e.lastChild):t=3===n.nodeType?Js(""):Us("div"),t.el=n,r.component.subTree=t}}else 64&C?O=8!==T?w():r.type.hydrate(n,r,i,a,d,b,e,p):128&C&&(O=r.type.hydrate(n,r,i,a,pr(l(n)),d,b,e,h))}return null!=S&&cr(S,null,a,r),O},u=(e,t,n,o,s,l)=>{l=l||!!t.dynamicChildren;const{type:c,dynamicProps:d,props:h,patchFlag:u,shapeFlag:f,dirs:m,transition:g}=t,b="input"===c||"option"===c,k=!!d;if(b||k||-1!==u){m&&wn(t,null,n,"created");let c,w=!1;if(v(e)){w=fs(null,g)&&n&&n.vnode.props&&n.vnode.props.appear;const r=e.content.firstChild;if(w){const e=r.getAttribute("class");e&&(r.$cls=e),g.beforeEnter(r)}y(r,e,n),t.el=e=r}if(16&f&&(!h||!h.innerHTML&&!h.textContent)){let r=p(e.firstChild,t,e,n,o,s,l);for(r&&!vr(e,1)&&ur();r;){const e=r;r=r.nextSibling,a(e)}}else if(8&f){let n=t.children;"\n"!==n[0]||"PRE"!==e.tagName&&"TEXTAREA"!==e.tagName||(n=n.slice(1));const{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,"\n")&&(vr(e,0)||ur(),e.textContent=t.children)}if(h)if(b||k||!l||48&u){const t=e.tagName.includes("-"),o=e.namespaceURI.includes("svg")?"svg":e.namespaceURI.includes("MathML")?"mathml":void 0;for(const s in h)(b&&(s.endsWith("value")||"indeterminate"===s)||i(s)&&!M(s)||"."===s[0]||t&&!M(s)||d&&d.includes(s))&&r(e,s,null,h[s],o,n)}else if(h.onClick)r(e,"onClick",null,h.onClick,void 0,n);else if(4&u&&wt(h.style))for(const e in h.style)h.style[e];(c=h&&h.onVnodeBeforeMount)&&ti(c,n,t),m&&wn(t,null,n,"beforeMount"),((c=h&&h.onVnodeMounted)||m||w)&&Ms(()=>{c&&ti(c,n,t),w&&g.enter(e),m&&wn(t,null,n,"mounted")},o)}return e.nextSibling},p=(e,t,r,i,l,a,d)=>{d=d||!!t.dynamicChildren;const u=t.children,p=u.length;let f=!1;for(let m=0;m<p;m++){const t=d?u[m]:u[m]=Xs(u[m]),g=t.type===Es;e?(g&&!d&&m+1<p&&Xs(u[m+1]).type===Es&&(c(o(e.data.slice(t.children.length)),r,s(e)),e.data=t.children),e=h(e,t,i,l,a,d)):g&&!t.children?c(t.el=o(""),r):(f||(f=!0,vr(r,1)||ur()),n(null,t,r,null,i,l,pr(r),a))}return e},f=(e,t,n,r,o,i)=>{const{slotScopeIds:a}=t;a&&(o=o?o.concat(a):a);const h=l(e),u=p(s(e),t,h,n,r,o,i);return u&&fr(u)&&"]"===u.data?s(t.anchor=u):(ur(),c(t.anchor=d("]"),h,u),u)},m=(e,t,r,o,i,c)=>{if(function(e,t){return vr(e.parentElement,1)||function(e){return 1===e.nodeType&&br(e.getAttribute(gr),1)}(e)||function({props:e}){const t=e&&e[gr];return"string"==typeof t&&br(t,1)}(t)}(e,t)||ur(),t.el=null,c){const t=g(e);for(;;){const n=s(e);if(!n||n===t)break;a(n)}}const d=s(e),h=l(e);return a(e),n(null,t,h,d,r,o,pr(h),i),r&&(r.vnode.el=t.el,qo(r,t.el)),d},g=(e,t="[",n="]")=>{let r=0;for(;e;)if((e=s(e))&&fr(e)&&(e.data===t&&r++,e.data===n)){if(0===r)return s(e);r--}return e},y=(e,t,n)=>{const r=t.parentNode;r&&r.replaceChild(e,t);let o=n;for(;o;)o.vnode.el===t&&(o.vnode.el=o.subTree.el=e),o=o.parent},v=e=>1===e.nodeType&&"TEMPLATE"===e.tagName;return[(e,t)=>{if(!t.hasChildNodes())return n(null,e,t),pn(),void(t._vnode=e);h(t.firstChild,e,null,null,null),pn(),t._vnode=e},h]}var gr="data-allow-mismatch",yr={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function vr(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(gr);)e=e.parentElement;return br(e&&e.getAttribute(gr),t)}function br(e,t){if(null==e)return!1;if(""===e)return!0;{const n=e.split(",");return!(0!==t||!n.includes("children"))||n.includes(yr[t])}}var kr=z().requestIdleCallback||(e=>
1setTimeout(e,1)),wr=z().cancelIdleCallback||(e=>clearTimeout(e)),xr=(e=1e4)=>t=>{const n=kr(t,{timeout:e});return()=>wr(n)};var Sr=e=>(t,n)=>{const r=new IntersectionObserver(e=>{for(const n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element)return function(e){const{top:t,left:n,bottom:r,right:o}=e.getBoundingClientRect(),{innerHeight:s,innerWidth:i}=window;return(t>0&&t<s||r>0&&r<s)&&(n>0&&n<i||o>0&&o<i)}(e)?(t(),r.disconnect(),!1):void r.observe(e)}),()=>r.disconnect()},Cr=e=>t=>{if(e){const n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},Mr=(e=[])=>(t,n)=>{y(e)&&(e=[e]);let r=!1;const o=e=>{r||(r=!0,s(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},s=()=>{n(t=>{for(const n of e)t.removeEventListener(n,o)})};return n(t=>{for(const n of e)t.addEventListener(n,o,{once:!0})}),s};var Tr=e=>!!e.type.__asyncLoader;function Or(e){g(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,hydrate:s,timeout:i,suspensible:l=!0,onError:a}=e;let c,d=null,h=0;const u=()=>{let e;return d||(e=d=t().catch(e=>{if(e=e instanceof Error?e:new Error(String(e)),a)return new Promise((t,n)=>{a(e,()=>t((h++,d=null,u())),()=>n(e),h+1)});throw e}).then(t=>e!==d&&d?d:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),c=t,t)))};return rr({name:"AsyncComponentWrapper",__asyncLoader:u,__asyncHydrate(e,t,n){const r=e.isConnected;let o=!1;(t.bu||(t.bu=[])).push(()=>o=!0);const i=()=>{o||!e.parentNode||r&&!e.isConnected||n()},l=s?()=>{const n=s(i,t=>function(e,t){if(fr(e)&&"["===e.data){let n=1,r=e.nextSibling;for(;r;){if(1===r.nodeType){if(!1===t(r))break}else if(fr(r))if("]"===r.data){if(0===--n)break}else"["===r.data&&n++;r=r.nextSibling}}else t(e)}(e,t));n&&(t.bum||(t.bum=[])).push(n)}:i;c?l():u().then(()=>!t.isUnmounted&&l())},get __asyncResolved(){return c},setup(){const e=ii;if(sr(e),c)return()=>Er(c,e);const t=t=>{d=null,Zt(t,e,13,!r)};if(l&&e.suspense||pi)return u().then(t=>()=>Er(t,e)).catch(e=>(t(e),()=>r?Us(r,{error:e}):null));const s=Nt(!1),a=Nt(),h=Nt(!!o);let p,f;return Ur(()=>{null!=p&&clearTimeout(p),null!=f&&clearTimeout(f)}),o&&(f=setTimeout(()=>{e.isUnmounted||(h.value=!1)},o)),null!=i&&(p=setTimeout(()=>{if(!e.isUnmounted&&!s.value&&!a.value){const e=new Error(`Async component timed out after ${i}ms.`);t(e),a.value=e}},i)),u().then(()=>{e.isUnmounted||(s.value=!0,e.parent&&Ar(e.parent.vnode)&&e.parent.update())}).catch(n=>{e.isUnmounted?d=null:(t(n),a.value=n)}),()=>s.value&&c?Er(c,e):a.value&&r?Us(r,{error:a.value}):n&&!h.value?Er(n,e):void 0}})}function Er(e,t){const{ref:n,props:r,children:o,ce:s}=t.vnode,i=Us(e,r,o);return i.ref=n,i.ce=s,delete t.vnode.ce,i}var Ar=e=>e.type.__isKeepAlive,Nr={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=li(),r=n.ctx;if(!r.renderer)return()=>{const e=t.default&&t.default();return e&&1===e.length?e[0]:e};const o=new Map,s=new Set;let i=null;const l=n.suspense,{renderer:{p:a,m:c,um:d,o:{createElement:h}}}=r,u=h("div");function p(e){Lr(e),d(e,n,l,!0)}function f(e){o.forEach((t,n)=>{const r=bi(Tr(t)?t.type.__asyncResolved||{}:t.type);r&&!e(r)&&m(n)})}function m(e){const t=o.get(e);!t||i&&js(t,i)?i&&Lr(i):p(t),o.delete(e),s.delete(e)}r.activate=(e,t,n,r,o)=>{const s=e.component;c(e,t,n,0,l),a(s.vnode,e,t,n,s,l,r,e.slotScopeIds,o),as(()=>{s.isDeactivated=!1,s.a&&_(s.a);const t=e.props&&e.props.onVnodeMounted;t&&ti(t,s.parent,e)},l)},r.deactivate=e=>{const t=e.component;ys(t.m),ys(t.a),c(e,u,null,1,l),as(()=>{t.da&&_(t.da);const n=e.props&&e.props.onVnodeUnmounted;n&&ti(n,t.parent,e),t.isDeactivated=!0},l)},On(()=>[e.include,e.exclude],([e,t])=>{e&&f(t=>Dr(e,t)),t&&f(e=>!Dr(t,e))},{flush:"post",deep:!0});let g=null;const y=()=>{null!=g&&(bs(n.subTree.type)?as(()=>{o.set(g,$r(n.subTree))},n.subTree.suspense):o.set(g,$r(n.subTree)))};return jr(y),Hr(y),Wr(()=>{o.forEach(e=>{const{subTree:t,suspense:r}=n,o=$r(t);if(e.type===o.type&&e.key===o.key){Lr(o);const e=o.component.da;return void(e&&as(e,r))}p(e)})}),()=>{if(g=null,!t.default)return i=null;
1const n=t.default(),r=n[0];if(n.length>1)return i=null,n;if(!(Fs(r)&&(4&r.shapeFlag||128&r.shapeFlag)))return i=null,r;let l=$r(r);if(l.type===As)return i=null,l;const a=l.type,c=bi(Tr(l)?l.type.__asyncResolved||{}:a),{include:d,exclude:h,max:u}=e;if(d&&(!c||!Dr(d,c))||h&&c&&Dr(h,c))return l.shapeFlag&=-257,i=l,r;const p=null==l.key?a:l.key,f=o.get(p);return l.el&&(l=Ks(l),128&r.shapeFlag&&(r.ssContent=l)),g=p,f?(l.el=f.el,l.component=f.component,l.transition&&tr(l,l.transition),l.shapeFlag|=512,s.delete(p),s.add(p)):(s.add(p),u&&s.size>parseInt(u,10)&&m(s.values().next().value)),l.shapeFlag|=256,i=l,bs(r.type)?r:l}}};function Dr(e,t){return u(e)?e.some(e=>Dr(e,t)):y(e)?e.split(",").includes(t):"[object RegExp]"===x(e)&&(e.lastIndex=0,e.test(t))}function Rr(e,t){_r(e,"a",t)}function Ir(e,t){_r(e,"da",t)}function _r(e,t,n=ii){const r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(zr(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Ar(e.parent.vnode)&&Pr(r,t,n,e),e=e.parent}}function Pr(e,t,n,r){const o=zr(t,e,r,!0);Ur(()=>{c(r[t],o)},n)}function Lr(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function $r(e){return 128&e.shapeFlag?e.ssContent:e}function zr(e,t,n=ii,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...r)=>{Ce();const o=ai(n),s=Yt(t,n,e,r);return o(),Me(),s});return r?o.unshift(s):o.push(s),s}}var Br=e=>(t,n=ii)=>{pi&&"sp"!==e||zr(e,(...e)=>t(...e),n)},Fr=Br("bm"),jr=Br("m"),Vr=Br("bu"),Hr=Br("u"),Wr=Br("bum"),Ur=Br("um"),qr=Br("sp"),Kr=Br("rtg"),Jr=Br("rtc");function Gr(e,t=ii){zr("ec",e,t)}var Qr="components";function Xr(e,t){return to(Qr,e,!0,t)||e}var Yr=Symbol.for("v-ndc");function Zr(e){return y(e)?to(Qr,e,!1)||e:e||Yr}function eo(e){return to("directives",e)}function to(e,t,n=!0,r=!1){const o=gn||ii;if(o){const n=o.type;if(e===Qr){const e=bi(n,!1);if(e&&(e===t||e===E(t)||e===D(E(t))))return n}const s=no(o[e]||n[e],t)||no(o.appContext[e],t);return!s&&r?n:s}}function no(e,t){return e&&(e[t]||e[E(t)]||e[D(E(t))])}function ro(e,t,n,r){let o;const s=n&&n[r],i=u(e);if(i||y(e)){let n=!1,r=!1;i&&wt(e)&&(n=!St(e),r=xt(e),e=ze(e)),o=new Array(e.length);for(let i=0,l=e.length;i<l;i++)o[i]=t(n?r?Et(Ot(e[i])):Ot(e[i]):e[i],i,void 0,s&&s[i])}else if("number"==typeof e){o=new Array(e);for(let n=0;n<e;n++)o[n]=t(n+1,n,void 0,s&&s[n])}else if(b(e))if(e[Symbol.iterator])o=Array.from(e,(e,n)=>t(e,n,void 0,s&&s[n]));else{const n=Object.keys(e);o=new Array(n.length);for(let r=0,i=n.length;r<i;r++){const i=n[r];o[r]=t(e[i],i,r,s&&s[r])}}else o=[];return n&&(n[r]=o),o}function oo(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(u(r))for(let t=0;t<r.length;t++)e[r[t].name]=r[t].fn;else r&&(e[r.name]=r.key?(...e)=>{const t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function so(e,t,n={},r,o,s){if(gn.ce||gn.parent&&Tr(gn.parent)&&gn.parent.ce){const e=null!=s&&null==n.key?a({},n,{key:s}):n,o=Object.keys(e).length>0;return"default"!==t&&(e.name=t),Is(),Bs(Os,null,[Us("slot",e,r&&r())],o?-2:64)}let i=e[t];i&&i._c&&(i._d=!1);const l=Ds.length;let c;Is();try{const o=i&&io(i(n)),l=n.key||s||o&&o.key;c=Bs(Os,{key:(l&&!v(l)?l:`_${t}`)+(!o&&r?"_fb":"")},o||(r?r():[]),o&&1===e._?64:-2)}catch(d){for(let e=Ds.length;e>l;e--)_s();throw d}finally{i&&i._c&&(i._d=!0)}return!o&&c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),c}function io(e){return e.some(e=>!Fs(e)||e.type!==As&&!(e.type===Os&&!io(e.children)))?e:null}function lo(e,t){const n={};for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:R(r)]=e[r];return n}var ao=e=>e?di(e)?vi(e):ao(e.parent):null,co=a(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ao(e.parent),$root:e=>ao(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>So(e),$forceUpdate:e=>e.f||(e.f=()=>{cn(e.update)}),$nextTick:e=>e.n||(e.n=an.bind(e.proxy)),$watch:e=>An.bind(e)}),ho=(e,t)=>e!==n&&!e.__isScriptSetup&&h(e,t),uo={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:r,setupState:o,data:s,props:i,accessCache:l,type:a,appContext:c}=e;if("$"!==t[0]){const e=l[t];if(void 0!==e)switch(e){case 1:return o[t];case 2:return s[t];case 4:return r[t];case 3:return i[t]}else{if(ho(o,t))return l[t]=1,o[t];if(s!==n&&h(s,t))return l[t]=2,s[t];if(h(i,t))return l[t]=3,i[t];if(r!==n&&h(r,t))return l[t]=4,r[t];bo&&(l[t]=0)}}const d=co[t];let u,p;return d?("$attrs"===t&&Pe(e.attrs,0,""),d(e)):(u=a.__cssModules)&&(u=u[t])?u:r!==n&&h(r,t)?(l[t]=4,r[t]):(p=c.config.globalProperties,h(p,t)?p[t]:void 0)},set({_:e},t,r){const{data:o,setupState:s,ctx:i}=e;return ho(s,t)?(s[t]=r,!0):o!==n&&h(o,t)?(o[t]=r,!0):!h(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(i[t]=r,!0))},has({_:{data:e,setupState:t,accessCache:r,ctx:o,appContext:s,props:i,type:l}},a){let c;return!!(r[a]||e!==n&&"$"!==a[0]&&h(e,a)||ho(t,a)||h(i,a)||h(o,a)||h(co,a)||h(s.config.globalProperties,a)||(c=l.__cssModules)&&c[a])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:h(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};
1function po(){return mo("useSlots").slots}function fo(){return mo("useAttrs").attrs}function mo(e){const t=li();return t.setupContext||(t.setupContext=yi(t))}function go(e){return u(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function yo(e,t){return e&&t?u(e)&&u(t)?e.concat(t):a({},go(e),go(t)):e||t}function vo(e){const t=li(),n=pi;let r=e();ci(),n&&si(!1);const o=()=>{ai(t),n&&si(!0)},s=()=>{li()!==t&&t.scope.off(),ci(),n&&si(!1)};return k(r)&&(r=r.catch(e=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(s)),e})),[r,()=>{o(),Promise.resolve().then(s)}]}var bo=!0;function ko(e){const t=So(e),n=e.proxy,r=e.ctx;bo=!1,t.beforeCreate&&wo(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:l,watch:a,provide:c,inject:d,created:h,beforeMount:p,mounted:f,beforeUpdate:m,updated:y,activated:v,deactivated:k,beforeDestroy:w,beforeUnmount:x,destroyed:S,unmounted:C,render:M,renderTracked:T,renderTriggered:O,errorCaptured:E,serverPrefetch:A,expose:N,inheritAttrs:D,components:R,directives:I,filters:_}=t;if(d&&function(e,t){u(e)&&(e=Oo(e));for(const n in e){const r=e[n];let o;o=b(r)?"default"in r?Sn(r.from||n,r.default,!0):Sn(r.from||n):Sn(r),At(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e}):t[n]=o}}(d,r,null),l)for(const o in l){const e=l[o];g(e)&&(r[o]=e.bind(n))}if(s){const t=s.call(n,n);b(t)&&(e.data=gt(t))}if(bo=!0,i)for(const u in i){const e=i[u],t=g(e)?e.bind(n,n):g(e.get)?e.get.bind(n,n):o,s=!g(e)&&g(e.set)?e.set.bind(n):o,l=ki({get:t,set:s});Object.defineProperty(r,u,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e})}if(a)for(const o in a)xo(a[o],r,n,o);if(c){const e=g(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{xn(t,e[t])})}function P(e,t){u(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(h&&wo(h,e,"c"),P(Fr,p),P(jr,f),P(Vr,m),P(Hr,y),P(Rr,v),P(Ir,k),P(Gr,E),P(Jr,T),P(Kr,O),P(Wr,x),P(Ur,C),P(qr,A),u(N))if(N.length){const t=e.exposed||(e.exposed={});N.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||(e.exposed={});M&&e.render===o&&(e.render=M),null!=D&&(e.inheritAttrs=D),R&&(e.components=R),I&&(e.directives=I),A&&sr(e)}function wo(e,t,n){Yt(u(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function xo(e,t,n,r){let o=r.includes(".")?Nn(n,r):()=>n[r];if(y(e)){const n=t[e];g(n)&&On(o,n)}else if(g(e))On(o,e.bind(n));else if(b(e))if(u(e))e.forEach(e=>xo(e,t,n,r));else{const r=g(e.handler)?e.handler.bind(n):t[e.handler];g(r)&&On(o,r,e)}}function So(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:i}}=e.appContext,l=s.get(t);let a;return l?a=l:o.length||n||r?(a={},o.length&&o.forEach(e=>Co(a,e,i,!0)),Co(a,t,i)):a=t,b(t)&&s.set(t,a),a}function Co(e,t,n,r=!1){const{mixins:o,extends:s}=t;s&&Co(e,s,n,!0),o&&o.forEach(t=>Co(e,t,n,!0));for(const i in t)if(r&&"expose"===i);else{const r=Mo[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var Mo={data:To,props:No,emits:No,methods:Ao,computed:Ao,beforeCreate:Eo,created:Eo,beforeMount:Eo,mounted:Eo,beforeUpdate:Eo,updated:Eo,beforeDestroy:Eo,beforeUnmount:Eo,destroyed:Eo,unmounted:Eo,activated:Eo,deactivated:Eo,errorCaptured:Eo,serverPrefetch:Eo,components:Ao,directives:Ao,watch:function(e,t){if(!e)return t;if(!t)return e;const n=a(Object.create(null),e);for(const r in t)n[r]=Eo(e[r],t[r]);return n},provide:To,inject:function(e,t){return Ao(Oo(e),Oo(t))}};function To(e,t){return t?e?function(){return a(g(e)?e.call(this,this):e,g(t)?t.call(this,this):t)}:t:e}function Oo(e){if(u(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Eo(e,t){return e?[...new Set([].concat(e,t))]:t}function Ao(e,t){return e?a(Object.create(null),e,t):t}function No(e,t){return e?u(e)&&u(t)?[...new Set([...e,...t])]:a(Object.create(null),go(e),go(null!=t?t:{})):t}function Do(){return{app:null,config:{isNativeTag:s,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var Ro=0;function Io(e,t){return function(n,r=null){g(n)||(n=a({},n)),null==r||b(r)||(r=null);const o=Do(),s=new WeakSet,i=[];let l=!1;const c=o.app={_uid:Ro++,_component:n,_props:r,_container:null,_context:o,_instance:null,version:Si,get config(){return o.config},set config(e){},use:(e,...t)=>(s.has(e)||(e&&g(e.install)?(s.add(e),e.install(c,...t)):g(e)&&(s.add(e),e(c,...t))),c),mixin:e=>(o.mixins.includes(e)||o.mixins.push(e),c),component:(e,t)=>
1t?(o.components[e]=t,c):o.components[e],directive:(e,t)=>t?(o.directives[e]=t,c):o.directives[e],mount(s,i,a){if(!l){const d=c._ceVNode||Us(n,r);return d.appContext=o,!0===a?a="svg":!1===a&&(a=void 0),i&&t?t(d,s):e(d,s,a),l=!0,c._container=s,s.__vue_app__=c,vi(d.component)}},onUnmount(e){i.push(e)},unmount(){l&&(Yt(i,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide:(e,t)=>(o.provides[e]=t,c),runWithContext(e){const t=_o;_o=c;try{return e()}finally{_o=t}}};return c}}var _o=null;function Po(e,t,r=n){const o=li(),s=E(t),i=N(t),l=Lo(e,s),a=Bt((l,a)=>{let c,d,h=n;return En(()=>{const t=e[s];I(c,t)&&(c=t,a())},null,{flush:"sync"}),{get:()=>(l(),r.get?r.get(c):c),set(e){const l=r.set?r.set(e):e;if(!(I(l,c)||h!==n&&I(e,h)))return;const u=o.vnode.props,p=!!(u&&(t in u||s in u||i in u)&&(`onUpdate:${t}`in u||`onUpdate:${s}`in u||`onUpdate:${i}`in u));p||(c=e,a()),o.emit(`update:${t}`,l),I(e,h)&&(I(e,l)&&!I(l,d)||p&&h!==n&&!I(l,c))&&a(),h=e,d=l}}});return a[Symbol.iterator]=()=>{let e=0;return{next:()=>e<2?{value:e++?l||n:a,done:!1}:{done:!0}}},a}var Lo=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${E(t)}Modifiers`]||e[`${N(t)}Modifiers`];function $o(e,t,...r){if(e.isUnmounted)return;const o=e.vnode.props||n;let s=r;const i=t.startsWith("update:"),l=i&&Lo(o,t.slice(7));let a;l&&(l.trim&&(s=r.map(e=>y(e)?e.trim():e)),l.number&&(s=r.map(L)));let c=o[a=R(t)]||o[a=R(E(t))];!c&&i&&(c=o[a=R(N(t))]),c&&Yt(c,e,6,s);const d=o[a+"Once"];if(d){if(e.emitted){if(e.emitted[a])return}else e.emitted={};e.emitted[a]=!0,Yt(d,e,6,s)}}var zo=new WeakMap;function Bo(e,t,n=!1){const r=n?zo:t.emitsCache,o=r.get(e);if(void 0!==o)return o;const s=e.emits;let i={},l=!1;if(!g(e)){const r=e=>{const n=Bo(e,t,!0);n&&(l=!0,a(i,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return s||l?(u(s)?s.forEach(e=>i[e]=null):a(i,s),b(e)&&r.set(e,i),i):(b(e)&&r.set(e,null),null)}function Fo(e,t){return!(!e||!i(t))&&(t="Once"===(t=t.slice(2))?t:t.replace(/Once$/,""),h(e,t[0].toLowerCase()+t.slice(1))||h(e,N(t))||h(e,t))}function jo(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[s],slots:i,attrs:a,emit:c,render:d,renderCache:h,props:u,data:p,setupState:f,ctx:m,inheritAttrs:g}=e,y=vn(e);let v,b;try{if(4&n.shapeFlag){const e=o||r,t=e;v=Xs(d.call(t,e,h,u,f,p,m)),b=a}else{const e=t;v=Xs(e.length>1?e(u,{attrs:a,slots:i,emit:c}):e(u,null)),b=t.props?a:Vo(a)}}catch(w){Ds.length=0,Zt(w,e,1),v=Us(As)}let k=v;if(b&&!1!==g){const e=Object.keys(b),{shapeFlag:t}=k;e.length&&7&t&&(s&&e.some(l)&&(b=Ho(b,s)),k=Ks(k,b,!1,!0))}return n.dirs&&(k=Ks(k,null,!1,!0),k.dirs=k.dirs?k.dirs.concat(n.dirs):n.dirs),n.transition&&tr(k,n.transition),v=k,vn(y),v}var Vo=e=>{let t;for(const n in e)("class"===n||"style"===n||i(n))&&((t||(t={}))[n]=e[n]);return t},Ho=(e,t)=>{const n={};for(const r in e)l(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function Wo(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o<r.length;o++){const s=r[o];if(Uo(t,e,s)&&!Fo(n,s))return!0}return!1}function Uo(e,t,n){const r=e[n],o=t[n];return"style"===n&&b(r)&&b(o)?!G(r,o):r!==o}function qo({vnode:e,parent:t,suspense:n},r){for(;t;){const n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n!==e)break;(e=t.vnode).el=r,t=t.parent}n&&n.activeBranch===e&&(n.vnode.el=r)}var Ko={},Jo=()=>Object.create(Ko),Go=e=>Object.getPrototypeOf(e)===Ko;function Qo(e,t,r,o){const[s,i]=e.propsOptions;let l,a=!1;if(t)for(let n in t){if(M(n))continue;const c=t[n];let d;s&&h(s,d=E(n))?i&&i.includes(d)?(l||(l={}))[d]=c:r[d]=c:Fo(e.emitsOptions,n)||n in o&&c===o[n]||(o[n]=c,a=!0)}if(i){const t=Mt(r),o=l||n;for(let n=0;n<i.length;n++){const l=i[n];r[l]=Xo(s,t,l,o[l],e,!h(o,l))}}return a}function Xo(e,t,n,r,o,s){const i=e[n];if(null!=i){const e=h(i,"default");if(e&&void 0===r){const e=i.default;if(i.type!==Function&&!i.skipFactory&&g(e)){const{propsDefaults:s}=o;if(n in s)r=s[n];else{const i=ai(o);r=s[n]=e.call(null,t),i()}}else r=e;o.ce&&o.ce._setProp(n,r)}i[0]&&(s&&!e?r=!1:!i[1]||""!==r&&r!==N(n)||(r=!0))}return r}var Yo=new WeakMap;function Zo(e,t,o=!1){const s=o?Yo:t.propsCache,i=s.get(e);if(i)return i;const l=e.props,c={},d=[];let p=!1;if(!g(e)){const n=e=>{p=!0;const[n,r]=Zo(e,t,!0);a(c,n),r&&d.push(...r)};!o&&t.mixins.length&&t.mixins.forEach(n),e.extends&&n(e.extends),e.mixins&&e.mixins.forEach(n)}if(!l&&!p)return b(e)&&s.set(e,r),r;if(u(l))for(let r=0;r<l.length;r++){const e=E(l[r]);es(e)&&(c[e]=n)}else if(l)for(const n in l){const e=E(n);if(es(e)){const t=l[n],r=c[e]=u(t)||g(t)?{type:t}:a({},t),o=r.type;let s=!1,i=!0;if(u(o))for(let e=0;e<o.length;++e){const t=o[e],n=g(t)&&t.name;if("Boolean"===n){s=!0;break}"String"===n&&(i=!1)}else s=g(o)&&"Boolean"===o.name;r[0]=s,r[1]=i,(s||h(r,"default"))&&d.push(e)}}const f=[c,d];return b(e)&&s.set(e,f),f}function es(e){return"$"!==e[0]&&!M(e)}var ts=e=>"_"===e||"_ctx"===e||"$stable"===e,ns=e=>u(e)?e.map(Xs):[Xs(e)],rs=(e,t,n)=>{if(t._n)return t;const r=bn((...e)=>ns(t(...e)),n);return r._c=!1,r},ss=(e,t,n)=>{const r=e._ctx;
1for(const o in e){if(ts(o))continue;const n=e[o];if(g(n))t[o]=rs(0,n,r);else if(null!=n){const e=ns(n);t[o]=()=>e}}},is=(e,t)=>{const n=ns(t);e.slots.default=()=>n},ls=(e,t,n)=>{for(const r in t)!n&&ts(r)||(e[r]=t[r])},as=Ms;function cs(e){return hs(e)}function ds(e){return hs(e,mr)}function hs(e,t){z().__VUE__=!0;const{insert:s,remove:i,patchProp:l,createElement:a,createText:c,createComment:d,setText:u,setElementText:p,parentNode:f,nextSibling:m,setScopeId:g=o,insertStaticContent:y}=e,v=(e,t,n,r=null,o=null,s=null,i=void 0,l=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!js(e,t)&&(r=X(e),q(e,o,s,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);const{type:c,ref:d,shapeFlag:h}=t;switch(c){case Es:b(e,t,n,r);break;case As:w(e,t,n,r);break;case Ns:null==e&&x(t,n,r,i);break;case Os:I(e,t,n,r,o,s,i,l,a);break;default:1&h?S(e,t,n,r,o,s,i,l,a):6&h?L(e,t,n,r,o,s,i,l,a):(64&h||128&h)&&c.process(e,t,n,r,o,s,i,l,a,ee)}null!=d&&o?cr(d,e&&e.ref,s,t||e,!t):null==d&&e&&null!=e.ref&&cr(e.ref,null,s,e,!0)},b=(e,t,n,r)=>{if(null==e)s(t.el=c(t.children),n,r);else{const n=t.el=e.el;t.children!==e.children&&u(n,t.children)}},w=(e,t,n,r)=>{null==e?s(t.el=d(t.children||""),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=y(e.children,t,n,r,e.el,e.anchor)},S=(e,t,n,r,o,s,i,l,a)=>{if("svg"===t.type?i="svg":"math"===t.type&&(i="mathml"),null==e)C(t,n,r,o,s,i,l,a);else{const n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),A(e,t,o,s,i,l,a)}finally{n&&n._endPatch()}}},C=(e,t,n,r,o,i,c,d)=>{let h,u;const{props:f,shapeFlag:m,transition:g,dirs:y}=e;if(h=e.el=a(e.type,i,f&&f.is,f),8&m?p(h,e.children):16&m&&O(e.children,h,null,r,o,us(e,i),c,d),y&&wn(e,null,r,"created"),T(h,e,e.scopeId,c,r),f){for(const e in f)"value"===e||M(e)||l(h,e,null,f[e],i,r);"value"in f&&l(h,"value",null,f.value,i),(u=f.onVnodeBeforeMount)&&ti(u,r,e)}y&&wn(e,null,r,"beforeMount");const v=fs(o,g);v&&g.beforeEnter(h),s(h,t,n),((u=f&&f.onVnodeMounted)||v||y)&&as(()=>{try{u&&ti(u,r,e),v&&g.enter(h),y&&wn(e,null,r,"mounted")}finally{}},o)},T=(e,t,n,r,o)=>{if(n&&g(e,n),r)for(let s=0;s<r.length;s++)g(e,r[s]);if(o){let n=o.subTree;if(t===n||bs(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=o.vnode;T(e,t,t.scopeId,t.slotScopeIds,o.parent)}}},O=(e,t,n,r,o,s,i,l,a=0)=>{for(let c=a;c<e.length;c++){const a=e[c]=l?Ys(e[c]):Xs(e[c]);v(null,a,t,n,r,o,s,i,l)}},A=(e,t,r,o,s,i,a)=>{const c=t.el=e.el;let{patchFlag:d,dynamicChildren:h,dirs:u}=t;d|=16&e.patchFlag;const f=e.props||n,m=t.props||n;let g;if(r&&ps(r,!1),(g=m.onVnodeBeforeUpdate)&&ti(g,r,t,e),u&&wn(t,e,r,"beforeUpdate"),r&&ps(r,!0),!h||e.dynamicChildren&&e.dynamicChildren.length===h.length||(d=0,a=!1,h=null),(f.innerHTML&&null==m.innerHTML||f.textContent&&null==m.textContent)&&p(c,""),h?D(e.dynamicChildren,h,c,r,o,us(t,s),i):a||V(e,t,c,null,r,o,us(t,s),i,!1),d>0){if(16&d)R(c,f,m,r,s);else if(2&d&&f.class!==m.class&&l(c,"class",null,m.class,s),4&d&&l(c,"style",f.style,m.style,s),8&d){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t],o=f[n],i=m[n];i===o&&"value"!==n||l(c,n,o,i,s,r)}}1&d&&e.children!==t.children&&p(c,t.children)}else a||null!=h||R(c,f,m,r,s);((g=m.onVnodeUpdated)||u)&&as(()=>{g&&ti(g,r,t,e),u&&wn(t,e,r,"updated")},o)},D=(e,t,n,r,o,s,i)=>{for(let l=0;l<t.length;l++){const a=e[l],c=t[l],d=a.el&&(a.type===Os||!js(a,c)||198&a.shapeFlag)?f(a.el):n;v(a,c,d,null,r,o,s,i,!0)}},R=(e,t,r,o,s)=>{if(t!==r){if(t!==n)for(const n in t)M(n)||n in r||l(e,n,t[n],null,s,o);for(const n in r){if(M(n))continue;const i=r[n],a=t[n];i!==a&&"value"!==n&&l(e,n,a,i,s,o)}"value"in r&&l(e,"value",t.value,r.value,s)}},I=(e,t,n,r,o,i,l,a,d)=>{const h=t.el=e?e.el:c(""),u=t.anchor=e?e.anchor:c("");let{patchFlag:p,dynamicChildren:f,slotScopeIds:m}=t;m&&(a=a?a.concat(m):m),null==e?(s(h,n,r),s(u,n,r),O(t.children||[],n,u,o,i,l,a,d)):p>0&&64&p&&f&&e.dynamicChildren&&e.dynamicChildren.length===f.length?(D(e.dynamicChildren,f,n,o,i,l,a),(null!=t.key||o&&t===o.subTree)&&ms(e,t,!0)):V(e,t,n,u,o,i,l,a,d)},L=(e,t,n,r,o,s,i,l,a)=>{t.slotScopeIds=l,null==e?512&t.shapeFlag?o.ctx.activate(t,n,r,i,a):$(t,n,r,o,s,i,a):B(e,t,a)},$=(e,t,r,o,s,i,l)=>{const a=e.component=function(e,t,r){const o=e.type,s=(t?t.appContext:e.appContext)||ni,i={uid:ri++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new oe(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Zo(o,s),emitsOptions:Bo(o,s),emit:null,emitted:null,propsDefaults:n,inheritAttrs:o.inheritAttrs,ctx:n,data:n,props:n,attrs:n,slots:n,refs:n,setupState:n,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,
1sp:null};i.ctx={_:i},i.root=t?t.root:i,i.emit=$o.bind(null,i),e.ce&&e.ce(i);return i}(e,o,s);if(Ar(e)&&(a.ctx.renderer=ee),function(e,t=!1,n=!1){t&&si(t);const{props:r,children:o}=e.vnode,s=di(e);(function(e,t,n,r=!1){const o={},s=Jo();e.propsDefaults=Object.create(null),Qo(e,t,o,s);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=r?o:yt(o):e.type.props?e.props=o:e.props=s,e.attrs=s})(e,r,s,t),((e,t,n)=>{const r=e.slots=Jo();if(32&e.vnode.shapeFlag){const e=t._;e?(ls(r,t,n),n&&P(r,"_",e,!0)):ss(t,r)}else t&&is(e,t)})(e,o,n||t);const i=s?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,uo);const{setup:r}=n;if(r){Ce();const n=e.setupContext=r.length>1?yi(e):null,o=ai(e),s=Xt(r,e,0,[e.props,n]),i=k(s);if(Me(),o(),!i&&!e.sp||Tr(e)||sr(e),i){if(s.then(ci,ci),t)return s.then(n=>{fi(e,n,t)}).catch(t=>{Zt(t,e,0)});e.asyncDep=s}else fi(e,s,t)}else mi(e,t)}(e,t):void 0;t&&si(!1)}(a,!1,l),a.asyncDep){if(s&&s.registerDep(a,F,l),!e.el){const n=a.subTree=Us(As);w(null,n,t,r),e.placeholder=n.el}}else F(a,e,t,r,s,i,l)},B=(e,t,n)=>{const r=t.component=e.component;if(function(e,t,n){const{props:r,children:o,component:s}=e,{props:i,children:l,patchFlag:a}=t,c=s.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&a>=0))return!(!o&&!l||l&&l.$stable)||r!==i&&(r?!i||Wo(r,i,c):!!i);if(1024&a)return!0;if(16&a)return r?Wo(r,i,c):!!i;if(8&a){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(Uo(i,r,n)&&!Fo(c,n))return!0}}return!1}(e,t,n)){if(r.asyncDep&&!r.asyncResolved)return void j(r,t,n);r.next=t,r.update()}else t.el=e.el,r.vnode=t},F=(e,t,n,r,o,s,i)=>{e.scope.on();const l=e.effect=new he(()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:l,vnode:c}=e;{const n=gs(e);if(n)return t&&(t.el=c.el,j(e,t,i)),void n.asyncDep.then(()=>{as(()=>{e.isUnmounted||a()},o)})}let d,h=t;ps(e,!1),t?(t.el=c.el,j(e,t,i)):t=c,n&&_(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&ti(d,l,t,c),ps(e,!0);const u=jo(e),p=e.subTree;e.subTree=u,v(p,u,f(p.el),X(p),e,o,s),t.el=u.el,null===h&&qo(e,u.el),r&&as(r,o),(d=t.props&&t.props.onVnodeUpdated)&&as(()=>ti(d,l,t,c),o)}else{let i;const{el:l,props:a}=t,{bm:c,m:d,parent:h,root:u,type:p}=e,f=Tr(t);if(ps(e,!1),c&&_(c),!f&&(i=a&&a.onVnodeBeforeMount)&&ti(i,h,t),ps(e,!0),l&&ne){const t=()=>{e.subTree=jo(e),ne(l,e.subTree,e,o,null)};f&&p.__asyncHydrate?p.__asyncHydrate(l,e,t):t()}else{u.ce&&u.ce._hasShadowRoot()&&u.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);const i=e.subTree=jo(e);v(null,i,n,r,e,o,s),t.el=i.el}if(d&&as(d,o),!f&&(i=a&&a.onVnodeMounted)){const e=t;as(()=>ti(i,h,e),o)}(256&t.shapeFlag||h&&Tr(h.vnode)&&256&h.vnode.shapeFlag)&&e.a&&as(e.a,o),e.isMounted=!0,t=n=r=null}});e.scope.off();const a=e.update=l.run.bind(l),c=e.job=l.runIfDirty.bind(l);c.i=e,c.id=e.uid,l.scheduler=()=>cn(c),ps(e,!0),a()},j=(e,t,r)=>{t.component=e;const o=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,r){const{props:o,attrs:s,vnode:{patchFlag:i}}=e,l=Mt(o),[a]=e.propsOptions;let c=!1;if(!(r||i>0)||16&i){let r;Qo(e,t,o,s)&&(c=!0);for(const s in l)t&&(h(t,s)||(r=N(s))!==s&&h(t,r))||(a?!n||void 0===n[s]&&void 0===n[r]||(o[s]=Xo(a,l,s,void 0,e,!0)):delete o[s]);if(s!==l)for(const e in s)t&&h(t,e)||(delete s[e],c=!0)}else if(8&i){const n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let i=n[r];if(Fo(e.emitsOptions,i))continue;const d=t[i];if(a)if(h(s,i))d!==s[i]&&(s[i]=d,c=!0);else{const t=E(i);o[t]=Xo(a,l,t,d,e,!1)}else d!==s[i]&&(s[i]=d,c=!0)}}c&&Le(e.attrs,"set","")}(e,t.props,o,r),((e,t,r)=>{const{vnode:o,slots:s}=e;let i=!0,l=n;if(32&o.shapeFlag){const e=t._;e?r&&1===e?i=!1:ls(s,t,r):(i=!t.$stable,ss(t,s)),l=t}else t&&(is(e,t),l={default:1});if(i)for(const n in s)ts(n)||null!=l[n]||delete s[n]})(e,t.children,r),Ce(),un(e),Me()},V=(e,t,n,r,o,s,i,l,a=!1)=>{const c=e&&e.children,d=e?e.shapeFlag:0,h=t.children,{patchFlag:u,shapeFlag:f}=t;if(u>0){if(128&u)return void W(c,h,n,r,o,s,i,l,a);if(256&u)return void H(c,h,n,r,o,s,i,l,a)}8&f?(16&d&&Q(c,o,s),h!==c&&p(n,h)):16&d?16&f?W(c,h,n,r,o,s,i,l,a):Q(c,o,s,!0):(8&d&&p(n,""),16&f&&O(h,n,r,o,s,i,l,a))},H=(e,t,n,o,s,i,l,a,c)=>{t=t||r;const d=(e=e||r).length,h=t.length,u=Math.min(d,h);let p;for(p=0;p<u;p++){const r=t[p]=c?Ys(t[p]):Xs(t[p]);v(e[p],r,n,null,s,i,l,a,c)}d>h?Q(e,s,i,!0,!1,u):O(t,n,o,s,i,l,a,c,u)},W=(e,t,n,o,s,i,l,a,c)=>{let d=0;const h=t.length;let u=e.length-1,p=h-1;for(;d<=u&&d<=p;){const r=e[d],o=t[d]=c?Ys(t[d]):Xs(t[d]);if(!js(r,o))break;v(r,o,n,null,s,i,l,a,c),d++}for(;d<=u&&d<=p;){const r=e[u],o=t[p]=c?Ys(t[p]):Xs(t[p]);if(!js(r,o))break;v(r,o,n,null,s,i,l,a,c),u--,p--}if(d>u){if(d<=p){const e=p+1,r=e<h?t[e].el:o;for(;d<=p;)v(null,t[d]=c?Ys(t[d]):Xs(t[d]),n,r,s,i,l,a,c),d++}}else if(d>p)for(;d<=u;)q(e[d],s,i,!0),d++;else{const f=d,m=d,g=new Map;for(d=m;d<=p;d++){const e=t[d]=c?Ys(t[d]):Xs(t[d]);null!=e.key&&g.set(e.key,d)}let y,b=0;const k=p-m+1;let w=!1,x=0;const S=new Array(k);for(d=0;d<k;d++)S[d]=0;for(d=f;d<=u;d++){const r=e[d];if(b>=k){q(r,s,i,!0);continue}let o;if(null!=r.key)o=g.get(r.key);else for(y=m;y<=p;y++)if(0===S[y-m]&&js(r,t[y])){o=y;break}void 0===o?q(r,s,i,!0):(S[o-m]=d+1,o>=x?x=o:w=!0,v(r,t[o],n,null,s,i,l,a,c),b++)}const C=w?function(e){const t=e.slice(),n=[0];let r,o,s,i,l;const a=e.length;for(r=0;r<a;r++){const a=e[r];if(0!==a){if(o=n[n.length-1],e[o]<a){t[r]=o,n.push(r);continue}for(s=0,i=n.length-1;s<i;)l=s+i>>1,e[n[l]]<a?s=l+1:i=l;a<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}s=n.length,i=n[s-1];for(;s-- >0;)n[s]=i,i=t[i];return n}(S):r;for(y=C.length-1,d=k-1;d>=0;d--){const e=m+d,r=t[e],u=t[e+1],p=e+1<h?u.el||vs(u):o;0===S[d]?v(null,r,n,p,s,i,l,a,c):w&&(y<0||d!==C[y]?U(r,n,p,2):y--)}}},U=(e,t,n,r,o=null)=>{const{el:l,type:a,transition:c,children:d,shapeFlag:h}=e;if(6&h)U(e.component.subTree,t,n,r);else if(128&h)e.suspense.move(t,n,r);else if(64&h)a.move(e,t,n,ee);else if(a!==Os)if(a!==Ns)if(2!==r&&1&h&&c)if(0===r)c.persisted&&!l[Hn]?s(l,t,n):(c.beforeEnter(l),s(l,t,n
1),as(()=>c.enter(l),o));else{const{leave:r,delayLeave:o,afterLeave:a}=c,d=()=>{e.ctx.isUnmounted?i(l):s(l,t,n)},h=()=>{const e=l._isLeaving||!!l[Hn];l._isLeaving&&l[Hn](!0),c.persisted&&!e?d():r(l,()=>{d(),a&&a()})};o?o(l,d,h):h()}else s(l,t,n);else(({el:e,anchor:t},n,r)=>{let o;for(;e&&e!==t;)o=m(e),s(e,n,r),e=o;s(t,n,r)})(e,t,n);else{s(l,t,n);for(let e=0;e<d.length;e++)U(d[e],t,n,r);s(e.anchor,t,n)}},q=(e,t,n,r=!1,o=!1)=>{const{type:s,props:i,ref:l,children:a,dynamicChildren:c,shapeFlag:d,patchFlag:h,dirs:u,cacheIndex:p,memo:f}=e;if(-2===h&&(o=!1),null!=l&&(Ce(),cr(l,null,n,e,!0),Me()),null!=p&&(t.renderCache[p]=void 0),256&d)return void t.ctx.deactivate(e);const m=1&d&&u,g=!Tr(e);let y;if(g&&(y=i&&i.onVnodeBeforeUnmount)&&ti(y,t,e),6&d)G(e.component,n,r);else{if(128&d)return void e.suspense.unmount(n,r);m&&wn(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,ee,r):c&&!c.hasOnce&&(s!==Os||h>0&&64&h)?Q(c,t,n,!1,!0):(s===Os&&384&h||!o&&16&d)&&Q(a,t,n),r&&K(e)}const v=null!=f&&null==p;(g&&(y=i&&i.onVnodeUnmounted)||m||v)&&as(()=>{y&&ti(y,t,e),m&&wn(e,null,t,"unmounted"),v&&(e.el=null)},n)},K=e=>{const{type:t,el:n,anchor:r,transition:o}=e;if(t===Os)return void J(n,r);if(t===Ns)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=m(e),i(e),e=n;i(t)})(e);const s=()=>{i(n),o&&!o.persisted&&o.afterLeave&&o.afterLeave()};if(1&e.shapeFlag&&o&&!o.persisted){const{leave:t,delayLeave:r}=o,i=()=>t(n,s);r?r(e.el,s,i):i()}else s()},J=(e,t)=>{let n;for(;e!==t;)n=m(e),i(e),e=n;i(t)},G=(e,t,n)=>{const{bum:r,scope:o,job:s,subTree:i,um:l,m:a,a:c}=e;ys(a),ys(c),r&&_(r),o.stop(),s&&(s.flags|=8,q(i,e,t,n)),l&&as(l,t),as(()=>{e.isUnmounted=!0},t)},Q=(e,t,n,r=!1,o=!1,s=0)=>{for(let i=s;i<e.length;i++)q(e[i],t,n,r,o)},X=e=>{if(6&e.shapeFlag)return X(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=m(e.anchor||e.el),n=t&&t[Rn];return n?m(n):t};let Y=!1;const Z=(e,t,n)=>{let r;null==e?t._vnode&&(q(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,Y||(Y=!0,un(r),pn(),Y=!1)},ee={p:v,um:q,m:U,r:K,mt:$,mc:O,pc:V,pbc:D,n:X,o:e};let te,ne;return t&&([te,ne]=t(ee)),{render:Z,hydrate:te,createApp:Io(Z,te)}}function us({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function ps({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function fs(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ms(e,t,n=!1){const r=e.children,o=t.children;if(u(r)&&u(o))for(let s=0;s<r.length;s++){const e=r[s];let t=o[s];1&t.shapeFlag&&!t.dynamicChildren&&((t.patchFlag<=0||32===t.patchFlag)&&(t=o[s]=Ys(o[s]),t.el=e.el),n||-2===t.patchFlag||ms(e,t)),t.type===Es&&(-1===t.patchFlag&&(t=o[s]=Ys(t)),t.el=e.el),t.type!==As||t.el||(t.el=e.el)}}function gs(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:gs(t)}function ys(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function vs(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?vs(t.subTree):null}var bs=e=>e.__isSuspense,ks=0,ws={name:"Suspense",__isSuspense:!0,process(e,t,n,r,o,s,i,l,a,c){if(null==e)!function(e,t,n,r,o,s,i,l,a){const{p:c,o:{createElement:d}}=a,h=d("div"),u=e.suspense=Ss(e,o,r,t,h,n,s,i,l,a);c(null,u.pendingBranch=e.ssContent,h,null,r,u,s,i),u.deps>0?(xs(e,"onPending"),xs(e,"onFallback"),c(null,e.ssFallback,t,n,r,null,s,i),Ts(u,e.ssFallback)):u.resolve(!1,!0)}(t,n,r,o,s,i,l,a,c);else{if(s&&s.deps>0&&!e.suspense.isInFallback)return t.suspense=e.suspense,t.suspense.vnode=t,void(t.el=e.el);!function(e,t,n,r,o,s,i,l,{p:a,um:c,o:{createElement:d}}){const h=t.suspense=e.suspense;h.vnode=t,t.el=e.el;const u=t.ssContent,p=t.ssFallback,{activeBranch:f,pendingBranch:m,isInFallback:g,isHydrating:y}=h;if(m)h.pendingBranch=u,js(m,u)?(a(m,u,h.hiddenContainer,null,o,h,s,i,l),h.deps<=0?h.resolve():g&&(y||(a(f,p,n,r,o,null,s,i,l),Ts(h,p)))):(h.pendingId=ks++,y?(h.isHydrating=!1,h.activeBranch=m):c(m,o,h),h.deps=0,h.effects.length=0,h.hiddenContainer=d("div"),g?(a(null,u,h.hiddenContainer,null,o,h,s,i,l),h.deps<=0?h.resolve():(a(f,p,n,r,o,null,s,i,l),Ts(h,p))):f&&js(f,u)?(a(f,u,n,r,o,h,s,i,l),h.resolve(!0)):(a(null,u,h.hiddenContainer,null,o,h,s,i,l),h.deps<=0&&h.resolve()));else if(f&&js(f,u))a(f,u,n,r,o,h,s,i,l),Ts(h,u);else if(xs(t,"onPending"),h.pendingBranch=u,512&u.shapeFlag?h.pendingId=u.component.suspenseId:h.pendingId=ks++,a(null,u,h.hiddenContainer,null,o,h,s,i,l),h.deps<=0)h.resolve();else{const{timeout:e,pendingId:t}=h;e>0?setTimeout(()=>
1{h.pendingId===t&&h.fallback(p)},e):0===e&&h.fallback(p)}}(e,t,n,r,o,i,l,a,c)}},hydrate:function(e,t,n,r,o,s,i,l,a){const c=t.suspense=Ss(t,r,n,e.parentNode,document.createElement("div"),null,o,s,i,l,!0),d=a(e,c.pendingBranch=t.ssContent,n,c,s,i);0===c.deps&&c.resolve(!1,!0);return d},normalize:function(e){const{shapeFlag:t,children:n}=e,r=32&t;e.ssContent=Cs(r?n.default:n),e.ssFallback=r?Cs(n.fallback):Us(As)}};function xs(e,t){const n=e.props&&e.props[t];g(n)&&n()}function Ss(e,t,n,r,o,s,i,l,a,c,d=!1){const{p:h,m:u,um:p,n:f,o:{parentNode:m,remove:g}}=c;let y;const v=function(e){const t=e.props&&e.props.suspensible;return null!=t&&!1!==t}(e);v&&t&&t.pendingBranch&&(y=t.pendingId,t.deps++);const b=e.props?$(e.props.timeout):void 0,k=s,w={vnode:e,parent:t,parentComponent:n,namespace:i,container:r,hiddenContainer:o,deps:0,pendingId:ks++,timeout:"number"==typeof b?b:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!d,isHydrating:d,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){const{vnode:r,activeBranch:o,pendingBranch:i,pendingId:l,effects:a,parentComponent:c,container:d,isInFallback:h}=w;let g=!1;if(w.isHydrating)w.isHydrating=!1;else if(!e){g=o&&i.transition&&"out-in"===i.transition.mode;let e=!1;g&&(o.transition.afterLeave=()=>{l===w.pendingId&&(u(i,d,s!==k||e?s:f(o),0),hn(a),h&&r.ssFallback&&(r.ssFallback.el=null))}),o&&!w.isFallbackMountPending&&(m(o.el)===d&&(s=f(o),e=!0),p(o,c,w,!0),!g&&h&&r.ssFallback&&as(()=>r.ssFallback.el=null,w)),g||u(i,d,s,0)}w.isFallbackMountPending=!1,Ts(w,i),w.pendingBranch=null,w.isInFallback=!1;let b=w.parent,x=!1;for(;b;){if(b.pendingBranch){b.effects.push(...a),x=!0;break}b=b.parent}x||g||hn(a),w.effects=[],v&&t&&t.pendingBranch&&y===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),xs(r,"onResolve")},fallback(e){if(!w.pendingBranch)return;const{vnode:t,activeBranch:n,parentComponent:r,container:o,namespace:s}=w;xs(t,"onFallback");const i=f(n),c=()=>{w.isFallbackMountPending=!1,w.isInFallback&&(h(null,e,o,i,r,null,s,l,a),Ts(w,e))},d=e.transition&&"out-in"===e.transition.mode;d&&(w.isFallbackMountPending=!0,n.transition.afterLeave=c),w.isInFallback=!0,p(n,r,null,!0),d||c()},move(e,t,n){w.activeBranch&&u(w.activeBranch,e,t,n),w.container=e},next:()=>w.activeBranch&&f(w.activeBranch),registerDep(e,t,n){const r=!!w.pendingBranch;r&&w.deps++;const o=e.vnode.el;e.asyncDep.catch(t=>{Zt(t,e,0)}).then(s=>{if(e.isUnmounted||w.isUnmounted||w.pendingId!==e.suspenseId)return;ci(),e.asyncResolved=!0;const{vnode:l}=e;fi(e,s,!1),o&&(l.el=o);const a=!o&&e.subTree.el;t(e,l,m(o||e.subTree.el),o?null:f(e.subTree),w,i,n),a&&(l.placeholder=null,g(a)),qo(e,l.el),r&&0===--w.deps&&w.resolve()})},unmount(e,t){w.isUnmounted=!0,w.activeBranch&&p(w.activeBranch,n,e,t),w.pendingBranch&&p(w.pendingBranch,n,e,t)}};return w}function Cs(e){let t;if(g(e)){const n=Ps&&e._c;n&&(e._d=!1,Is()),e=e(),n&&(e._d=!0,t=Rs,_s())}return u(e)&&(e=function(e){let t;for(let n=0;n<e.length;n++){const r=e[n];if(!Fs(r))return;if(r.type!==As||"v-if"===r.children){if(t)return;t=r}}return t}(e)),e=Xs(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function Ms(e,t){t&&t.pendingBranch?u(e)?t.effects.push(...e):t.effects.push(e):hn(e)}function Ts(e,t){e.activeBranch=t;const{vnode:n,parentComponent:r}=e;let o=t.el;for(;!o&&t.component;)o=(t=t.component.subTree).el;n.el=o,r&&r.subTree===n&&(r.vnode.el=o,qo(r,o))}var Os=Symbol.for("v-fgt"),Es=Symbol.for("v-txt"),As=Symbol.for("v-cmt"),Ns=Symbol.for("v-stc"),Ds=[],Rs=null;function Is(e=!1){Ds.push(Rs=e?null:[])}function _s(){Ds.pop(),Rs=Ds[Ds.length-1]||null}var Ps=1;function Ls(e,t=!1){Ps+=e,e<0&&Rs&&t&&(Rs.hasOnce=!0)}function $s(e){return e.dynamicChildren=Ps>0?Rs||r:null,_s(),Ps>0&&Rs&&Rs.push(e),e}function zs(e,t,n,r,o,s){return $s(Ws(e,t,n,r,o,s,!0))}function Bs(e,t,n,r,o){return $s(Us(e,t,n,r,o,!0))}function Fs(e){return!!e&&!0===e.__v_isVNode}function js(e,t){return e.type===t.type&&e.key===t.key}var Vs=({key:e})=>null!=e?e:null,Hs=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?y(e)||At(e)||g(e)?{i:gn,r:e,k:t,f:!!n}:e:null);function Ws(e,t=null,n=null,r=0,o=null,s=(e===Os?0:1),i=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,t
1ype:e,props:t,key:t&&Vs(t),ref:t&&Hs(t),scopeId:yn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:gn};return l?(Zs(a,n),128&s&&e.normalize(a)):n&&(a.shapeFlag|=y(n)?8:16),Ps>0&&!i&&Rs&&(a.patchFlag>0||6&s)&&32!==a.patchFlag&&Rs.push(a),a}var Us=function(e,t=null,n=null,r=0,o=null,s=!1){e&&e!==Yr||(e=As);if(Fs(e)){const r=Ks(e,t,!0);return n&&Zs(r,n),Ps>0&&!s&&Rs&&(6&r.shapeFlag?Rs[Rs.indexOf(e)]=r:Rs.push(r)),r.patchFlag=-2,r}i=e,g(i)&&"__vccOpts"in i&&(e=e.__vccOpts);var i;if(t){t=qs(t);let{class:e,style:n}=t;e&&!y(e)&&(t.class=W(e)),b(n)&&(Ct(n)&&!u(n)&&(n=a({},n)),t.style=B(n))}const l=y(e)?1:bs(e)?128:In(e)?64:b(e)?4:g(e)?2:0;return Ws(e,t,n,r,o,l,s,!0)};function qs(e){return e?Ct(e)||Go(e)?a({},e):e:null}function Ks(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:l,transition:a}=e,c=t?ei(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Vs(c),ref:t&&t.ref?n&&s?u(s)?s.concat(Hs(t)):[s,Hs(t)]:Hs(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Os?-1===i?16:16|i:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ks(e.ssContent),ssFallback:e.ssFallback&&Ks(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&r&&tr(d,a.clone(d)),d}function Js(e=" ",t=0){return Us(Es,null,e,t)}function Gs(e,t){const n=Us(Ns,null,e);return n.staticCount=t,n}function Qs(e="",t=!1){return t?(Is(),Bs(As,null,e)):Us(As,null,e)}function Xs(e){return null==e||"boolean"==typeof e?Us(As):u(e)?Us(Os,null,e.slice()):Fs(e)?Ys(e):Us(Es,null,String(e))}function Ys(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Ks(e)}function Zs(e,t){let n=0;const{shapeFlag:r}=e;if(null==t)t=null;else if(u(t))n=16;else if("object"==typeof t){if(65&r){const n=t.default;return void(n&&(n._c&&(n._d=!1),Zs(e,n()),n._c&&(n._d=!0)))}{n=32;const r=t._;r||Go(t)?3===r&&gn&&(1===gn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=gn}}else if(g(t)){if(65&r)return void Zs(e,{default:t});t={default:t,_ctx:gn},n=32}else t=String(t),64&r?(n=16,t=[Js(t)]):n=8;e.children=t,e.shapeFlag|=n}function ei(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const e in r)if("class"===e)t.class!==r.class&&(t.class=W([t.class,r.class]));else if("style"===e)t.style=B([t.style,r.style]);else if(i(e)){const n=t[e],o=r[e];!o||n===o||u(n)&&n.includes(o)?null!=o||null!=n||l(e)||(t[e]=o):t[e]=n?[].concat(n,o):o}else""!==e&&(t[e]=r[e])}return t}function ti(e,t,n,r=null){Yt(e,t,7,[n,r])}var ni=Do(),ri=0;var oi,si,ii=null,li=()=>ii||gn;{const e=z(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};oi=t("__VUE_INSTANCE_SETTERS__",e=>ii=e),si=t("__VUE_SSR_SETTERS__",e=>pi=e)}var ai=e=>{const t=ii;return oi(e),e.scope.on(),()=>{e.scope.off(),oi(t)}},ci=()=>{ii&&ii.scope.off(),oi(null)};function di(e){return 4&e.vnode.shapeFlag}var hi,ui,pi=!1;function fi(e,t,n){g(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:b(t)&&(e.setupState=$t(t)),mi(e,n)}function mi(e,t,n){const r=e.type;if(!e.render){if(!t&&hi&&!r.render){const t=r.template||So(e).template;if(t){const{isCustomElement:n,compilerOptions:o}=e.appContext.config,{delimiters:s,compilerOptions:i}=r,l=a(a({isCustomElement:n,delimiters:s},o),i);r.render=hi(t,l)}}e.render=r.render||o,ui&&ui(e)}{const t=ai(e);Ce();try{ko(e)}finally{Me(),t()}}}var gi={get:(e,t)=>(Pe(e,0,""),e[t])};function yi(e){return{attrs:new Proxy(e.attrs,gi),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function vi(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy($t(Tt(e.exposed)),{get:(t,n)=>n in t?t[n]:n in co?co[n](e):void 0,has:(e,t)=>t in e||t in co})):e.proxy}function bi(e,t=!0){return g(e)?e.displayName||e.name:e.name||t&&e.__name}var ki=(e,t)=>function(e,t,n=!1){let r,o;return g(e)?r=e:(r=e.get,o=e.set),new Ut(r,o,n)}(e,0,pi);function wi(e,t,n){try{Ls(-1);const r=arguments.length;return 2===r?b(t)&&!u(t)?Fs(t)?Us(e,null,[t]):Us(e,t):Us(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):3===r&&Fs(n)&&(n=[n]),Us(e,t,n))}finally{Ls(1)}}function xi(e,t,n,r){const o=n[r];if(o&&function(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let r=0;r<n.length;r++)if(I(n[r],t[r]))return!1;Ps>0&&Rs&&Rs.push(e);return!0}(o,e))return o;const s=t();return s.memo=e.slice(),s.cacheIndex=r,n[r]=s}var Si="3.5.40";function Ci(e){this.content=e}function Mi(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),s=t.child(r);
1if(o!=s){if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&Ei(e.charCodeAt(r-1))&&Oi(e.charCodeAt(r))&&n--,n}if(o.content.size||s.content.size){let e=Mi(o.content,s.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function Ti(e,t,n,r){for(let o=e.childCount,s=t.childCount;;){if(0==o||0==s)return o==s?null:{a:n,b:r};let i=e.child(--o),l=t.child(--s),a=i.nodeSize;if(i!=l){if(!i.sameMarkup(l))return{a:n,b:r};if(i.isText&&i.text!=l.text){let e=i.text,t=l.text,o=e.length,s=t.length;for(;o>0&&s>0&&e[o-1]==t[s-1];)o--,s--,n--,r--;return o&&s&&o<e.length&&Ei(e.charCodeAt(o-1))&&Oi(e.charCodeAt(o))&&(n++,r++),{a:n,b:r}}if(i.content.size||l.content.size){let e=Ti(i.content,l.content,n-1,r-1);if(e)return e}n-=a,r-=a}else n-=a,r-=a}}function Oi(e){return e>=56320&&e<57344}function Ei(e){return e>=55296&&e<56320}Ci.prototype={constructor:Ci,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),s=r.content.slice();return-1==o?s.push(n||e,t):(s[o+1]=t,n&&(s[o]=n)),new Ci(s)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new Ci(n)},addToStart:function(e,t){return new Ci([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Ci(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),s=r.find(e);return o.splice(-1==s?o.length:s,0,t,n),new Ci(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=Ci.from(e)).size?new Ci(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=Ci.from(e)).size?new Ci(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Ci.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Ci.from=function(e){if(e instanceof Ci)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ci(t)};var Ai=class e{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,r=0,o){for(let s=0,i=0;i<t;s++){let l=this.content[s],a=i+l.nodeSize;if(a>e&&!1!==n(l,r+i,o||null,s)&&l.content.size){let o=i+1;l.nodesBetween(Math.max(0,e-o),Math.min(l.content.size,t-o),n,r+o)}i=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",s=!0;return this.nodesBetween(e,t,(i,l)=>{let a=i.isText?i.text.slice(Math.max(e,l)-l,t-l):i.isLeaf?r?"function"==typeof r?r(i):r:i.type.spec.leafText?i.type.spec.leafText(i):"":"";i.isBlock&&(i.isLeaf&&a||i.isTextblock)&&n&&(s?s=!1:o+=n),o+=a},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),s=1);s<t.content.length;s++)o.push(t.content[s]);return new e(o,this.size+t.size)}cut(t,n=this.size){if(0==t&&n==this.size)return this;let r=[],o=0;if(n>t)for(let e=0,s=0;s<n;e++){let i=this.content[e],l=s+i.nodeSize;l>t&&((s<t||l>n)&&(i=i.isText?i.cut(Math.max(0,t-s),Math.min(i.text.length,n-s)):i.cut(Math.max(0,t-s-1),Math.min(i.content.size,n-s-1))),r.push(i),o+=i.nodeSize),s=l}return new e(r,o)}cutByIndex(t,n){return t==n?e.empty:0==t&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new e(o,s)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Mi(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Ti(this,e,t,n)}findIndex(e){if(0==e)return Di(0,e);if(e==this.size)return Di(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e)return r==e?Di(t+1,r):Di(t,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let o=t[e];r+=o.nodeSize,e&&o.isText&&t[e-1].sameMarkup(o)?(n||(n=t.slice(0,e)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};Ai.empty=new Ai([],0);var Ni={index:0,offset:0};function Di(e,t){return Ni.index=e,Ni.offset=t,Ni}function Ri(e,t){if(e===t)return!0;
1if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Ri(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Ri(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Ii=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ri(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};Ii.none=[];var _i=class extends Error{},Pi=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=$i(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Li(this.content,t+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(t,n){if(!n)return e.empty;let r=n.openStart||0,o=n.openEnd||0;if("number"!=typeof r||"number"!=typeof o)throw new RangeError("Invalid input for Slice.fromJSON");return new e(Ai.fromJSON(t,n.content),r,o)}static maxOpen(t,n=!0){let r=0,o=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)o++;return new e(t,r,o)}};function Li(e,t,n){let{index:r,offset:o}=e.findIndex(t),s=e.maybeChild(r),{index:i,offset:l}=e.findIndex(n);if(o==t||s.isText){if(l!=n&&!e.child(i).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=i)throw new RangeError("Removing non-flat range");return e.replaceChild(r,s.copy(Li(s.content,t-o-1,n-o-1)))}function $i(e,t,n,r,o,s){let{index:i,offset:l}=e.findIndex(t),a=e.maybeChild(i);if(l==t||a.isText)return s&&r<=0&&o<=0&&!s.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let c=$i(a.content,t-l-1,n,0==i?r-1:0,i==e.childCount-1?o-1:0,a);return c&&e.replaceChild(i,a.copy(c))}function zi(e,t,n){if(n.openStart>e.depth)throw new _i("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new _i("Inconsistent open depths");return Bi(e,t,n,0)}function Bi(e,t,n,r){let o=e.index(r),s=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let i=Bi(e,t,n,r+1);return s.copy(s.content.replaceChild(o,i))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:o,end:i}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)r=t.node(o).copy(Ai.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Wi(s,Ui(e,o,i,t,r))}{let r=e.parent,o=r.content;return Wi(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return Wi(s,qi(e,t,r))}function Fi(e,t){if(!t.type.compatibleContent(e.type))throw new _i("Cannot join "+t.type.name+" onto "+e.type.n
1ame)}function ji(e,t,n){let r=e.node(n);return Fi(r,t.node(n)),r}function Vi(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Hi(e,t,n,r){let o=(t||e).node(n),s=0,i=t?t.index(n):o.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(Vi(e.nodeAfter,r),s++));for(let l=s;l<i;l++)Vi(o.child(l),r);t&&t.depth==n&&t.textOffset&&Vi(t.nodeBefore,r)}function Wi(e,t){if(!e.type.validContent(t))throw new _i("Invalid content for node "+e.type.name);return e.copy(t)}function Ui(e,t,n,r,o){let s=e.depth>o&&ji(e,t,o+1),i=r.depth>o&&ji(n,r,o+1),l=[];return Hi(null,e,o,l),s&&i&&t.index(o)==n.index(o)?(Fi(s,i),Vi(Wi(s,Ui(e,t,n,r,o+1)),l)):(s&&Vi(Wi(s,qi(e,t,o+1)),l),Hi(t,n,o,l),i&&Vi(Wi(i,qi(n,r,o+1)),l)),Hi(r,null,o,l),new Ai(l)}function qi(e,t,n){let r=[];return Hi(null,e,n,r),e.depth>n&&Vi(Wi(ji(e,t,n+1),qi(e,t,n+1)),r),Hi(t,null,n,r),new Ai(r)}Pi.empty=new Pi(Ai.empty,0,0);var Ki=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let o=0;o<e;o++)r+=n.child(o).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return Ii.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let o=n.marks;for(var s=0;s<o.length;s++)!1!==o[s].type.spec.inclusive||r&&o[s].isInSet(r.marks)||(o=o[s--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Xi(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,s=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(s),i=s-n;if(r.push(e,t,o+n),!i)break;if(e=e.child(t),e.isText)break;s=i-1,o+=n+1}return new e(n,r,s)}static resolveCached(t,n){let r=Qi.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Qi.set(t,r=new Ji);let o=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Gi,o}},Ji=class{constructor(){this.elts=[],this.i=0}},Gi=12,Qi=new WeakMap,Xi=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Yi=Object.create(null),Zi=class e{constructor(e,t,n,r=Ii.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Ai.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,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}
vendor: 4,234 bytes, line 1
1textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Ri(this.attrs,t||e.defaultAttrs||Yi)&&Ii.sameSet(this.marks,n||Ii.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Pi.empty;let r=this.resolve(e),o=this.resolve(t),s=n?0:r.sharedDepth(t),i=r.start(s),l=r.node(s).content.cut(r.pos-i,o.pos-i);return new Pi(l,r.depth-s,o.depth-s)}replace(e,t,n){return zi(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Ki.resolveCached(this,e)}resolveNoCache(e){return Ki.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),tl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Ai.empty,r=0,o=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,r,o),i=s&&s.matchFragment(this.content,t);if(!i||!i.validEnd)return!1;for(let l=r;l<o;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(n),s=o&&o.matchFragment(this.content,t);return!!s&&s.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Ii.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Ii.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=Ai.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,r,n);return o.type.checkAttrs(o.attrs),o}};Zi.prototype.text=void 0;var el=class e extends Zi{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):tl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}
1mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function tl(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var nl=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new rl(t,n);if(null==r.next)return e.empty;let o=ol(r);r.next&&r.err("Unexpected trailing text");let s=hl(function(e){let t=[[]];return o(s(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach(e=>e.to=t)}function s(e,t){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(s(n,t)),[]);if("seq"!=e.type){if("star"==e.type){let i=n();return r(t,i),o(s(e.expr,i),i),[r(i)]}if("plus"==e.type){let i=n();return o(s(e.expr,t),i),o(s(e.expr,i),i),[r(i)]}if("opt"==e.type)return[r(t)].concat(s(e.expr,t));if("range"==e.type){let i=t;for(let t=0;t<e.min;t++){let t=n();o(s(e.expr,i),t),i=t}if(-1==e.max)o(s(e.expr,i),i);else for(let t=e.min;t<e.max;t++){let t=n();r(i,t),o(s(e.expr,i),t),i=t}return[r(i)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let i=s(e.exprs[r],t);if(r==e.exprs.length-1)return i;o(i,t=n())}}}(o));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,s=[];for(let t=0;t<e.next.length;t++){let{type:n,next:i}=e.next[t];s.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(i)&&r.push(i)}o&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,r),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function o(s,i){let l=s.matchFragment(e,n);if(l&&(!t||l.validEnd))return Ai.from(i.map(e=>e.createAndFill()));for(let e=0;e<s.next.length;e++){let{type:t,next:n}=s.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=o(n,i.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:s,next:i}=o.next[e];s.isLeaf||s.hasRequiredAttrs()||s.name in t||r.type&&!i.validEnd||(n.push({match:s.contentMatch,type:s,via:r}),t[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let o=0;o<t.next.length;o++)r+=(o?", ":"")+t.next[o].type.name+"->"+e.indexOf(t.next[o].next);return r}).join("\n")}};nl.empty=new nl(!0);var rl=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function ol(e){let t=[];do{t.push(sl(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function sl(e){let t=[];do{t.push(il(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}
1function il(e){let t=function(e){if(e.eat("(")){let t=ol(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let s in n){let e=n[s];e.isInGroup(t)&&o.push(e)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=al(e,t)}return t}function ll(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function al(e,t){let n=ll(e),r=n;return e.eat(",")&&(r="}"!=e.next?ll(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function cl(e,t){return t-e}function dl(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:s}=o[e];r||-1!=n.indexOf(s)||t(s)}}(t),n.sort(cl)}function hl(e){let t=Object.create(null);return function n(r){let o=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<o.length;e++)o[e][0]==t&&(r=o[e][1]);dl(e,n).forEach(e=>{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})})});let s=t[r.join(",")]=new nl(r.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let r=o[e][1].sort(cl);s.next.push({type:o[e][0],next:t[r.join(",")]||n(r)})}return s}(dl(e,0))}function ul(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function pl(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(void 0===o){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=t.default}n[r]=o}return n}function fl(e,t,n,r){for(let o in t)if(!(o in e))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${r}`);for(let o in e)e[o].validate&&e[o].validate(t[o])}function ml(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new yl(e,r,t[r]);return n}var gl=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=ml(e,n.attrs),this.defaultAttrs=ul(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==nl.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:pl(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Zi(this,this.computeAttrs(e),Ai.from(t),Ii.setFrom(n))}createChecked(e=null,t,n){return t=Ai.from(t),this.checkContent(t),new Zi(this,this.computeAttrs(e),t,Ii.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=Ai.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(Ai.empty,!0);return o?new Zi(this,e,t.append(o),Ii.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){fl(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Ii.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,o)=>r[t]=new e(t,n,o));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};var yl=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let o=null===n?"null":typeof n;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},vl=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=ml(e,r.attrs),this.excluded=null;let o=ul(this.attrs);this.instance=o?new Ii(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Ii(this,pl(this.attrs,e))}static compile(t,n){let r=Object.create(null),o=0;return t.forEach((t,s)=>r[t]=new e(t,o++,n,s)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){fl(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},bl=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=Ci.from(e.nodes),t.marks=Ci.from(e.marks||{}),this.nodes=gl.compile(this.spec.nodes,this),this.marks=vl.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let e=this.nodes[r],t=e.spec.content||"",o=e.spec.marks;if(e.contentMatch=n[t]||(n[t]=nl.parse(t,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==o?null:o?kl(this,o.split(" ")):""!=o&&e.inlineContent?null:[]}for(let r in this.marks){let e=this.marks[r],t=e.spec.excludes;e.excluded=null==t?[e]:""==t?[]:kl(this,t.split(" "))}this.nodeFromJSON=e=>Zi.fromJSON(this,e),this.markFromJSON=e=>Ii.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof gl))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new el(n,n.defaultAttrs,e,Ii.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}};function kl(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],s=e.marks[o],i=s;
1if(s)n.push(s);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(i=r)}if(!i)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}var wl=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new Ol(this,t,!1);return n.addAll(e,Ii.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Ol(this,t,!0);return n.addAll(e,Ii.none,t.from,t.to),Pi.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(El(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],s=r.style;if(!(0!=s.indexOf(e)||r.context&&!n.matchesContext(r.context)||s.length>e.length&&(61!=s.charCodeAt(e.length)||s.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let r in e.marks){let t=e.marks[r].spec.parseDOM;t&&t.forEach(e=>{n(e=Al(e)),e.mark||e.ignore||e.clearMark||(e.mark=r)})}for(let r in e.nodes){let t=e.nodes[r].spec.parseDOM;t&&t.forEach(e=>{n(e=Al(e)),e.node||e.ignore||e.mark||(e.node=r)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},xl={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},Sl={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Cl={ol:!0,ul:!0};function Ml(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}var Tl=class{constructor(e,t,n,r,o,s){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=s,this.content=[],this.activeMarks=Ii.none,this.match=o||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Ai.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=Ai.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Ai.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!xl.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Ol=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r,o=t.topNode,s=Ml(null,t.preserveWhitespace,0)|(n?4:0);r=o?new Tl(o.type,o.attrs,Ii.none,!0,t.topMatch||o.type.contentMatch,s):new Tl(n?null:e.schema.topNodeType,null,Ii.none,!0,null,s),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,o=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:s}=this.parser;if("full"===o||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if
1(o)if("full"===o)n=n.replace(/\r\n?/g,"\n");else if(s.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(s.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(s.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(s.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],o=e.previousSibling;(!t||o&&"BR"==o.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(s.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,o=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s,i=e.nodeName.toLowerCase();Cl.hasOwnProperty(i)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&Cl.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:Sl.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,t);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 n,r=this.needsBlock;if(xl.hasOwnProperty(i))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),n=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let s=l&&l.skip?t:this.readStyles(e,t);s&&this.addAll(e,s),n&&this.sync(o),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,l,n,!1===l.consuming?s:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let e=this.parser.matchedStyles[r],o=n.getPropertyValue(e);if(o)for(let n;;){let r=this.parser.matchStyle(e,o,this,n);if(!r)break;if(r.ignore)return null;if(t=r.clearMark?t.filter(e=>!r.clearMark(e)):t.concat(this.parser.schema.marks[r.mark].create(r.attrs)),!1!==r.consuming)break;n=r}}return t}addElementByRule(e,t,n,r){let o,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(s,t.attrs||null,n,t.preserveWhitespace);e&&(o=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let i=this.top;if(s&&s.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}o&&this.sync(i)&&this.open--}addAll(e,t,n,r){let o=n||0;for(let s=n?e.childNodes[n]:e.firstChild,i=null==r?null:e.childNodes[r];s!=i;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,t);this.findAtPoint(e,o)}findPlace(e,t,n){let r,o;for(let s=this.open,i=0;s>=0;s--){let t=this.nodes[s],l=t.findWrapping(e);if(l&&(!r||r.length>l.length+i)&&(r=l,o=t,!l.length))break;if(t.solid){if(n)break;i+=2}}if(!r)return null;this.sync(o);for(let s=0;s<r.length;s++)t=this.enterInner(r[s],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=Ii.none;for(let o of r.concat(e.marks))(t.type?t.type.allowsMarkType(o.type):Nl(o.type,e.type))&&(n=o.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let o=this.findPlace(e.create(t),n,!1);return o&&(o=this.enterInner(e,t,n,!0,r)),o}enterInner(e,t,n,r=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let i=Ml(e,o,s.options);4&s.options&&0==s.content.length&&(i|=4);let l=Ii.none;return n=n.filter(t=>!(s.type?s.type.allowsMarkType(t.type):Nl(t.type,e))||(l=t.addToSet(l),!1)),this.nodes.push(new Tl(e,t,l,r,null,i)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),s=(e,i)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;i>=o;i--)if(s(e-1,i))return!0;return!1}{let e=i>
10||0==i&&r?this.nodes[i].type:n&&i>=o?n.node(i-o).type:null;if(!e||e.name!=l&&!e.isInGroup(l))return!1;i--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}};function El(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Al(e){let t={};for(let n in e)t[n]=e[n];return t}function Nl(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let s=[],i=e=>{s.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t)return!0;if(s.indexOf(o)<0&&i(o))return!0}};if(i(o.contentMatch))return!0}}var Dl=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Il(t).createDocumentFragment());let r=n,o=[];return e.forEach(e=>{if(o.length||e.marks.length){let n=0,s=0;for(;n<o.length&&s<e.marks.length;){let t=e.marks[s];if(this.marks[t.type.name]){if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,s++}else s++}for(;n<o.length;)r=o.pop()[1];for(;s<e.marks.length;){let n=e.marks[s++],i=this.serializeMark(n,e.isInline,t);i&&(o.push([n,r]),r.appendChild(i.dom),r=i.contentDOM||i.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return Il(t).createTextNode(e.text);let{dom:n,contentDOM:r}=Ll(Il(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Ll(Il(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return"string"==typeof t?{dom:e.createTextNode(t)}:Ll(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Rl(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Rl(e.marks)}};function Rl(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Il(e){return e.document||window.document}var _l=new WeakMap;function Pl(e){let t=_l.get(e);return void 0===t&&_l.set(e,t=function(e){let t=null;function n(e){if(e&&"object"==typeof e)if(Array.isArray(e))if("string"==typeof e[0])t||(t=[]),t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}(e)),t}function Ll(e,t,n,r){if(1==t.nodeType)return{dom:t};if(t.dom&&1==t.dom.nodeType)return t;let o,s=t[0];if("string"!=typeof s)throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=Pl(r))&&o.indexOf(t)>-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 i,l=s.indexOf(" ");l>0&&(n=s.slice(0,l),s=s.slice(l+1));let a=n?e.createElementNS(n,s):e.createElement(s),c=t[1],d=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){d=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?a.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):"style"==e&&a.style?a.style.cssText=c[e]:a.setAttribute(e,c[e])}}for(let h=d;h<t.length;h++){let o=t[h];if(0===o){if(h<t.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}if("string"==typeof o)a.appendChild(e.createTextNode(o));else{let{dom:t,contentDOM:s}=Ll(e,o,n,r);if(a.appendChild(t),s){if(i)throw new RangeError("Multiple content holes");i=s}}}return{dom:a,contentDOM:i}}var $l=Math.pow(2,16);function zl(e,t){return e+t*$l}function Bl(e){return 65535&e}var Fl=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}},jl=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Bl(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/$l}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,o=this.inverted?2:1,s=this.inverted?1:2;
1for(let i=0;i<this.ranges.length;i+=3){let l=this.ranges[i]-(this.inverted?r:0);if(l>e)break;let a=this.ranges[i+o],c=this.ranges[i+s],d=l+a;if(e<=d){let o=l+r+((a?e==l?-1:e==d?1:t:t)<0?0:c);if(n)return o;let s=e==(t<0?l:d)?null:zl(i/3,e-l),h=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(h|=8),new Fl(o,h,s)}r+=c-a}return n?e+r:new Fl(e+r,0,null)}touches(e,t){let n=0,r=Bl(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let i=0;i<this.ranges.length;i+=3){let t=this.ranges[i]-(this.inverted?n:0);if(t>e)break;let l=this.ranges[i+o];if(e<=t+l&&i==3*r)return!0;n+=this.ranges[i+s]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let s=this.ranges[r],i=s-(this.inverted?o:0),l=s+(this.inverted?0:o),a=this.ranges[r+t],c=this.ranges[r+n];e(i,i+a,l,l+c),o+=c-a}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};jl.empty=new jl([]);var Vl=class e{constructor(e,t,n=0,r=(e?e.length:0)){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let o=this.from;o<this.to;o++){let n=this._maps[o].mapResult(e,t);if(null!=n.recover){let t=this.getMirror(o);if(null!=t&&t>o&&t<this.to){o=t,e=this._maps[t].recover(n.recover);continue}}r|=n.delInfo,e=n.pos}return n?e:new Fl(e,r,null)}},Hl=Object.create(null),Wl=class{getMap(){return jl.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Hl[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Hl)throw new RangeError("Duplicate use of step JSON ID "+e);return Hl[e]=t,t.prototype.jsonID=e,t}},Ul=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,o){try{return e.ok(t.replace(n,r,o))}catch(s){if(s instanceof _i)return e.fail(s.message);throw s}}};function ql(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let s=e.child(o);s.content.size&&(s=s.copy(ql(s.content,t,s))),s.isInline&&(s=t(s,n,o)),r.push(s)}return Ai.fromArray(r)}var Kl=class e extends Wl{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new Pi(ql(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return Ul.fromReplace(e,this.from,this.to,o)}invert(){return new Jl(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};Wl.jsonID("addMark",Kl);var Jl=class e extends Wl{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}
vendor: 6,465 bytes, line 1
1apply(e){let t=e.slice(this.from,this.to),n=new Pi(ql(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Ul.fromReplace(e,this.from,this.to,n)}invert(){return new Kl(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};Wl.jsonID("removeMark",Jl);var Gl=class e extends Wl{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ul.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ul.fromReplace(e,this.pos,this.pos+1,new Pi(Ai.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Ql(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};Wl.jsonID("addNodeMark",Gl);var Ql=class e extends Wl{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ul.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ul.fromReplace(e,this.pos,this.pos+1,new Pi(Ai.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Gl(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};Wl.jsonID("removeNodeMark",Ql);var Xl=class e extends Wl{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Zl(e,this.from,this.to)?Ul.fail("Structure replace would overwrite content"):Ul.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new jl([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let n=this.slice.size+t.slice.size==0?Pi.empty:new Pi(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}}{let n=this.slice.size+t.slice.size==0?Pi.empty:new Pi(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,Pi.fromJSON(t,n.slice),!!n.structure)}};Xl.MAP_BIAS=1,Wl.jsonID("replace",Xl);var Yl=class e extends Wl{constructor(e,t,n,r,o,s,i=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=s,this.structure=i}apply(e){if(this.structure&&(Zl(e,this.from,this.gapFrom)||Zl(e,this.gapTo,this.to)))return Ul.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ul.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Ul.fromReplace(e,this.from,this.to,n):Ul.fail("Content does not fit in gap")}getMap(){return new jl([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||s>r.pos?null:new e(n.pos,r.pos,o,s,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(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,Pi.fromJSON(t,n.slice),n.insert,!!n.structure)}};function Zl(e,t,n){let r=e.resolve(t),o=n-t,s=r.depth;for(;o>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,o--;if(o>0){let e=r.node(s).maybeChild(r.indexAfter(s));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function ea(e,t,n,r=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),i=[],l=t+1;for(let a=0;a<s.childCount;a++){let t=s.child(a),c=l+t.nodeSize,d=r.matchType(t.type);if(d){r=d;for(let r=0;r<t.marks.length;r++)n.allowsMarkType(t.marks[r].type)||e.step(new Jl(l,c,t.marks[r]));if(o&&t.isText&&"pre"!=n.whitespace){let e,r,o=/\r?\n|\r/g;
1for(;e=o.exec(t.text);)r||(r=new Pi(Ai.from(n.schema.text(" ",n.allowedMarks(t.marks))),0,0)),i.push(new Xl(l+e.index,l+e.index+e[0].length,r))}}else i.push(new Xl(l,c,Pi.empty));l=c}if(!r.validEnd){let t=r.fillBefore(Ai.empty,!0);e.replace(l,l,new Pi(t,0,0))}for(let a=i.length-1;a>=0;a--)e.step(i[a])}function ta(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function na(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,o=0;;--n){let s=e.$from.node(n),i=e.$from.index(n)+r,l=e.$to.indexAfter(n)-o;if(n<e.depth&&s.canReplace(i,l,t))return n;if(0==n||s.type.spec.isolating||!ta(s,i,l))break;i&&(r=1),l<s.childCount&&(o=1)}return null}function ra(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,s=n.contentMatchAt(r).findWrapping(t);if(!s)return null;let i=s.length?s[0]:t;return n.canReplaceWith(r,o,i)?s:null}(e,t),s=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,s=n.child(r),i=t.contentMatch.findWrapping(s.type);if(!i)return null;let l=(i.length?i[i.length-1]:t).contentMatch;for(let a=r;l&&a<o;a++)l=l.matchType(n.child(a).type);return l&&l.validEnd?i:null}(r,t);return s?o.map(oa).concat({type:t,attrs:n}).concat(s.map(oa)):null}function oa(e){return{type:e,attrs:null}}function sa(e,t,n,r){t.forEach((o,s)=>{if(o.isText){let i,l=/\r?\n|\r/g;for(;i=l.exec(o.text);){let o=e.mapping.slice(r).map(n+1+s+i.index);e.replaceWith(o,o+1,t.type.schema.linebreakReplacement.create())}}})}function ia(e,t,n,r){t.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let o=e.mapping.slice(r).map(n+1+s);e.replaceWith(o,o+1,t.type.schema.text("\n"))}})}function la(e,t,n=1,r){let o=e.resolve(t),s=o.depth-n,i=r&&r[r.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!i.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,d=n-2;c>s;c--,d--){let e=o.node(c),t=o.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),s=r&&r[d+1];s&&(n=n.replaceChild(0,s.type.create(s.attrs)));let i=r&&r[d]||e;if(!e.canReplace(t+1,e.childCount)||!i.type.validContent(n))return!1}let l=o.indexAfter(s),a=r&&r[0];return o.node(s).canReplaceWith(l,l,a?a.type:o.node(s+1).type)}function aa(e,t){let n=e.resolve(t),r=n.index();return ca(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ca(e,t){return!(!e||!t||e.isLeaf||!function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let o=0;o<t.childCount;o++){let s=t.child(o),i=s.type==r?e.type.schema.nodes.text:s.type;if(n=n.matchType(i),!n)return!1;if(!e.type.allowsMarks(s.marks))return!1}return n.validEnd}(e,t))}function da(e,t,n=-1){let r=e.resolve(t);for(let o=r.depth;;o--){let e,s,i=r.index(o);if(o==r.depth?(e=r.nodeBefore,s=r.nodeAfter):n>0?(e=r.node(o+1),i++,s=r.node(o).maybeChild(i)):(e=r.node(o).maybeChild(i-1),s=r.node(o+1)),e&&!e.isTextblock&&ca(e,s)&&r.node(o).canReplace(i,i+1))return t;if(0==o)break;t=n<0?r.before(o):r.after(o)}}function ha(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let s=0;s<n.openStart;s++)o=o.firstChild.content;for(let s=1;s<=(0==n.openStart&&n.size?2:1);s++)for(let e=r.depth;e>=0;e--){let t=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,n=r.index(e)+(t>0?1:0),i=r.node(e),l=!1;if(1==s)l=i.canReplace(n,n,o);else{let e=i.contentMatchAt(n).findWrapping(o.firstChild.type);l=e&&i.canReplaceWith(n,n,e[0])}if(l)return 0==t?r.pos:t<0?r.before(e+1):r.after(e+1)}return null}function ua(e,t,n=t,r=Pi.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),s=e.resolve(n);
vendor: 8,986 bytes, line 1
1return pa(o,s,r)?new Xl(t,n,r):new fa(o,s,r).fit()}function pa(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Wl.jsonID("replaceAround",Yl);var fa=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=Ai.empty;for(let r=0;r<=e.depth;r++){let t=e.node(r);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=Ai.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let o=this.placed,s=n.depth,i=r.depth;for(;s&&i&&1==o.childCount;)o=o.firstChild.content,s--,i--;let l=new Pi(o,s,i);return e>-1?new Yl(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new Xl(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=t.firstChild;if(t.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=ya(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let o=e.firstChild;for(let s=this.depth;s>=0;s--){let e,{type:i,match:l}=this.frontier[s],a=null;if(1==t&&(o?l.matchType(o.type)||(a=l.fillBefore(Ai.from(o),!1)):r&&i.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:s,parent:r,inject:a};if(2==t&&o&&(e=l.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:s,parent:r,wrap:e};if(r&&l.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=ya(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new Pi(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=ya(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new Pi(ma(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new Pi(ma(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let f=0;f<o.length;f++)this.openFrontierNode(o[f]);let s=this.unplaced,i=n?n.content:s.content,l=s.openStart-e,a=0,c=[],{match:d,type:h}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));d=d.matchFragment(r)}let u=i.size+e-(s.content.size-s.openEnd);for(;a<i.childCount;){let e=i.child(a),t=d.matchType(e.type);if(!t)break;a++,(a>1||0==l||e.content.size)&&(d=t,c.push(va(e.mark(h.allowedMarks(e.marks)),1==a?l:0,a==i.childCount?u:-1)))}let p=a==i.childCount;p||(u=-1),this.placed=ga(this.placed,t,Ai.from(c)),this.frontier[t].match=d,p&&u<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let f=0,m=i;f<u;f++){let e=m.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),m=e.content}this.unplaced=p?0==e?Pi.empty:new Pi(ma(s.content,e-1,1),e-1,u<0?s.openEnd:e-1):new Pi(ma(s.content,e,a),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!ba(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=ba(e,t,r,n,o);if(s){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=ba(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:s,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=ga(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=ga(this.placed,this.depth,Ai.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Ai.empty,!0);e.childCount&&(this.placed=ga(this.placed,this.frontier.length,e))}};function ma(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(ma(e.firstChild.content,t-1,n)))}function ga(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(ga(e.lastChild.content,t-1,n)))}function ya(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function va(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,va(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Ai.empty,!0)))),e.copy(r)}function ba(e,t,n,r,o){let s=e.node(t),i=o?e.indexAfter(t):e.index(t);if(i==s.childCount&&!n.compatibleContent(s.type))return null;let l=r.fillBefore(s.content,!0,i);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,s.content,i)?l:null}function ka(e){return e.spec.defining||e.spec.definingForContent}function wa(e,t,n,r,o){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(wa(o.content,t+1,n,r,o)))}if(t>r){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(Ai.empty,!0))}return e}function xa(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}var Sa=class e extends Wl{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ul.fail("No node at attribute step's position");let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Ul.fromReplace(e,this.pos,this.pos+1,new Pi(Ai.from(r),0,t.isLeaf?0:1))}getMap(){return jl.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new e(n.pos,n.attr,n.value)}};Wl.jsonID("attr",Sa);var Ca=class e extends Wl{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Ul.ok(n)}getMap(){return jl.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if("string"!=typeof n.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new e(n.attr,n.value)}};Wl.jsonID("docAttr",Ca);var Ma=Error;((Ma=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype)).constructor=Ma,Ma.prototype.name="TransformError";var Ta=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Vl}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ma(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,o,s)=>{e=Math.min(e,o),t=Math.max(t,s)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=Pi.empty){let r=ua(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new Pi(Ai.from(n),0,0))}delete(e,t){return this.replace(e,t,Pi.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),s=e.doc.resolve(n);if(pa(o,s,r))return e.step(new Xl(t,n,r));let i=xa(o,s);0==i[i.length-1]&&i.pop();let l=-(o.depth+1);i.unshift(l);for(let u=o.depth,p=o.pos-1;u>0;u--,p--){let e=o.node(u).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;
1i.indexOf(u)>-1?l=u:o.before(u)==p&&i.splice(1,0,-u)}let a=i.indexOf(l),c=[],d=r.openStart;for(let u=r.content,p=0;;p++){let e=u.firstChild;if(c.push(e),p==r.openStart)break;u=e.content}for(let u=d-1;u>=0;u--){let e=c[u],t=ka(e.type);if(t&&!e.sameMarkup(o.node(Math.abs(l)-1)))d=u;else if(t||!e.type.isTextblock)break}for(let u=r.openStart;u>=0;u--){let t=(u+d+1)%(r.openStart+1),l=c[t];if(l)for(let c=0;c<i.length;c++){let d=i[(c+a)%i.length],h=!0;d<0&&(h=!1,d=-d);let u=o.node(d-1),p=o.index(d-1);if(u.canReplaceWith(p,p,l.type,l.marks))return e.replace(o.before(d),h?s.after(d):n,new Pi(wa(r.content,0,r.openStart,t),t,r.openEnd))}}let h=e.steps.length;for(let u=i.length-1;u>=0&&(e.replace(t,n,r),!(e.steps.length>h));u--){let e=i[u];e<0||(t=o.before(e),n=s.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let o=r.depth-1;o>=0;o--){let e=r.index(o);if(r.node(o).canReplaceWith(e,e,n))return r.before(o+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let e=r.indexAfter(o);if(r.node(o).canReplaceWith(e,e,n))return r.after(o+1);if(e<r.node(o).childCount)return null}return null}(e.doc,t,r.type);null!=o&&(t=n=o)}e.replaceRange(t,n,new Pi(Ai.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&0==r.parentOffset&&0==o.parentOffset){let s=r.sharedDepth(n),i=!1;for(let e=r.depth;e>s;e--)r.node(e).type.spec.isolating&&(i=!0);for(let e=o.depth;e>s;e--)o.node(e).type.spec.isolating&&(i=!0);if(!i){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=o.depth;e>0&&n==o.start(e);e--)n=o.before(e);r=e.doc.resolve(t),o=e.doc.resolve(n)}}let s=xa(r,o);for(let i=0;i<s.length;i++){let t=s[i],n=i==s.length-1;if(n&&0==t||r.node(t).type.contentMatch.validEnd)return e.delete(r.start(t),o.end(t));if(t>0&&(n||r.node(t-1).canReplace(r.index(t-1),o.indexAfter(t-1))))return e.delete(r.before(t),o.after(t))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:o,depth:s}=t,i=r.before(s+1),l=o.after(s+1),a=i,c=l,d=Ai.empty,h=0;for(let f=s,m=!1;f>n;f--)m||r.index(f)>0?(m=!0,d=Ai.from(r.node(f).copy(d)),h++):a--;let u=Ai.empty,p=0;for(let f=s,m=!1;f>n;f--)m||o.after(f+1)<o.end(f)?(m=!0,u=Ai.from(o.node(f).copy(u)),p++):c++;e.step(new Yl(a,c,i,l,new Pi(d.append(u),h,p),d.size-h,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=null,{linebreakReplacement:o}=e.doc.type.schema,s=e.doc.resolve(t-n),i=s.node().type;if(o&&i.inlineContent){let e="pre"==i.whitespace,t=!!i.contentMatch.matchType(o);e&&!t?r=!1:!e&&t&&(r=!0)}let l=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);ia(e,r.node(),r.before(),l)}i.inlineContent&&ea(e,t+n-1,i,s.node().contentMatchAt(s.index()),null==r);let a=e.mapping.slice(l),c=a.map(t-n);if(e.step(new Xl(c,a.map(t+n,-1),Pi.empty,!0)),!0===r){let t=e.doc.resolve(c);sa(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=Ai.empty;for(let i=n.length-1;i>=0;i--){if(r.size){let e=n[i].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Ai.from(n[i].type.create(n[i].attrs,r))}let o=t.start,s=t.end;e.step(new Yl(o,s,o,s,new Pi(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let i="function"==typeof o?o(t):o;if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(s).map(n),r)){let o=null;if(r.schema.linebreakReplacement){let e="pre"==r.whitespace,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?o=!1:!e&&t&&(o=!0)}!1===o&&ia(e,t,n,s),ea(e,e.mapping.slice(s).map(n,1),r,void 0,null===o);let l=e.mapping.slice(s),a=l.map(n,1),c=l.map(n+t.nodeSize,1);return e.step(new Yl(a,c,a+1,c-1,new Pi(Ai.from(r.create(i,null,t.marks)),0,0),1,!0)),!0===o&&sa(e,t,n,s),!1}})}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return function(e,t,n,r,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let i=n.create(r,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,i);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Yl(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new Pi(Ai.from(i),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Sa(e,t,n)),this}setDocAttribute(e,t){return this.step(new Ca(e,t)),this}
1addNodeMark(e,t){return this.step(new Gl(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof Ii)t.isInSet(n.marks)&&this.step(new Ql(e,t));else{let r,o=n.marks,s=[];for(;r=t.isInSet(o);)s.push(new Ql(e,r)),o=r.removeFromSet(o);for(let e=s.length-1;e>=0;e--)this.step(s[e])}return this}split(e,t=1,n){return function(e,t,n=1,r){let o=e.doc.resolve(t),s=Ai.empty,i=Ai.empty;for(let l=o.depth,a=o.depth-n,c=n-1;l>a;l--,c--){s=Ai.from(o.node(l).copy(s));let e=r&&r[c];i=Ai.from(e?e.type.create(e.attrs,i):o.node(l).copy(i))}e.step(new Xl(t,t,new Pi(s.append(i),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let o,s,i=[],l=[];e.doc.nodesBetween(t,n,(e,a,c)=>{if(!e.isInline)return;let d=e.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let c=Math.max(a,t),h=Math.min(a+e.nodeSize,n),u=r.addToSet(d);for(let e=0;e<d.length;e++)d[e].isInSet(u)||(o&&o.to==c&&o.mark.eq(d[e])?o.to=h:i.push(o=new Jl(c,h,d[e])));s&&s.to==c?s.to=h:l.push(s=new Kl(c,h,r))}}
1),i.forEach(t=>e.step(t)),l.forEach(t=>e.step(t))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let o=[],s=0;e.doc.nodesBetween(t,n,(e,i)=>{if(!e.isInline)return;s++;let l=null;if(r instanceof vl){let t,n=e.marks;for(;t=r.isInSet(n);)(l||(l=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(l=[r]):l=e.marks;if(l&&l.length){let r=Math.min(i+e.nodeSize,n);for(let e=0;e<l.length;e++){let n,a=l[e];for(let e=0;e<o.length;e++){let t=o[e];t.step==s-1&&a.eq(o[e].style)&&(n=t)}n?(n.to=r,n.step=s):o.push({style:a,from:Math.max(i,t),to:r,step:s})}}}),o.forEach(t=>e.step(new Jl(t.from,t.to,t.style)))}(this,e,t,n),this}clearIncompatible(e,t,n){return ea(this,e,t,n),this}},Oa=Object.create(null),Ea=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Aa(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=Pi.empty){let n=t.content.lastChild,r=null;for(let i=0;i<t.openEnd;i++)r=n,n=n.lastChild;let o=e.steps.length,s=this.ranges;for(let i=0;i<s.length;i++){let{$from:l,$to:a}=s[i],c=e.mapping.slice(o);e.replaceRange(c.map(l.pos),c.map(a.pos),i?Pi.empty:t),0==i&&Ba(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:s,$to:i}=r[o],l=e.mapping.slice(n),a=l.map(s.pos),c=l.map(i.pos);o?e.deleteRange(a,c):(e.replaceRangeWith(a,c,t),Ba(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Ra(e):za(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let o=e.depth-1;o>=0;o--){let r=t<0?za(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):za(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(r)return r}return null}
1static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new La(e.node(0))}static atStart(e){return za(e,e,0,0,1)||new La(e)}static atEnd(e){return za(e,e,e.content.size,e.childCount,-1)||new La(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Oa[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Oa)throw new RangeError("Duplicate use of selection JSON ID "+e);return Oa[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Ra.between(this.$anchor,this.$head).getBookmark()}};Ea.prototype.visible=!0;var Aa=class{constructor(e,t){this.$from=e,this.$to=t}},Na=!1;function Da(e){Na||e.parent.inlineContent||(Na=!0)}var Ra=class e extends Ea{constructor(e,t=e){Da(e),Da(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ea.near(r);let o=t.resolve(n.map(this.anchor));return new e(o.parent.inlineContent?o:r,r)}replace(e,t=Pi.empty){if(super.replace(e,t),t==Pi.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ia(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let o=t.pos-n.pos;if(r&&!o||(r=o>=0?1:-1),!n.parent.inlineContent){let e=Ea.findFrom(n,r,!0)||Ea.findFrom(n,-r,!0);if(!e)return Ea.near(n,r);n=e.$head}return t.parent.inlineContent||(0==o||(t=(Ea.findFrom(t,-r,!0)||Ea.findFrom(t,r,!0)).$anchor).pos<n.pos!=o<0)&&(t=n),new e(t,n)}};Ea.jsonID("text",Ra);var Ia=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return Ra.between(e.resolve(this.anchor),e.resolve(this.head))}},_a=class e extends Ea{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),s=t.resolve(o);return r?Ea.near(s):new e(s)}content(){return new Pi(Ai.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Pa(this.anchor)}static fromJSON(t,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}};_a.prototype.visible=!1,Ea.jsonID("node",_a);var Pa=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Ia(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&_a.isSelectable(n)?new _a(t):Ea.near(t)}},La=class e extends Ea{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=Pi.empty){if(t==Pi.empty){e.delete(0,e.doc.content.size);let t=Ea.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return $a}};Ea.jsonID("all",La);var $a={map(){return this},resolve:e=>new La(e)};function za(e,t,n,r,o,s=!1){if(t.inlineContent)return Ra.create(e,n);for(let i=r-(o>0?0:1);o>0?i<t.childCount:i>=0;i+=o){let r=t.child(i);if(r.isAtom){if(!s&&_a.isSelectable(r))return _a.create(e,n-(o<0?r.nodeSize:0))}else{let t=za(e,r,n+o,o<0?r.childCount:0,o,s);if(t)return t}n+=r.nodeSize*o}return null}function Ba(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,s=e.steps[r];(s instanceof Xl||s instanceof Yl)&&(e.mapping.maps[r].forEach((e,t,n,r)=>{null==o&&(o=r)}),e.setSelection(Ea.near(e.doc.resolve(o),n)))}var Fa=class extends Ta{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=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return Ii.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(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Ii.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(Ea.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}};function ja(e,t){return t&&e?e.bind(t):e}var Va=class{constructor(e,t,n){this.name=e,this.init=ja(t.init,n),this.apply=ja(t.a
1pply,n)}},Ha=[new Va("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Va("selection",{init:(e,t)=>e.selection||Ea.atStart(t.doc),apply:e=>e.selection}),new Va("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new Va("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})],Wa=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Ha.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Va(e.key,e.spec.state,e))})}},Ua=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let i=this.config.plugins[s];if(i.spec.appendTransaction){let l=r?r[s].n:0,a=r?r[s].state:this,c=l<t.length&&i.spec.appendTransaction.call(i,l?t.slice(l):t,a,n);if(c&&n.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<s?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[s]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let o=r[e];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new Fa(this)}static create(t){let n=new Wa(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new Wa(this.schema,t.plugins),r=n.fields,o=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;o[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,o)}return o}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new Wa(t.schema,t.plugins),s=new e(o);return o.fields.forEach(e=>{if("doc"==e.name)s.doc=Zi.fromJSON(t.schema,n.doc);else if("selection"==e.name)s.selection=Ea.fromJSON(s.doc,n.selection);else if("storedMarks"==e.name)n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let o in r){let i=r[o],l=i.spec.state;if(i.key==e.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(n,o))return void(s[e.name]=l.fromJSON.call(i,t,n[o],s))}s[e.name]=e.init(t,s)}}),s}};function qa(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=qa(o,t,{})),n[r]=o}return n}var Ka=class{constructor(e){this.spec=e,this.props={},e.props&&qa(e.props,this,this.props),this.key=e.key?e.key.key:Ga("plugin")}getState(e){return e[this.key]}},Ja=Object.create(null);function Ga(e){return e in Ja?e+"$"+ ++Ja[e]:(Ja[e]=0,e+"$")}var Qa=class{constructor(e="key"){this.key=Ga(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Xa=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Ya(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}var Za=(e,t,n)=>{let r=Ya(e,n);if(!r)return!1;let o=rc(r);if(!o){let n=r.blockRange(),o=n&&na(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let s=o.nodeBefore;if(mc(e,o,t,-1))return!0;
1if(0==r.parent.content.size&&(tc(s,"end")||_a.isSelectable(s)))for(let i=r.depth;;i--){let n=ua(e.doc,r.before(i),r.after(i),Pi.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(tc(s,"end")?Ea.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):_a.create(r.doc,o.pos-s.nodeSize)),t(r.scrollIntoView())}return!0}if(1==i||r.node(i-1).childCount>1)break}return!(!s.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0)};function ec(e,t,n){let r=t.nodeBefore,o=t.pos-1;for(;!r.isTextblock;o--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let s=t.nodeAfter,i=t.pos+1;for(;!s.isTextblock;i++){if(s.type.spec.isolating)return!1;let e=s.firstChild;if(!e)return!1;s=e}let l=ua(e.doc,o,i,Pi.empty);if(!l||l.from!=o||l instanceof Xl&&l.slice.size>=i-o)return!1;if(n){let t=e.tr.step(l);t.setSelection(Ra.create(t.doc,o)),n(t.scrollIntoView())}return!0}function tc(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}var nc=(e,t,n)=>{let{$head:r,empty:o}=e.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=rc(r)}let i=s&&s.nodeBefore;return!(!i||!_a.isSelectable(i))&&(t&&t(e.tr.setSelection(_a.create(e.doc,s.pos-i.nodeSize)).scrollIntoView()),!0)};function rc(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function oc(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}var sc=(e,t,n)=>{let r=oc(e,n);if(!r)return!1;let o=lc(r);if(!o)return!1;let s=o.nodeAfter;if(mc(e,o,t,1))return!0;if(0==r.parent.content.size&&(tc(s,"start")||_a.isSelectable(s))){let n=ua(e.doc,r.before(),r.after(),Pi.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(tc(s,"start")?Ea.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):_a.create(r.doc,r.mapping.map(o.pos))),t(r.scrollIntoView())}return!0}}return!(!s.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos,o.pos+s.nodeSize).scrollIntoView()),!0)},ic=(e,t,n)=>{let{$head:r,empty:o}=e.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;s=lc(r)}let i=s&&s.nodeAfter;return!(!i||!_a.isSelectable(i))&&(t&&t(e.tr.setSelection(_a.create(e.doc,s.pos)).scrollIntoView()),!0)};function lc(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var ac=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function cc(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var dc=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),s=n.indexAfter(-1),i=cc(o.contentMatchAt(s));if(!i||!o.canReplaceWith(s,s,i))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,i.createAndFill());o.setSelection(Ea.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0},hc=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof La||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=cc(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,i=e.tr.insert(n,s.createAndFill());i.setSelection(Ra.create(i.doc,n+1)),t(i.scrollIntoView())}return!0},uc=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(la(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&na(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};var pc,fc=(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof _a&&e.selection.node.isBlock)return!(!n.parentOffset||!la(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let o,s,i=[],l=!1,a=!1;for(let u=n.depth;;u--){if(n.node(u).isBlock){l=n.end(u)==n.pos+(n.depth-u),a=n.start(u)==n.pos-(n.depth-u),s=cc(n.node(u-1).contentMatchAt(n.indexAfter(u-1)));let e=pc&&pc(r.parent,l,n);i.unshift(e||(l&&s?{type:s}:null)),o=u;break}if(1==u)return!1;i.unshift(null)}let c=e.tr;(e.selection instanceof Ra||e.selection instanceof La)&&c.deleteSelection();let d=c.mapping.map(n.pos),h=la(c.doc,d,i.length,i);if(h||(i[0]=s?{type:s}:null,h=la(c.doc,d,i.length,i)),!h)return!1;if(c.split(d,i.length,i),!l&&a&&n.node(o).type!=s){let e=c.mapping.map(n.before(o)),t=c.doc.resolve(e);s&&n.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&c.setNodeMarkup(c.mapping.map(n.before(o)),s)}return t&&t(c.scrollIntoView()),!0};function mc(e,t,n,r){let o,s,i=t.nodeBefore,l=t.nodeAfter,a=i.type.spec.isolating||l.type.spec.isolating;if(!a&&function(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,s=t.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(s,s+1)||!o.isTextblock&&!aa(e.doc,t.pos)||(n&&n(e.tr.join(t.pos).scrollIntoView()),0)))}
1(e,t,n))return!0;let c=!a&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(l.type))&&s.matchType(o[0]||l.type).validEnd){if(n){let r=t.pos+l.nodeSize,s=Ai.empty;for(let e=o.length-1;e>=0;e--)s=Ai.from(o[e].create(null,s));s=Ai.from(i.copy(s));let a=e.tr.step(new Yl(t.pos-1,r,t.pos,r,new Pi(s,1,0),o.length,!0)),c=a.doc.resolve(r+2*o.length);c.nodeAfter&&c.nodeAfter.type==i.type&&aa(a.doc,c.pos)&&a.join(c.pos),n(a.scrollIntoView())}return!0}let d=l.type.spec.isolating||r>0&&a?null:Ea.findFrom(t,1),h=d&&d.$from.blockRange(d.$to),u=h&&na(h);if(null!=u&&u>=t.depth)return n&&n(e.tr.lift(h,u).scrollIntoView()),!0;if(c&&tc(l,"start",!0)&&tc(i,"end")){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=l,a=1;for(;!s.isTextblock;s=s.firstChild)a++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=Ai.empty;for(let e=o.length-1;e>=0;e--)r=Ai.from(o[e].copy(r));n(e.tr.step(new Yl(t.pos-o.length,t.pos+l.nodeSize,t.pos+a,t.pos+l.nodeSize-a,new Pi(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function gc(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return!!o.node(s).isTextblock&&(n&&n(t.tr.setSelection(Ra.create(t.doc,e<0?o.start(s):o.end(s)))),!0)}}var yc=gc(-1),vc=gc(1);function bc(e,t=null){return function(n,r){let o=!1;for(let s=0;s<n.selection.ranges.length&&!o;s++){let{$from:{pos:r},$to:{pos:i}}=n.selection.ranges[s];n.doc.nodesBetween(r,i,(r,s)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{let t=n.doc.resolve(s),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}})}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:s},$to:{pos:i}}=n.selection.ranges[r];o.setBlockType(s,i,e,t)}r(o.scrollIntoView())}return!0}}function kc(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}var wc=kc(Xa,Za,nc),xc=kc(Xa,sc,ic),Sc={Enter:kc(ac,hc,uc,fc),"Mod-Enter":dc,Backspace:wc,"Mod-Backspace":wc,"Shift-Backspace":wc,Delete:xc,"Mod-Delete":xc,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new La(e.doc))),!0)},Cc={"Ctrl-h":Sc.Backspace,"Alt-Backspace":Sc["Mod-Backspace"],"Ctrl-d":Sc.Delete,"Ctrl-Alt-Backspace":Sc["Mod-Delete"],"Alt-Delete":Sc["Mod-Delete"],"Alt-d":Sc["Mod-Delete"],"Ctrl-a":yc,"Ctrl-e":vc};for(let os in Sc)Cc[os]=Sc[os];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();function Mc(e,t=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s);if(!i)return!1;let l=r?n.tr:null;return!!function(e,t,n,r=null){let o=!1,s=t,i=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=i.resolve(t.start-2);s=new Xi(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new Xi(t.$from,i.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let l=ra(s,n,r,t);if(!l)return!1;e&&function(e,t,n,r,o){let s=Ai.empty;for(let d=n.length-1;d>=0;d--)s=Ai.from(n[d].type.create(n[d].attrs,s));e.step(new Yl(t.start-(r?2:0),t.end,t.start,t.end,new Pi(s,0,0),n.length,!0));let i=0;for(let d=0;d<n.length;d++)n[d].type==o&&(i=d+1);let l=n.length-i,a=t.start+n.length-(r?2:0),c=t.parent;for(let d=t.startIndex,h=t.endIndex,u=!0;d<h;d++,u=!1)!u&&la(e.doc,a,l)&&(e.split(a,l),a+=2*l),a+=c.child(d).nodeSize}(e,t,l,o,n);return!0}(l,i,e,t)&&(r&&r(l.scrollIntoView()),!0)}}function Tc(e){return function(t,n){let{$from:r,$to:o}=t.selection,s=r.blockRange(o,t=>t.childCount>0&&t.firstChild.type==e);return!!s&&(!n||(r.node(s.depth-1).type==e?function(e,t,n,r){let o=e.tr,s=r.end,i=r.$to.end(r.depth);s<i&&(o.step(new Yl(s-1,i,s,i,new Pi(Ai.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Xi(o.doc.resolve(r.$from.pos),o.doc.resolve(i),r.depth));const l=na(r);if(null==l)return!1;o.lift(r,l);let a=o.doc.resolve(o.mapping.map(s,-1)-1);aa(o.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&o.join(a.pos);return t(o.scrollIntoView()),!0}(t,n,e,s):function(e,t,n){let r=e.tr,o=n.parent;for(let p=n.end,f=n.endIndex-1,m=n.startIndex;f>m;f--)p-=o.child(f).nodeSize,r.delete(p-1,p+1);let s=r.doc.resolve(n.start),i=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let l=0==n.startIndex,a=n.endIndex==o.childCount,c=s.node(-1),d=s.index(-1);if(!c.canReplace(d+(l?0:1),d+1,i.content.append(a?Ai.empty:Ai.from(o))))return!1;let h=s.pos,u=h+i.nodeSize;return r.step(new Yl(h-(l?1:0),u+(a?1:0),h+1,u-1,new Pi((l?Ai.empty:Ai.from(o.copy(Ai.empty))).append(a?Ai.empty:Ai.from(o.copy(Ai.empty))),l?0:1,a?0:1),l?0:1)),t(r.scrollIntoView()),!0}(t,n,s)))}}var Oc=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Ec=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},Ac=null,Nc=function(e,t,n){let r=Ac||(Ac=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Dc=function(e,t,n,r){return n&&(Ic(e,t,n,r,-1)||Ic(e,t,n,r,1))},Rc=/^(img|br|input|textarea|hr)$/i;function Ic(e,t,n,r,o){for(var s;;){if(e==n&&t==r)return!0;
1if(t==(o<0?0:_c(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Pc(e)||Rc.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Oc(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;{let n=e.childNodes[t+(o<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(!(null===(s=n.pmViewDesc)||void 0===s?void 0:s.ignoreForSelection))return!1;t+=o}else e=n,t=o<0?_c(e):0}}}}function _c(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Pc(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Lc=function(e){return e.focusNode&&Dc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function $c(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}var zc="undefined"!=typeof navigator?navigator:null,Bc="undefined"!=typeof document?document:null,Fc=zc&&zc.userAgent||"",jc=/Edge\/(\d+)/.exec(Fc),Vc=/MSIE \d/.exec(Fc),Hc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Fc),Wc=!!(Vc||Hc||jc),Uc=Vc?document.documentMode:Hc?+Hc[1]:jc?+jc[1]:0,qc=!Wc&&/gecko\/(\d+)/i.test(Fc);qc&&(/Firefox\/(\d+)/.exec(Fc)||[0,0])[1];var Kc=!Wc&&/Chrome\/(\d+)/.exec(Fc),Jc=!!Kc,Gc=Kc?+Kc[1]:0,Qc=!Wc&&!!zc&&/Apple Computer/.test(zc.vendor),Xc=Qc&&(/Mobile\/\w+/.test(Fc)||!!zc&&zc.maxTouchPoints>2),Yc=Xc||!!zc&&/Mac/.test(zc.platform),Zc=!!zc&&/Win/.test(zc.platform),ed=/Android \d/.test(Fc),td=!!Bc&&"webkitFontSmoothing"in Bc.documentElement.style,nd=td?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function rd(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function od(e,t){return"number"==typeof e?e:e[t]}function sd(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function id(e,t,n){if(!fd(t)&&0==t.left)return;let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let i=n||e.dom;i;){if(1!=i.nodeType){i=Ec(i);continue}let e=i,n=e==s.body,l=n?rd(s):sd(e),a=0,c=0;if(t.top<l.top+od(r,"top")?c=-(l.top-t.top+od(o,"top")):t.bottom>l.bottom-od(r,"bottom")&&(c=t.bottom-t.top>l.bottom-l.top?t.top+od(o,"top")-l.top:t.bottom-l.bottom+od(o,"bottom")),t.left<l.left+od(r,"left")?a=-(l.left-t.left+od(o,"left")):t.right>l.right-od(r,"right")&&(a=t.right-l.right+od(o,"right")),a||c)if(n)s.defaultView.scrollBy(a,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),a&&(e.scrollLeft+=a);let o=e.scrollLeft-n,s=e.scrollTop-r;t={left:t.left-o,top:t.top-s,right:t.right-o,bottom:t.bottom-s}}let d=n?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(d))break;i="absolute"==d?i.offsetParent:Ec(i)}}function ld(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Ec(r));return t}function ad(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:s}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=s&&(r.scrollLeft=s)}}var cd=null;function dd(e,t){let n,r,o,s,i=2e8,l=0,a=t.top,c=t.top;for(let d=e.firstChild,h=0;d;d=d.nextSibling,h++){let e;if(1==d.nodeType)e=d.getClientRects();else{if(3!=d.nodeType)continue;e=Nc(d).getClientRects()}for(let u=0;u<e.length;u++){let p=e[u];if(p.top<=a&&p.bottom>=c){a=Math.max(p.bottom,a),c=Math.min(p.top,c);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<i){n=d,i=e,r=e&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==d.nodeType&&e&&(l=h+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!o&&p.left<=t.left&&p.right>=t.left&&(o=d,s={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(l=h+1)}}return!n&&o&&(n=o,r=s,i=0),n&&3==n.nodeType?function(e,t){let n,r=e.nodeValue.length,o=document.createRange();for(let s=0;s<r;s++){o.setEnd(e,s+1),o.setStart(e,s);let r=md(o,1);if(r.top!=r.bottom&&hd(t,r)){n={node:e,offset:s+(t.left>=(r.left+r.right)/2?1:0)};break}}return o.detach(),n||{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:l}:dd(n,r)}function hd(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>
1=t.top-1&&e.top<=t.bottom+1}function ud(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),s=o;;){let n=e.childNodes[s];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let o=e[r];if(hd(t,o))return ud(n,t,o)}}if((s=(s+1)%r)==o)break}return e}function pd(e,t){let n,r=e.dom.ownerDocument,o=0,s=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(_c(r.offsetNode),r.offset)}}catch(r){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(_c(r.startContainer),r.startOffset)}}}(r,t.left,t.top);s&&({node:n,offset:o}=s);let i,l=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!l||!e.dom.contains(1!=l.nodeType?l.parentNode:l)){let n=e.dom.getBoundingClientRect();if(!hd(t,n))return null;if(l=ud(e.dom,t,n),!l)return null}if(Qc)for(let c=l;n&&c;c=Ec(c))c.draggable&&(n=void 0);if(l=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(l,t),n){if(qc&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let e,r=n.childNodes[o];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&o++}let r;td&&o&&1==n.nodeType&&1==(r=n.childNodes[o-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(i=function(e,t,n,r){let o=-1;for(let s=t,i=!1;s!=e.dom;){let t,n=e.docView.nearestDesc(s,!0);if(!n)return null;if(1==n.dom.nodeType&&(n.node.isBlock&&n.parent||!n.contentDOM)&&((t=n.dom.getBoundingClientRect()).width||t.height)&&(n.node.isBlock&&n.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(n.dom.nodeName)&&(!i&&t.left>r.left||t.top>r.top?o=n.posBefore:(!i&&t.right<r.left||t.bottom<r.top)&&(o=n.posAfter),i=!0),!n.contentDOM&&o<0&&!n.node.isText))return(n.node.isBlock?r.top<(t.top+t.bottom)/2:r.left<(t.left+t.right)/2)?n.posBefore:n.posAfter;s=n.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}(e,n,o,t))}null==i&&(i=function(e,t,n){let{node:r,offset:o}=dd(t,n),s=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();s=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,s)}(e,l,t));let a=e.docView.nearestDesc(l,!0);return{pos:i,inside:a?a.posAtStart-a.border:-1}}function fd(e){return e.top<e.bottom||e.left<e.right}function md(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(fd(e))return e}return Array.prototype.find.call(n,fd)||e.getBoundingClientRect()}var gd=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function yd(e,t,n){let{node:r,offset:o,atom:s}=e.docView.domFromPos(t,n<0?-1:1),i=td||qc;if(3==r.nodeType){if(!i||!gd.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let e=o,t=o,s=n<0?1:-1;return n<0&&!o?(t++,s=-1):n>=0&&o==r.nodeValue.length?(e--,s=1):n<0?e--:t++,vd(md(Nc(r,e,t),s),s<0)}{let e=md(Nc(r,o,o),n);if(qc&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=md(Nc(r,o-1,o-1),-1);if(t.top==e.top){let n=md(Nc(r,o,o+1),-1);if(n.top!=e.top)return vd(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(null==s&&o&&(n<0||o==_c(r))){let e=r.childNodes[o-1];if(1==e.nodeType)return bd(e.getBoundingClientRect(),!1)}if(null==s&&o<_c(r)){let e=r.childNodes[o];if(1==e.nodeType)return bd(e.getBoundingClientRect(),!0)}return bd(r.getBoundingClientRect(),n>=0)}if(null==s&&o&&(n<0||o==_c(r))){let e=r.childNodes[o-1],t=3==e.nodeType?Nc(e,_c(e)-(i?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return vd(md(t,1),!1)}if(null==s&&o<_c(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Nc(e,0,i?0:1):1==e.nodeType?e:null:null;if(t)return vd(md(t,-1),!0)}return vd(md(3==r.nodeType?Nc(r):r,-n),n>=0)}function vd(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function bd(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function kd(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}var wd=/[\u0590-\u08ac]/;var xd=null,Sd=null,Cd=!1;
1function Md(e,t,n){return xd==t&&Sd==n?Cd:(xd=t,Sd=n,Cd="up"==n||"down"==n?function(e,t,n){let r=t.selection,o="up"==n?r.$from:r.$to;return kd(e,t,()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=yd(e,o.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=Nc(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0})}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,s=!o,i=o==r.parent.content.size,l=e.domSelection();return l?wd.test(r.parent.textContent)&&l.modify?kd(e,t,()=>{let{focusNode:t,focusOffset:o,anchorNode:s,anchorOffset:i}=e.domSelectionRange(),a=l.caretBidiLevel;l.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:d,focusOffset:h}=e.domSelectionRange(),u=d&&!c.contains(1==d.nodeType?d:d.parentNode)||t==d&&o==h;try{l.collapse(s,i),t&&(t!=s||o!=i)&&l.extend&&l.extend(t,o)}catch(p){}return null!=a&&(l.caretBidiLevel=a),u}):"left"==n||"backward"==n?s:i:r.pos==r.start()||r.pos==r.end()}(e,t,n))}var Td=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>Oc(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let o,s=this.getDesc(r);if(s&&(!t||s.node)){if(!n||!(o=s.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return s;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let o=0;n<this.children.length;n++){let t=this.children[n],s=o+t.size;if(s>e||t instanceof Id){r=e-o;break}o=s}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let o;n&&!(o=this.children[n-1]).size&&o instanceof Od&&o.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Oc(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Oc(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let s=n,i=0;;i++){let n=this.children[i],l=s+n.size;if(-1==r&&e<=l){let o=s+n.border;if(e>=o&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=s;for(let t=i;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Oc(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||i==this.children.length-1)){t=l;for(let e=i+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=Oc(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}s=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let o=Math.min(e,t),s=Math.max(e,t);for(let p=0,f=0;p<this.children.length;p++){let i=this.children[p],l=f+i.size;if(o>f&&s<l)return i.setSelection(e-f-i.border,t-f-i.border,n,r);f=l}let i=this.domFromPos(e,e?-1:1),l=t==e?i:this.domFromPos(t,t?-1:1),a=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if((qc||Qc)&&e==t){let{node:e,offset:t}=i;if(3==e.nodeType){if(d=!(!t||"\n"!=e.nodeValue[t-1]),d&&t==e.nodeValue.length)for(let n,r=e;r;r=r.parentNode){if(n=r.nextSibling){"BR"==n.nodeName&&(i=l={node:n.parentNode,offset:Oc(n)+1});break}
1let e=r.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];d=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(qc&&c.focusNode&&c.focusNode!=l.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||d&&Qc)&&Dc(i.node,i.offset,c.anchorNode,c.anchorOffset)&&Dc(l.node,l.offset,c.focusNode,c.focusOffset))return;let h=!1;if((a.extend||e==t)&&(!d||!qc)){a.collapse(i.node,i.offset);try{e!=t&&a.extend(l.node,l.offset),h=!0}catch(u){}}if(!h){if(e>t){let e=i;i=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(i.node,i.offset),a.removeAllRanges(),a.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],s=n+o.size;if(n==s?e<=s&&t>=n:e<s&&t>n){let r=n+o.border,i=s-o.border;if(e>=r&&t<=i)return this.dirty=e==n||t==s?2:1,void(e!=r||t!=i||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-r,t-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=s}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Od=class extends Td{constructor(e,t,n,r){let o,s=t.type.toDOM;if("function"==typeof s&&(s=s(n,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r)),!t.type.spec.raw){if(1!=s.nodeType){let e=document.createElement("span");e.appendChild(s),s=e}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Ed=class extends Td{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}},Ad=class e extends Td{constructor(e,t,n,r,o){super(e,[],n,r),this.mark=t,this.spec=o}static create(t,n,r,o){let s=o.nodeViews[n.type.name],i=s&&s(n,o,r);return i&&i.dom||(i=Dl.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,i.dom,i.contentDOM||i.dom,i)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(t,n,r){let o=e.create(this.parent,this.mark,!0,r),s=this.children,i=this.size;n<i&&(s=qd(s,n,i,r)),t>0&&(s=qd(s,0,t,r));for(let e=0;e<s.length;e++)s[e].parent=o;return o.children=s,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Nd=class e extends Td{constructor(e,t,n,r,o,s,i){super(e,[],o,s),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=i}static create(t,n,r,o,s,i){let l,a=s.nodeViews[n.type.name],c=a&&a(n,s,()=>l?l.parent?l.parent.posBeforeChild(l):void 0:i,r,o),d=c&&c.dom,h=c&&c.contentDOM;if(n.isText)if(d){if(3!=d.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else d=document.createTextNode(n.text);else if(!d){let e=Dl.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:d,contentDOM:h}=e)}h||n.isText||"BR"==d.nodeName||(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let u=d;return d=jd(d,r,n),c?l=new _d(t,n,r,o,d,h||null,u,c):n.isText?new Rd(t,
1n,r,o,d,u):new e(t,n,r,o,d,h||null,u)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Ai.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&Vd(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,i=o&&o.pos<0,l=new Wd(this,s&&s.node,e);!function(e,t,n,r){let o=t.locals(e),s=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let i=e.child(n);r(i,o,t.forChild(s,i),n),s+=i.nodeSize}return}let i=0,l=[],a=null;for(let c=0;;){let d,h,u,p;for(;i<o.length&&o[i].to==s;){let e=o[i++];e.widget&&(d?(h||(h=[d])).push(e):d=e)}if(d)if(h){h.sort(Ud);for(let e=0;e<h.length;e++)n(h[e],c,!!a)}else n(d,c,!!a);if(a)p=-1,u=a,a=null;else{if(!(c<e.childCount))break;p=c,u=e.child(c++)}for(let e=0;e<l.length;e++)l[e].to<=s&&l.splice(e--,1);for(;i<o.length&&o[i].from<=s&&o[i].to>s;)l.push(o[i++]);let f=s+u.nodeSize;if(u.isText){let e=f;i<o.length&&o[i].from<e&&(e=o[i].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<f&&(a=u.cut(e-s),u=u.cut(0,e-s),f=e,p=-1)}else for(;i<o.length&&o[i].to<f;)i++;r(u,u.isInline&&!u.isLeaf?l.filter(e=>!e.inline):l.slice(),t.forChild(s,u),p),s=f}}(this.node,this.innerDeco,(t,o,s)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e,o):t.type.side>=0&&!s&&l.syncToMarks(o==this.node.childCount?Ii.none:this.node.child(o).marks,n,e,o),l.placeWidget(t,e,r)},(t,s,a,c)=>{let d;l.syncToMarks(t.marks,n,e,c),l.findNodeMatch(t,s,a,c)||i&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(d=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(t,s,a,d,e)||l.updateNextNode(t,s,a,e,c,r)||l.addNode(t,s,a,e,r),r+=t.nodeSize}),l.syncToMarks([],n,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),Pd(this.contentDOM,this.children,e),Xc&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Ra)||n<t||r>t+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 e=o.nodeValue,s=function(e,t,n,r){for(let o=0,s=0;o<e.childCount&&s<=r;){let i=e.child(o++),l=s;if(s+=i.nodeSize,!i.isText)continue;let a=i.text;for(;o<e.childCount;){let t=e.child(o++);if(s+=t.nodeSize,!t.isText)break;a+=t.text}if(s>=n){if(s>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l<r?a.lastIndexOf(t,r-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return s<0?null:{node:o,pos:s,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let o=t;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 Ed(this,o,t,r);e.input.compositionNodes.push(s),this.children=qd(this.children,n,n+r.length,e,s)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(Vd(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Bd(this.dom,this.nodeDOM,zd(this.outerDeco,this.node,t),zd(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function Dd(e,t,n,r,o){jd(r,t,e);let s=new Nd(void 0,e,t,n,r,r,r);return s.contentDOM&&s.updateChildren(o,0),s}var Rd=class e extends Nd{constructor(e,t,n,r,o,s){super(e,t,n,r,o,null,s)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(t,n,r){let o=this.node.cut(t,n),s=document.createTextNode(o.text);return new e(this.parent,o,this.outerDeco,this.innerDeco,s,s)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}},Id=class extends Td{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}},_d=class extends Nd{constructor(e,t,n,r,o,s,i,l){super(e,t,n,r,o,s,i),this.spec=l}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Pd(e,t,n){let r=e.firstChild,o=!1;for(let s=0;s<t.length;s++){let i=t[s],l=i.dom;if(l.parentNode==e){for(;l!=r;)r=Hd(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(l,r);if(i instanceof Ad){let t=r?r.previousSibling:e.lastChild;Pd(i.contentDOM,i.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Hd(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}var Ld=function(e){e&&(this.nodeName=e)};Ld.prototype=Object.create(null);var $d=[new Ld];function zd(e,t,n){if(0==e.length)return $d;let r=n?$d[0]:new Ld,o=[r];for(let s=0;s<e.length;s++){let i=e[s].type.attrs;if(i){i.nodeName&&o.push(r=new Ld(i.nodeName));for(let e in i){let s=i[e];null!=s&&(n&&1==o.length&&o.push(r=new Ld(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+s:"style"==e?r.style=(r.style?r.style+";":"")+s:"nodeName"!=e&&(r[e]=s))}}}return o}function Bd(e,t,n,r){if(n==$d&&r==$d)return t;let o=t;for(let s=0;s<r.length;s++){let t=r[s],i=n[s];if(s){let n;i&&i.nodeName==t.nodeName&&o!=e&&(n=o.parentNode)&&n.nodeName.toLowerCase()==t.nodeName||(n=document.createElement(t.no
1deName),n.pmIsDeco=!0,n.appendChild(o),i=$d[0]),o=n}Fd(o,i||$d[0],t)}return o}function Fd(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==o.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<o.length;t++)-1==r.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function jd(e,t,n){return Bd(e,e,$d,zd(t,n,1!=e.nodeType))}function Vd(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Hd(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Wd=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,o=e.childCount,s=new Map,i=[];e:for(;o>0;){let l;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Ad)){l=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=e.child(o-1))break;--o,s.set(l,o),i.push(l)}}return{index:o,matched:s,matches:i.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let o=0,s=this.stack.length>>1,i=Math.min(s,e.length);for(;o<i&&(o==s-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&!1!==e[o].type.spec.spanning;)o++;for(;o<s;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let o=-1,i=this.top.children.length;r<this.preMatch.index&&(i=Math.min(this.index+3,i));for(let t=this.index;t<i;t++){let n=this.top.children[t];if(n.matchesMark(e[s])&&!this.isLocked(n.dom)){o=t;break}}if(o<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof Ad&&3!=t.dirty&&t.mark.type==e[s].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[s])&&(t.mark=e[s],o=this.index,this.changed=!0)}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let r=Ad.create(this.top,e[s],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,s++}}findNodeMatch(e,t,n,r){let o,s=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))s=this.top.children.indexOf(o,this.index);else for(let i=this.index,l=Math.min(this.top.children.length,i+5);i<l;i++){let r=this.top.children[i];if(r.matchesNode(e,t,n)&&!this.preMatch.matched.has(r)){s=i;break}}return!(s<0)&&(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,n,r,o){let s=this.top.children[r];return 3==s.dirty&&s.dom==s.contentDOM&&(s.dirty=2),!!s.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,o,s){for(let i=this.index;i<this.top.children.length;i++){let l=this.top.children[i];if(l instanceof Nd){let a=this.preMatch.matched.get(l);if(null!=a&&a!=o)return!1;let c,d=l.dom,h=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&Vd(t,l.outerDeco));if(!h&&l.update(e,t,n,r))return this.destroyBetween(this.index,i),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!h&&(c=this.recreateWrapper(l,e,t,n,r,s)))return this.destroyBetween(this.index,i),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,s+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,o,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Vd(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let i=Nd.create(this.top,t,n,r,o,s);if(i.contentDOM){i.children=e.children,e.children=[];for(let e of i.children)e.parent=i}return e.destroy(),i}addNode(e,t,n,r,o){let s=Nd.create(this.top,e,t,n,r,o);s.contentDOM&&s.updateChildren(r,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new Od(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Ad;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Rd)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Qc||Jc)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new Id(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}
1isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}};function Ud(e,t){return e.type.side-t.type.side}function qd(e,t,n,r,o){let s=[];for(let i=0,l=0;i<e.length;i++){let a=e[i],c=l,d=l+=a.size;c>=n||d<=t?s.push(a):(c<t&&s.push(a.slice(0,t-c,r)),o&&(s.push(o),o=void 0),d>n&&s.push(a.slice(n-c,a.size,r)))}return s}function Kd(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),s=o&&0==o.size,i=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(i<0)return null;let l,a,c=r.resolve(i);if(Lc(n)){for(l=i;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&_a.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==_c(e);r||o;){if(e==n)return!0;let t=Oc(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==_c(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;a=new _a(i==e?c:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=i,o=i;for(let r=0;r<n.rangeCount;r++){let s=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(s.startContainer,s.startOffset,1)),o=Math.max(o,e.docView.posFromDOM(s.endContainer,s.endOffset,-1))}if(t<0)return null;[l,i]=o==e.state.selection.anchor?[o,t]:[t,o],c=r.resolve(i)}else l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!a){a=nh(e,d,c,"pointer"==t||e.state.selection.head<c.pos&&!s?1:-1)}return a}function Jd(e){return e.editable?e.hasFocus():oh(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Gd(e,t=!1){let n=e.state.selection;if(eh(e,n),!Jd(e))return;let r=e.input.mouseDown;if(!t&&Jc&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Dc(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate())return void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,Oc(n)+1):t.collapse(n,0);!r&&!e.state.selection.visible&&Wc&&Uc<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let r,o,{anchor:s,head:i}=n;!Qd||n instanceof Ra||(n.$from.parent.inlineContent||(r=Xd(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=Xd(e,n.to))
1),e.docView.setSelection(s,i,e,t),Qd&&(r&&Zd(r),o&&Zd(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{Jd(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var Qd=Qc||Jc&&Gc<63;function Xd(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Qc&&o&&"false"==o.contentEditable)return Yd(o);if(!(o&&"false"!=o.contentEditable||s&&"false"!=s.contentEditable)){if(o)return Yd(o);if(s)return Yd(s)}}function Yd(e){return e.contentEditable="true",Qc&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Zd(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function eh(e,t){if(t instanceof _a){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(th(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else th(e)}function th(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function nh(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||Ra.between(t,n,r)}function rh(e){return!(e.editable&&!e.hasFocus())&&oh(e)}function oh(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(n){return!1}}function sh(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),s=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return s&&Ea.findFrom(s,t)}function ih(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function lh(e,t,n){let r=e.state.selection;if(!(r instanceof Ra)){if(r instanceof _a&&r.node.isInline)return ih(e,new Ra(t>0?r.$to:r.$from));{let n=sh(e.state,t);return!!n&&ih(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=e.state.doc.resolve(n.pos+o.nodeSize*(t<0?-1:1));return ih(e,new Ra(r.$anchor,s))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=sh(e.state,t);return!!(n&&n instanceof _a)&&ih(e,n)}if(!(Yc&&n.indexOf("m")>-1)){let n,o=r.$head,s=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText)return!1;let i=t<0?o.pos-s.nodeSize:o.pos;return!!(s.isAtom||(n=e.docView.descAt(i))&&!n.contentDOM)&&(_a.isSelectable(s)?ih(e,new _a(t<0?e.state.doc.resolve(o.pos-s.nodeSize):o)):!!td&&ih(e,new Ra(e.state.doc.resolve(t<0?i:i+s.nodeSize))))}}function ah(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function ch(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function dh(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,s,i=!1;qc&&1==n.nodeType&&r<ah(n)&&ch(n.childNodes[r],-1)&&(i=!0);for(;;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(ch(e,-1))o=n,s=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(hh(n))break;{let t=n.previousSibling;for(;t&&ch(t,-1);)o=n.parentNode,s=Oc(t),t=t.previousSibling;if(t)n=t,r=ah(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}i?uh(e,n,r):o&&uh(e,o,s)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,s,i=ah(n);for(;;)if(r<i){if(1!=n.nodeType)break;if(!ch(n.childNodes[r],1))break;o=n,s=++r}else{if(hh(n))break;{let t=n.nextSibling;for(;t&&ch(t,1);)o=t.parentNode,s=Oc(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=ah(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&uh(e,o,s)}(e)}function hh(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function uh(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!Pc(e);)t=Oc(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];
1if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!Pc(e);)t=Oc(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Lc(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout(()=>{e.state==o&&Gd(e)},50)}function ph(e,t){let n=e.state.doc.resolve(t);if(!Jc&&!Zc&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function fh(e,t,n){let r=e.state.selection;if(r instanceof Ra&&!r.empty||n.indexOf("s")>-1)return!1;if(Yc&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=sh(e.state,t);if(n&&n instanceof _a)return ih(e,n)}if(!o.parent.inlineContent){let n=t<0?o:s,i=r instanceof La?Ea.near(n,t):Ea.findFrom(n,t);return!!i&&ih(e,i)}return!1}function mh(e,t){if(!(e.state.selection instanceof Ra))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let r=e.state.tr;return t<0?r.delete(n.pos-s.nodeSize,n.pos):r.delete(n.pos,n.pos+s.nodeSize),e.dispatch(r),!0}return!1}function gh(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function yh(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||Yc&&72==n&&"c"==r)return mh(e,-1)||dh(e,-1);if(46==n&&!t.shiftKey||Yc&&68==n&&"c"==r)return mh(e,1)||dh(e,1);if(13==n||27==n)return!0;if(37==n||Yc&&66==n&&"c"==r){let t=37==n?"ltr"==ph(e,e.state.selection.from)?-1:1:-1;return lh(e,t,r)||dh(e,t)}if(39==n||Yc&&70==n&&"c"==r){let t=39==n?"ltr"==ph(e,e.state.selection.from)?1:-1:1;return lh(e,t,r)||dh(e,t)}return 38==n||Yc&&80==n&&"c"==r?fh(e,-1,r)||dh(e,-1):40==n||Yc&&78==n&&"c"==r?function(e){if(!Qc||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;gh(e,n,"true"),setTimeout(()=>gh(e,n,"false"),20)}return!1}(e)||fh(e,1,r)||dh(e,1):r==(Yc?"m":"c")&&(66==n||73==n||89==n||90==n)}function vh(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:r,openStart:o,openEnd:s}=t;for(;o>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,s--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let i=e.someProp("clipboardSerializer")||Dl.fromSchema(e.state.schema),l=Oh(),a=l.createElement("div");a.appendChild(i.serializeFragment(r,{document:l}));let c,d=a.firstChild,h=0;for(;d&&1==d.nodeType&&(c=Th[d.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=l.createElement(c[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),h++}d=a.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${o} ${s}${h?` -${h}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function bh(e,t,n,r,o){let s,i,l=o.parent.type.spec.code;if(!n&&!t)return null;let a=!!t&&(r||l||!n);if(a){if(e.someProp("transformPastedText",n=>{t=n(t,l||r,e)}),l)return i=new Pi(Ai.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{i=t(i,e,!0)}),i;let n=e.someProp("clipboardTextParser",n=>n(t,o,r,e));if(n)i=n;else{let n=o.marks(),{schema:r}=e.state,i=Dl.fromSchema(r);
1s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(i.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),s=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Oh(),o=r.body,s=/<([a-z][^>\s]+)/i.exec(e);(n=s&&Th[s[1].toLowerCase()])&&(e=n.map(e=>"<"+e+">").join("")+e+n.map(e=>"</"+e+">").reverse().join(""));if(o.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;Eh||(Eh=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e}));return Eh.createHTML(e)}(e),n)for(let i=0;i<n.length;i++)o=o.querySelector(n[i])||o;for(let i=0;i<r.styleSheets.length;i++){let e=r.styleSheets[i];for(let t=0;t<e.rules.length;t++){let n=e.rules[t];if(n instanceof CSSStyleRule){let e=o.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return o}(n),td&&function(e){let t=e.querySelectorAll(Jc?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&"Â "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(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 h=+d[3];h>0;h--){let e=s.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;s=e}if(i||(i=(e.someProp("clipboardParser")||e.someProp("domParser")||wl.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!(!a&&!d),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||kh.test(e.parentNode.nodeName)?null:{ignore:!0}})),d)i=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(l){return e}let{content:o,openStart:s,openEnd:i}=e;for(let a=n.length-2;a>=0;a-=2){let e=r.nodes[n[a]];if(!e||e.hasRequiredAttrs())break;o=Ai.from(e.create(n[a+1],o)),s++,i++}return new Pi(o,s,i)}(Mh(i,+d[1],+d[2]),d[4]);else if(i=Pi.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),s=[];if(e.forEach(e=>{if(!s)return;let t,n=o.findWrapping(e.type);if(!n)return s=null;if(t=s.length&&r.length&&xh(n,r,e,s[s.length-1],0))s[s.length-1]=t;else{s.length&&(s[s.length-1]=Sh(s[s.length-1],r.length));let t=wh(e,n);s.push(t),o=o.matchType(t.type),r=n}}),s)return Ai.from(s)}return e}(i.content,o),!0),i.openStart||i.openEnd){let e=0,t=0;for(let n=i.content.firstChild;e<i.openStart&&!n.type.spec.isolating;e++,n=n.firstChild);for(let n=i.content.lastChild;t<i.openEnd&&!n.type.spec.isolating;t++,n=n.lastChild);i=Mh(i,e,t)}return e.someProp("transformPasted",t=>{i=t(i,e,a)}),i}var kh=/^(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 wh(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Ai.from(e));return e}function xh(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let s=xh(e,t,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(Ai.from(wh(n,e,o+1))))}}function Sh(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Sh(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Ai.empty,!0);return e.copy(n.append(r))}function Ch(e,t,n,r,o,s){let i=t<0?e.firstChild:e.lastChild,l=i.content;return e.childCount>1&&(s=0),o<r-1&&(l=Ch(l,t,n,r,o+1,s)),o>=n&&(l=t<0?i.contentMatchAt(0).fillBefore(l,s<=o).append(l):l.append(i.contentMatchAt(i.childCount).fillBefore(Ai.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,i.copy(l))}function Mh(e,t,n){return t<e.openStart&&(e=new Pi(Ch(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Pi(Ch(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Th={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function Oh(){return document.implementation.createHTMLDocument("title")}var Eh=null;var Ah={},Nh={},Dh={touchstart:!0,touchmove:!0},Rh=class{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.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function Ih(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function _h(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Ph(e,t))})}function Ph(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function Lh(e,t){if(!t.bubbles)return!0;
1if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function $h(e){return{left:e.clientX,top:e.clientY}}function zh(e,t,n,r,o){if(-1==r)return!1;let s=e.state.doc.resolve(r);for(let i=s.depth+1;i>0;i--)if(e.someProp(t,t=>i>s.depth?t(e,n,s.nodeAfter,s.before(i),o,!0):t(e,n,s.node(i),s.before(i),o,!1)))return!0;return!1}function Bh(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Fh(e,t,n,r,o){return zh(e,"handleClickOn",t,n,r)||e.someProp("handleClick",n=>n(e,t,r))||(o?function(e,t){if(-1==t)return!1;let n,r,o=e.state.selection;o instanceof _a&&(n=o.node);let s=e.state.doc.resolve(t);for(let i=s.depth+1;i>0;i--){let e=i>s.depth?s.nodeAfter:s.node(i);if(_a.isSelectable(e)){r=n&&o.$from.depth>0&&i>=o.$from.depth&&s.before(o.$from.depth+1)==o.$from.pos?s.before(o.$from.depth):s.before(i);break}}return null!=r&&(Bh(e,_a.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&_a.isSelectable(r))&&(Bh(e,new _a(n),"pointer"),!0)}(e,n))}function jh(e,t,n,r){return zh(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}function Vh(e,t,n,r){return zh(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=Hh(e,t,!0),o=e.state.doc;if(!r)return!1;Bh(e,r,"pointer"),r instanceof Ra&&o.eq(e.state.doc)&&(e.input.mouseDown=new Jh(e,r));return!0}(e,n,r)}function Hh(e,t,n){let r=e.state.doc;if(-1==t)return r.inlineContent?Ra.create(r,0,r.content.size):null;let o=r.resolve(t);for(let s=o.depth+1;s>0;s--){let e=s>o.depth?o.nodeAfter:o.node(s),t=o.before(s);if(e.inlineContent)return Ra.create(r,t+1,t+1+e.content.size);if(n&&_a.isSelectable(e))return _a.create(r,t)}return null}function Wh(e){return eu(e)}Nh.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Gh(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!ed||!Jc||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Xc||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",t=>t(e,n))||yh(e,n)?n.preventDefault():Ih(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,$c(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},Nh.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Nh.keypress=(e,t)=>{let n=t;if(Gh(e)||!n.charCode||n.ctrlKey&&!n.altKey||Yc&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof Ra&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(t).scrollIntoView();/[\r\n]/.test(t)||e.someProp("handleTextInput",n=>n(e,r.$from.pos,r.$to.pos,t,o))||e.dispatch(o()),n.preventDefault()}};var Uh=Yc?"metaKey":"ctrlKey";Ah.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Wh(e),o=Date.now(),s="singleClick";o-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[Uh]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?s="doubleClick":"doubleClick"==e.input.lastClick.type&&(s="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:s,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let i=e.posAtCoords($h(n));i&&("singleClick"==s?e.input.mouseDown=new Kh(e,i,n,!!r):("doubleClick"==s?jh:Vh)(e,i.pos,i.inside,n)?n.preventDefault():Ih(e,"pointer"))};var qh=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){0==e.buttons&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},Kh=class extends qh{constructor(e,t,n,r){let o,s;if(super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[Uh],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,s=n.depth?n.before():0}const i=r?null:n.target,l=i?e.docView.nearestDesc(i,!0):null;
1this.target=l&&1==l.nodeDOM.nodeType?l.nodeDOM:null;let{selection:a}=e.state;0==n.button&&(o.type.spec.draggable&&!1!==o.type.spec.selectable||a instanceof _a&&a.from<=s&&a.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!qc||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()),Ih(e,"pointer")}done(){super.done(),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(()=>{this.view.isDestroyed||Gd(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords($h(e))),this.updateAllowDefault(e),this.allowDefault||!t?Ih(this.view,"pointer"):Fh(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Qc&&this.mightDrag&&!this.mightDrag.node.isAtom||Jc&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Bh(this.view,Ea.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Ih(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ih(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0)}},Jh=class extends qh{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(0==e.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();e.preventDefault(),Ih(this.view,"pointer");let t=this.view.posAtCoords($h(e)),n=t&&Hh(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,o=this.startSelection,[s,i]=n.from<o.from?[o.to,n.from]:[o.from,n.to];Bh(this.view,Ra.create(r,s,i),"pointer")}};function Gh(e,t){return!!e.composing||!!(Qc&&Math.abs(Date.now()-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Ah.touchstart=e=>{e.input.lastTouch=Date.now(),Wh(e),Ih(e,"pointer")},Ah.touchmove=e=>{e.input.lastTouch=Date.now(),Ih(e,"pointer")},Ah.contextmenu=e=>Wh(e);var Qh=ed?5e3:-1;function Xh(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>eu(e),t))}function Yh(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Zh(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=_c(e=e.childNodes[t-1])}else{if(!e.parentNode||Pc(e))return null;t=Oc(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||Pc(e))return null;t=Oc(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}function eu(e,t=!1){if(!(ed&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Yh(e),t||e.docView&&e.docView.dirty){let n=Kd(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}Nh.compositionstart=Nh.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Ra&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||Jc&&Zc&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),eu(e,!0),e.markCursor=null;
1else if(eu(e,!t.selection.empty),qc&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Xh(e,Qh)},Nh.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Xh(e,20))};var tu=Wc&&Uc<15||Xc&&nd<604;function nu(e,t,n,r,o){let s=bh(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,o,s||Pi.empty)))return!0;if(!s)return!1;let i=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}
1(s),l=i?e.state.tr.replaceSelectionWith(i,r):e.state.tr.replaceSelection(s);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function ru(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Ah.copy=Nh.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let s=tu?null:n.clipboardData,{dom:i,text:l}=vh(e,r.content());s?(n.preventDefault(),s.clearData(),s.setData("text/html",i.innerHTML),s.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,i),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Nh.paste=(e,t)=>{let n=t;if(e.composing&&!ed)return;let r=tu?null:n.clipboardData,o=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&nu(e,ru(r),r.getData("text/html"),o,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?nu(e,r.value,null,o,t):nu(e,r.textContent,r.innerHTML,o,t)},50)}(e,n)};var ou=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},su=Yc?"altKey":"ctrlKey";function iu(e,t){let n;return e.someProp("dragCopies",e=>{n=n||e(t)}),null!=n?!n:!t[su]}Ah.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o,s=e.state.selection,i=s.empty?null:e.posAtCoords($h(n));if(i&&i.pos>=s.from&&i.pos<=(s instanceof _a?s.to-1:s.to));else if(r&&r.mightDrag)o=_a.create(e.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=_a.create(e.state.doc,t.posBefore))}let{dom:l,text:a,slice:c}=vh(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!Jc||Gc>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(tu?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",tu||n.dataTransfer.setData("text/plain",a),e.dragging=new ou(c,iu(e,n),o)},Ah.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Nh.dragover=Nh.dragenter=(e,t)=>t.preventDefault(),Nh.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords($h(t));if(!r)return;let o=e.state.doc.resolve(r.pos),s=n&&n.slice;s?e.someProp("transformPasted",t=>{s=t(s,e,!1)}):s=bh(e,ru(t.dataTransfer),tu?null:t.dataTransfer.getData("text/html"),!1,o);let i=!(!n||!iu(e,t));if(e.someProp("handleDrop",n=>n(e,t,s||Pi.empty,i)))return void t.preventDefault();if(!s)return;t.preventDefault();let l=s?ha(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let a=e.state.tr;if(i){let{node:e}=n;e?e.replace(a):a.deleteSelection()}let c=a.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,h=a.doc;d?a.replaceRangeWith(c,c,s.content.firstChild):a.replaceRange(c,c,s);if(a.doc.eq(h))return;let u=a.doc.resolve(c);if(d&&_a.isSelectable(s.content.firstChild)&&u.nodeAfter&&u.nodeAfter.sameMarkup(s.content.firstChild))a.setSelection(new _a(u));else{let t=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((e,n,r,o)=>t=o),a.setSelection(nh(e,u,a.doc.resolve(t)))}e.focus(),e.dispatch(a.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},Ah.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Gd(e)},20))},Ah.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Ah.beforeinput=(e,t)=>{if(Jc&&ed&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,$c(8,"Backspace"))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let os in Nh)Ah[os]=Nh[os];function lu(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var au=class e{constructor(e,t){this.toDOM=e,this.spec=t||pu,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:s}=e.mapResult(t.from+r,this.side<0?-1:1);return s?null:new hu(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&lu(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},cu=class e{constructor(e,t){this.attrs=e,this.spec=t||pu}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,s=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=s?null:new hu(o,s,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&lu(this.attrs,t.attrs)&&lu(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},du=class e{constructor(e,t){this.attrs=e,this.spec=t||pu}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let s=e.mapResult(t.to+r,-1);return s.deleted||s.pos<=o.pos?null:new hu(o.pos-n,s.pos-n,this)}valid(e,t){let n,{index:r,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(n=e.child(r)).isText&&o+n.nodeSize==t.to}eq(t){return this==t||t instanceof e&&lu(this.attrs,t.attrs)&&lu(this.spec,t.spec)}destroy(){}},hu=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new au(n,r))}static inline(t,n,r,o){return new e(t,n,new cu(r,o))}
1static node(t,n,r,o){return new e(t,n,new du(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof cu}get widget(){return this.type instanceof au}},uu=[],pu={},fu=class e{constructor(e,t){this.local=e.length?e:uu,this.children=t.length?t:uu}static create(e,t){return t.length?wu(t,e,0,pu):mu}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,o){for(let s=0;s<this.local.length;s++){let i=this.local[s];i.from<=t&&i.to>=e&&(!o||o(i.spec))&&n.push(i.copy(i.from+r,i.to+r))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let i=this.children[s]+1;this.children[s+2].findInner(e-i,t-i,n,r+i,o)}}map(e,t,n){return this==mu||0==e.maps.length?this:this.mapInner(e,t,0,0,n||pu)}mapInner(t,n,r,o,s){let i;for(let e=0;e<this.local.length;e++){let l=this.local[e].map(t,r,o);l&&l.type.valid(n,l)?(i||(i=[])).push(l):s.onRemove&&s.onRemove(this.local[e].spec)}return this.children.length?yu(this.children,i||[],t,n,r,o,s):i?new e(i.sort(xu),uu):mu}add(t,n){return n.length?this==mu?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let o,s=0;t.forEach((e,t)=>{let i,l=t+r;if(i=bu(n,e,l)){for(o||(o=this.children.slice());s<o.length&&o[s]<t;)s+=3;o[s]==t?o[s+2]=o[s+2].addInner(e,i,l+1):o.splice(s,0,t,t+e.nodeSize,wu(i,e,l+1,pu)),s+=3}});let i=vu(s?ku(n):n,-r);for(let e=0;e<i.length;e++)i[e].type.valid(t,i[e])||i.splice(e--,1);return new e(i.length?this.local.concat(i).sort(xu):this.local,o||this.children)}remove(e){return 0==e.length||this==mu?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,o=this.local;for(let e=0;e<r.length;e+=3){let o,s=r[e]+n,i=r[e+1]+n;for(let e,n=0;n<t.length;n++)(e=t[n])&&e.from>s&&e.to<i&&(t[n]=null,(o||(o=[])).push(e));if(!o)continue;r==this.children&&(r=this.children.slice());let l=r[e+2].removeInner(o,s+1);l!=mu?r[e+2]=l:(r.splice(e,3),e-=3)}if(o.length)for(let e,s=0;s<t.length;s++)if(e=t[s])for(let t=0;t<o.length;t++)o[t].eq(e,n)&&(o==this.local&&(o=this.local.slice()),o.splice(t--,1));return r==this.children&&o==this.local?this:o.length||r.length?new e(o,r):mu}forChild(t,n){if(this==mu)return this;if(n.isLeaf)return e.empty;let r,o;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let s=t+1,i=s+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>s&&t.type instanceof cu){let e=Math.max(s,t.from)-s,n=Math.min(i,t.to)-s;e<n&&(o||(o=[])).push(t.copy(e,n))}}if(o){let t=new e(o.sort(xu),uu);return r?new gu([t,r]):t}return r||mu}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return Su(this.localsInner(e))}localsInner(e){if(this==mu)return uu;if(e.inlineContent||!this.local.some(cu.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof cu||t.push(this.local[n]);return t}forEachSet(e){e(this)}};fu.empty=new fu([],[]),fu.removeOverlap=Su;var mu=fu.empty,gu=class e{constructor(e){this.members=e}map(t,n){const r=this.members.map(e=>e.map(t,n,pu));return e.from(r)}forChild(t,n){if(n.isLeaf)return fu.empty;let r=[];for(let o=0;o<this.members.length;o++){let s=this.members[o].forChild(t,n);s!=mu&&(s instanceof e?r=r.concat(s.members):r.push(s))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?Su(n?t:t.sort(xu)):uu}static from(t){switch(t.length){case 0:return mu;case 1:return t[0];default:return new e(t.every(e=>e instanceof fu)?t:t.reduce((e,t)=>
1e.concat(t instanceof fu?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function yu(e,t,n,r,o,s,i){let l=e.slice();for(let c=0,d=s;c<n.maps.length;c++){let e=0;n.maps[c].forEach((t,n,r,o)=>{let s=o-r-(n-t);for(let i=0;i<l.length;i+=3){let r=l[i+1];if(r<0||t>r+d-e)continue;let o=l[i]+d-e;n>=o?l[i+1]=t<=o?-2:-1:t>=d&&s&&(l[i]+=s,l[i+1]+=s)}e+=s}),d=n.maps[c].map(d,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(-2==l[c+1]){a=!0,l[c+1]=-1;continue}let t=n.map(e[c]+s),d=t-o;if(d<0||d>=r.content.size){a=!0;continue}let h=n.map(e[c+1]+s,-1)-o,{index:u,offset:p}=r.content.findIndex(d),f=r.maybeChild(u);if(f&&p==d&&p+f.nodeSize==h){let r=l[c+2].mapInner(n,f,t+1,e[c]+s+1,i);r!=mu?(l[c]=d,l[c+1]=h,l[c+2]=r):(l[c+1]=-2,a=!0)}else a=!0}if(a){let a=wu(function(e,t,n,r,o,s,i){function l(e,t){for(let s=0;s<e.local.length;s++){let l=e.local[s].map(r,o,t);l?n.push(l):i.onRemove&&i.onRemove(e.local[s].spec)}for(let n=0;n<e.children.length;n+=3)l(e.children[n+2],e.children[n]+t+1)}for(let a=0;a<e.length;a+=3)-1==e[a+1]&&l(e[a+2],t[a]+s+1);return n}(l,e,t,n,o,s,i),r,0,i);t=a.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<a.children.length;e+=3){let n=a.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,a.children[e],a.children[e+1],a.children[e+2])}}return new fu(t.sort(xu),l)}function vu(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new hu(o.from+t,o.to+t,o.type))}return n}function bu(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let s,i=0;i<e.length;i++)(s=e[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),e[i]=null);return o}function ku(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function wu(e,t,n,r){let o=[],s=!1;t.forEach((t,i)=>{let l=bu(e,t,i+n);if(l){s=!0;let e=wu(l,t,n+i+1,r);e!=mu&&o.push(i,i+t.nodeSize,e)}});let i=vu(s?ku(e):e,-n).sort(xu);for(let l=0;l<i.length;l++)i[l].type.valid(t,i[l])||(r.onRemove&&r.onRemove(i[l].spec),i.splice(l--,1));return i.length||o.length?new fu(i,o):mu}function xu(e,t){return e.from-t.from||e.to-t.to}function Su(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let s=t[o];if(s.from!=r.from){s.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,s.from),Cu(t,o,r.copy(s.from,r.to)));break}s.to!=r.to&&(t==e&&(t=e.slice()),t[o]=s.copy(s.from,r.to),Cu(t,o+1,s.copy(r.to,s.to)))}}return t}function Cu(e,t,n){for(;t<e.length&&xu(n,e[t])>0;)t++;e.splice(t,0,n)}function Mu(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=mu&&t.push(r)}),e.cursorWrapper&&t.push(fu.create(e.state.doc,[e.cursorWrapper.deco])),gu.from(t)}var Tu={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ou=Wc&&Uc<=11,Eu=class{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}},Au=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Eu,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);Wc&&Uc<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Qc&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Ou&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Tu)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(rh(this.view)){if(this.suppressingSelectionUpdates)return Gd(this.view);if(Wc&&Uc<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Dc(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 t,n=new Set;for(let o=e.focusNode;o;o=Ec(o))n.add(o);for(let o=e.anchorNode;o;o=Ec(o))if(n.has(o)){t=o;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 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 t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&rh(e)&&!this.ignoreSelectionChange(n),o=-1,s=-1,i=!1,l=[];
1if(e.editable)for(let c=0;c<t.length;c++){let e=this.registerMutation(t[c],l);e&&(o=o<0?e.from:Math.min(e.from,o),s=s<0?e.to:Math.max(e.to,s),e.typeOver&&(i=!0))}if(l.some(e=>"BR"==e.nodeName)&&(8==e.input.lastKeyCode||46==e.input.lastKeyCode||Jc&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>"childList"==e.type&&e.removedNodes.length))){for(let c of l)if("BR"==c.nodeName&&c.parentNode){let e=c.nextSibling;for(;e&&1==e.nodeType;){if("false"==e.contentEditable){c.parentNode.removeChild(c);break}e=e.firstChild}}}else if(qc&&l.length){let t=l.filter(e=>"BR"==e.nodeName);if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;!t||"LI"!=t.nodeName||n&&Iu(e,n)==t||r.remove()}}}let a=null;o<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Lc(n)&&(a=Kd(e))&&a.eq(Ea.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Gd(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||r)&&(o>-1&&(e.docView.markDirty(o,s),function(e){if(Nu.has(e))return;if(Nu.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=qc,Du)return;Du=!0}}(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:o}=e.domSelectionRange();for(let s of t)if("TR"==(null===(n=s.parentNode)||void 0===n?void 0:n.nodeName)){let t=s.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(s,n.firstChild),r==s&&e.domSelection().collapse(s,o)}else s.parentNode.removeChild(s)}}(e,l)),this.handleDOMChange(o,s,i,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Gd(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,o=e.nextSibling;if(Wc&&Uc<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:s}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!s||Array.prototype.indexOf.call(e.addedNodes,s)<0)&&(o=s)}let s=r&&r.parentNode==e.target?Oc(r)+1:0,i=n.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?Oc(o):e.target.childNodes.length;return{from:i,to:n.localPosFromDOM(e.target,l,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},Nu=new WeakMap,Du=!1;function Ru(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,s=t.endOffset,i=e.domAtPos(e.state.selection.anchor);return Dc(i.node,i.offset,o,s)&&([n,r,o,s]=[o,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:s}}function Iu(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function _u(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Qc&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Qc&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}var Pu=/^(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 Lu(e,t,n,r,o){let s=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Kd(e,t);
1if(n&&!e.state.selection.eq(n)){if(Jc&&ed&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,$c(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),s&&r.setMeta("composition",s),e.dispatch(r)}return}let i=e.state.doc.resolve(t),l=i.sharedDepth(n);t=i.before(l+1),n=e.state.doc.resolve(n).after(l+1);let a,c,d=e.state.selection,h=function(e,t,n){let r,{node:o,fromOffset:s,toOffset:i,from:l,to:a}=e.docView.parseRange(t,n),c=e.domSelectionRange(),d=c.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:c.anchorOffset}],Lc(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Jc&&8===e.input.lastKeyCode)for(let g=i;g>s;g--){let e=o.childNodes[g-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){i=g;break}if(!t||t.size)break}let h=e.state.doc,u=e.someProp("domParser")||wl.fromSchema(e.state.schema),p=h.resolve(l),f=null,m=u.parse(o,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:s,to:i,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:r,ruleFromNode:_u,context:p});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+l,head:t+l}}return{doc:m,sel:f,from:l,to:a}}(e,t,n),u=e.state.doc,p=u.slice(h.from,h.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(a=e.state.selection.to,c="end"):(a=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let f=function(e,t,n,r,o){let s=e.findDiffStart(t,n),i=n+e.size,l=n+t.size;if(null==s)return null;let{a:a,b:c}=e.findDiffEnd(t,i,l);if("end"==o){r-=a+Math.max(0,s-Math.min(a,c))-s}if(a<s&&i<l){s-=r<=s&&r>=a?s-r:0,c=s+(c-a),a=s}else if(c<s){s-=r<=s&&r>=c?s-r:0,a=s+(a-c),c=s}return{start:s,endA:a,endB:c}}(p.content,h.doc.content,h.from,a,c);if(f&&e.input.domChangeCount++,(Xc&&e.input.lastIOSEnter>Date.now()-225||ed)&&o.some(e=>1==e.nodeType&&!Pu.test(e.nodeName))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",t=>t(e,$c(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&d instanceof Ra&&!d.empty&&d.$head.sameParent(d.$anchor))||e.composing||h.sel&&h.sel.anchor!=h.sel.head){if(h.sel){let t=$u(e,e.state.doc,h.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);s&&n.setMeta("composition",s),e.dispatch(n)}}return}f={start:d.from,endA:d.to,endB:d.to}}e.state.selection.from<e.state.selection.to&&f.start==f.endB&&e.state.selection instanceof Ra&&(f.start>e.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=h.from?f.start=e.state.selection.from:f.endA<e.state.selection.to&&f.endA>=e.state.selection.to-2&&e.state.selection.to<=h.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),Wc&&Uc<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>h.from&&" Â "==h.doc.textBetween(f.start-h.from-1,f.start-h.from+1)&&(f.start--,f.endA--,f.endB--);let m=h.doc.resolveNoCache(f.start-h.from),g=h.doc.resolveNoCache(f.endB-h.from),y=u.resolve(f.start),v=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=f.endA;if((Xc&&e.input.lastIOSEnter>Date.now()-225&&(!v||o.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!v&&m.pos<h.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(h.doc.textBetween(m.pos,g.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,$c(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,r,o){if(n-t<=o.pos-r.pos||zu(r,!0,!1)<o.pos)return!1;let s=e.resolve(t);if(!r.parent.isTextblock){let e=s.nodeAfter;return null!=e&&n==t+e.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let i=e.resolve(zu(s,!0,!0));return!(!i.parent.isTextblock||i.pos>n||zu(i,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(i.parent.content)}(u,f.start,f.endA,m,g)&&e.someProp("handleKeyDown",t=>t(e,$c(8,"Backspace"))))return void(ed&&Jc&&e.domObserver.suppressSelectionUpdates());Jc&&f.endB==f.start&&(e.input.lastChromeDelete=Date.now()),ed&&!v&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==f.endA&&(f.endB-=2,g=h.doc.resolveNoCache(f.endB-h.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,$c(13,"Enter"))})},20));let b,k=f.start,w=f.endA,x=t=>{let n=t||e.state.tr.replace(k,w,h.doc.slice(f.start-h.from,f.endB-h.from));if(h.sel){let t=$u(e,n.doc,h.sel);
1t&&!(Jc&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==k||t.head==n.mapping.map(w)-1)||Wc&&t.empty&&t.head==k)&&n.setSelection(t)}return s&&n.setMeta("composition",s),n.scrollIntoView()};if(v)if(m.pos==g.pos){Wc&&Uc<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Gd(e),20));let t=x(e.state.tr.delete(k,w)),n=u.resolve(f.start).marksAcross(u.resolve(f.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(f.endA==f.endB&&(b=function(e,t){let n,r,o,s=e.firstChild.marks,i=t.firstChild.marks,l=s,a=i;for(let d=0;d<i.length;d++)l=i[d].removeFromSet(l);for(let d=0;d<s.length;d++)a=s[d].removeFromSet(a);if(1==l.length&&0==a.length)r=l[0],n="add",o=e=>e.mark(r.addToSet(e.marks));else{if(0!=l.length||1!=a.length)return null;r=a[0],n="remove",o=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let d=0;d<t.childCount;d++)c.push(o(t.child(d)));if(Ai.from(c).eq(e))return{mark:r,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start())))){let t=x(e.state.tr);"add"==b.type?t.addMark(k,w,b.mark):t.removeMark(k,w,b.mark),e.dispatch(t)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,k,w));e.someProp("handleTextInput",r=>r(e,k,w,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function $u(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:nh(e,t.resolve(n.anchor),t.resolve(n.head))}function zu(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}var Bu=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Rh,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Wu),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Vu(this),ju(this),this.nodeViews=Hu(this),this.docView=Dd(this.state.doc,Fu(this),Mu(this),this.dom,this),this.domObserver=new Au(this,(e,t,n,r)=>Lu(this,e,t,n,r)),this.domObserver.start(),function(e){for(let t in Ah){let n=Ah[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Lh(e,t)||Ph(e,t)||!e.editable&&t.type in Nh||n(e,t)},Dh[t]?{passive:!0}:void 0)}Qc&&e.dom.addEventListener("input",()=>null),_h(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&_h(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Wu),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let r=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(Yh(this),s=!0),this.state=e;let i=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(i||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Hu(this);(function(e,t){let n=0,r=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,o=!0)}(i||t.handleDOMEvents!=this._props.handleDOMEvents)&&_h(this),this.editable=Vu(this),ju(this);let l=Mu(this),a=Fu(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",d=o||!this.docView.matchesNode(e.doc,a,l);!d&&e.selection.eq(r.selection)||(s=!0);let h="preserve"==c&&s&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let s=(r.left+r.right)/2,i=o+1;
1i<Math.min(innerHeight,r.bottom);i+=5){let r=e.root.elementFromPoint(s,i);if(!r||r==e.dom||!e.dom.contains(r))continue;let l=r.getBoundingClientRect();if(l.top>=o-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:ld(e.dom)}}(this);if(s){this.domObserver.stop();let t=d&&(Wc||Jc)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(d){let n=Jc?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Zh(this)),!o&&this.docView.update(e.doc,a,l,this)||(this.docView.updateOuterDeco(a),this.docView.destroy(),this.docView=Dd(e.doc,a,l,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}let n=this.input.mouseDown;t||!(n&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Dc(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this)&&n.delaySelUpdate())?Gd(this,t):(eh(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():h&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;ad(n,0==r?0:r-t)}(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof _a){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&id(this,t.getBoundingClientRect(),e)}else id(this,this.coordsAtPos(this.state.selection.head,1),e);else;}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new ou(e.slice,e.move,r<0?void 0:_a.create(this.state.doc,r))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let s=0;s<this.directPlugins.length;s++){let r=this.directPlugins[s].props[e];if(null!=r&&(n=t?t(r):r))return n}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let r=o[s].props[e];if(null!=r&&(n=t?t(r):r))return n}}hasFocus(){if(Wc){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("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(cd)return e.focus(cd);let t=ld(e);e.focus(null==cd?{get preventScroll(){return cd={preventScroll:!0},!0}}:void 0),cd||(cd=!1,ad(t,0))}(this.dom),Gd(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t;return e||document}updateRoot(){this._root=null}posAtCoords(e){return pd(this,e)}coordsAtPos(e,t=1){return yd(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return Md(this,t||this.state,e)}pasteHTML(e,t){return nu(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return nu(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return vh(this,e)}destroy(){this.docView&&(!function(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Mu(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,A
1c=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Ph(e,t)||!Ah[t.type]||!e.editable&&t.type in Nh||Ah[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?Qc&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Ru(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?Ru(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function Fu(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[hu.node(0,e.state.doc.content.size,t)]}function ju(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:hu.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Vu(e){return!e.someProp("editable",t=>!1===t(e.state))}function Hu(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Wu(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}Bu.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var Uu={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:"'"},qu={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ku="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Ju="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Gu=0;Gu<10;Gu++)Uu[48+Gu]=Uu[96+Gu]=String(Gu);for(Gu=1;Gu<=24;Gu++)Uu[Gu+111]="F"+Gu;for(Gu=65;Gu<=90;Gu++)Uu[Gu]=String.fromCharCode(Gu+32),qu[Gu]=String.fromCharCode(Gu);for(var Qu in Uu)qu.hasOwnProperty(Qu)||(qu[Qu]=Uu[Qu]);var Xu="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Yu="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function Zu(e){let t,n,r,o,s=e.split(/-(?!$)/),i=s[s.length-1];"Space"==i&&(i=" ");for(let l=0;l<s.length-1;l++){let e=s[l];if(/^(cmd|meta|m)$/i.test(e))o=!0;else if(/^a(lt)?$/i.test(e))t=!0;else if(/^(c|ctrl|control)$/i.test(e))n=!0;else if(/^s(hift)?$/i.test(e))r=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);Xu?o=!0:n=!0}}return t&&(i="Alt-"+i),n&&(i="Ctrl-"+i),o&&(i="Meta-"+i),r&&(i="Shift-"+i),i}function ep(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function tp(e){let t=function(e){let t=Object.create(null);for(let n in e)t[Zu(n)]=e[n];return t}(e);return function(e,n){let r,o=function(e){var t=!(Ku&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Ju&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?qu:Uu)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),s=t[ep(o,n)];if(s&&s(e.state,e.dispatch,e))return!0;
1if(1==o.length&&" "!=o){if(n.shiftKey){let r=t[ep(o,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Yu&&n.ctrlKey&&n.altKey)&&(r=Uu[n.keyCode])&&r!=o){let o=t[ep(r,n)];if(o&&o(e.state,e.dispatch,e))return!0}}return!1}}var np=Object.defineProperty,rp=(e,t)=>{for(var n in t)np(e,n,{get:t[n],enumerable:!0})};function op(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:s}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return s},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,s=n.storedMarks,n}}}var sp=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:t,state:n}=this,{view:r}=t,{tr:o}=n,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{const n=t(...e)(s);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:s}=r,i=[],l=!!e,a=e||o.tr,c={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{const r=this.buildProps(a,t),o=n(...e)(r);return i.push(o),c}])),run:()=>(l||!t||a.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(a),i.every(e=>!0===e))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,o=e||n.tr,s=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:s}=r,i={tr:e,editor:r,view:s,state:op({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(i)]))}};return i}},ip={};rp(ip,{blur:()=>lp,clearContent:()=>ap,clearNodes:()=>cp,command:()=>dp,createParagraphNear:()=>hp,cut:()=>up,deleteCurrentNode:()=>pp,deleteNode:()=>mp,deleteRange:()=>gp,deleteSelection:()=>vp,enter:()=>bp,exitCode:()=>kp,extendMarkRange:()=>Op,first:()=>Ep,focus:()=>_p,forEach:()=>Pp,insertContent:()=>Lp,insertContentAt:()=>Fp,joinBackward:()=>Hp,joinDown:()=>Vp,joinForward:()=>Wp,joinItemBackward:()=>Up,joinItemForward:()=>qp,joinTextblockBackward:()=>Kp,joinTextblockForward:()=>Jp,joinUp:()=>jp,keyboardShortcut:()=>Qp,lift:()=>Yp,liftEmptyBlock:()=>Zp,liftListItem:()=>ef,newlineInCode:()=>tf,resetAttributes:()=>of,scrollIntoView:()=>sf,selectAll:()=>lf,selectNodeBackward:()=>af,selectNodeForward:()=>cf,selectParentNode:()=>df,selectTextblockEnd:()=>hf,selectTextblockStart:()=>uf,setContent:()=>ff,setMark:()=>Jf,setMeta:()=>Gf,setNode:()=>Qf,setNodeSelection:()=>Xf,setTextDirection:()=>Yf,setTextSelection:()=>Zf,sinkListItem:()=>em,splitBlock:()=>nm,splitListItem:()=>rm,toggleList:()=>am,toggleMark:()=>cm,toggleNode:()=>dm,toggleWrap:()=>hm,undoInputRule:()=>um,unsetAllMarks:()=>pm,unsetMark:()=>fm,unsetTextDirection:()=>mm,updateAttributes:()=>gm,wrapIn:()=>ym,wrapInList:()=>vm});var lp=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),ap=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),cp=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:o}=r;return!n||(o.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;const{doc:r,mapping:o}=t,s=r.resolve(o.map(n)),i=r.resolve(o.map(n+e.nodeSize)),l=s.blockRange(i);if(!l)return;const a=na(l);if(e.type.isTextblock){const{defaultType:e}=s.parent.contentMatchAt(s.index());t.setNodeMarkup(l.start,e)}(a||0===a)&&t.lift(l,a)})}),!0)},dp=e=>t=>e(t),hp=()=>({state:e,dispatch:t})=>hc(e,t),up=(e,t)=>({editor:n,tr:r})=>{const{state:o}=n,s=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const i=r.mapping.map(t);return r.insert(i,s.content),r.setSelection(new Ra(r.doc.resolve(Math.max(i-1,0)))),!0},pp=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r.type){if(t){const t=o.before(s),n=o.after(s);e.delete(t,n).scrollIntoView()}return!0}return!1};function fp(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var mp=e=>({tr:t,state:n,dispatch:r})=>{const o=fp(e,n.schema),s=t.selection.$anchor;for(let e=s.depth;e>0;e-=1)if(s.node(e).type===o){if(r){const n=s.before(e),r=s.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},gp=e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},yp=(e,t,n)=>{if(!e.parent.isInline)return e.pos;if("left"===n&&e.pos>e.start()||"right"===n&&e.pos<e.end())return e.pos;
1const r=t.nodes[e.parent.type.name].spec;return(o=r).content&&/^text(\*|\+)/.test(o.content)?"left"===n?e.start()-1:e.end()+1:e.pos;var o},vp=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){const n=e.tr,{ranges:r}=e.selection,o=n.steps.length;r.forEach(t=>{const r=n.mapping.slice(o),{from:s,to:i}=(l=n.doc.resolve(r.map(t.$from.pos)),a=n.doc.resolve(r.map(t.$to.pos)),c=e.schema,{from:yp(l,c,"left"),to:yp(a,c,"right")});var l,a,c;n.deleteRange(s,i)}),n.scrollIntoView(),t(n)}return!0},bp=()=>({commands:e})=>e.keyboardShortcut("Enter"),kp=()=>({state:e,dispatch:t})=>dc(e,t);function wp(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function xp(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:wp(t[r])?t[r].test(e[r]):t[r]===e[r])}function Sp(e,t,n={}){return e.find(e=>e.type===t&&xp(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function Cp(e,t,n={}){return!!Sp(e,t,n)}function Mp(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(r.node&&r.node.marks.some(e=>e.type===t)||(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){const e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!Sp([...r.node.marks],t,n))return;let o=r.index,s=e.start()+r.offset,i=o+1,l=s+r.node.nodeSize;for(;o>0&&Cp([...e.parent.child(o-1).marks],t,n);)o-=1,s-=e.parent.child(o).nodeSize;for(;i<e.parent.childCount&&Cp([...e.parent.child(i).marks],t,n);)l+=e.parent.child(i).nodeSize,i+=1;return{from:s,to:l}}function Tp(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var Op=(e,t)=>({tr:n,state:r,dispatch:o})=>{const s=Tp(e,r.schema),{doc:i,selection:l}=n,{$from:a,from:c,to:d}=l;if(o){const e=Mp(a,s,t);if(e&&e.from<=c&&e.to>=d){const t=Ra.create(i,e.from,e.to);n.setSelection(t)}}return!0},Ep=e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function Ap(e){return e instanceof Ra}function Np(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Dp(e,t=null){if(!t)return null;const n=Ea.atStart(e),r=Ea.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const o=n.from,s=r.to;return"all"===t?Ra.create(e,Np(0,o,s),Np(e.content.size,o,s)):Ra.create(e,Np(t,o,s),Np(t,o,s))}function Rp(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function Ip(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var _p=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:s})=>{t={scrollIntoView:!0,...t};const i=()=>{(Ip()||Rp())&&r.dom.focus(),"undefined"==typeof navigator||!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||Ip()||Rp()||r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&null===e||!1===e)return!0}catch{return!1}if(s&&null===e&&!Ap(n.state.selection))return i(),!0;const l=Dp(o.doc,e)||n.state.selection,a=n.state.selection.eq(l);return s&&(a||o.setSelection(l),a&&o.storedMarks&&o.setStoredMarks(o.storedMarks),i()),!0},Pp=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),Lp=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),$p=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&$p(r)}return e};function zp(e){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return $p(n)}function Bp(e,t,n){if(e instanceof Zi||e instanceof Ai)return e;n={slice:!0,parseOptions:{},...n};const r="string"==typeof e;if("object"==typeof e&&null!==e)try{if(Array.isArray(e)&&e.length>0)return Ai.fromArray(e.map(e=>t.nodeFromJSON(e)));
1const r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return Bp("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,o="";const s=new bl({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(r=!0,o="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?wl.fromSchema(s).parseSlice(zp(e),n.parseOptions):wl.fromSchema(s).parse(zp(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const r=wl.fromSchema(t);return n.slice?r.parseSlice(zp(e),n.parseOptions).content:r.parse(zp(e),n.parseOptions)}return Bp("",t,n)}var Fp=(e,t,n)=>({tr:r,dispatch:o,editor:s})=>{var i,l;if(o){let o;const c=e=>{s.emit("contentError",{editor:s,error:e,disableCollaboration:()=>{"collaboration"in s.storage&&"object"==typeof s.storage.collaboration&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...(n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Bp(t,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(a){c(a)}try{o=Bp(t,s.schema,{parseOptions:d,errorOnInvalidContent:null!=(i=n.errorOnInvalidContent)?i:s.options.enableContentCheck})}catch(a){return c(a),!1}let h,{from:u,to:p}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},f=!0,m=!0;if((l=o,"type"in l?[o]:o).forEach(e=>{e.check(),f=!!f&&(e.isText&&0===e.marks.length),m=!!m&&e.isBlock}),u===p&&m){const{parent:e}=r.doc.resolve(u);!e.isTextblock||e.type.spec.code||e.childCount||(u-=1,p+=1)}if(f){if(Array.isArray(t))h=t.map(e=>e.text||"").join("");else if(t instanceof Ai){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),h=e}else h="object"==typeof t&&t&&t.text?t.text:t;r.insertText(h,u,p)}else{h=o;const e=r.doc.resolve(u),t=e.node(),n=0===e.parentOffset,s=t.isText||t.isTextblock,i=t.content.size>0;n&&s&&i&&m&&(u=Math.max(0,u-1)),r.replaceWith(u,p,h)}n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const o=e.steps[r];if(!(o instanceof Xl||o instanceof Yl))return;const s=e.mapping.maps[r];let i=0;s.forEach((e,t,n,r)=>{0===i&&(i=r)}),e.setSelection(Ea.near(e.doc.resolve(i),n))}(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:h})}return!0},jp=()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection,o=r instanceof _a;if(o){if(r.node.isTextblock||!aa(e.doc,r.from))return!1;n=r.from}else if(n=da(e.doc,r.from,-1),null==n)return!1;if(t){let r=e.tr.join(n);o&&r.setSelection(_a.create(r.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(r.scrollIntoView())}return!0})(e,t),Vp=()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection;if(r instanceof _a){if(r.node.isTextblock||!aa(e.doc,r.to))return!1;n=r.to}else if(n=da(e.doc,r.to,1),null==n)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0})(e,t),Hp=()=>({state:e,dispatch:t})=>Za(e,t),Wp=()=>({state:e,dispatch:t})=>sc(e,t),Up=()=>({state:e,dispatch:t,tr:n})=>{try{const r=da(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},qp=()=>({state:e,dispatch:t,tr:n})=>{try{const r=da(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Kp=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=Ya(e,n);if(!r)return!1;let o=rc(r);return!!o&&ec(e,o,t)})(e,t),Jp=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=oc(e,n);if(!r)return!1;let o=lc(r);return!!o&&ec(e,o,t)})(e,t);function Gp(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var Qp=e=>({editor:t,view:n,tr:r,dispatch:o})=>{const s=function(e){const t=e.split(/-(?!$)/);let n,r,o,s,i=t[t.length-1];"Space"===i&&(i=" ");for(let l=0;l<t.length-1;l+=1){const e=t[l];if(/^(cmd|meta|m)$/i.test(e))s=!0;else if(/^a(lt)?$/i.test(e))n=!0;else if(/^(c|ctrl|control)$/i.test(e))r=!0;else if(/^s(hift)?$/i.test(e))o=!0;else{if(!/^mod$/i.test(e))throw new Error(`Unrecognized modifier name: ${e}`);Ip()||Gp()?s=!0:r=!0}}return n&&(i=`Alt-${i}`),r&&(i=`Ctrl-${i}`),s&&(i=`Meta-${i}`),o&&(i=`Shift-${i}`),i}(e).split(/-(?!$)/),i=s.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),l=new KeyboardEvent("keydown",{key:"Space"
1===i?" ":i,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,l))})?.steps.forEach(e=>{const t=e.map(r.mapping);t&&o&&r.maybeStep(t)}),!0};function Xp(e,t,n={}){const{from:r,to:o,empty:s}=e.selection,i=t?fp(t,e.schema):null,l=[];e.doc.nodesBetween(r,o,(e,t)=>{if(e.isText)return;const n=Math.max(r,t),s=Math.min(o,t+e.nodeSize);l.push({node:e,from:n,to:s})});const a=o-r,c=l.filter(e=>!i||i.name===e.node.type.name).filter(e=>xp(e.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((e,t)=>e+t.to-t.from,0)>=a}var Yp=(e,t={})=>({state:n,dispatch:r})=>!!Xp(n,fp(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),s=o&&na(o);return null!=s&&(t&&t(e.tr.lift(o,s).scrollIntoView()),!0)})(n,r),Zp=()=>({state:e,dispatch:t})=>uc(e,t),ef=e=>({state:t,dispatch:n})=>Tc(fp(e,t.schema))(t,n),tf=()=>({state:e,dispatch:t})=>ac(e,t);function nf(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function rf(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var of=(e,t)=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const l=nf("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(s=fp(e,r.schema)),"mark"===l&&(i=Tp(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{s&&s===e.type&&(a=!0,o&&n.setNodeMarkup(r,void 0,rf(e.attrs,t))),i&&e.marks.length&&e.marks.forEach(s=>{i===s.type&&(a=!0,o&&n.addMark(r,r+e.nodeSize,i.create(rf(s.attrs,t))))})})}),a},sf=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),lf=()=>({tr:e,dispatch:t})=>{if(t){const t=new La(e.doc);e.setSelection(t)}return!0},af=()=>({state:e,dispatch:t})=>nc(e,t),cf=()=>({state:e,dispatch:t})=>ic(e,t),df=()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:o}=e.selection,s=r.sharedDepth(o);return 0!=s&&(n=r.before(s),t&&t(e.tr.setSelection(_a.create(e.doc,n))),!0)})(e,t),hf=()=>({state:e,dispatch:t})=>vc(e,t),uf=()=>({state:e,dispatch:t})=>yc(e,t);function pf(e,t,n={},r={}){return Bp(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var ff=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:s,dispatch:i,commands:l})=>{const{doc:a}=s;if("full"!==r.preserveWhitespace){const l=pf(e,o.schema,r,{errorOnInvalidContent:null!=t?t:o.options.enableContentCheck});return i&&s.replaceWith(0,a.content.size,l).setMeta("preventUpdate",!n),!0}return i&&s.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:o.options.enableContentCheck})};function mf(e,t){const n=Tp(t,e.schema),{from:r,to:o,empty:s}=e.selection,i=[];s?(e.storedMarks&&i.push(...e.storedMarks),i.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,e=>{i.push(...e.marks)});const l=i.find(e=>e.type.name===n.name);return l?{...l.attrs}:{}}function gf(e,t){const n=new Ta(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function yf(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function vf(e,t,n){return void 0===e.config[t]&&e.parent?vf(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?vf(e.parent,t,n):null}):e.config[t]}function bf(e){return e.map(e=>{const t=vf(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...bf(t())]:e}).flat(10)}function kf(e,t){const n=Dl.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function wf(e){return"function"==typeof e}function xf(e,t=void 0,...n){return wf(e)?t?e.bind(t)(...n):e(...n):e}function Sf(e){return{baseExtensions:e.filter(e=>"extension"===e.type),nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function Cf(e){const t=[],{nodeExtensions:n,markExtensions:r}=Sf(e),o=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},i=n.filter(e=>"text"!==e.name).map(e=>e.name),l=r.map(e=>e.name),a=[...i,...l];
1return e.forEach(e=>{const n=vf(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:o});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:"*"===e.types?a:"nodes"===e.types?i:"marks"===e.types?l:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...s,...r}})})})})}),o.forEach(e=>{const n=vf(e,"addAttributes",{name:e.name,options:e.options,storage:e.storage});if(!n)return;const r=n();Object.entries(r).forEach(([n,r])=>{const o={...s,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&void 0===(null==o?void 0:o.default)&&delete o.default,t.push({type:e.name,name:n,attribute:o})})}),t}function Mf(e){const t=[],n=function(e){const t=[];let n="",r=!1,o=!1,s=0;const i=e.length;for(let l=0;l<i;l+=1){const i=e[l];if("'"!==i||o)if('"'!==i||r){if(!r&&!o){if("("===i){s+=1,n+=i;continue}if(")"===i&&s>0){s-=1,n+=i;continue}if(";"===i&&0===s){t.push(n),n="";continue}}n+=i}else o=!o,n+=i;else r=!r,n+=i}return n&&t.push(n),t}(e||""),r=n.length;for(let o=0;o<r;o+=1){const e=n[o],r=e.indexOf(":");if(-1===r)continue;const s=e.slice(0,r).trim(),i=e.slice(r+1).trim();s&&i&&t.push([s,i])}return t}function Tf(...e){return e.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([e,t])=>{if(n[e])if("class"===e){const r=t?String(t).split(" "):[],o=n[e]?n[e].split(" "):[],s=r.filter(e=>!o.includes(e));n[e]=[...o,...s].join(" ")}else if("style"===e){const r=new Map([...Mf(n[e]),...Mf(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t;else n[e]=t}),n},{})}function Of(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>Tf(e,t),{})}function Ef(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const o=t.reduce((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}},{});return{...r,...o}}}}function Af(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function Nf(e){var t,n;const r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),void 0!==(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)&&(r.validate=e.attribute.validate),[e.name,r]}function Df(e){return e.sort((e,t)=>{const n=vf(e,"priority")||100,r=vf(t,"priority")||100;return n>r?-1:n<r?1:0})}function Rf(e){const t=Df(bf(e));return function(e){const t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}(t.map(e=>e.name)).length,t}function If(e,t,n){const{from:r,to:o}=t,{blockSeparator:s="\n\n",textSerializers:i={}}=n||{};let l="";return e.nodesBetween(r,o,(e,n,a,c)=>{var d;e.isBlock&&n>r&&(l+=s);const h=null==i?void 0:i[e.type.name];if(h)return a&&(l+=h({node:e,pos:n,parent:a,index:c,range:t})),!1;e.isText&&(l+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,o-n))}),l}function _f(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Pf(e,t){const n=nf("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=fp(t,e.schema),{from:r,to:o}=e.selection,s=[];e.doc.nodesBetween(r,o,e=>{s.push(e)});const i=s.reverse().find(e=>e.type.name===n.name);return i?{...i.attrs}:{}}(e,t):"mark"===n?mf(e,t):{}}function Lf(e){const t=function(e,t=JSON.stringify){const n={};return e.filter(e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(e);return 1===t.length?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function $f(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,o)=>{const s=[];if(e.ranges.length)e.forEach((e,t)=>{s.push({from:e,to:t})});else{const{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;s.push({from:e,to:t})}s.forEach(({from:e,to:n})=>{const s=t.slice(o).map(e,-1),i=t.slice(o).map(n),l=t.invert().map(s,-1),a=t.invert().map(i);r.push({oldRange:{from:l,to:a},newRange:{from:s,to:i}})})}),Lf(r)}function zf(e,t,n){const r=[];
1return e===t?n.resolve(e).marks().forEach(t=>{const o=Mp(n.resolve(e),t.type);o&&r.push({mark:t,...o})}):n.nodesBetween(e,t,(e,t)=>{e&&void 0!==(null==e?void 0:e.nodeSize)&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function Bf(e,t){return t.nodes[e]||t.marks[e]||null}function Ff(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{const r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}function jf(e,t,n={}){const{empty:r,ranges:o}=e.selection,s=t?Tp(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!s||s.name===e.type.name).find(e=>xp(e.attrs,n,{strict:!1}));let i=0;const l=[];if(o.forEach(({$from:t,$to:n})=>{const r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,(e,t)=>{if(s&&e.inlineContent&&!e.type.allowsMarkType(s))return!1;if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),a=Math.min(o,t+e.nodeSize);i+=a-n,l.push(...e.marks.map(e=>({mark:e,from:n,to:a})))})}),0===i)return!1;const a=l.filter(e=>!s||s.name===e.mark.type.name).filter(e=>xp(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),c=l.filter(e=>!s||e.mark.type!==s&&e.mark.type.excludes(s)).reduce((e,t)=>e+t.to-t.from,0);return(a>0?a+c:a)>=i}function Vf(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function Hf(e,t){const{nodeExtensions:n}=Sf(t),r=n.find(t=>t.name===e);if(!r)return!1;const o=xf(vf(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function Wf(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return!/\S/.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach(e=>{!1!==r&&(Wf(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}var Uf=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function qf(e,t){const n=t.mapping.mapResult(e.position);return{position:new Uf(n.pos),mapResult:n}}function Kf(e){return new Uf(e)}var Jf=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=n,{empty:i,ranges:l}=s,a=Tp(e,r.schema);if(o)if(i){const e=mf(r,a);n.addStoredMark(a.create({...e,...t}))}else l.forEach(e=>{const o=e.$from.pos,s=e.$to.pos;r.doc.nodesBetween(o,s,(e,r)=>{const i=Math.max(r,o),l=Math.min(r+e.nodeSize,s);e.marks.find(e=>e.type===a)?e.marks.forEach(e=>{a===e.type&&n.addMark(i,l,a.create({...e.attrs,...t}))}):n.addMark(i,l,a.create(t))})});return function(e,t,n){var r;const{selection:o}=t;let s=null;if(Ap(o)&&(s=o.$cursor),s){const t=null!=(r=e.storedMarks)?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}const{ranges:i}=o;return i.some(({$from:t,$to:r})=>{let o=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(o)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),s=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));o=t&&s}return!o}),o})}(r,n,a)},Gf=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Qf=(e,t={})=>({state:n,dispatch:r,chain:o})=>{const s=fp(e,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),!!s.isTextblock&&o().command(({commands:e})=>!!bc(s,{...i,...t})(n)||e.clearNodes()).command(({state:e})=>bc(s,{...i,...t})(e,r)).run()},Xf=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=Np(e,0,n.content.size),o=_a.create(n,r);t.setSelection(o)}return!0},Yf=(e,t)=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=r;let i,l;return"number"==typeof t?(i=t,l=t):t&&"from"in t&&"to"in t?(i=t.from,l=t.to):(i=s.from,l=s.to),o&&n.doc.nodesBetween(i,l,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},Zf=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,s=Ra.atStart(n).from,i=Ra.atEnd(n).to,l=Np(r,s,i),a=Np(o,s,i),c=Ra.create(n,l,a);t.setSelection(c)}return!0},em=e=>({state:t,dispatch:n})=>{return(r=fp(e,t.schema),function(e,t){let{$from:n,$to:o}=e.selection,s=n.blockRange(o,e=>e.childCount>0&&e.firstChild.type==r);if(!s)return!1;let i=s.startIndex;if(0==i)return!1;let l=s.parent,a=l.child(i-1);if(a.type!=r)return!1;if(t){let n=a.lastChild&&a.lastChild.type==l.type,o=Ai.from(n?r.create():null),i=new Pi(Ai.from(r.create(null,Ai.from(l.type.create(null,o)))),n?3:1,0),c=s.start,d=s.end;t(e.tr.step(new Yl(c-(n?3:1),d,c,d,i,1,!0)).scrollIntoView())}return!0})(t,n);var r};function tm(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(e=>
1null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}var nm=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:i}=t,{$from:l,$to:a}=s,c=Ff(o.extensionManager.attributes,l.node().type.name,l.node().attrs);if(s instanceof _a&&s.node.isBlock)return!(!l.parentOffset||!la(i,l.pos))&&(r&&(e&&tm(n,o.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,h=0===l.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(l.node(-1).contentMatchAt(l.indexAfter(-1)));let u=d&&h?[{type:h,attrs:c}]:void 0,p=la(t.doc,t.mapping.map(l.pos),1,u);if(u||p||!la(t.doc,t.mapping.map(l.pos),1,h?[{type:h}]:void 0)||(p=!0,u=h?[{type:h,attrs:c}]:void 0),r){if(p&&(s instanceof Ra&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,u),h&&!d&&!l.parentOffset&&l.parent.type!==h)){const e=t.mapping.map(l.before()),n=t.doc.resolve(e);l.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&t.setNodeMarkup(t.mapping.map(l.before()),h)}e&&tm(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return p},rm=(e,t={})=>({tr:n,state:r,dispatch:o,editor:s})=>{var i;const l=fp(e,r.schema),{$from:a,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||a.depth<2||!a.sameParent(c))return!1;const h=a.node(-1);if(h.type!==l)return!1;const u=s.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(o){let e=Ai.empty;const r=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-r;t>=a.depth-3;t-=1)e=Ai.from(a.node(t).copy(e));const o=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,s={...Ff(u,a.node().type.name,a.node().attrs),...t},c=(null==(i=l.contentMatch.defaultType)?void 0:i.createAndFill(s))||void 0;e=e.append(Ai.from(l.createAndFill(null,c)||void 0));const d=a.before(a.depth-(r-1));n.replace(d,a.after(-o),new Pi(e,4-r,0));let h=-1;n.doc.nodesBetween(d,n.doc.content.size,(e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)}),h>-1&&n.setSelection(Ra.near(n.doc.resolve(h))),n.scrollIntoView()}return!0}const p=c.pos===a.end()?h.contentMatchAt(0).defaultType:null,f={...Ff(u,h.type.name,h.attrs),...t},m={...Ff(u,a.node().type.name,a.node().attrs),...t};n.delete(a.pos,c.pos);const g=p?[{type:l,attrs:f},{type:p,attrs:m}]:[{type:l,attrs:f}];if(!la(n.doc,a.pos,2))return!1;if(o){const{selection:e,storedMarks:t}=r,{splittableMarks:i}=s.extensionManager,l=t||e.$to.parentOffset&&e.$from.marks();if(n.split(a.pos,2,g).scrollIntoView(),!l||!o)return!0;const c=l.filter(e=>i.includes(e.type.name));n.ensureMarks(c)}return!0};function om(e){return e&&"1"!==e?e:null}function sm(e,t){return om(e)===om(t)}var im=(e,t)=>{const n=yf(e=>e.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!aa(e.doc,n.pos)||(!sm(n.node.attrs.type,null==o?void 0:o.attrs.type)||(e.join(n.pos),!0))},lm=(e,t)=>{const n=yf(e=>e.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!aa(e.doc,r)||(!sm(n.node.attrs.type,null==o?void 0:o.attrs.type)||(e.join(r),!0))};var am=(e,t,n,r={})=>({editor:o,tr:s,state:i,dispatch:l,chain:a,commands:c,can:d})=>{const{extensions:h,splittableMarks:u}=o.extensionManager,p=fp(e,i.schema),f=fp(t,i.schema),{selection:m,storedMarks:g}=i,{$from:y,$to:v}=m,b=y.blockRange(v),k=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const w=yf(e=>Hf(e.type.name,h))(m),x=0===m.from&&m.to===i.doc.content.size,S=i.doc.content.content,C=1===S.length?S[0]:null,M=x&&C&&Hf(C.type.name,h)?{node:C,pos:0,depth:0}:null,T=null!=w?w:M,O=!!M;if((!!w&&b.depth>=1&&b.depth-w.depth<=1||O)&&T){if(T.node.type===p)return x&&O?a().command(({tr:e,dispatch:t})=>{const n=function(e){const t=e.doc,n=t.firstChild;if(!n)return null;const r=t.resolve(1),o=t.resolve(n.nodeSize-1);return Ra.between(r,o)}(e);return!!n&&(e.setSelection(n),t&&t(e),!0)}).liftListItem(f).run():c.liftListItem(f);
1if(Hf(T.node.type.name,h)&&p.validContent(T.node.content))return a().command(()=>(s.setNodeMarkup(T.pos,p),!0)).command(()=>im(s,p)).command(()=>lm(s,p)).run()}return n&&k&&l?a().command(()=>{const e=d().wrapInList(p,r),t=k.filter(e=>u.includes(e.type.name));return s.ensureMarks(t),!!e||c.clearNodes()}).wrapInList(p,r).command(()=>im(s,p)).command(()=>lm(s,p)).run():a().command(()=>!!d().wrapInList(p,r)||c.clearNodes()).wrapInList(p,r).command(()=>im(s,p)).command(()=>lm(s,p)).run()},cm=(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:s=!1}=n,i=Tp(e,r.schema);return jf(r,i,t)?o.unsetMark(i,{extendEmptyMarkRange:s}):o.setMark(i,t)},dm=(e,t,n={})=>({state:r,commands:o})=>{const s=fp(e,r.schema),i=fp(t,r.schema),l=Xp(r,s,n);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?o.setNode(i,a):o.setNode(s,{...a,...n})},hm=(e,t={})=>({state:n,commands:r})=>{const o=fp(e,n.schema);return Xp(n,o,t)?r.lift(o):r.wrapIn(o,t)},um=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let s;if(o.spec.isInputRules&&(s=o.getState(e))){if(t){const t=e.tr,n=s.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(s.text){const n=t.doc.resolve(s.from).marks();t.replaceWith(s.from,s.to,e.schema.text(s.text,n))}else t.delete(s.from,s.to)}return!0}}return!1},pm=(e={})=>({tr:t,dispatch:n,editor:r})=>{const{ignoreClearable:o=!1}=e,{selection:s}=t,{empty:i,ranges:l}=s;if(i)return!0;const{nonClearableMarks:a}=r.extensionManager;if(n){const e=Object.values(r.schema.marks).filter(e=>o||!a.includes(e.name));l.forEach(n=>{for(const r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},fm=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var s;const{extendEmptyMarkRange:i=!1}=t,{selection:l}=n,a=Tp(e,r.schema),{$from:c,empty:d,ranges:h}=l;if(!o)return!0;if(d&&i){let{from:e,to:t}=l;const r=Mp(c,a,null==(s=c.marks().find(e=>e.type===a))?void 0:s.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,a)}else h.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,a)});return n.removeStoredMark(a),!0},mm=e=>({tr:t,state:n,dispatch:r})=>{const{selection:o}=n;let s,i;return"number"==typeof e?(s=e,i=e):e&&"from"in e&&"to"in e?(s=e.from,i=e.to):(s=o.from,i=o.to),r&&t.doc.nodesBetween(s,i,(e,n)=>{if(e.isText)return;const r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},gm=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const l=nf("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(s=fp(e,r.schema)),"mark"===l&&(i=Tp(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{const l=e.$from.pos,c=e.$to.pos;let d,h,u,p;n.selection.empty?r.doc.nodesBetween(l,c,(e,t)=>{s&&s===e.type&&(a=!0,u=Math.max(t,l),p=Math.min(t+e.nodeSize,c),d=t,h=e)}):r.doc.nodesBetween(l,c,(e,r)=>{r<l&&s&&s===e.type&&(a=!0,u=Math.max(r,l),p=Math.min(r+e.nodeSize,c),d=r,h=e),r>=l&&r<=c&&(s&&s===e.type&&(a=!0,o&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),i&&e.marks.length&&e.marks.forEach(s=>{if(i===s.type&&(a=!0,o)){const o=Math.max(r,l),a=Math.min(r+e.nodeSize,c);n.addMark(o,a,i.create({...s.attrs,...t}))}}))}),h&&(void 0!==d&&o&&n.setNodeMarkup(d,void 0,{...h.attrs,...t}),i&&h.marks.length&&h.marks.forEach(e=>{i===e.type&&o&&n.addMark(u,p,i.create({...e.attrs,...t}))}))}),a},ym=(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s),l=i&&ra(i,e,t);return!!l&&(r&&r(n.tr.wrap(i,l).scrollIntoView()),!0)}}(fp(e,n.schema),t)(n,r),vm=(e,t={})=>({state:n,dispatch:r})=>Mc(fp(e,n.schema),t)(n,r),bm=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};function km(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function wm(e){if(!(null==e?void 0:e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),o=r.match(/(?:^|\s)\.([\w-]+)/g);o&&(t.class=o.map(e=>e.trim().slice(1)).join(" "));const s=r.match(/(?:^|\s)#([\w-]+)/);
1s&&(t.id=s[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{var o;const s=parseInt((null==(o=r.match(/__QUOTED_(\d+)__/))?void 0:o[1])||"0",10),i=n[s];i&&(t[e]=i.slice(1,-1))});const i=r.replace(/(?:^|\s)\.([\w-]+)/g,"").replace(/(?:^|\s)#([\w-]+)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return i&&i.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function xm(e){if(!e||0===Object.keys(e).length)return"";const t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))}),t.join(" ")}function Sm(e){const{nodeName:t,name:n,parseAttributes:r=wm,serializeAttributes:o=xm,defaultAttributes:s={},requiredAttributes:i=[],allowedAttributes:l}=e,a=n||t;return{parseMarkdown:(e,n)=>{const r={...s,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${a}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,o){const s=new RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),l=e.match(s);if(!l)return;const c=l[1]||"",d=r(c);return i.find(e=>!(e in d))?void 0:{type:t,raw:l[0],attributes:d}}},renderMarkdown:e=>{const t=(e=>{if(!l)return e;const t={};return l.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{}),n=o(t);return`:::${a}${n?` {${n}}`:""} :::`}}}function Cm(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=wm,serializeAttributes:s=xm,defaultAttributes:i={},content:l="block",allowedAttributes:a}=e,c=n||t;return{parseMarkdown:(e,n)=>{let o;if(r){const t=r(e);o="string"==typeof t?[{type:"text",text:t}]:t}else o="block"===l?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);const s={...i,...e.attributes};return n.createNode(t,s,o)},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var s;const i=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),a=e.match(i);if(!a)return;const[d,h=""]=a,u=o(h);let p=1;const f=d.length;let m="";const g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){const n=g.exec(y);if(null===n)break;const o=n.index,i=n[1];if(!(null==(s=n[2])?void 0:s.endsWith(":::")))if(i)p+=1;else if(p-=1,0===p){const s=y.slice(0,o);m=s.trim();const i=e.slice(0,f+o+n[0].length);let a=[];if(m)if("block"===l)for(a=r.blockTokens(s),a.forEach(e=>{!e.text||e.tokens&&0!==e.tokens.length||(e.tokens=r.inlineTokens(e.text))});a.length>0;){const e=a[a.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;a.pop()}else a=r.inlineTokens(m);return{type:t,raw:i,attributes:u,content:m,tokens:a}}}}},renderMarkdown:(e,t)=>{const n=(e=>{if(!a)return e;const t={};return a.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{}),r=s(n),o=r?` {${r}}`:"",i=t.renderChildren(e.content||[],"\n\n");return`:::${c}${o}\n\n${i}\n\n:::`}}}function Mm(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;null!==r;){const[,o,s,i]=r;t[o]=s||i,r=n.exec(e)}return t}function Tm(e){return Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}="${t}"`).join(" ")}function Om(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=Mm,serializeAttributes:s=Tm,defaultAttributes:i={},selfClosing:l=!1,allowedAttributes:a}=e,c=n||t,d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{const o={...i,...e.attributes};if(l)return n.createNode(t,o);const s=r?r(e):e.content||"";return s?n.createNode(t,o,[n.createTextNode(s)]):n.createNode(t,o,[])},markdownTokenizer:{name:t,level:"inline",start(e){const t=l?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){const s=l?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),i=e.match(s);if(!i)return;let a="",c="";if(l){const[,e]=i;c=e}else{const[,e,t]=i;c=e,a=t||""}const h=o(c.trim());return{type:t,raw:i[0],content:a.trim(),attributes:h}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>"text"===e.type).map(e=>e.text).join(""));const n=(e=>{if(!a)return e;const t={};return a.forEach(n=>{const r="string"==typeof n?n:n.name,o="string"==typeof n?void 0:n.skipIfDefault;if(r in e){const n=e[r];if(void 0!==o&&n===o)return;t[r]=n}}),t})(e.attrs||{}),o=s(n),i=o?` ${o}`:"";return l?`[${c}${i}]`:`[${c}${i}]${t}[/${c}]`}}}function Em(e,t,n){var r,o,s,i;const l=e.split("\n"),a=[];let c="",d=0;const h=t.baseIndentSize||2;for(;d<l.length;){const e=l[d],u=e.match(t.itemPattern);if(!u){if(a.length>0)break;if(""===e.trim()){d+=1,c=`${c}${e}\n`;continue}return}const p=t.extractItemData(u),{indentLevel:f,mainContent:m}=p;c=`${c}${e}\n`;const g=[m];for(d+=1;d<l.length;){const e=l[d];if(""===e.trim()){const t=l.slice(d+1).findIndex(e=>""!==e.trim());if(-1===t)break;
1if(((null==(o=null==(r=l[d+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:o.length)||0)>f){g.push(e),c=`${c}${e}\n`,d+=1;continue}break}if(!(((null==(i=null==(s=e.match(/^(\s*)/))?void 0:s[1])?void 0:i.length)||0)>f))break;g.push(e),c=`${c}${e}\n`,d+=1}let y;const v=g.slice(1);if(v.length>0){const e=v.map(e=>e.slice(f+h)).join("\n");e.trim()&&(y=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}const b=t.createToken(p,y);a.push(b)}if(0!==a.length)return{items:a,raw:c}}function Am(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const o="function"==typeof n?n(r):n,[s,...i]=e.content;let l=`${o}${t.renderChildren([s])}`;return i&&i.length>0&&i.forEach((e,n)=>{var r,o;const s=null!=(o=null==(r=t.renderChild)?void 0:r.call(t,e,n+1))?o:t.renderChildren([e]);if(null!=s){const n=s.split("\n").map(e=>e?t.indent(e):t.indent("")).join("\n");l+="paragraph"===e.type?`\n\n${n}`:`\n${n}`}}),l}function Nm(e,t){const n={...e};return km(e)&&km(t)&&Object.keys(t).forEach(r=>{km(t[r])&&km(e[r])?n[r]=Nm(e[r],t[r]):n[r]=t[r]}),n}rp({},{createAtomBlockMarkdownSpec:()=>Sm,createBlockMarkdownSpec:()=>Cm,createInlineMarkdownSpec:()=>Om,parseAttributes:()=>wm,parseIndentedBlocks:()=>Em,renderNestedMarkdownContent:()=>Am,serializeAttributes:()=>xm});var Dm=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}};function Rm(e){var t;const{editor:n,from:r,to:o,text:s,rules:i,plugin:l}=e,{view:a}=n;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let d=!1;const h=((e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,o,s)=>{var i,l;const a=(null==(l=(i=e.type.spec).toText)?void 0:l.call(i,{node:e,pos:t,parent:o,index:s}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?a:a.slice(0,Math.max(0,r-t))}),n})(c)+s;return i.forEach(e=>{if(d)return;const t=((e,t)=>{if(wp(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith),r.push(n.replaceWith)),r})(h,e.find);if(!t)return;const i=a.state.tr,c=op({state:a.state,transaction:i}),u={from:r-(t[0].length-s.length),to:o},{commands:p,chain:f,can:m}=new sp({editor:n,state:c});null!==e.handler({state:c,range:u,match:t,commands:p,chain:f,can:m})&&i.steps.length&&(e.undoable&&i.setMeta(l,{transform:i,from:r,to:o,text:s}),a.dispatch(i),d=!0)}),d}var Im=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{...xf(vf(this,"addOptions",{name:this.name}))}}get storage(){return{...xf(vf(this,"addStorage",{name:this.name,options:this.options}))}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Nm(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},_m=class e extends Im{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!o.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;const s=o.find(e=>(null==e?void 0:e.type.name)===t.name);return s&&n.removeStoredMark(s),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},Pm=class{constructor(e){this.find=e.find,this.handler=e.handler}};function Lm(e){const{editor:t,state:n,from:r,to:o,rule:s,pasteEvent:i,dropEvent:l}=e,{commands:a,chain:c,can:d}=new sp({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,o,(e,t)=>{var u,p,f,m,g;if((null==(p=null==(u=e.type)?void 0:u.spec)?void 0:p.code)||!(e.isText||e.isTextblock||e.isInline))return;const y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,v=Math.max(r,t),b=Math.min(o,t+y);v>=b||((e,t,n)=>{if(wp(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(t=>{const n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith),n.push(t.replaceWith)),n}):[]})(e.isText?e.text||"":e.textBetween(v-t,b-t,void 0,""),s.find,i).forEac
1h(e=>{if(void 0===e.index)return;const t=v+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},u=s.handler({state:n,range:o,match:e,commands:a,chain:c,can:d,pasteEvent:i,dropEvent:l});h.push(u)})}),h.every(e=>null!==e)}var $m=null;function zm(e){const{editor:t,rules:n}=e;let r,o=null,s=!1,i=!1,l="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const a=({state:e,from:n,to:o,rule:s,pasteEvt:i})=>{const a=e.tr,c=op({state:e,transaction:a});if(Lm({editor:t,state:c,from:Math.max(n-1,0),to:o.b-1,rule:s,pasteEvent:i,dropEvent:r})&&a.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return l="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,a}};return n.map(e=>new Ka({view(e){const n=n=>{var r;o=(null==(r=e.dom.parentElement)?void 0:r.contains(n.target))?e.dom.parentElement:null,o&&($m=t)},r=()=>{$m&&($m=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(i=o===e.dom.parentElement,r=t,!i){const e=$m;(null==e?void 0:e.isEditable)&&setTimeout(()=>{const t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var n;const r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return l=t,s=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const o=t[0],c="paste"===o.getMeta("uiEvent")&&!s,d="drop"===o.getMeta("uiEvent")&&!i,h=o.getMeta("applyPasteRules"),u=!!h;if(!c&&!d&&!u)return;if(u){let{text:t}=h;"string"==typeof t||(t=kf(Ai.from(t),r.schema));const{from:n}=h,o=n+t.length,s=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t);return a({rule:e,state:r,from:n,to:{b:o},pasteEvt:s})}const p=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof p&&f&&p!==f.b?a({rule:e,state:r,from:p,to:f,pasteEvt:l}):void 0}}))}var Bm=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=Rf(e),this.schema=function(e,t){var n;const r=Cf(e),{nodeExtensions:o,markExtensions:s}=Sf(e);return new bl({topNode:null==(n=o.find(e=>vf(e,"topNode")))?void 0:n.name,nodes:Object.fromEntries(o.map(n=>{const o=r.filter(e=>e.type===n.name),s={name:n.name,options:n.options,storage:n.storage,editor:t},i=Af({...e.reduce((e,t)=>{const r=vf(t,"extendNodeSchema",s);return{...e,...r?r(n):{}}},{}),content:xf(vf(n,"content",s)),marks:xf(vf(n,"marks",s)),group:xf(vf(n,"group",s)),inline:xf(vf(n,"inline",s)),atom:xf(vf(n,"atom",s)),selectable:xf(vf(n,"selectable",s)),draggable:xf(vf(n,"draggable",s)),code:xf(vf(n,"code",s)),whitespace:xf(vf(n,"whitespace",s)),linebreakReplacement:xf(vf(n,"linebreakReplacement",s)),defining:xf(vf(n,"defining",s)),isolating:xf(vf(n,"isolating",s)),attrs:Object.fromEntries(o.map(Nf))}),l=xf(vf(n,"parseHTML",s));l&&(i.parseDOM=l.map(e=>Ef(e,o)));const a=vf(n,"renderHTML",s);a&&(i.toDOM=e=>a({node:e,HTMLAttributes:Of(e,o)}));const c=vf(n,"renderText",s);return c&&(i.toText=c),[n.name,i]})),marks:Object.fromEntries(s.map(n=>{const o=r.filter(e=>e.type===n.name),s={name:n.name,options:n.options,storage:n.storage,editor:t},i=Af({...e.reduce((e,t)=>{const r=vf(t,"extendMarkSchema",s);return{...e,...r?r(n):{}}},{}),inclusive:xf(vf(n,"inclusive",s)),excludes:xf(vf(n,"excludes",s)),group:xf(vf(n,"group",s)),spanning:xf(vf(n,"spanning",s)),code:xf(vf(n,"code",s)),attrs:Object.fromEntries(o.map(Nf))}),l=xf(vf(n,"parseHTML",s));l&&(i.parseDOM=l.map(e=>Ef(e,o)));const a=vf(n,"renderHTML",s);return a&&(i.toDOM=e=>a({mark:e,HTMLAttributes:Of(e,o)})),[n.name,i]}))})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n=vf(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Bf(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){const{editor:e}=this;return Df([...this.extensions].reverse()).flatMap(t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Bf(t.name,this.schema)},r=[],o=vf(t,"addKeyboardShortcuts",n);let s={};if("mark"===t.type&&vf(t,"exitable",n)&&(s.ArrowRight=()=>_m.handleExit({editor:e,mark:t})),o){const t=Object.fromEntries(Object.entries(o()).map(([t,n])=>[t,()=>n({editor:e})]));s={...s,...t}}const i=new Ka({props:{handleKeyDown:tp(s)}});r.push(i);const l=vf(t,"addInputRules",n);if(Vf(t,e.options.enableInputRules)&&l){const t=l();if(t&&t.length){const n=function(e){const{editor:t,rules:n}=e,r=new Ka({state:{init:()=>null,apply(e,o,s){const i=e.getMeta(r);if(i)return i;const l=e.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:e}=l;"string"==typeof e||(e=kf(Ai.from(e),s.schema));const{from:o}=l,i=o+e.length;Rm({editor:t,from:o,to:i,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput:(e,o,s,i)=>Rm({editor:t,from:o,to:s,text:i,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>
1{const{$cursor:o}=e.state.selection;o&&Rm({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;const{$cursor:s}=e.state.selection;return!!s&&Rm({editor:t,from:s.pos,to:s.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),o=Array.isArray(n)?n:[n];r.push(...o)}}const a=vf(t,"addPasteRules",n);if(Vf(t,e.options.enablePasteRules)&&a){const t=a();if(t&&t.length){const n=zm({editor:e,rules:t});r.push(...n)}}const c=vf(t,"addProseMirrorPlugins",n);if(c){const e=c();r.push(...e)}return r})}get attributes(){return Cf(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Sf(this.extensions);return Object.fromEntries(t.filter(e=>!!vf(e,"addNodeView")).map(t=>{const n=this.attributes.filter(e=>e.type===t.name),r=vf(t,"addNodeView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:fp(t.name,this.schema)});if(!r)return[];const o=r();if(!o)return[];return[t.name,(r,s,i,l,a)=>{const c=Of(r,n);return o({node:r,view:s,getPos:i,decorations:l,innerDecorations:a,editor:e,extension:t,HTMLAttributes:c})}]}))}dispatchTransaction(e){const{editor:t}=this;return Df([...this.extensions].reverse()).reduceRight((e,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Bf(n.name,this.schema)},o=vf(n,"dispatchTransaction",r);return o?t=>{o.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){const{editor:t}=this;return Df([...this.extensions]).reduce((e,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Bf(n.name,this.schema)},o=vf(n,"transformPastedHTML",r);return o?(t,n)=>{const s=e(t,n);return o.call(r,s)}:e},e||(e=>e))}get markViews(){const{editor:e}=this,{markExtensions:t}=Sf(this.extensions);return Object.fromEntries(t.filter(e=>!!vf(e,"addMarkView")).map(t=>{const n=this.attributes.filter(e=>e.type===t.name),r=vf(t,"addMarkView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Tp(t.name,this.schema)});if(!r)return[];return[t.name,(o,s,i)=>{const l=Of(o,n);return r()({mark:o,view:s,inline:i,editor:e,extension:t,HTMLAttributes:l,updateAttributes:t=>{!function(e,t,n={}){const{state:r}=t,{doc:o,tr:s}=r,i=e;o.descendants((t,r)=>{const o=s.mapping.map(r),l=s.mapping.map(r)+t.nodeSize;let a=null;if(t.marks.forEach(e=>{if(e!==i)return!1;a=e}),!a)return;let c=!1;if(Object.keys(n).forEach(e=>{n[e]!==a.attrs[e]&&(c=!0)}),c){const t=e.type.create({...e.attrs,...n});s.removeMark(o,l,e.type),s.addMark(o,l,t)}}),s.docChanged&&t.view.dispatch(s)}(o,e,t)}})}]}))}destroy(){this.extensions.forEach(e=>{let t=e;for(;t.parent;){const e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{var t,n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Bf(e.name,this.schema)};"mark"===e.type&&((null==(t=xf(vf(e,"keepOnSplit",r)))||t)&&this.splittableMarks.push(e.name),null==(n=xf(vf(e,"clearable",r)))||n||this.nonClearableMarks.push(e.name));const o=vf(e,"onBeforeCreate",r),s=vf(e,"onCreate",r),i=vf(e,"onUpdate",r),l=vf(e,"onSelectionUpdate",r),a=vf(e,"onTransaction",r),c=vf(e,"onFocus",r),d=vf(e,"onBlur",r),h=vf(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),s&&this.editor.on("create",s),i&&this.editor.on("update",i),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),h&&this.editor.on("destroy",h)})}};Bm.resolve=Rf,Bm.sort=Df,Bm.flatten=bf;rp({},{ClipboardTextSerializer:()=>jm,Commands:()=>Vm,Delete:()=>Hm,Drop:()=>Wm,Editable:()=>Um,FocusEvents:()=>Km,Keymap:()=>Jm,Paste:()=>Gm,Tabindex:()=>Qm,TextDirection:()=>Xm,focusEventsPluginKey:()=>qm});var Fm=class e extends Im{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}}
1,jm=Fm.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new Ka({key:new Qa("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,s=_f(n),{blockSeparator:i}=this.options,l={...void 0!==i?{blockSeparator:i}:{},textSerializers:s};return[...o.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>If(r,{from:e.pos,to:t.pos},l)).join(null!=i?i:"\n\n")}}})]}}),Vm=Fm.create({name:"commands",addCommands:()=>({...ip})}),Hm=Fm.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,o;const s=()=>{var n,r,o,s;if(null!=(s=null==(o=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:o.call(r,e))?s:e.getMeta("y-sync$"))return;const i=gf(e.before,[e,...t]);$f(i).forEach(t=>{i.mapping.mapResult(t.oldRange.from).deletedAfter&&i.mapping.mapResult(t.oldRange.to).deletedBefore&&i.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{const o=r+n.nodeSize-2,s=t.oldRange.from<=r&&o<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:o,newFrom:i.mapping.map(r),newTo:i.mapping.map(o),deletedRange:t.oldRange,newRange:t.newRange,partial:!s,editor:this.editor,transaction:e,combinedTransform:i})})});const l=i.mapping;i.steps.forEach((t,n)=>{var r,o;if(t instanceof Jl){const s=l.slice(n).map(t.from,-1),a=l.slice(n).map(t.to),c=l.invert().map(s,-1),d=l.invert().map(a),h=s>0&&(null==(r=i.doc.nodeAt(s-1))?void 0:r.marks.some(e=>e.eq(t.mark))),u=null==(o=i.doc.nodeAt(a))?void 0:o.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:s,to:a},partial:Boolean(u||h),editor:this.editor,transaction:e,combinedTransform:i})}})};null==(o=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||o?setTimeout(s,0):s()}}),Wm=Fm.create({name:"drop",addProseMirrorPlugins(){return[new Ka({key:new Qa("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Um=Fm.create({name:"editable",addProseMirrorPlugins(){return[new Ka({key:new Qa("editable"),props:{editable:()=>this.editor.options.editable}})]}}),qm=new Qa("focusEvents"),Km=Fm.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Ka({key:qm,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),Jm=Fm.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{const{selection:n,doc:r}=t,{empty:o,$anchor:s}=n,{pos:i,parent:l}=s,a=s.parent.isTextblock&&i>0?t.doc.resolve(i-1):s,c=a.parent.type.spec.isolating,d=s.pos-s.parentOffset,h=c&&1===a.parent.childCount?d===s.pos:Ea.atStart(r).from===i;return!(!o||!l.type.isTextblock||l.textContent.length||!h||h&&"paragraph"===s.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ip()||Gp()?o:r},addProseMirrorPlugins(){return[new Ka({key:new Qa("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;const r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),o=e.some(e=>e.getMeta("preventClearDocument"));if(!r||o)return;const{empty:s,from:i,to:l}=t.selection,a=Ea.atStart(t.doc).from,c=Ea.atEnd(t.doc).to;
1if(s||i!==a||l!==c)return;if(!Wf(n.doc))return;const d=n.tr,h=op({state:n,transaction:d}),{commands:u}=new sp({editor:this.editor,state:h});return u.clearNodes(),d.steps.length?d:void 0}})]}}),Gm=Fm.create({name:"paste",addProseMirrorPlugins(){return[new Ka({key:new Qa("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),Qm=Fm.create({name:"tabindex",addOptions:()=>({value:void 0}),addProseMirrorPlugins(){return[new Ka({key:new Qa("tabindex"),props:{attributes:()=>{var e;return this.editor.isEditable||void 0!==this.options.value?{tabindex:null!=(e=this.options.value)?e:"0"}:{}}}})]}}),Xm=Fm.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=Sf(this.extensions);return[{types:e.filter(e=>"text"!==e.name).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return!t||"ltr"!==t&&"rtl"!==t&&"auto"!==t?this.options.direction:t},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Ka({key:new Qa("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),Ym=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}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 null!=(e=this.actualDepth)?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return;t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},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(0===this.depth)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,i=n.isInline,l=this.pos+r+(s?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(l);if(!o&&!i&&a.depth<=this.depth)return;const c=new e(a,this.editor,o,o||i?n:null);o&&(c.actualDepth=this.depth+1),t.push(c)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){const e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];if(e[o]!==t[o])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;const o=Object.keys(t);return this.children.forEach(s=>{n&&r.length>0||(s.node.type.name===e&&o.every(e=>t[e]===s.node.attrs[e])&&r.push(s),n&&r.length>0||(r=r.concat(s.querySelectorAll(e,t,n))))}),r}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Zm=class extends bm{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"undefined"!=typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:qf,createMappablePosition:Kf},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit
1("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:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=Dp(t,this.options.autofocus);this.editorState=Ua.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if("undefined"==typeof document)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||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(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&&"undefined"!=typeof document&&(this.css=function(e,t,n){const r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(null!==r)return r;const o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute("data-tiptap-style"+(n?`-${n}`:""),""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}
1\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}',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,t=!0){this.setOptions({editable:e}),t&&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:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=wf(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(e=>{const t="string"==typeof e?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t,n,r;const o=[...this.options.enableCoreExtensions?[Um,jm.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),Vm,Km,Jm,Qm.configure({value:null==(r=null==(n=this.options.coreExtensionOptions)?void 0:n.tabindex)?void 0:r.value}),Wm,Gm,Hm,Xm.configure({direction:this.options.textDirection})].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new Bm(o,this)}createCommandManager(){this.commandManager=new sp({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=pf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message)))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),e=pf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,s=t.transformPastedHTML,i=this.extensionManager.transformPastedHTML(s);this.editorView=new Bu(e,{...t,attributes:{role:"textbox",...null==t?void 0:t.attributes},dispatchTransaction:o,transformPastedHTML:i,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS();this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach(e
1=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)}):void(this.capturedTransaction=e);const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),o=n.includes(e),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!o)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=n.findLast(e=>e.getMeta("focus")||e.getMeta("blur")),l=null==i?void 0:i.getMeta("focus"),a=null==i?void 0:i.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:i}),a&&this.emit("blur",{editor:this,event:a.event,transaction:i}),e.getMeta("preventUpdate")||!n.some(e=>e.docChanged)||s.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return Pf(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return Xp(e,null,n)||jf(e,null,n);const r=nf(t,e.schema);return"node"===r?Xp(e,t,n):"mark"===r&&jf(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return kf(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return If(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{..._f(this.schema),...n}})}get isEmpty(){return Wf(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText?t.nodeAfter:null;return new Ym(t,this,!1,n)}get $doc(){return this.$pos(0)}};function eg(e){return new Dm({find:e.find,handler:({state:t,range:n,match:r})=>{const o=xf(e.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:s}=t,i=r[r.length-1],l=r[0];if(i){const r=l.search(/\S/),a=n.from+l.indexOf(i),c=a+i.length;if(zf(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>a).length)return null;c<n.to&&s.delete(c,n.to),a>n.from&&s.delete(n.from+r,a);const d=n.from+r+i.length;s.addMark(n.from+r,d,e.type.create(o||{})),s.removeStoredMark(e.type)}},undoable:e.undoable})}function tg(e){return new Dm({find:e.find,handler:({state:t,range:n,match:r,chain:o})=>{const s=xf(e.getAttributes,void 0,r)||{},i=t.tr.delete(n.from,n.to),l=i.doc.resolve(n.from).blockRange(),a=l&&ra(l,e.type,s);if(!a)return null;if(i.wrap(l,a),e.keepMarks&&e.editor){const{selection:n,storedMarks:r}=t,{splittableMarks:o}=e.editor.extensionManager,s=r||n.$to.parentOffset&&n.$from.marks();if(s){const e=s.filter(e=>o.includes(e.type.name));i.ensureMarks(e)}}if(e.keepAttributes){const t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";o().updateAttributes(t,s).run()}const c=i.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&aa(i.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&i.join(n.from-1)},undoable:e.undoable})}var ng=class e extends Im{constructor(){super(...arguments),this.type="node"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};function rg(e){return new Pm({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{const s=xf(e.getAttributes,void 0,r,o);if(!1===s||null===s)return null;const{tr:i}=t,l=r[r.length-1],a=r[0];let c=n.to;if(l){const o=a.search(/\S/),d=n.from+a.indexOf(l),h=d+l.length;if(zf(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>d).length)return null;h<n.to&&i.delete(h,n.to),d>n.from&&i.delete(n.from+o,d),c=n.from+o+l.length,i.addMark(n.from+o,c,e.type.create(s||{})),void 0!==r.index&&void 0!==r.input&&r.index+r[0].length>=r.input.length||i.removeStoredMark(e.type)}}})}var og=(e,t)=>
1{if("slot"===e)return 0;if(e instanceof Function)return e(t);const{children:n,...r}=null!=t?t:{};if("svg"===e)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},sg=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,ig=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,lg=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,ag=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,cg=_m.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return og("strong",{...Tf(this.options.HTMLAttributes,e),children:og("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[eg({find:sg,type:this.type}),eg({find:lg,type:this.type})]},addPasteRules(){return[rg({find:ig,type:this.type}),rg({find:ag,type:this.type})]}}),dg=cg,hg=Object.defineProperty,ug="textStyle",pg=/^\s*([-+*])\s$/,fg=ng.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Tf(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>"list"!==e.type||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(ug)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=tg({find:pg,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=tg({find:pg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(ug),editor:this.editor})),[e]}}),mg=(e,t,n)=>((e,t,n,r)=>{const o=((e,t,n)=>{const{selection:r}=e;if(!r.empty)return null;const{$from:o}=r;if(!o.parent.isTextblock)return null;if(o.parentOffset!==o.parent.content.size)return null;let s=-1;for(let p=o.depth;p>0;p-=1)if(o.node(p).type.name===t){s=p;break}if(s<0)return null;const i=o.node(s),l=o.index(s);if(l+1>=i.childCount)return null;const a=i.child(l+1);if(!n.includes(a.type.name))return null;const c=e.schema.nodes[t];let d=!1;if(a.forEach(e=>{e.type===c&&e.childCount>1&&(d=!0)}),!d)return null;const h=e.doc.resolve(o.after()).nodeAfter;if(!h||!n.includes(h.type.name))return null;const u=[];return h.forEach(e=>{u.push(e)}),0===u.length?null:{listItemDepth:s,nestedList:h,nestedListPos:o.after(),insertPos:o.after(s),items:u}})(e,n,r);if(!o)return!1;const{selection:s}=e,{nestedList:i,nestedListPos:l,insertPos:a,items:c}=o,d=e.tr;d.delete(l,l+i.nodeSize);const h=d.mapping.map(a);return d.insert(h,Ai.from(c)),d.setSelection(s.map(d.doc,d.mapping)),t&&t(d),!0})(e.state,e.view.dispatch,t,n),gg=(e,t)=>Fm.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const n=()=>mg(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),yg=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],vg="abcdefghijklmnopqrstuvwxyz",bg=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function kg(e){let t=e,n="";for(const[r,o]of yg)for(;t>=r;)n+=o,t-=r;return n}function wg(e){return kg(e).toUpperCase()}function xg(e){const t=e.toLowerCase();let n=0,r=0;for(;n<t.length;){let e=!1;for(const[o,s]of yg)if(t.startsWith(s,n)){r+=o,n+=s.length,e=!0;break}if(!e)return 0}return r}function Sg(e){if(e<=26)return vg[e-1];const t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?vg[n]:vg[t]+vg[n]}function Cg(e){if(e&&!/^\d+$/.test(e))return function(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;const t=xg(e);return!(t<=0)&&(e===e.toLowerCase()?kg(t):wg(t))===e}(e)?e===e.toLowerCase()?"i":"I":/^[a-z]{1,2}$/.test(e)?"a":/^[A-Z]{1,2}$/.test(e)?"A":void 0}function Mg(e){if(/^\d+$/.test(e))return parseInt(e,10);const t=Cg(e);if("i"===t||"I"===t)return xg(e);if("a"===t||"A"===t){const t=function(e){const t=e.toLowerCase();if(1===t.length)return t.charCodeAt(0)-"a".charCodeAt(0)+1;if(2===t.length)return 26*(t.charCodeAt(0)-"a".charCodeAt(0)+1)+(t.charCodeAt(1)-"a".charCodeAt(0))+1;return 0}(e);return t>0?t:1}const n=parseInt(e,10);return Number.isNaN(n)?1:n}function Tg(e,t){if("numeric"===e)return String(t);switch(e){case"a":return Sg(t);case"A":return Sg(t).toUpperCase();case"i":return kg(t);case"I":return wg(t);default:return String(t)}}function Og(e){const{type:t,start:n}=function(e){return{type:Cg(e),start:Mg(e)}}(e),r={};return t&&(r.type=t),1!==n&&(r.start=n),r}function Eg(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:"text",raw:e,text:e}])}var Ag=ng.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Tf(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n;if("list_item"!==e.type)return[];const r=null!=(n=t.parseBlockChildren)?n:t.parseChildren;let o=[];if(e.tokens&&e.tokens.length>0){if(function(e){var t,n;const r=null==(t=e.tokens)?void 0:t[0];return Boolean(e.text&&1===(null==(n=e.tokens)?void 0:n.length)&&"list"===(null==r?void 0:r.type)&&r.ordered&&r.raw===e.text)}(e))return{type:"listItem",content:[{type:"paragraph",content:Eg(e.text||"",t)}]};if(e.tokens.some(e=>"paragraph"===e.type))o=r(e.tokens);else{const n=e.tokens[0];if(n&&"text"===n.type&&n.tokens&&n.tokens.length>0){if(o=[{type:"paragraph",content:t.parseInline(n.tokens)}],e.tokens.length>1){const t=r(e.tokens.slice(1));o.push(...t)}}else o=r(e.tokens)}}return 0===o.length&&(o=[{type:"paragraph",content:[]}]),{type:"listItem",content:o}},renderMarkdown:(e,t,n)=>Am(e,t,e=>{var t,n,r,o;
1if("bulletList"===e.parentType)return"- ";if("orderedList"===e.parentType){const s=(null==(n=null==(t=e.meta)?void 0:t.parentAttrs)?void 0:n.start)||1;return function(e,t,n=". "){const r=t+1;if(!e||"1"===e)return`${r}${n}`;switch(e){case"a":return`${Sg(r)}${n}`;case"A":return`${Sg(r).toUpperCase()}${n}`;case"i":return`${kg(r)}${n}`;case"I":return`${wg(r)}${n}`;default:return`${r}${n}`}}(null==(o=null==(r=e.meta)?void 0:r.parentAttrs)?void 0:o.type,s-1+(e.index||0),". ")}return"- "},n),addExtensions(){return[gg(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});((e,t)=>{for(var n in t)hg(e,n,{get:t[n],enumerable:!0})})({},{findListItemPos:()=>Ng,getNextListDepth:()=>Dg,handleBackspace:()=>Ig,handleDelete:()=>Lg,hasListBefore:()=>Rg,hasListItemAfter:()=>$g,hasListItemBefore:()=>zg,listItemHasSubList:()=>Bg,nextListIsDeeper:()=>_g,nextListIsHigher:()=>Pg});var Ng=(e,t)=>{const{$from:n}=t.selection,r=fp(e,t.schema);let o=null,s=n.depth,i=n.pos,l=null;for(;s>0&&null===l;)o=n.node(s),o.type===r?l=s:(s-=1,i-=1);return null===l?null:{$pos:t.doc.resolve(i),depth:l}},Dg=(e,t)=>{const n=Ng(e,t);if(!n)return!1;const[,r]=((e,t,n,r=20)=>{const o=e.doc.resolve(n);let s=r,i=null;for(;s>0&&null===i;){const e=o.node(s);(null==e?void 0:e.type.name)===t?i=e:s-=1}return[i,s]})(t,e,n.$pos.pos+4);return r},Rg=(e,t,n)=>{const{$anchor:r}=e.selection,o=Math.max(0,r.pos-2),s=e.doc.resolve(o).node();return!(!s||!n.includes(s.type.name))},Ig=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Xp(e.state,t)&&Rg(e.state,t,n)){const{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),o=[];r.node().descendants((e,n)=>{e.type.name===t&&o.push({node:e,pos:n})});const s=o.at(-1);if(!s)return!1;const i=e.state.doc.resolve(r.start()+s.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},i.end()).joinForward().run()}return!!Xp(e.state,t)&&(!!(e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)})(e.state)&&e.chain().liftListItem(t).run())},_g=(e,t)=>{const n=Dg(e,t),r=Ng(e,t);return!(!r||!n)&&n>r.depth},Pg=(e,t)=>{const n=Dg(e,t),r=Ng(e,t);return!(!r||!n)&&n<r.depth},Lg=(e,t)=>{if(!Xp(e.state,t))return!1;if(!((e,t)=>{const{$from:n,$to:r,$anchor:o}=e.selection;if(t){const n=yf(e=>e.type.name===t)(e.selection);if(!n)return!1;const r=e.doc.resolve(n.pos+1);return o.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)})(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:o}=n;return!(!n.empty&&r.sameParent(o))&&(_g(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Pg(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},$g=(e,t)=>{var n;const{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-r.parentOffset-2);return o.index()!==o.parent.childCount-1&&(null==(n=o.nodeAfter)?void 0:n.type.name)===e},zg=(e,t)=>{var n;const{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-2);return 0!==o.index()&&(null==(n=o.nodeBefore)?void 0:n.type.name)===e},Bg=(e,t,n)=>{if(!n)return!1;const r=fp(e,t.schema);let o=!1;return n.descendants(e=>{e.type===r&&(o=!0)}),o},Fg=Fm.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&Lg(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&Lg(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&Ig(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;
1return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&Ig(e,n,r)&&(t=!0)}),t}}}}),jg=new RegExp(`^(\\s*)(${bg})([.)])\\s+(.*)$`),Vg=/^\s/,Hg={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function Wg(e){const t=e.trimStart();return Hg.bulletItem.test(t)||function(e){return jg.test(e.trimStart())}(t)||Hg.heading.test(t)||Hg.thematicBreak.test(t)&&!t.startsWith("-")||/^>\s?/.test(t)||Hg.codeFence.test(t)}function Ug(e){return Object.values(Hg).some(t=>t.test(e))}function qg(e){const t=[],n=[];let r=!1;return e.forEach(e=>{if(!r)return""===e.trim()||t.length>0&&Wg(e)?(r=!0,void n.push(e)):void t.push(e);n.push(e)}),{paragraphLines:t,blockLines:n}}var Kg=new RegExp(`^(${bg})([.)])\\s+(.+)$`);function Jg(e){const t=e.split("\n").filter(e=>e.trim().length>0);if(0===t.length)return null;const n=[];for(const r of t){const e=r.trim().match(Kg);if(!e)return null;n.push({marker:e[1],content:e[3]})}return function(e){var t;if(0===e.length)return!1;const n=null!=(t=Cg(e[0]))?t:"numeric",r=Mg(e[0]);if(r<1)return!1;for(let o=0;o<e.length;o++){const t=Tg(n,r+o);if(e[o]!==t)return!1}return!0}(n.map(e=>e.marker))?{type:"orderedList",attrs:Og(n[0].marker),content:n.map(e=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:e.content}]}]}))}:null}function Gg(e,t,n){const r=[];let o=0;for(;o<e.length;){const s=e[o];if(s.indent===t){const{paragraphLines:i,blockLines:l}=qg(s.contentLines),a=i.join("\n").trim(),c=[];a&&c.push({type:"paragraph",raw:a,tokens:n.inlineTokens(a)});const d=l.join("\n").trim();if(d){const e=n.blockTokens(d);c.push(...e)}let h=o+1;const u=[];for(;h<e.length&&e[h].indent>t;)u.push(e[h]),h+=1;if(u.length>0){const e=Gg(u,Math.min(...u.map(e=>e.indent)),n);c.push({type:"list",ordered:!0,start:u[0].number,typeMarker:u[0].type,items:e,raw:u.map(e=>e.raw).join("\n")})}r.push({type:"list_item",raw:s.raw,tokens:c}),o=h}else o+=1}return r}var Qg="textStyle",Xg=/^(\d+)\.\s$/;function Yg(e){const t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}var Zg=ng.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>{const t=e.getAttribute("type");if(t)return t;const n=e.getAttribute("style");if(n){const e=Yg(n);if(e)return e}const r=e.querySelector("li");if(r){const e=r.getAttribute("style");if(e){const t=Yg(e);if(t)return t}}return null}}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,type:n,...r}=e,o=Tf(this.options.HTMLAttributes,r);return 1!==t&&(o.start=t),n&&"1"!==n&&(o.type=n),["ol",o,0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if("list"!==e.type||!e.ordered)return[];const n=e.start||1,r=e.typeMarker,o=e.items?function(e,t){return e.map(e=>{if("list_item"!==e.type)return t.parseChildren([e])[0];const n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if("paragraph"===e.type||"list"===e.type||"blockquote"===e.type||"code"===e.type)n.push(...t.parseChildren([e]));else if("text"===e.type&&e.tokens){const r=t.parseChildren([e]);n.push({type:"paragraph",content:r})}else{const r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:"listItem",content:n}})}(e.items,t):[],s={};return 1!==n&&(s.start=n),r&&(s.type=r),Object.keys(s).length>0?{type:"orderedList",attrs:s,content:o}:{type:"orderedList",content:o}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(e,t,n)=>{var r,o;const s=e.split("\n"),[i,l]=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const o=e[n],s=o.match(jg);if(!s)break;const[,i,l,a,c]=s,d=i.length,h=parseInt(l,10),u=isNaN(h)?Cg(l):void 0,p=isNaN(h)?Mg(l):h,f=[c];let m=n+1;const g=[o];let y=!1;for(;m<e.length;){const t=e[m];if(t.match(jg))break;if(""===t.trim())g.push(t),f.push(""),y=!0,m+=1;else if(t.match(Vg)){const e=t.length-t.trimStart().length,n=d+l.length+1;g.push(t),f.push(t.slice(Math.min(e,n))),m+=1}else{if(y||Ug(t))break;g.push(t),f.push(t),m+=1}}t.push({indent:d,number:p,type:u,content:f.join("\n").trim(),contentLines:f,raw:g.join("\n")}),r=m,n=m}return[t,r]}(s);if(0===i.length)return;const a=Gg(i,i[0].indent,n);return 0!==a.length?{type:"list",ordered:!0,start:(null==(r=i[0])?void 0:r.number)||1,typeMarker:null==(o=i[0])?void 0:o.type,items:a,raw:s.slice(0,l).join("\n")}:void 0}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(Qg)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}}
1,addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins:()=>[new Ka({props:{handlePaste:(e,t)=>{var n,r;const o=null==(n=t.clipboardData)?void 0:n.getData("text/html");if(null==o?void 0:o.trim())return!1;const s=null==(r=t.clipboardData)?void 0:r.getData("text/plain");if(!s)return!1;const i=Jg(s);if(!i)return!1;try{const t=e.state.schema.nodeFromJSON(i),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})],addInputRules(){const e=(e,t)=>(!t.attrs.type||"1"===t.attrs.type)&&t.childCount+t.attrs.start===+e[1];let t=tg({find:Xg,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=tg({find:Xg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Qg)}),joinPredicate:e,editor:this.editor})),[t]}}),ey=/^\s*(\[([( |x])?\])\s$/,ty=ng.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",Tf(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;return Am(e,t,`- [${(null==(n=e.attrs)?void 0:n.checked)?"x":" "}] `)},addExtensions(){return this.options.nested?[gg(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const o=document.createElement("li"),s=document.createElement("label"),i=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),c=e=>{var t,n;l.ariaLabel=(null==(n=null==(t=this.options.a11y)?void 0:t.checkboxLabel)?void 0:n.call(t,e,l.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};c(e),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",e=>e.preventDefault()),l.addEventListener("change",t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked)return void(l.checked=!l.checked);const{checked:o}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{const t=n();if("number"!=typeof t)return!1;const r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==r?void 0:r.attrs,checked:o}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,o)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{o.setAttribute(e,t)}),o.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,s.append(l,i),o.append(s,a),Object.entries(t).forEach(([e,t])=>{o.setAttribute(e,t)});let d=new Set(Object.keys(t));return{dom:o,contentDOM:a,update:e=>{if(e.type!==this.type)return!1;o.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,c(e);const t=Of(e,r.extensionManager.attributes),n=new Set(Object.keys(t)),s=this.options.HTMLAttributes;return d.forEach(e=>{n.has(e)||(e in s?o.setAttribute(e,s[e]):o.removeAttribute(e))}),Object.entries(t).forEach(([e,t])=>{null==t?e in s?o.setAttribute(e,s[e]):o.removeAttribute(e):o.setAttribute(e,t)}
1),d=n,!0}}}},addInputRules(){return[tg({find:ey,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),ny=ng.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",Tf(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=null==(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:t.index;return void 0!==n?n:-1},tokenize(e,t,n){const r=e=>{const t=Em(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(t){const r={type:"taskList",raw:t.raw,items:t.items},o=e.slice(t.raw.length);return o.trim()?[r,...n.blockTokens(o)]:[r]}return n.blockTokens(e)},o=Em(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),ry=(Fm.create({name:"listKit",addExtensions(){const e=[];return!1!==this.options.bulletList&&e.push(fg.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(Ag.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(Fg.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(Zg.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(ty.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(ny.configure(this.options.taskList)),e}}),fg);function oy(e={}){return new Ka({view:t=>new sy(t,e)})}var sy=class{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(null!=this.cursorPos&&t.doc!=e.state.doc)if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r=this.editorView.dom,o=r.getBoundingClientRect(),s=o.width/r.offsetWidth,i=o.height/r.offsetHeight;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let o=t.getBoundingClientRect(),s=n?o.bottom:o.top;n&&r&&(s=(s+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let l=this.width/2*i;e={left:o.left,right:o.right,top:s-l,bottom:s+l}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*s;e={left:t.left-n,right:t.left+n,top:t.top,bottom:t.bottom}}let l,a,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.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),!c||c==document.body&&"static"==getComputedStyle(c).position)l=-pageXOffset,a=-pageYOffset;else{let e=c.getBoundingClientRect(),t=e.width/c.offsetWidth,n=e.he
1ight/c.offsetHeight;l=e.left-c.scrollLeft*t,a=e.top-c.scrollTop*n}this.element.style.left=(e.left-l)/s+"px",this.element.style.top=(e.top-a)/i+"px",this.element.style.width=(e.right-e.left)/s+"px",this.element.style.height=(e.bottom-e.top)/i+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(!t||o)return null;let s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=ha(this.editorView.state.doc,s,this.editorView.dragging.slice);null!=e&&(s=e)}return s}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);null!=t&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},iy=class e extends Ea{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):Ea.near(r)}content(){return Pi.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new e(t.resolve(n.pos))}getBookmark(){return new ly(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||ay(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||ay(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&e.valid(t))return t;let o=t.pos,s=null;for(let r=t.depth;;r--){let i=t.node(r);if(n>0?t.indexAfter(r)<i.childCount:t.index(r)>0){s=i.child(n>0?t.indexAfter(r):t.index(r)-1);break}if(0==r)return null;o+=n;let l=t.doc.resolve(o);if(e.valid(l))return l}for(;;){let i=n>0?s.firstChild:s.lastChild;if(!i){if(s.isAtom&&!s.isText&&!_a.isSelectable(s)){t=t.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=i,o+=n;let l=t.doc.resolve(o);if(e.valid(l))return l}return null}}};iy.prototype.visible=!1,iy.findFrom=iy.findGapCursorFrom,Ea.jsonID("gapcursor",iy);var ly=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return iy.valid(t)?new iy(t):Ea.near(t)}};function ay(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}var cy=tp({ArrowLeft:dy("horiz",-1),ArrowRight:dy("horiz",1),ArrowUp:dy("vert",-1),ArrowDown:dy("vert",1)});function dy(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let s=e.selection,i=t>0?s.$to:s.$from,l=s.empty;if(s instanceof Ra){if(!o.endOfTextblock(n)||0==i.depth)return!1;l=!1,i=e.doc.resolve(t>0?i.after():i.before())}let a=iy.findGapCursorFrom(i,t,l);return!!a&&(r&&r(e.tr.setSelection(new iy(a))),!0)}}function hy(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!iy.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&_a.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new iy(r))),!0)}function uy(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof iy))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=Ai.empty;for(let i=r.length-1;i>=0;i--)o=Ai.from(r[i].createAndFill(null,o));let s=e.state.tr.replace(n.pos,n.pos,new Pi(o,0,0));return s.setSelection(Ra.near(s.doc.resolve(n.pos+1))),e.dispatch(s),!1}function py(e){if(!(e.selection instanceof iy))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",fu.create(e.doc,[hu.widget(e.selection.head,t,{key:"gapcursor"})])}var fy=200,my=function(){};my.prototype.append=function(e){return e.length?(e=my.from(e),!this.length&&e||e.length<fy&&this.leafAppend(e)||this.length<fy&&e.leafPrepend(this)||this.appendInner(e)):this},my.prototype.prepend=function(e){return e.length?my.from(e).append(this):this},my.prototype.appendInner=function(e){return new yy(this,e)},my.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?my.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},my.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},my.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},my.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},my.from=function(e){return e instanceof my?e:e&&e.length?new gy(e):my.empty};var gy=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=fy)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=fy)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(my);my.empty=new gy([]);var yy=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(my),vy=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(0==this.eventCount)return null;let r,o,s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}n&&(r=this.remapping(s,this.items.length),o=r.maps.length);let i,l,a=t.tr,c=[],d=[];
1return this.items.forEach((t,n)=>{if(!t.step)return r||(r=this.remapping(s,n+1),o=r.maps.length),o--,void d.push(t);if(r){d.push(new by(t.map));let e,n=t.step.map(r.slice(o));n&&a.maybeStep(n).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],c.push(new by(e,void 0,void 0,c.length+d.length))),o--,e&&r.appendMap(e,o)}else a.maybeStep(t.step);return t.selection?(i=r?t.selection.map(r.slice(o)):t.selection,l=new e(this.items.slice(0,s).append(d.reverse().concat(c)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:l,transform:a,selection:i}}addTransform(t,n,r,o){let s=[],i=this.eventCount,l=this.items,a=!o&&l.length?l.get(l.length-1):null;for(let e=0;e<t.steps.length;e++){let r,c=t.steps[e].invert(t.docs[e]),d=new by(t.mapping.maps[e],c,n);(r=a&&a.merge(d))&&(d=r,e?s.pop():l=l.slice(0,l.length-1)),s.push(d),n&&(i++,n=void 0),o||(a=d)}let c=i-r.depth;return c>wy&&(l=function(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&0==t--)return n=r,!1}),e.slice(n)}(l,c),i-=c),new e(l.append(s),i)}remapping(e,t){let n=new Vl;return this.items.forEach((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)},e,t),n}addMaps(t){return 0==this.eventCount?this:new e(this.items.append(t.map(e=>new by(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),s=t.mapping,i=t.steps.length,l=this.eventCount;this.items.forEach(e=>{e.selection&&l--},o);let a=n;this.items.forEach(e=>{let n=s.getMirror(--a);if(null==n)return;i=Math.min(i,n);let o=s.maps[n];if(e.step){let i=t.steps[n].invert(t.docs[n]),c=e.selection&&e.selection.map(s.slice(a+1,n));c&&l++,r.push(new by(o,i,c))}else r.push(new by(o))},o);let c=[];for(let e=n;e<i;e++)c.push(new by(s.maps[e]));let d=this.items.slice(0,o).append(c).append(r),h=new e(d,l);return h.emptyItemCount()>500&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,o=[],s=0;return this.items.forEach((e,i)=>{if(i>=t)o.push(e),e.selection&&s++;else if(e.step){let t=e.step.map(n.slice(r)),i=t&&t.getMap();if(r--,i&&n.appendMap(i,r),t){let l=e.selection&&e.selection.map(n.slice(r));l&&s++;let a,c=new by(i.invert(),t,l),d=o.length-1;(a=o.length&&o[d].merge(c))?o[d]=a:o.push(c)}}else e.map&&r--},this.items.length,0),new e(my.from(o.reverse()),s)}};vy.empty=new vy(my.empty,0);var by=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},ky=class{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}},wy=20;function xy(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,o)=>t.push(r,o));return t}function Sy(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),s=t.map(e[r+1],-1);o<=s&&n.push(o,s)}return n}var Cy=!1,My=null;function Ty(e){let t=e.plugins;if(My!=t){Cy=!1,My=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Cy=!0;break}}return Cy}var Oy=new Qa("history"),Ey=new Qa("closeHistory");function Ay(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500}
1,new Ka({key:Oy,state:{init:()=>new ky(vy.empty,vy.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,s=n.getMeta(Oy);if(s)return s.historyState;n.getMeta(Ey)&&(e=new ky(e.done,e.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(i&&i.getMeta(Oy))return i.getMeta(Oy).redo?new ky(e.done.addTransform(n,void 0,r,Ty(t)),e.undone,xy(n.mapping.maps),e.prevTime,e.prevComposition):new ky(e.done,e.undone.addTransform(n,void 0,r,Ty(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||i&&!1===i.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new ky(e.done.rebased(n,o),e.undone.rebased(n,o),Sy(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new ky(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Sy(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),s=0==e.prevTime||!i&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)}),n}(n,e.prevRanges)),l=i?Sy(e.prevRanges,n.mapping):xy(n.mapping.maps);return new ky(e.done.addTransform(n,s?t.selection.getBookmark():void 0,r,Ty(t)),vy.empty,l,n.time,null==o?e.prevComposition:o)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?Dy:"historyRedo"==n?Ry:null;return!(!r||!e.editable)&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Ny(e,t){return(n,r)=>{let o=Oy.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let s=function(e,t,n){let r=Ty(t),o=Oy.get(t).spec.config,s=(n?e.undone:e.done).popEvent(t,r);if(!s)return null;let i=s.selection.resolve(s.transform.doc),l=(n?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),o,r),a=new ky(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(i).setMeta(Oy,{redo:n,historyState:a})}(o,n,e);s&&r(t?s.scrollIntoView():s)}return!0}}var Dy=Ny(!1,!0),Ry=Ny(!0,!0),Iy=(Ny(!1,!1),Ny(!0,!1),Fm.create({name:"characterCount",addOptions:()=>({limit:null,autoTrim:!0,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(e=>""!==e).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){const e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Ka({key:new Qa("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const o=this.options.limit,s=this.options.autoTrim;if(null==o||0===o||!1===s)return void(e=!0);const i=this.storage.characters({node:r.doc});if(i>o){const t=0,n=i-o,s=r.tr.deleteRange(t,n);return e=!0,s}e=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=n)return!0;if(r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r)return!1;if(!e.getMeta("paste"))return!1;const s=e.selection.$head.pos,i=s-(o-n),l=s;return e.deleteRange(i,l),!(this.storage.characters({node:e.doc})>n)}})]}})),_y=(Fm.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[oy(this.options)]}}),Fm.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new Ka({key:new Qa("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=t,s=[];if(!n||!r)return fu.create(e,[]);let i=0;"deepest"===this.options.mode&&e.descendants((e,t)=>{if(!e.isText)return o>=t&&o<=t+e.nodeSize-1&&void(i+=1)});let l=0;return e.descendants((e,t)=>!e.isText&&(o>=t&&o<=t+e.nodeSize-1&&(l+=1,"deepest"===this.options.mode&&i-l>0||"shallowest"===this.options.mode&&l>1?"deepest"===this.options.mode:void s.push(hu.node(t,t+e.nodeSize,{class:this.options.className}))))),fu.create(e,s)}}})]}}),Fm.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Ka({props:{decorations:py,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&iy.valid(n)?new iy(n):null,handleClick:hy,handleKeyDown:cy,handleDOMEvents:{beforeinput
1:uy}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!=(t=xf(vf(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))?t:null}}}),"placeholder"),Py=new Qa("tiptap__placeholder");function Ly(e){const{editor:t,placeholder:n,dataAttribute:r,pos:o,node:s,isEmptyDoc:i,hasAnchor:l,classes:{emptyNode:a,emptyEditor:c}}=e,d=[a];return i&&d.push(c),hu.node(o,o+s.nodeSize,{class:d.join(" "),[r]:"function"==typeof n?n({editor:t,node:s,pos:o,hasAnchor:l}):n})}function $y(e,t){return"function"==typeof e?e(t):e}function zy({editor:e,options:t,dataAttribute:n,doc:r,selection:o,from:s,to:i}){const{anchor:l}=o,a=[],c=e.isEmpty;return r.nodesBetween(s,i,(r,o)=>{const s=l>=o&&l<=o+r.nodeSize,i=!r.isLeaf&&Wf(r);return r.type.isTextblock?(!s&&t.showOnlyCurrent||!i||a.push(Ly({editor:e,isEmptyDoc:c,dataAttribute:n,hasAnchor:s,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:$y(t.emptyNodeClass,{editor:e,node:r,pos:o,hasAnchor:s})},node:r,pos:o})),t.includeChildren):t.includeChildren}),a}function By({editor:e,options:t,dataAttribute:n,doc:r,selection:o}){if(!e.isEditable&&t.showOnlyWhenEditable)return null;const{anchor:s}=o,i=[],l=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){const o=r.resolve(s),a=o.depth>0?o.node(1):o.nodeAfter,c=o.depth>0?o.before(1):s;if(a&&a.type.isTextblock&&Wf(a)){const r=s>=c&&s<=c+a.nodeSize;i.push(Ly({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:$y(t.emptyNodeClass,{editor:e,node:a,pos:c,hasAnchor:r})},node:a,pos:c}))}}else i.push(...zy({editor:e,options:t,dataAttribute:n,doc:r,selection:o,from:0,to:r.content.size}));return fu.create(r,i)}function Fy(e,t){var n;const r=e.resolve(t);if(0===r.depth){const e=null!=(n=r.nodeAfter)?n:r.nodeBefore;if(!e)return{from:t,to:t};const o=r.nodeAfter?t:t-e.nodeSize;return{from:o,to:o+e.nodeSize}}const o=r.before(1);return{from:o,to:o+r.node(1).nodeSize}}function jy(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function Vy(e,t){const n=function(e,t,n){const r=[];return e.forEach((e,o)=>{const s=o,i=s+e.nodeSize;s+1<n&&i+1>t&&r.push({from:s,to:i})}),r}(e,t.from,t.to);return n.push(jy(e,Fy(e,t.from))),t.to>t.from?n.push(jy(e,Fy(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(jy(e,Fy(e,Math.min(t.from+1,e.content.size)))),n}function Hy(e,t,n){const r=[];if(e.docChanged){const t=$f(e);for(const e of t)r.push(...Vy(n.doc,e.newRange))}return e.selectionSet&&(r.push(jy(n.doc,Fy(n.doc,e.mapping.map(t.selection.anchor)))),r.push(jy(n.doc,Fy(n.doc,n.selection.anchor)))),function(e){if(0===e.length)return[];const t=[...e].sort((e,t)=>e.from-t.from),n=[{...t[0]}];for(let r=1;r<t.length;r+=1){const e=n[n.length-1],o=t[r];o.from<=e.to?e.to=Math.max(e.to,o.to):n.push({...o})}return n}(r)}function Wy(e,t,n){const r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function Uy({editor:e,options:t,dataAttribute:n}){return{init(r,o){const s=By({editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection});return null!=s?s:fu.empty},apply:(r,o,s,i)=>r.docChanged||r.selectionSet?function({decorations:e,ranges:t,editor:n,options:r,dataAttribute:o,doc:s,selection:i}){let l=e;for(const a of t){const{from:e,to:t}=Wy(a.from,a.to,s),c=l.find(e,t).filter(n=>n.from>=e&&n.to<=t);c.length&&(l=l.remove(c));const d=zy({editor:n,options:r,dataAttribute:o,doc:s,selection:i,from:e,to:t});d.length&&(l=l.add(s,d))}return l}({decorations:o.map(r.mapping,r.doc),ranges:Hy(r,s,i),editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection}):o}}function qy({editor:e,options:t}){const n=t.dataAttribute?`data-${r=t.dataAttribute,r.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${_y}`;var r;const o=t.showOnlyCurrent&&!t.includeChildren;return new Ka({key:Py,...o?{}:{state:Uy({editor:e,options:t,dataAttribute:n})},props:{decorations:o?({doc:r,selection:o})=>By({editor:e,options:t,dataAttribute:n,doc:r,selection:o}):n=>{var r;return t.showOnlyWhenEditable&&!e.isEditable?fu.empty:null!=(r=Py.getState(n))?r:fu.empty}}})}Fm.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:_y,placeholder:"Write something â¦",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[qy({editor:this.editor,options:this.options})]}});function Ky(e,t){return!e.selection.empty&&!(e.selection instanceof _a)&&t.isEditable}Fm.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:e,options:t}=this;
1return[new Ka({key:new Qa("selection"),props:{decorations:n=>function(e,t){return Ky(e,t)&&!t.isFocused&&!t.view.dragging}(n,e)?fu.create(n.doc,[hu.inline(n.selection.from,n.selection.to,{class:t.className})]):null,handleDOMEvents:{blur(t){return!!Ky(t.state,e)&&(null==(n=window.getSelection())||n.removeAllRanges(),!1);var n},focus:t=>!!Ky(t.state,e)&&(requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&function(e){e.focus()}(t)}),!1)}}})]}});function Jy({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}Fm.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;const t=new Qa(this.name),n=this.options.node||(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(n).includes(e.name));return[new Ka({key:t,appendTransaction:(e,r,o)=>{const{doc:s,tr:i,schema:l}=o,a=t.getState(o),c=s.content.size,d=l.nodes[n];if(!e.some(e=>e.getMeta("skipTrailingNode"))&&a)return i.insert(c,d.create())},state:{init:(e,t)=>!Jy({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>{if(!e.docChanged)return t;if(e.getMeta("__uniqueIDTransaction"))return t;return!Jy({node:e.doc.lastChild,types:r})}}})]}});var Gy=Fm.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Dy(e,t),redo:()=>({state:e,dispatch:t})=>Ry(e,t)}),addProseMirrorPlugins(){return[Ay(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Ñ":()=>this.editor.commands.undo(),"Shift-Mod-Ñ":()=>this.editor.commands.redo()}}}),Qy=Iy,Xy=ng.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),Yy=Xy,Zy=ng.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Tf(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=(null==(n=e.attrs)?void 0:n.level)?parseInt(e.attrs.level,10):1,o="#".repeat(r);return e.content?`${o} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>{return t={find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}}
1)\\s$`),type:this.type,getAttributes:{level:e}},new Dm({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),s=xf(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable});var t})}}),ev=Zy,tv=Gy,nv=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,rv=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,ov=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,sv=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,iv=_m.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Tf(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[eg({find:nv,type:this.type}),eg({find:ov,type:this.type})]},addPasteRules(){return[rg({find:rv,type:this.type}),rg({find:sv,type:this.type})]}}),lv=iv,av="numeric",cv="ascii",dv="alpha",hv="asciinumeric",uv="alphanumeric",pv="domain",fv="emoji",mv="scheme",gv="slashscheme",yv="whitespace";function vv(e,t){return e in t||(t[e]=[]),t[e]}function bv(e,t,n){t[av]&&(t[hv]=!0,t[uv]=!0),t[cv]&&(t[hv]=!0,t[dv]=!0),t[hv]&&(t[uv]=!0),t[dv]&&(t[uv]=!0),t[uv]&&(t[pv]=!0),t[fv]&&(t[pv]=!0);for(const r in t){const t=vv(r,n);t.indexOf(e)<0&&t.push(e)}}function kv(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}kv.groups={},kv.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const n=t.jr[r][0],o=t.jr[r][1];if(o&&n.test(e))return o}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){let o;return r=r||kv.groups,t&&t.j?o=t:(o=new kv(t),n&&r&&bv(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const s=e.length;if(!s)return o;for(let i=0;i<s-1;i++)o=o.tt(e[i]);return o.tt(e[s-1],t,n,r)},tt(e,t,n,r){r=r||kv.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const s=t;let i,l=o.go(e);return l?(i=new kv,Object.assign(i.j,l.j),i.jr.push.apply(i.jr,l.jr),i.jd=l.jd,i.t=l.t):i=new kv,s&&(r&&(i.t&&"string"==typeof i.t?bv(s,Object.assign(function(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(i.t,r),n),r):n&&bv(s,n,r)),i.t=s),o.j[e]=i,i}};var wv=(e,t,n,r,o)=>e.ta(t,n,r,o),xv=(e,t,n,r,o)=>e.tr(t,n,r,o),Sv=(e,t,n,r,o)=>e.ts(t,n,r,o),Cv=(e,t,n,r,o)=>e.tt(t,n,r,o),Mv="WORD",Tv="UWORD",Ov="ASCIINUMERICAL",Ev="ALPHANUMERICAL",Av="LOCALHOST",Nv="TLD",Dv="UTLD",Rv="SCHEME",Iv="SLASH_SCHEME",_v="NUM",Pv="WS",Lv="NL",$v="OPENBRACE",zv="CLOSEBRACE",Bv="OPENBRACKET",Fv="CLOSEBRACKET",jv="OPENPAREN",Vv="CLOSEPAREN",Hv="OPENANGLEBRACKET",Wv="CLOSEANGLEBRACKET",Uv="FULLWIDTHLEFTPAREN",qv="FULLWIDTHRIGHTPAREN",Kv="LEFTCORNERBRACKET",Jv="RIGHTCORNERBRACKET",Gv="LEFTWHITECORNERBRACKET",Qv="RIGHTWHITECORNERBRACKET",Xv="FULLWIDTHLESSTHAN",Yv="FULLWIDTHGREATERTHAN",Zv="AMPERSAND",eb="APOSTROPHE",tb="ASTERISK",nb="AT",rb="BACKSLASH",ob="BACKTICK",sb="CARET",ib="COLON",lb="COMMA",ab="DOLLAR",cb="DOT",db="EQUALS",hb="EXCLAMATION",ub="HYPHEN",pb="PERCENT",fb="PIPE",mb="PLUS",gb="POUND",yb="QUERY",vb="QUOTE",bb
vendor: 4,571 bytes, line 1
1="FULLWIDTHMIDDLEDOT",kb="SEMI",wb="SLASH",xb="TILDE",Sb="UNDERSCORE",Cb="EMOJI",Mb="SYM",Tb=Object.freeze({__proto__:null,ALPHANUMERICAL:Ev,AMPERSAND:Zv,APOSTROPHE:eb,ASCIINUMERICAL:Ov,ASTERISK:tb,AT:nb,BACKSLASH:rb,BACKTICK:ob,CARET:sb,CLOSEANGLEBRACKET:Wv,CLOSEBRACE:zv,CLOSEBRACKET:Fv,CLOSEPAREN:Vv,COLON:ib,COMMA:lb,DOLLAR:ab,DOT:cb,EMOJI:Cb,EQUALS:db,EXCLAMATION:hb,FULLWIDTHGREATERTHAN:Yv,FULLWIDTHLEFTPAREN:Uv,FULLWIDTHLESSTHAN:Xv,FULLWIDTHMIDDLEDOT:bb,FULLWIDTHRIGHTPAREN:qv,HYPHEN:ub,LEFTCORNERBRACKET:Kv,LEFTWHITECORNERBRACKET:Gv,LOCALHOST:Av,NL:Lv,NUM:_v,OPENANGLEBRACKET:Hv,OPENBRACE:$v,OPENBRACKET:Bv,OPENPAREN:jv,PERCENT:pb,PIPE:fb,PLUS:mb,POUND:gb,QUERY:yb,QUOTE:vb,RIGHTCORNERBRACKET:Jv,RIGHTWHITECORNERBRACKET:Qv,SCHEME:Rv,SEMI:kb,SLASH:wb,SLASH_SCHEME:Iv,SYM:Mb,TILDE:xb,TLD:Nv,UNDERSCORE:Sb,UTLD:Dv,UWORD:Tv,WORD:Mv,WS:Pv}),Ob=/[a-z]/,Eb=/\p{L}/u,Ab=/\p{Emoji}/u,Nb=/\d/,Db=/\s/,Rb=null,Ib=null;function _b(e,t){const n=function(e){const t=[],n=e.length;let r=0;for(;r<n;){let o,s=e.charCodeAt(r),i=s<55296||s>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(i),r+=i.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,o=[];let s=0,i=0;for(;i<r;){let l=e,a=null,c=0,d=null,h=-1,u=-1;for(;i<r&&(a=l.go(n[i]));)l=a,l.accepts()?(h=0,u=0,d=l):h>=0&&(h+=n[i].length,u++),c+=n[i].length,s+=n[i].length,i++;s-=h,i-=u,c-=h,o.push({t:d.t,v:t.slice(s-c,s),s:s-c,e:s})}return o}function Pb(e,t,n,r,o){let s;const i=t.length;for(let l=0;l<i-1;l++){const n=t[l];e.j[n]?s=e.j[n]:(s=new kv(r),s.jr=o.slice(),e.j[n]=s),e=s}return s=new kv(n),s.jr=o.slice(),e.j[t[i-1]]=s,s}function Lb(e){const t=[],n=[];let r=0;for(;r<e.length;){let o=0;for(;"0123456789".indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+o),10);t>0;t--)n.pop();r+=o}else n.push(e[r]),r++}return t}var $b={defaultProtocol:"http",events:null,format:Bb,formatHref:Bb,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function zb(e,t=null){let n=Object.assign({},$b);e&&(n=Object.assign(n,e instanceof zb?e.o:e));const r=n.ignoreTags,o=[];for(let s=0;s<r.length;s++)o.push(r[s].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}function Bb(e){return e}function Fb(e,t){this.t="token",this.v=e,this.tk=t}function jb(e,t){class n extends Fb{constructor(t,n){super(t,n),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}zb.prototype={o:$b,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=null!=t;let o=this.o[e];return o?("object"==typeof o?(o=n.t in o?o[n.t]:$b[e],"function"==typeof o&&r&&(o=o(t,n))):"function"==typeof o&&r&&(o=o(t,n.t,n)),o):o},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},Fb.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"â¦":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=$b.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),s=this.toFormattedString(e),i={},l=e.get("className",n,t),a=e.get("target",n,t),c=e.get("rel",n,t),d=e.getObj("attributes",n,t),h=e.getObj("events",n,t);return i.href=r,l&&(i.class=l),a&&(i.target=a),c&&(i.rel=c),d&&Object.assign(i,d),{tagName:o,attributes:i,content:s,eventListeners:h}}};var Vb=jb("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Hb=jb("text"),Wb=jb("nl"),Ub=jb("url",{isLink:!0,toHref(e=$b.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Av&&e[1].t===ib}}),qb=e=>new kv(e);function Kb(e,t,n){const r=n[0].s,o=n[n.length-1].e;return new e(t.slice(r,o),n)}var Jb="undefined"!=typeof console&&console&&console.warn||(()=>{}
1),Gb={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Qb(e,t=!1){if(Gb.initialized&&Jb(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');Gb.customSchemes.push([e,t])}function Xb(){Gb.scanner=function(e=[]){const t={};kv.groups=t;const n=new kv;null==Rb&&(Rb=Lb("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yac
1hts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==Ib&&(Ib=Lb("ελ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")),Cv(n,"'",eb),Cv(n,"{",$v),Cv(n,"}",zv),Cv(n,"[",Bv),Cv(n,"]",Fv),Cv(n,"(",jv),Cv(n,")",Vv),Cv(n,"<",Hv),Cv(n,">",Wv),Cv(n,"ï¼",Uv),Cv(n,"ï¼",qv),Cv(n,"ã",Kv),Cv(n,"ã",Jv),Cv(n,"ã",Gv),Cv(n,"ã",Qv),Cv(n,"ï¼",Xv),Cv(n,"ï¼",Yv),Cv(n,"&",Zv),Cv(n,"*",tb),Cv(n,"@",nb),Cv(n,"`",ob),Cv(n,"^",sb),Cv(n,":",ib),Cv(n,",",lb),Cv(n,"$",ab),Cv(n,".",cb),Cv(n,"=",db),Cv(n,"!",hb),Cv(n,"-",ub),Cv(n,"%",pb),Cv(n,"|",fb),Cv(n,"+",mb),Cv(n,"#",gb),Cv(n,"?",yb),Cv(n,'"',vb),Cv(n,"/",wb),Cv(n,";",kb),Cv(n,"~",xb),Cv(n,"_",Sb),Cv(n,"\\",rb),Cv(n,"ã»",bb);const r=xv(n,Nb,_v,{[av]:!0});xv(r,Nb,r);const o=xv(r,Ob,Ov,{[hv]:!0}),s=xv(r,Eb,Ev,{[uv]:!0}),i=xv(n,Ob,Mv,{[cv]:!0});xv(i,Nb,o),xv(i,Ob,i),xv(o,Nb,o),xv(o,Ob,o);const l=xv(n,Eb,Tv,{[dv]:!0});xv(l,Ob),xv(l,Nb,s),xv(l,Eb,l),xv(s,Nb,s),xv(s,Ob),xv(s,Eb,s);const a=Cv(n,"\n",Lv,{[yv]:!0}),c=Cv(n,"\r",Pv,{[yv]:!0}),d=xv(n,Db,Pv,{[yv]:!0});Cv(n,"",d),Cv(c,"\n",a),Cv(c,"",d),xv(c,Db,d),Cv(d,"\r"),Cv(d,"\n"),xv(d,Db,d),Cv(d,"",d);const h=xv(n,Ab,Cb,{[fv]:!0});Cv(h,"#"),xv(h,Ab,h),Cv(h,"ï¸",h);const u=Cv(h,"â");Cv(u,"#"),xv(u,Ab,h);const p=[[Ob,i],[Nb,o]],f=[[Ob,null],[Eb,l],[Nb,s]];for(let m=0;m<Rb.length;m++)Pb(n,Rb[m],Nv,Mv,p);for(let m=0;m<Ib.length;m++)Pb(n,Ib[m],Dv,Tv,f);bv(Nv,{tld:!0,ascii:!0},t),bv(Dv,{utld:!0,alpha:!0},t),Pb(n,"file",Rv,Mv,p),Pb(n,"mailto",Rv,Mv,p),Pb(n,"http",Iv,Mv,p),Pb(n,"https",Iv,Mv,p),Pb(n,"ftp",Iv,Mv,p),Pb(n,"ftps",Iv,Mv,p),bv(Rv,{scheme:!0,ascii:!0},t),bv(Iv,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let m=0;m<e.length;m++){const t=e[m][0],r=e[m][1]?{[mv]:!0}:{[gv]:!0};t.indexOf("-")>=0?r[pv]=!0:Ob.test(t)?Nb.test(t)?r[hv]=!0:r[cv]=!0:r[av]=!0,Sv(n,t,t,r)}return Sv(n,"localhost",Av,{ascii:!0}),n.jd=new kv(Mb),{start:n,tokens:Object.assign({groups:t},Tb)}}(Gb.customSchemes);for(let e=0;e<Gb.tokenQueue.length;e++)Gb.tokenQueue[e][1]({scanner:Gb.scanner});Gb.parser=function({groups:e}){const t=e.domain.concat([Zv,tb,nb,rb,ob,sb,ab,db,ub,_v,pb,fb,mb,gb,wb,Mb,xb,Sb]),n=[eb,ib,lb,cb,hb,pb,yb,vb,kb,Hv,Wv,$v,zv,Fv,Bv,jv,Vv,Uv,qv,Kv,Jv,Gv,Qv,Xv,Yv],r=[Zv,eb,tb,rb,ob,sb,ab,db,ub,$v,zv,pb,fb,mb,gb,yb,wb,Mb,xb,Sb],o=qb(),s=Cv(o,xb);wv(s,r,s),wv(s,e.domain,s);const i=qb(),l=qb(),a=qb();wv(o,e.domain,i),wv(o,e.scheme,l),wv(o,e.slashscheme,a),wv(i,r,s),wv(i,e.domain,i);const c=Cv(i,nb);Cv(s,nb,c),Cv(l,nb,c),Cv(a,nb,c);const d=Cv(s,cb);wv(d,r,s),wv(d,e.domain,s);const h=qb();wv(c,e.domain,h),wv(h,e.domain,h);const u=Cv(h,cb);wv(u,e.domain,h);const p=qb(Vb);wv(u,e.tld,p),wv(u,e.utld,p),Cv(c,Av,p);const f=Cv(h,ub);Cv(f,ub,f),wv(f,e.domain,h),wv(p,e.domain,h),Cv(p,cb,u),Cv(p,ub,f);const m=Cv(i,ub),g=Cv(i,cb);Cv(m,ub,m),wv(m,e.domain,i),wv(g,r,s),wv(g,e.domain,i);const y=qb(Ub);wv(g,e.tld,y),wv(g,e.utld,y),wv(y,e.domain,i),wv(y,r,s),Cv(y,cb,g),Cv(y,ub,m),Cv(y,nb,c);const v=Cv(y,ib),b=qb(Ub);wv(v,e.numeric,b);const k=qb(Ub),w=qb();wv(k,t,k),wv(k,n,w),wv(w,t,k),wv(w,n,w),Cv(y,wb,k),Cv(b,wb,k);const x=Cv(l,ib),S=Cv(a,ib),C=Cv(S,wb),M=Cv(C,wb);wv(l,e.domain,i),Cv(l,cb,g),Cv(l,ub,m),wv(a,e.domain,i),Cv(a,cb,g),Cv(a,ub,m),wv(x,e.domain,k),Cv(x,wb,k),Cv(x,yb,k),wv(M,e.domain,k),wv(M,t,k),Cv(M,wb,k);const T=[[$v,zv],[Bv,Fv],[jv,Vv],[Hv,Wv],[Uv,qv],[Kv,Jv],[Gv,Qv],[Xv,Yv]];for(let O=0;O<T.length;O++){const[e,r]=T[O],o=Cv(k,e);Cv(w,e,o);const s=qb(Ub);wv(o,t,s);const i=qb();wv(o,n,i),Cv(o,r,k),wv(s,t,s),wv(s,n,i),wv(i,t,s),wv(i,n,i),Cv(s,r,k),Cv(i,r,k)}return Cv(o,Av,y),Cv(o,Lv,Wb),{start:o,tokens:Tb}}(Gb.scanner.tokens);for(let e=0;e<Gb.pluginQueue.length;e++)Gb.pluginQueue[e][1]({scanner:Gb.scanner,parser:Gb.parser});return Gb.initialized=!0,Gb}function Yb(e){return Gb.initialized||Xb(),function(e,t,n){let r=n.length,o=0,s=[],i=[];for(;o<r;){let l=e,a=null,c=null,d=0,h=null,u=-1;for(;o<r&&!(a=l.go(n[o].t));)i.push(n[o++]);for(;o<r&&(c=a||l.go(n[o].t));)a=null,l=c,l.accepts()?(u=0,h=l):u>=0&&u++,o++,d++;if(u<0)o-=d,o<r&&(i.push(n[o]),o++);else{i.length>0&&(s.push(Kb(Hb,t,i)),i=[]),o-=u,d-=u;const e=h.t,r=n.slice(o-d,o);s.push(Kb(e,t,r))}}return i.length>0&&s.push(Kb(Hb,t,i)),s}(Gb.parser.start,e,_b(Gb.scanner.start,e))}function Zb(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new zb(n),o=Yb(e),s=[];for(let i=0;i<o.length;i++){const e=o[i];!e.isLink||t&&e.t!==t||!r.check(e)||s.push(e.toFormattedObject(r))}return s}Yb.scan=_b;var ek="[\0-  áá â-\u2029âã]",tk=new RegExp(ek),nk=new RegExp(`${ek}$`),rk=new RegExp(ek,"g");function ok(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];
1return t&&t.forEach(e=>{const t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(rk,"").match(new RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}var sk=_m.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate),this.options.protocols.forEach(e=>{"string"!=typeof e?Qb(e.scheme,e.optionalSlashes):Qb(e)})},onDestroy(){kv.groups={},Gb.scanner=null,Gb.parser=null,Gb.tokenQueue=[],Gb.pluginQueue=[],Gb.customSchemes=[],Gb.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!ok(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(r)&&!!/\./.test(r)}}),addAttributes(){var e,t,n;return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:null!=(e=this.options.HTMLAttributes.target)?e:null},rel:{default:null!=(t=this.options.HTMLAttributes.rel)?t:null},class:{default:null!=(n=this.options.HTMLAttributes.class)?n:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!(!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!ok(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!ok(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Tf(this.options.HTMLAttributes,e),0]:["a",Tf(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,o,s;const i=null!=(r=null==(n=e.attrs)?void 0:n.href)?r:"",l=null!=(s=null==(o=e.attrs)?void 0:o.title)?s:"",a=t.renderChildren(e);return l?`[${a}](${i} "${l}")`:`[${a}](${i})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!ok(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return!(n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!ok(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[rg({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,o=Zb(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!ok(e,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t}
1,type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;var r;return this.options.autolink&&e.push((r={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!ok(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink},new Ka({key:new Qa("autolink"),appendTransaction:(e,t,n)=>{const o=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),s=e.some(e=>e.getMeta("preventAutolink"));if(!o||s)return;const{tr:i}=n;return $f(gf(t.doc,[...e])).forEach(({newRange:e})=>{const t=function(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}(n.doc,e,e=>e.isTextblock);let o,s;if(t.length>1)o=t[0],s=n.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ");else if(t.length){const r=n.doc.textBetween(e.from,e.to," "," ");if(!nk.test(r))return;o=t[0],s=n.doc.textBetween(o.pos,e.to,void 0," ")}if(o&&s){const e=s.split(tk).filter(Boolean);if(e.length<=0)return!1;const t=e[e.length-1],a=o.pos+s.lastIndexOf(t);if(!t)return!1;const c=Yb(t).map(e=>e.toObject(r.defaultProtocol));if(!(1===(l=c).length?l[0].isLink:3===l.length&&l[1].isLink&&["()","[]"].includes(l[0].value+l[2].value)))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:a+e.start+1,to:a+e.end+1})).filter(e=>!n.schema.marks.code||!n.doc.rangeHasMark(e.from,e.to,n.schema.marks.code)).filter(e=>r.validate(e.value)).filter(e=>r.shouldAutoLink(e.value)).forEach(e=>{zf(e.from,e.to,n.doc).some(e=>e.mark.type===r.type)||i.addMark(e.from,e.to,r.type.create({href:e.href}))})}var l}),i.steps.length?i:void 0}}))),e.push(function(e){return new Ka({key:new Qa("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,s;if(0!==r.button)return!1;if(!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{const t=r.target;if(!t)return!1;const n=e.editor.view.dom;i=t.closest("a"),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let l=!1;if(e.enableClickSelection&&(l=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const n=Pf(t.state,e.type.name),r=null!=(o=i.href)?o:n.href,a=null!=(s=i.target)?s:n.target;r&&(window.open(r,a),l=!0)}return l}}})}({type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(function(e){return new Ka({key:new Qa("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:o}=e,{state:s}=t,{selection:i}=s,{empty:l}=i;if(l)return!1;let a="";r.content.forEach(e=>{a+=e.textContent});const c=Zb(a,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===a);return!(!a||!c||void 0!==o&&!o(c.value))&&e.editor.commands.setMark(e.type,{href:c.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),ik=sk,lk=Ag,ak=Zg,ck=" ",dk=ng.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Tf(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(1===n.length&&"image"===n[0].type)return t.parseChildren([n[0]]);const r=t.parseInline(n);return 1!==n.length||"text"!==n[0].type||n[0].raw!==ck&&n[0].text!==ck&&"Â "!==n[0].raw&&"Â "!==n[0].text||1!==r.length||"text"!==r[0].type||r[0].text!==ck&&"Â "!==r[0].text?t.createNode("paragraph",void 0,r):t.createNode("paragraph",void 0,[])},renderMarkdown:(e,t,n)=>{var r,o;if(!e)return"";const s=Array.isArray(e.content)?e.content:[];if(0===s.length){const e=Array.isArray(null==(r=null==n?void 0:n.previousNode)?void 0:r.content)?n.previousNode.content:[];return"paragraph"===(null==(o=null==n?void 0:n.previousNode)?void 0:o.type)&&0===e.length?ck:""}return t.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),hk=dk,uk=ng.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""});function pk(e){return Bt((t,n)=>({get:()=>(t(),e),set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var fk=class extends Zm{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=pk(this.view.state),this.reactiveExtensionStorage=pk(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),Tt(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){const n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){const t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},mk=rr({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=Nt(),n=li();return Tn(()=>{const r=e.editor;r&&r.options.element&&t.value&&an(()=>{var e;if(!t.value||!(null==(e=r.view.dom)?void 0:e.parentNode))return;const o=_t(t.value);
1t.value.append(...r.view.dom.parentNode.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:o}),r.createNodeViews()})}),Wr(()=>{const t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:t}},render(){return wi("div",{ref:e=>{this.rootEl=e}})}}),gk=(rr({name:"NodeViewContent",props:{as:{type:String,default:"div"}},inject:{nodeViewContentRef:{default:void 0}},mounted(){const e=this.nodeViewContentRef;e&&this.$el&&e(this.$el)},beforeUnmount(){const e=this.nodeViewContentRef;e&&e(null)},render(){return wi(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),rr({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var e,t;return wi(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},null==(t=(e=this.$slots).default)?void 0:t.call(e))}}),(e={})=>{const t=Dt();return jr(()=>{t.value=new fk(e)}),Wr(()=>{var e;null==(e=t.value)||e.destroy()}),t});rr({name:"MarkViewContent",props:{as:{type:String,default:"span"}},render(){return wi(this.as,{style:{whiteSpace:"inherit"},"data-mark-view-content":""})}});export{Wr as $,J as $t,cs as A,Bt as At,wi as B,yt as Bt,Ks as C,Un as Ct,Qs as D,bn as Dt,Bs as E,vo as Et,Or as F,At as Ft,Sr as G,Ft as Gt,xr as H,Dt as Ht,rr as I,Tt as It,yo as J,o as Jt,Sn as K,Pt as Kt,li as L,le as Lt,Gs as M,ie as Mt,Js as N,wt as Nt,zs as O,kn as Ot,Us as P,xt as Pt,Fr as Q,N as Qt,nr as R,gt as Rt,Yt as S,ir as St,Ws as T,Tn as Tt,Mr as U,Mt as Ut,Cn as V,bt as Vt,Cr as W,Ht as Wt,an as X,D as Xt,ei as Y,E as Yt,Rr as Z,a as Zt,Os as _,U as _n,lo as _t,ak as a,i as an,Hr as at,ws as b,$ as bn,Po as bt,lv as c,f as cn,hn as ct,Yy as d,v as dn,Xr as dt,_ as en,Vr as et,Qy as f,G as fn,eo as ft,Kn as g,ne as gn,tr as gt,Qn as h,W as hn,Ls as ht,hk as i,b as in,Ur as it,oo as j,se as jt,ds as k,xi as kt,tv as l,K as ln,ro as lt,dg as m,L as mn,Yn as mt,gk as n,g as nn,Gr as nt,lk as o,S as on,Is as ot,ry as p,Q as pn,Zr as pt,Fs as q,_t as qt,uk as r,l as rn,jr as rt,ik as s,k as sn,xn as st,mk as t,u as tn,Ir as tt,ev as u,y as un,so as ut,Nr as v,B as vn,fo as vt,ki as w,On as wt,Fn as x,po as xt,Ns as y,Z as yn,or as yt,qs as z,Nt as zt};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.