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,Z=e=>!(!e||!0!==e.__v_isRef),ee=e=>y(e)?e:null==e?"":u(e)||b(e)&&(e.toString===w||!g(e.toString))?Z(e)?ee(e.value):JSON.stringify(e,te,2):String(e),te=(e,t)=>Z(t)?te(e,t.value):p(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[ne(t,r)+" =>"]=n,e),{})}:f(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>ne(e))}:v(t)?ne(t):!b(t)||u(t)||S(t)?t:String(t),ne=(e,t="")=>{var n;return v(e)?`Symbol(${null!=(n=e.description)?n:t})`:e},re=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 oe(e){return new re(e)}function se(){return X}function ie(e,t=!1){X&&X.cleanups.push(e)}var le,ae,ce=new WeakSet,de=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
1=void 0,X&&(X.active?X.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,ce.has(this)&&(ce.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||ue(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,Me(this),me(this);const e=Y,t=we;Y=this,we=!0;try{return this.fn()}finally{ge(this),Y=e,we=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)be(e);this.deps=this.depsTail=void 0,Me(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?ce.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ye(this)&&this.run()}get dirty(){return ye(this)}},he=0;function ue(e,t=!1){if(e.flags|=8,t)return e.next=ae,void(ae=e);e.next=le,le=e}function pe(){he++}function fe(){if(--he>0)return;if(ae){let e=ae;for(ae=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;le;){let n=le;for(le=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 me(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ge(e){let t,n=e.depsTail,r=n;for(;r;){const e=r.prevDep;-1===r.version?(r===n&&(n=e),be(r),ke(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function ye(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ve(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ve(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===Te)return;if(e.globalVersion=Te,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!ye(e)))return;e.flags|=2;const t=e.dep,n=Y,r=we;Y=e,we=!0;try{me(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{Y=n,we=r,ge(e),e.flags&=-3}}function be(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)be(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function ke(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var we=!0,xe=[];function Se(){xe.push(we),we=!1}function Ce(){const e=xe.pop();we=void 0===e||e}function Me(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=Y;Y=void 0;try{t()}finally{Y=e}}}var Te=0,Oe=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}},Ee=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(!Y||!we||Y===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==Y)t=this.activeLink=new Oe(Y,this),Y.deps?(t.prevDep=Y.depsTail,Y.depsTail.nextDep=t,Y.depsTail=t):Y.deps=Y.depsTail=t,Ae(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=Y.depsTail,t.nextDep=void 0,Y.depsTail.nextDep=t,Y.depsTail=t,Y.deps===t&&(Y.deps=e)}return t}trigger(e){this.version++,Te++,this.notify(e)}notify(e){pe();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{fe()}}};function Ae(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)Ae(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var Ne=new WeakMap,De=Symbol(""),Re=Symbol(""),Ie=Symbol("");function _e(e,t,n){if(we&&Y){let t=Ne.get(e);t||Ne.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Ee),r.map=t,r.key=n),r.track()}}function Pe(e,t,n,r,o,s){const i=Ne.get(e);if(!i)return void Te++;const l=e=>{e&&e.trigger()};if(pe(),"clear"===t)i.forEach(l);else{const o=u(e),s=o&&C(n);if(o&&"length"===n){const e=Number(r);i.forEach((t,n)=>{("length"===n||n===Ie||!v(n)&&n>=e)&&l(t)})}else switch((void 0!==n||i.has(void 0))&&l(i.get(n)),s&&l(i.get(Ie)),t){case"add":o?s&&l(i.get("length")):(l(i.get(De)),p(e)&&l(i.get(Re)));break;case"delete":o||(l(i.get(De)),p(e)&&l(i.get(Re)));break;case"set":p(e)&&l(i.get(De))}}fe()}function Le(e){const t=Ct(e);return t===e?t:(_e(t,0,Ie),xt(e)?t:t.map(Tt))}function $e(e){return _e(e=Ct(e),0,Ie),e}function ze(e,t){return wt(e)?Ot(kt(e)?Tt(t):t):Tt(t)}var Be={__proto__:null,[Symbol.iterator](){return Fe(this,Symbol.iterator,e=>ze(this,e))},concat(...e){return Le(this).concat(...e.map(e=>u(e)?Le(e):e))}
1,entries(){return Fe(this,"entries",e=>(e[1]=ze(this,e[1]),e))},every(e,t){return Ve(this,"every",e,t,void 0,arguments)},filter(e,t){return Ve(this,"filter",e,t,e=>e.map(e=>ze(this,e)),arguments)},find(e,t){return Ve(this,"find",e,t,e=>ze(this,e),arguments)},findIndex(e,t){return Ve(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ve(this,"findLast",e,t,e=>ze(this,e),arguments)},findLastIndex(e,t){return Ve(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ve(this,"forEach",e,t,void 0,arguments)},includes(...e){return We(this,"includes",e)},indexOf(...e){return We(this,"indexOf",e)},join(e){return Le(this).join(e)},lastIndexOf(...e){return We(this,"lastIndexOf",e)},map(e,t){return Ve(this,"map",e,t,void 0,arguments)},pop(){return Ue(this,"pop")},push(...e){return Ue(this,"push",e)},reduce(e,...t){return He(this,"reduce",e,t)},reduceRight(e,...t){return He(this,"reduceRight",e,t)},shift(){return Ue(this,"shift")},some(e,t){return Ve(this,"some",e,t,void 0,arguments)},splice(...e){return Ue(this,"splice",e)},toReversed(){return Le(this).toReversed()},toSorted(e){return Le(this).toSorted(e)},toSpliced(...e){return Le(this).toSpliced(...e)},unshift(...e){return Ue(this,"unshift",e)},values(){return Fe(this,"values",e=>ze(this,e))}};function Fe(e,t,n){const r=$e(e),o=r[t]();return r===e||xt(e)||(o._next=o.next,o.next=()=>{const e=o._next();return e.done||(e.value=n(e.value)),e}),o}var je=Array.prototype;function Ve(e,t,n,r,o,s){const i=$e(e),l=i!==e&&!xt(e),a=i[t];if(a!==je[t]){const t=a.apply(e,s);return l?Tt(t):t}let c=n;i!==e&&(l?c=function(t,r){return n.call(this,ze(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 He(e,t,n,r){const o=$e(e);let s=n,i=!1;o!==e&&(o!==e&&!xt(e)?(i=0===r.length,s=function(t,r,o){return i&&(i=!1,t=ze(e,t)),n.call(this,t,ze(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?ze(e,l):l}function We(e,t,n){const r=Ct(e);_e(r,0,Ie);const o=r[t](...n);return-1!==o&&!1!==o||!St(n[0])?o:(n[0]=Ct(n[0]),r[t](...n))}function Ue(e,t,n=[]){Se(),pe();const r=Ct(e)[t].apply(e,n);return fe(),Ce(),r}var qe=e("__proto__,__v_isRef,__isVue"),Ke=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(v));function Je(e){v(e)||(e=String(e));const t=Ct(this);return _e(t,0,e),t.hasOwnProperty(e)}var Ge=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?ft:pt:o?ut:ht).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const s=u(e);if(!r){let e;if(s&&(e=Be[t]))return e;if("hasOwnProperty"===t)return Je}const i=Reflect.get(e,t,Et(e)?e:n);if(v(t)?Ke.has(t):qe(t))return i;if(r||_e(e,0,t),o)return i;if(Et(i)){const e=s&&C(t)?i:i.value;return r&&b(e)?yt(e):e}return b(i)?r?yt(i):mt(i):i}},Qe=class extends Ge{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=wt(o);if(xt(n)||wt(n)||(o=Ct(o),n=Ct(n)),!s&&Et(o)&&!Et(n))return e||(o.value=n),!0}const i=s?Number(t)<e.length:h(e,t),l=Reflect.set(e,t,n,Et(e)?e:r);return e===Ct(r)&&l&&(i?I(n,o)&&Pe(e,"set",t,n):Pe(e,"add",t,n)),l}deleteProperty(e,t){const n=h(e,t),r=(e[t],Reflect.deleteProperty(e,t));return r&&n&&Pe(e,"delete",t,void 0),r}has(e,t){const n=Reflect.has(e,t);return v(t)&&Ke.has(t)||_e(e,0,t),n}ownKeys(e){return _e(e,0,u(e)?"length":De),Reflect.ownKeys(e)}},Xe=class extends Ge{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},Ye=new Qe,Ze=new Xe,et=new Qe(!0),tt=new Xe(!0),nt=e=>e,rt=e=>Reflect.getPrototypeOf(e);function ot(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function st(e,t){const n={get(n){const r=this.__v_raw,o=Ct(r),s=Ct(n);e||(I(n,s)&&_e(o,0,n),_e(o,0,s));const{has:i}=rt(o),l=t?nt:e?Ot:Tt;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&&_e(Ct(t),0,De),t.size},has(t){const n=this.__v_raw,r=Ct(n),o=Ct(t);return e||(I(t,o)&&_e(r,0,t),_e(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?nt:e?Ot:Tt;return!e&&_e(Ct(s),0,De),s.forEach((e,t)=>n.call(r,i(e),i(t),o))}};return a(n,e?{add:ot("add"),set:ot("set"),delete:ot("delete"),clear:ot("clear")}:{add(e){const n=Ct(this),r=rt(n),o=Ct(e),s=t||xt(e)||wt(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),Pe(n,"add",s,s)),this},set(e,n){t||xt(n)||wt(n)||(n=Ct(n));const r=Ct(this),{has:o,get:s}=rt(r);let i=o.call(r,e);i||(e=Ct(e),i=o.call(r,e));const l=s.call(r,e);return r.set(e,n),i?I(n,l)&&Pe(r,"set",e,n):Pe(r,"add",e,n),this},delete(e){const t=Ct(this),{has:n,get:r}=rt(t);let o=n.call(t,e);o||(e=Ct(e),o=n.call(t,e));r&&r.call(t,e);const s=t.delete(e);return o&&Pe(t,"delete",e,void 0),s},clear(){const e=Ct(this),t=0!==e.size,n=e.clear();return t&&Pe(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=Ct(o),i=p(s),l="entries"===e||e===Symbol.iterator&&i,c="keys"===e&&i,d=o[e](...r),h=n?nt:t?Ot:Tt;return!t&&_e(s,0,c?Re:De),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 it(e,t){const n=st(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 lt={get:it(!1,!1)},at={get:it(!1,!0)},ct={get:it(!0,!1)},dt={get:it(!0,!0)},ht=new WeakMap,ut=new WeakMap,pt=new WeakMap,ft=new WeakMap;function mt(e){return wt(e)?e:bt(e,!1,Ye,lt,ht)}function gt(e){return bt(e,!1,et,at,ut)}function yt(e){return bt(e,!0,Ze,ct,pt)}function vt(e){return bt(e,!0,tt,dt,ft)}function bt(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 kt(e){return wt(e)?kt(e.__v_raw):!(!e||!e.__v_isReactive)}function wt(e){return!(!e||!e.__v_isReadonly)}function xt(e){return!(!e||!e.__v_isShallow)}function St(e){return!!e&&!!e.__v_raw}function Ct(e){const t=e&&e.__v_raw;return t?Ct(t):e}function Mt(e){return!h(e,"__v_skip")&&Object.isExtensible(e)&&P(e,"__v_skip",!0),e}var Tt=e=>b(e)?mt(e):e,Ot=e=>b(e)?yt(e):e;function Et(e){return!!e&&!0===e.__v_isRef}function At(e){return Dt(e,!1)}function Nt(e){return Dt(e,!0)}function Dt(e,t){return Et(e)?e:new Rt(e,t)}var Rt=class{constructor(e,t){this.dep=new Ee,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Ct(e),this._value=t?e:Tt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||xt(e)||wt(e);I(e=n?e:Ct(e),t)&&(this._rawValue=e,this._value=n?e:Tt(e),this.dep.trigger())}};function It(e){return Et(e)?e.value:e}function _t(e){return g(e)?e():It(e)}var Pt={get:(e,t,n)=>"__v_raw"===t?e:It(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Et(o)&&!Et(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function Lt(e){return kt(e)?e:new Proxy(e,Pt)}var $t=class{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new Ee,{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 zt(e){return new $t(e)}function Bt(e){const t=u(e)?new Array(e.length):{};for(const n in e)t[n]=Ht(e,n);return t}var Ft=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=Ct(e);let r=!0,o=e;if(!u(e)||v(this._key)||!C(this._key))do{r=!St(o)||xt(o)}while(r&&(o=o.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=It(e)),this._value=void 0===e?this._defaultValue:e}set value(e){if(this._shallow&&Et(this._raw[this._key])){const t=this._object[this._key];if(Et(t))return void(t.value=e)}this._object[this._key]=e}get dep(){return function(e,t){const n=Ne.get(e);return n&&n.get(t)}(this._raw,this._key)}},jt=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 Vt(e,t,n){return Et(e)?e:g(e)?new jt(e):b(e)&&arguments.length>1?Ht(e,t,n):At(e)}function Ht(e,t,n){return new Ft(e,t,n)}var Wt=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Ee(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Te-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&Y!==this)return ue(this,!0),!0}get value(){const e=this.dep.track();return ve(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};var Ut={},qt=new WeakMap,Kt=void 0;function Jt(e,t,r=n){const{immediate:s,deep:i,once:l,scheduler:a,augmentJob:d,call:h}=r,p=e=>i?e:xt(e)||!1===i||0===i?Gt(e,1):Gt(e);let f,m,y,v,b=!1,k=!1;if(Et(e)?(m=()=>e.value,b=xt(e)):kt(e)?(m=()=>p(e),b=!0):u(e)?(k=!0,b=e.some(e=>kt(e)||xt(e)),m=()=>e.map(e=>
1Et(e)?e.value:kt(e)?p(e):g(e)?h?h(e,2):e():void 0)):m=g(e)?t?h?()=>h(e,2):e:()=>{if(y){Se();try{y()}finally{Ce()}}const t=Kt;Kt=f;try{return h?h(e,3,[v]):e(v)}finally{Kt=t}}:o,t&&i){const e=m,t=!0===i?1/0:i;m=()=>Gt(e(),t)}const w=se(),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(Ut):Ut;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=Kt;Kt=f;try{const e=[n,S===Ut?void 0:k&&S[0]===Ut?[]:S,v];S=n,h?h(t,3,e):t(...e)}finally{Kt=e}}}else f.run()};return d&&d(C),f=new de(m),f.scheduler=a?()=>a(C,!1):C,v=e=>function(e,t=!1,n=Kt){if(n){let t=qt.get(n);t||qt.set(n,t=[]),t.push(e)}}(e,!1,f),y=f.onStop=()=>{const e=qt.get(f);if(e){if(h)h(e,4);else for(const t of e)t();qt.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 Gt(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--,Et(e))Gt(e.value,t,n);else if(u(e))for(let r=0;r<e.length;r++)Gt(e[r],t,n);else if(f(e)||p(e))e.forEach(e=>{Gt(e,t,n)});else if(S(e)){for(const r in e)Gt(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Gt(e[r],t,n)}return e}function Qt(e,t,n,r){try{return r?e(...r):e()}catch(o){Yt(o,t,n)}}function Xt(e,t,n,r){if(g(e)){const o=Qt(e,t,n,r);return o&&k(o)&&o.catch(e=>{Yt(e,t,n)}),o}if(u(e)){const o=[];for(let s=0;s<e.length;s++)o.push(Xt(e[s],t,n,r));return o}}function Yt(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 Se(),Qt(s,null,10,[e,o,i]),void Ce()}!function(e,t,n,r=!0,o=!1){if(o)throw e}(e,0,0,o,i)}var Zt=[],en=-1,tn=[],nn=null,rn=0,on=Promise.resolve(),sn=null;function ln(e){const t=sn||on;return e?t.then(this?e.bind(this):e):t}function an(e){if(!(1&e.flags)){const t=pn(e),n=Zt[Zt.length-1];!n||!(2&e.flags)&&t>=pn(n)?Zt.push(e):Zt.splice(function(e){let t=en+1,n=Zt.length;for(;t<n;){const r=t+n>>>1,o=Zt[r],s=pn(o);s<e||s===e&&2&o.flags?t=r+1:n=r}return t}(t),0,e),e.flags|=1,cn()}}function cn(){sn||(sn=on.then(fn))}function dn(e){u(e)?tn.push(...e):nn&&-1===e.id?nn.splice(rn+1,0,e):1&e.flags||(tn.push(e),e.flags|=1),cn()}function hn(e,t,n=en+1){for(;n<Zt.length;n++){const t=Zt[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;Zt.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function un(e){if(tn.length){const e=[...new Set(tn)].sort((e,t)=>pn(e)-pn(t));if(tn.length=0,nn)return void nn.push(...e);for(nn=e,rn=0;rn<nn.length;rn++){const e=nn[rn];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}nn=null,rn=0}}var pn=e=>null==e.id?2&e.flags?-1:1/0:e.id;function fn(e){try{for(en=0;en<Zt.length;en++){const e=Zt[en];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),Qt(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;en<Zt.length;en++){const e=Zt[en];e&&(e.flags&=-2)}en=-1,Zt.length=0,un(),sn=null,(Zt.length||tn.length)&&fn(e)}}var mn=null,gn=null;function yn(e){const t=mn;return mn=e,gn=e&&e.type.__scopeId||null,t}function vn(e,t=mn,n){if(!t)return e;if(e._n)return e;const r=(...n)=>{r._d&&_s(-1);const o=yn(t),s=As.length;let i;try{i=e(...n)}finally{for(let e=As.length;e>s;e--)Rs();yn(o),r._d&&_s(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function bn(e,t){if(null===mn)return e;const r=gi(mn),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&&Gt(i),o.push({dir:e,instance:r,value:i,oldValue:void 0,arg:l,modifiers:a}))}return e}function kn(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&&(Se(),Xt(a,n,8,[e.el,l,e,t]),Ce())}}function wn(e,t){if(oi){let n=oi.provides;const r=oi.parent&&oi.parent.provides;r===n&&(n=oi.provides=Object.create(r)),n[e]=t}}function xn(e,t,n=!1){const r=si();if(r||Ro){let o=Ro?Ro._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 Sn(){return!(!si()&&!Ro)}var Cn=Symbol.for("v-scx");function Mn(e,t){return On(e,null,t)}
1function Tn(e,t,n){return On(e,t,n)}function On(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(hi)if("sync"===l){const e=xn(Cn);u=e.__watcherHandles||(e.__watcherHandles=[])}else if(!h){const e=()=>{};return e.stop=o,e.resume=o,e.pause=o,e}const p=oi;d.call=(e,t,n)=>Xt(e,p,t,n);let f=!1;"post"===l?d.scheduler=e=>{is(e,p&&p.suspense)}:"sync"!==l&&(f=!0,d.scheduler=(e,t)=>{t?e():an(e)}),d.augmentJob=e=>{t&&(e.flags|=4),f&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};const m=Jt(e,t,d);return hi&&(u?u.push(m):h&&m()),m}function En(e,t,n){const r=this.proxy,o=y(e)?e.includes(".")?An(r,e):()=>r[e]:e.bind(r,r);let s;g(t)?s=t:(s=t.handler,n=t);const i=ii(this),l=On(o,s.bind(r),n);return i(),l}function An(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 Nn=new WeakMap,Dn=Symbol("_vte"),Rn=e=>e.__isTeleport,In=e=>e&&(e.disabled||""===e.disabled),_n=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,Pn=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,Ln=(e,t)=>{const n=e&&e.to;return y(n)?t?t(n):null:n},$n={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=In(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=In(e.props),r=e.target=Ln(e.props,f),s=jn(r,e,m,p);r&&("svg"!==i&&_n(r)?i="svg":"mathml"!==i&&Pn(r)&&(i="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(r),n||(k(e,r,s),Fn(e,!1)))},x=e=>{const t=()=>{if(Nn.get(e)===t){if(Nn.delete(e),In(e.props)){const t=y(e.el)||n;k(e,t,e.anchor),Fn(e,!0)}w(e)}};Nn.set(e,t),is(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),Fn(t,!0)),w()}else{t.el=e.el;const r=t.anchor=e.anchor,d=Nn.get(e);if(d)return d.flags|=8,Nn.delete(e),void x(t);t.targetStart=e.targetStart;const p=t.target=e.target,m=t.targetAnchor=e.targetAnchor,g=In(e.props),y=g?n:p,k=g?r:m;if("svg"===i||_n(p)?i="svg":("mathml"===i||Pn(p))&&(i="mathml"),b?(u(e.dynamicChildren,b,y,o,s,i,l),ps(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):zn(t,n,r,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=Ln(t.props,f);e&&(t.target=e,zn(t,e,null,c,0))}else g&&zn(t,p,m,c,1);Fn(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=In(u),f=s||!p,m=Nn.get(e);if(m&&(m.flags|=8,Nn.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:zn,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=Ln(t.props,a),m=In(t.props);if(f){const a=f._lpa||f.firstChild;16&t.shapeFlag&&(m?(p(e,t),u(f,a),t.targetAnchor||jn(f,t,d,c,l(e)===f?e:null)):(t.anchor=i(e),u(f,a),t.targetAnchor||jn(f,t,d,c),h(a&&i(a),t,f,n,r,o,s))),Fn(t,m)}else m&&16&t.shapeFlag&&(p(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}};function zn(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),!Nn.has(e)&&(!h||In(d))&&16&a)for(let u=0;u<c.length;u++)o(c[u],t,n,2);h&&r(l,t,n)}var Bn=$n;function Fn(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 jn(e,t,n,r,o=null){const s=t.targetStart=n(""),i=t.targetAnchor=n("");return s[Dn]=i,e&&(r(s,e,o),r(i,e,o)),i}var Vn=Symbol("_leaveCb"),Hn=Symbol("_enterCb");function Wn(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leav
1ingVNodes:new Map};return Fr(()=>{e.isMounted=!0}),Hr(()=>{e.isUnmounting=!0}),e}var Un=[Function,Array],qn={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Un,onEnter:Un,onAfterEnter:Un,onEnterCancelled:Un,onBeforeLeave:Un,onLeave:Un,onAfterLeave:Un,onLeaveCancelled:Un,onBeforeAppear:Un,onAppear:Un,onAfterAppear:Un,onAppearCancelled:Un},Kn=e=>{const t=e.subTree;return t.component?Kn(t.component):t};function Jn(e){let t=e[0];if(e.length>1)for(const n of e)if(n.type!==Os){t=n;break}return t}var Gn={name:"BaseTransition",props:qn,setup(e,{slots:t}){const n=si(),r=Wn();return()=>{const o=t.default&&tr(t.default(),!0),s=o&&o.length?Jn(o):n.subTree?Js():void 0;if(!s)return;const i=Ct(e),{mode:l}=i;if(r.isLeaving)return Yn(s);const a=Zn(s);if(!a)return Yn(s);let c=Xn(a,i,r,n,e=>c=e);a.type!==Os&&er(a,c);let d=n.subTree&&Zn(n.subTree);if(d&&d.type!==Os&&!Bs(d,a)&&Kn(n).type!==Os){let e=Xn(d,i,r,n);if(er(d,e),"out-in"===l&&a.type!==Os)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,d=void 0},Yn(s);"in-out"===l&&a.type!==Os?e.delayLeave=(e,t,n)=>{Qn(r,d)[String(d.key)]=d,e[Vn]=()=>{t(),e[Vn]=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 Qn(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 Xn(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=Qn(n,e),S=(e,t)=>{e&&Xt(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[Vn]&&t[Vn](!0);const o=x[w];o&&Bs(e,o)&&o.el[Vn]&&o.el[Vn](),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[Hn]=e=>{l||(l=!0,S(e?i:o,[t]),M.delayedLeave&&M.delayedLeave(),t[Hn]=void 0)};const a=t[Hn].bind(null,!1);r?C(r,[t,a]):a()},leave(t,r){const o=String(e.key);if(t[Hn]&&t[Hn](!0),n.isUnmounting)return r();S(p,[t]);let s=!1;t[Vn]=n=>{s||(s=!0,r(),S(n?g:m,[t]),t[Vn]=void 0,x[o]===e&&delete x[o])};const i=t[Vn].bind(null,!1);x[o]=e,f?C(f,[t,i]):i()},clone(e){const s=Xn(e,t,n,r,o);return o&&o(s),s}};return M}function Yn(e){if(Er(e))return(e=Us(e)).children=null,e}function Zn(e){if(!Er(e))return Rn(e.type)&&e.children?Jn(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 er(e,t){6&e.shapeFlag&&e.component?(e.transition=t,er(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 tr(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===Ms?(128&i.patchFlag&&o++,r=r.concat(tr(i.children,t,l))):(t||i.type!==Os)&&r.push(null!=l?Us(i,{key:l}):i)}if(o>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function nr(e,t){return g(e)?(()=>a({name:e.name},t,{setup:e}))():e}function rr(){const e=si();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function or(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function sr(e){const t=si(),r=Nt(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 ir(e,t){let n;return!(!(n=Object.getOwnPropertyDescriptor(e,t))||n.configurable)}var lr=new WeakMap;function ar(e,t,r,o,i=!1){if(u(e))return void e.forEach((e,n)=>ar(e,t&&(u(t)?t[n]:t),r,o,i));if(Mr(o)&&!i)return void(512&o.shapeFlag&&o.type.__asyncResolved&&o.component.subTree.component&&ar(e,t,r,o.component.subTree));const l=4&o.shapeFlag?gi(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=Ct(v),k=v===n?s:e=>!ir(m,e)&&h(b,e),w=(e,t)=>!t||!ir(m,t);if(null!=f&&f!==p)if(cr(t),y(f))m[f]=null,k(f)&&(v[f]=null);else if(Et(f)){const e=t;w(0,e.k)&&(f.value=null),e.k&&(m[e.k]=null)}
1if(g(p))Qt(p,d,12,[a,m]);else{const t=y(p),n=Et(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(),lr.delete(e)};t.id=-1,lr.set(e,t),is(t,r)}else cr(e),o()}}}function cr(e){const t=lr.get(e);t&&(t.flags|=8,lr.delete(e))}var dr=!1,hr=()=>{dr||(dr=!0)},ur=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},pr=e=>8===e.nodeType;function fr(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=pr(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 Ts:3!==T?""===r.children?(c(r.el=o(""),l(n),n),O=n):O=w():(n.data!==r.children&&(hr(),n.data=r.children),O=s(n));break;case Os:v(n)?(O=s(n),y(r.el=n.content.firstChild,n,i)):O=8!==T||k?w():s(n);break;case Es: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 Ms: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):pr(n)&&"teleport start"===n.data?g(n,n.data,"teleport end"):s(n),t(r,e,null,i,a,ur(e),b),Mr(r)&&!r.type.__asyncResolved){let t;k?(t=Hs(Ms),t.anchor=O?O.previousSibling:e.lastChild):t=3===n.nodeType?qs(""):Hs("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,ur(l(n)),d,b,e,h))}return null!=S&&ar(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&&kn(t,null,n,"created");let c,w=!1;if(v(e)){w=us(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&&!yr(e,1)&&hr();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")&&(yr(e,0)||hr(),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&&kt(h.style))for(const e in h.style)h.style[e];(c=h&&h.onVnodeBeforeMount)&&Zs(c,n,t),m&&kn(t,null,n,"beforeMount"),((c=h&&h.onVnodeMounted)||m||w)&&Ss(()=>{c&&Zs(c,n,t),w&&g.enter(e),m&&kn(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]=Gs(u[m]),g=t.type===Ts;e?(g&&!d&&m+1<p&&Gs(u[m+1]).type===Ts&&(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,yr(r,1)||hr()),n(null,t,r,null,i,l,ur(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&&pr(u)&&"]"===u.data?s(t.anchor=u):(hr(),c(t.anchor=d("]"),h,u),u)},m=(e,t,r,o,i,c)=>{if(function(e,t){return yr(e.parentElement,1)||function(e){return 1===e.nodeType&&vr(e.getAttribute(mr),1)}(e)||function({props:e}){const t=e&&e[mr];return"string"==typeof t&&vr(t,1)}(t)}(e,t)||hr(),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,ur(h),i),r&&(r.vnode.el=t.el,Wo(r,t.el)),d},g=(e,t="[",n="]")=>{let r=0;for(;e;)if((e=s(e))&&pr(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),un(),void(t._vnode=e);h(t.firstChild,e,null,null,null),un(),t._vnode=e},h]}var mr="data-allow-mismatch",gr={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function yr(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(mr);)e=e.parentElement;return vr(e&&e.getAttribute(mr),t)}function vr(e,t){if(null==e)return!1;if(""===e)return!0;{const n=e.split(",");return!(0!==t||!n.includes("children"))||n.includes(gr[t])}}var br=z().requestIdleCallback||(e=>
1setTimeout(e,1)),kr=z().cancelIdleCallback||(e=>clearTimeout(e)),wr=(e=1e4)=>t=>{const n=br(t,{timeout:e});return()=>kr(n)};var xr=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()},Sr=e=>t=>{if(e){const n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},Cr=(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 Mr=e=>!!e.type.__asyncLoader;function Tr(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 nr({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(pr(e)&&"["===e.data){let n=1,r=e.nextSibling;for(;r;){if(1===r.nodeType){if(!1===t(r))break}else if(pr(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=oi;if(or(e),c)return()=>Or(c,e);const t=t=>{d=null,Yt(t,e,13,!r)};if(l&&e.suspense||hi)return u().then(t=>()=>Or(t,e)).catch(e=>(t(e),()=>r?Hs(r,{error:e}):null));const s=At(!1),a=At(),h=At(!!o);let p,f;return Wr(()=>{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&&Er(e.parent.vnode)&&e.parent.update())}).catch(n=>{e.isUnmounted?d=null:(t(n),a.value=n)}),()=>s.value&&c?Or(c,e):a.value&&r?Hs(r,{error:a.value}):n&&!h.value?Or(n,e):void 0}})}function Or(e,t){const{ref:n,props:r,children:o,ce:s}=t.vnode,i=Hs(e,r,o);return i.ref=n,i.ce=s,delete t.vnode.ce,i}var Er=e=>e.type.__isKeepAlive,Ar={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=si(),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){Pr(e),d(e,n,l,!0)}function f(e){o.forEach((t,n)=>{const r=yi(Mr(t)?t.type.__asyncResolved||{}:t.type);r&&!e(r)&&m(n)})}function m(e){const t=o.get(e);!t||i&&Bs(t,i)?i&&Pr(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),is(()=>{s.isDeactivated=!1,s.a&&_(s.a);const t=e.props&&e.props.onVnodeMounted;t&&Zs(t,s.parent,e)},l)},r.deactivate=e=>{const t=e.component;ms(t.m),ms(t.a),c(e,u,null,1,l),is(()=>{t.da&&_(t.da);const n=e.props&&e.props.onVnodeUnmounted;n&&Zs(n,t.parent,e),t.isDeactivated=!0},l)},Tn(()=>[e.include,e.exclude],([e,t])=>{e&&f(t=>Nr(e,t)),t&&f(e=>!Nr(t,e))},{flush:"post",deep:!0});let g=null;const y=()=>{null!=g&&(ys(n.subTree.type)?is(()=>{o.set(g,Lr(n.subTree))},n.subTree.suspense):o.set(g,Lr(n.subTree)))};return Fr(y),Vr(y),Hr(()=>{o.forEach(e=>{const{subTree:t,suspense:r}=n,o=Lr(t);if(e.type===o.type&&e.key===o.key){Pr(o);const e=o.component.da;return void(e&&is(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(!(zs(r)&&(4&r.shapeFlag||128&r.shapeFlag)))return i=null,r;let l=Lr(r);if(l.type===Os)return i=null,l;const a=l.type,c=yi(Mr(l)?l.type.__asyncResolved||{}:a),{include:d,exclude:h,max:u}=e;if(d&&(!c||!Nr(d,c))||h&&c&&Nr(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=Us(l),128&r.shapeFlag&&(r.ssContent=l)),g=p,f?(l.el=f.el,l.component=f.component,l.transition&&er(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,ys(r.type)?r:l}}};function Nr(e,t){return u(e)?e.some(e=>Nr(e,t)):y(e)?e.split(",").includes(t):"[object RegExp]"===x(e)&&(e.lastIndex=0,e.test(t))}function Dr(e,t){Ir(e,"a",t)}function Rr(e,t){Ir(e,"da",t)}function Ir(e,t,n=oi){const r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if($r(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Er(e.parent.vnode)&&_r(r,t,n,e),e=e.parent}}function _r(e,t,n,r){const o=$r(t,e,r,!0);Wr(()=>{c(r[t],o)},n)}function Pr(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Lr(e){return 128&e.shapeFlag?e.ssContent:e}function $r(e,t,n=oi,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...r)=>{Se();const o=ii(n),s=Xt(t,n,e,r);return o(),Ce(),s});return r?o.unshift(s):o.push(s),s}}var zr=e=>(t,n=oi)=>{hi&&"sp"!==e||$r(e,(...e)=>t(...e),n)},Br=zr("bm"),Fr=zr("m"),jr=zr("bu"),Vr=zr("u"),Hr=zr("bum"),Wr=zr("um"),Ur=zr("sp"),qr=zr("rtg"),Kr=zr("rtc");function Jr(e,t=oi){$r("ec",e,t)}var Gr="components";function Qr(e,t){return Zr(Gr,e,!0,t)||e}var Xr=Symbol.for("v-ndc");function Yr(e){return y(e)?Zr(Gr,e,!1)||e:e||Xr}function Zr(e,t,n=!0,r=!1){const o=mn||oi;if(o){const n=o.type;if(e===Gr){const e=yi(n,!1);if(e&&(e===t||e===E(t)||e===D(E(t))))return n}const s=eo(o[e]||n[e],t)||eo(o.appContext[e],t);return!s&&r?n:s}}function eo(e,t){return e&&(e[t]||e[E(t)]||e[D(E(t))])}function to(e,t,n,r){let o;const s=n&&n[r],i=u(e);if(i||y(e)){let n=!1,r=!1;i&&kt(e)&&(n=!xt(e),r=wt(e),e=$e(e)),o=new Array(e.length);for(let i=0,l=e.length;i<l;i++)o[i]=t(n?r?Ot(Tt(e[i])):Tt(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 no(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 ro(e,t,n={},r,o,s){if(mn.ce||mn.parent&&Mr(mn.parent)&&mn.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),Ds(),$s(Ms,null,[Hs("slot",e,r&&r())],o?-2:64)}let i=e[t];i&&i._c&&(i._d=!1);const l=As.length;let c;Ds();try{const o=i&&oo(i(n)),l=n.key||s||o&&o.key;c=$s(Ms,{key:(l&&!v(l)?l:`_${t}`)+(!o&&r?"_fb":"")},o||(r?r():[]),o&&1===e._?64:-2)}catch(d){for(let e=As.length;e>l;e--)Rs();throw d}finally{i&&i._c&&(i._d=!0)}return!o&&c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),c}function oo(e){return e.some(e=>!zs(e)||e.type!==Os&&!(e.type===Ms&&!oo(e.children)))?e:null}function so(e,t){const n={};for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:R(r)]=e[r];return n}var io=e=>e?ai(e)?gi(e):io(e.parent):null,lo=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=>io(e.parent),$root:e=>io(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>wo(e),$forceUpdate:e=>e.f||(e.f=()=>{an(e.update)}),$nextTick:e=>e.n||(e.n=ln.bind(e.proxy)),$watch:e=>En.bind(e)}),ao=(e,t)=>e!==n&&!e.__isScriptSetup&&h(e,t),co={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(ao(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];yo&&(l[t]=0)}}const d=lo[t];let u,p;return d?("$attrs"===t&&_e(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 ao(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)||ao(t,a)||h(i,a)||h(o,a)||h(lo,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)}};function ho(){return po("useSlots").slots}function uo(){return po("useAttrs").attrs}function po(e){const t=si();return t.setupContext||(t.setupContext=mi(t))}function fo(e){return u(e)?e.reduce((e,t)=>
1(e[t]=null,e),{}):e}function mo(e,t){return e&&t?u(e)&&u(t)?e.concat(t):a({},fo(e),fo(t)):e||t}function go(e){const t=si(),n=hi;let r=e();li(),n&&ri(!1);const o=()=>{ii(t),n&&ri(!0)},s=()=>{si()!==t&&t.scope.off(),li(),n&&ri(!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 yo=!0;function vo(e){const t=wo(e),n=e.proxy,r=e.ctx;yo=!1,t.beforeCreate&&bo(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=Mo(e));for(const n in e){const r=e[n];let o;o=b(r)?"default"in r?xn(r.from||n,r.default,!0):xn(r.from||n):xn(r),Et(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=mt(t))}if(yo=!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=vi({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)ko(a[o],r,n,o);if(c){const e=g(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{wn(t,e[t])})}function P(e,t){u(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(h&&bo(h,e,"c"),P(Br,p),P(Fr,f),P(jr,m),P(Vr,y),P(Dr,v),P(Rr,k),P(Jr,E),P(Kr,T),P(qr,O),P(Hr,x),P(Wr,C),P(Ur,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&&or(e)}function bo(e,t,n){Xt(u(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ko(e,t,n,r){let o=r.includes(".")?An(n,r):()=>n[r];if(y(e)){const n=t[e];g(n)&&Tn(o,n)}else if(g(e))Tn(o,e.bind(n));else if(b(e))if(u(e))e.forEach(e=>ko(e,t,n,r));else{const r=g(e.handler)?e.handler.bind(n):t[e.handler];g(r)&&Tn(o,r,e)}}function wo(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=>xo(a,e,i,!0)),xo(a,t,i)):a=t,b(t)&&s.set(t,a),a}function xo(e,t,n,r=!1){const{mixins:o,extends:s}=t;s&&xo(e,s,n,!0),o&&o.forEach(t=>xo(e,t,n,!0));for(const i in t)if(r&&"expose"===i);else{const r=So[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var So={data:Co,props:Eo,emits:Eo,methods:Oo,computed:Oo,beforeCreate:To,created:To,beforeMount:To,mounted:To,beforeUpdate:To,updated:To,beforeDestroy:To,beforeUnmount:To,destroyed:To,unmounted:To,activated:To,deactivated:To,errorCaptured:To,serverPrefetch:To,components:Oo,directives:Oo,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]=To(e[r],t[r]);return n},provide:Co,inject:function(e,t){return Oo(Mo(e),Mo(t))}};function Co(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 Mo(e){if(u(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function To(e,t){return e?[...new Set([].concat(e,t))]:t}function Oo(e,t){return e?a(Object.create(null),e,t):t}function Eo(e,t){return e?u(e)&&u(t)?[...new Set([...e,...t])]:a(Object.create(null),fo(e),fo(null!=t?t:{})):t}function Ao(){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 No=0;function Do(e,t){return function(n,r=null){g(n)||(n=a({},n)),null==r||b(r)||(r=null);const o=Ao(),s=new WeakSet,i=[];let l=!1;const c=o.app={_uid:No++,_component:n,_props:r,_container:null,_context:o,_instance:null,version:wi,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||Hs(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,gi(d.component)}},onUnmount(e){i.push(e)},unmount(){l&&(Xt(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=Ro;Ro=c;try{return e()}finally{Ro=t}}};return c}}var Ro=null;function Io(e,t,r=n){const o=si(),s=E(t),i=N(t),l=_o(e,s),a=zt((l,a)=>{let c,d,h=n;return On(()=>{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 _o=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${E(t)}Modifiers`]||e[`${N(t)}Modifiers`];function Po(e,t,...r){if(e.isUnmounted)return;const o=e.vnode.props||n;let s=r;const i=t.startsWith("update:"),l=i&&_o(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&&Xt(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,Xt(d,e,6,s)}}var Lo=new WeakMap;function $o(e,t,n=!1){const r=n?Lo: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=$o(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 zo(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 Bo(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=yn(e);let v,b;try{if(4&n.shapeFlag){const e=o||r,t=e;v=Gs(d.call(t,e,h,u,f,p,m)),b=a}else{const e=t;v=Gs(e.length>1?e(u,{attrs:a,slots:i,emit:c}):e(u,null)),b=t.props?a:Fo(a)}}catch(w){As.length=0,Yt(w,e,1),v=Hs(Os)}let k=v;if(b&&!1!==g){const e=Object.keys(b),{shapeFlag:t}=k;e.length&&7&t&&(s&&e.some(l)&&(b=jo(b,s)),k=Us(k,b,!1,!0))}return n.dirs&&(k=Us(k,null,!1,!0),k.dirs=k.dirs?k.dirs.concat(n.dirs):n.dirs),n.transition&&er(k,n.transition),v=k,yn(y),v}var Fo=e=>{let t;for(const n in e)("class"===n||"style"===n||i(n))&&((t||(t={}))[n]=e[n]);return t},jo=(e,t)=>{const n={};for(const r in e)l(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function Vo(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(Ho(t,e,s)&&!zo(n,s))return!0}return!1}function Ho(e,t,n){const r=e[n],o=t[n];return"style"===n&&b(r)&&b(o)?!G(r,o):r!==o}function Wo({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 Uo={},qo=()=>Object.create(Uo),Ko=e=>Object.getPrototypeOf(e)===Uo;function Jo(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:zo(e.emitsOptions,n)||n in o&&c===o[n]||(o[n]=c,a=!0)}if(i){const t=Ct(r),o=l||n;for(let n=0;n<i.length;n++){const l=i[n];r[l]=Go(s,t,l,o[l],e,!h(o,l))}}return a}function Go(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=ii(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 Qo=new WeakMap;function Xo(e,t,o=!1){const s=o?Qo: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]=Xo(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]);Yo(e)&&(c[e]=n)}else if(l)for(const n in l){const e=E(n);if(Yo(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 Yo(e){return"$"!==e[0]&&!M(e)}var Zo=e=>"_"===e||"_ctx"===e||"$stable"===e,es=e=>u(e)?e.map(Gs):[Gs(e)],ts=(e,t,n)=>{if(t._n)return t;const r=vn((...e)=>es(t(...e)),n);return r._c=!1,r},ns=(e,t,n)=>{const r=e._ctx;for(const o in e){if(Zo(o))continue;const n=e[o];if(g(n))t[o]=ts(0,n,r);else if(null!=n){const e=es(n);t[o]=()=>e}}},rs=(e,t)=>{const n=es(t);e.slots.default=()=>n},ss=(e,t,n)=>{for(const r in t)!n&&Zo(r)||(e[r]=t[r])},is=Ss;function ls(e){return cs(e)}function as(e){return cs(e,fr)}function cs(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&&!Bs(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 Ts:b(e,t,n,r);break;case Os:w(e,t,n,r);break;case Es:null==e&&x(t,n,r,i);break;case Ms: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?ar(d,e&&e.ref,s,t||e,!t):null==d&&e&&null!=e.ref&&ar(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,ds(e,i),c,d),y&&kn(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)&&Zs(u,r,e)}y&&kn(e,null,r,"beforeMount");const v=us(o,g);v&&g.beforeEnter(h),s(h,t,n),((u=f&&f.onVnodeMounted)||v||y)&&is(()=>{try{u&&Zs(u,r,e),v&&g.enter(h),y&&kn(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||ys(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?Qs(e[c]):Gs(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&&hs(r,!1),(g=m.onVnodeBeforeUpdate)&&Zs(g,r,t,e),u&&kn(t,e,r,"beforeUpdate"),r&&hs(r,!0),!h||e.dynamicChildren&&e.dynamicChildren.length===
1h.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,ds(t,s),i):a||V(e,t,c,null,r,o,ds(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)&&is(()=>{g&&Zs(g,r,t,e),u&&kn(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===Ms||!Bs(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)&&ps(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)||ei,i={uid:ti++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new re(!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:Xo(o,s),emitsOptions:$o(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,sp:null};i.ctx={_:i},i.root=t?t.root:i,i.emit=Po.bind(null,i),e.ce&&e.ce(i);return i}(e,o,s);if(Er(e)&&(a.ctx.renderer=ee),function(e,t=!1,n=!1){t&&ri(t);const{props:r,children:o}=e.vnode,s=ai(e);(function(e,t,n,r=!1){const o={},s=qo();e.propsDefaults=Object.create(null),Jo(e,t,o,s);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=r?o:gt(o):e.type.props?e.props=o:e.props=s,e.attrs=s})(e,r,s,t),((e,t,n)=>{const r=e.slots=qo();if(32&e.vnode.shapeFlag){const e=t._;e?(ss(r,t,n),n&&P(r,"_",e,!0)):ns(t,r)}else t&&rs(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,co);const{setup:r}=n;if(r){Se();const n=e.setupContext=r.length>1?mi(e):null,o=ii(e),s=Qt(r,e,0,[e.props,n]),i=k(s);if(Ce(),o(),!i&&!e.sp||Mr(e)||or(e),i){if(s.then(li,li),t)return s.then(n=>{ui(e,n,t)}).catch(t=>{Yt(t,e,0)});e.asyncDep=s}else ui(e,s,t)}else pi(e,t)}(e,t):void 0;t&&ri(!1)}(a,!1,l),a.asyncDep){if(s&&s.registerDep(a,F,l),!e.el){const n=a.subTree=Hs(Os);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||Vo(r,i,c):!!i);if(1024&a)return!0;if(16&a)return r?Vo(r,i,c):!!i;if(8&a){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(Ho(i,r,n)&&!zo(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 de(()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:l,vnode:c}=e;{const n=fs(e);if(n)return t&&(t.el=c.el,j(e,t,i)),void n.asyncDep.then(()=>{is(()=>{e.isUnmounted||a()},o)})}let d,h=t;hs(e,!1),t?(t.el=c.el,j(e,t,i)):t=c,n&&_(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Zs(d,l,t,c),hs(e,!0);const u=Bo(e),p=e.subTree;
1e.subTree=u,v(p,u,f(p.el),X(p),e,o,s),t.el=u.el,null===h&&Wo(e,u.el),r&&is(r,o),(d=t.props&&t.props.onVnodeUpdated)&&is(()=>Zs(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=Mr(t);if(hs(e,!1),c&&_(c),!f&&(i=a&&a.onVnodeBeforeMount)&&Zs(i,h,t),hs(e,!0),l&&ne){const t=()=>{e.subTree=Bo(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=Bo(e);v(null,i,n,r,e,o,s),t.el=i.el}if(d&&is(d,o),!f&&(i=a&&a.onVnodeMounted)){const e=t;is(()=>Zs(i,h,e),o)}(256&t.shapeFlag||h&&Mr(h.vnode)&&256&h.vnode.shapeFlag)&&e.a&&is(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=()=>an(c),hs(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=Ct(o),[a]=e.propsOptions;let c=!1;if(!(r||i>0)||16&i){let r;Jo(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]=Go(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(zo(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]=Go(a,l,t,d,e,!1)}else d!==s[i]&&(s[i]=d,c=!0)}}c&&Pe(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:ss(s,t,r):(i=!t.$stable,ns(t,s)),l=t}else t&&(rs(e,t),l={default:1});if(i)for(const n in s)Zo(n)||null!=l[n]||delete s[n]})(e,t.children,r),Se(),hn(e),Ce()},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?Qs(t[p]):Gs(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?Qs(t[d]):Gs(t[d]);if(!Bs(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?Qs(t[p]):Gs(t[p]);if(!Bs(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?Qs(t[d]):Gs(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?Qs(t[d]):Gs(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]&&Bs(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||gs(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!==Ms)if(a!==Es)if(2!==r&&1&h&&c)if(0===r)c.persisted&&!l[Vn]?s(l,t,n):(c.beforeEnter(l),s(l,t,n),is(()=>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[Vn];l._isLeaving&&l[Vn](!0),c.persisted&&!e?d():r(l,()=>{d(),a&&a()})};o?o(l,d,h):h()}
1else 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&&(Se(),ar(l,null,n,e,!0),Ce()),null!=p&&(t.renderCache[p]=void 0),256&d)return void t.ctx.deactivate(e);const m=1&d&&u,g=!Mr(e);let y;if(g&&(y=i&&i.onVnodeBeforeUnmount)&&Zs(y,t,e),6&d)G(e.component,n,r);else{if(128&d)return void e.suspense.unmount(n,r);m&&kn(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,ee,r):c&&!c.hasOnce&&(s!==Ms||h>0&&64&h)?Q(c,t,n,!1,!0):(s===Ms&&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)&&is(()=>{y&&Zs(y,t,e),m&&kn(e,null,t,"unmounted"),v&&(e.el=null)},n)},K=e=>{const{type:t,el:n,anchor:r,transition:o}=e;if(t===Ms)return void J(n,r);if(t===Es)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;ms(a),ms(c),r&&_(r),o.stop(),s&&(s.flags|=8,q(i,e,t,n)),l&&is(l,t),is(()=>{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[Dn];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,hn(r),un(),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:Do(Z,te)}}function ds({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 hs({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function us(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ps(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]=Qs(o[s]),t.el=e.el),n||-2===t.patchFlag||ps(e,t)),t.type===Ts&&(-1===t.patchFlag&&(t=o[s]=Qs(t)),t.el=e.el),t.type!==Os||t.el||(t.el=e.el)}}function fs(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:fs(t)}function ms(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function gs(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?gs(t.subTree):null}var ys=e=>e.__isSuspense,vs=0,bs={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=ws(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?(ks(e,"onPending"),ks(e,"onFallback"),c(null,e.ssFallback,t,n,r,null,s,i),Cs(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,Bs(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),Cs(h,p)))):(h.pendingId=vs++,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),Cs(h,p))):f&&Bs(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&&Bs(f,u))a(f,u,n,r,o,h,s,i,l),Cs(h,u);else if(ks(t,"onPending"),h.pendingBranch=u,512&u.shapeFlag?h.pendingId=u.component.suspenseId:h.pendingId=vs++,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=ws(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=xs(r?n.default:n),e.ssFallback=r?xs(n.fallback):Hs(Os)}};function ks(e,t){const n=e.props&&e.props[t];g(n)&&n()}function ws(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:vs++,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),dn(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&&is(()=>r.ssFallback.el=null,w)),g||u(i,d,s,0)}w.isFallbackMountPending=!1,Cs(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||dn(a),w.effects=[],v&&t&&t.pendingBranch&&y===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),ks(r,"onResolve")},fallback(e){if(!w.pendingBranch)return;const{vnode:t,activeBranch:n,parentComponent:r,container:o,namespace:s}=w;ks(t,"onFallback");const i=f(n),c=()=>{w.isFallbackMountPending=!1,w.isInFallback&&(h(null,e,o,i,r,null,s,l,a),Cs(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=>{Yt(t,e,0)}).then(s=>{if(e.isUnmounted||w.isUnmounted||w.pendingId!==e.suspenseId)return;li(),e.asyncResolved=!0;const{vnode:l}=e;ui(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)),Wo(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 xs(e){let t;if(g(e)){const n=Is&&e._c;n&&(e._d=!1,Ds()),e=e(),n&&(e._d=!0,t=Ns,Rs())}return u(e)&&(e=function(e){let t;for(let n=0;n<e.length;n++){const r=e[n];if(!zs(r))return;if(r.type!==Os||"v-if"===r.children){if(t)return;t=r}}return t}(e)),e=Gs(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function Ss(e,t){t&&t.pendingBranch?u(e)?t.effects.push(...e):t.effects.push(e):dn(e)}function Cs(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,Wo(r,o))}var Ms=Symbol.for("v-fgt"),Ts=Symbol.for("v-txt"),Os=Symbol.for("v-cmt"),Es=Symbol.for("v-stc"),As=[],Ns=null;function Ds(e=!1){As.push(Ns=e?null:[])}function Rs(){As.pop(),Ns=As[As.length-1]||null}var Is=1;function _s(e,t=!1){Is+=e,e<0&&Ns&&t&&(Ns.hasOnce=!0)}function Ps(e){return e.dynamicChildren=Is>0?Ns||r:null,Rs(),Is>0&&Ns&&Ns.push(e),e}function Ls(e,t,n,r,o,s){return Ps(Vs(e,t,n,r,o,s,!0))}function $s(e,t,n,r,o){return Ps(Hs(e,t,n,r,o,!0))}function zs(e){return!!e&&!0===e.__v_isVNode}function Bs(e,t){return e.type===t.type&&e.key===t.key}var Fs=({key:e})=>null!=e?e:null,js=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?y(e)||Et(e)||g(e)?{i:mn,r:e,k:t,f:!!n}:e:null);function Vs(e,t=null,n=null,r=0,o=null,s=(e===Ms?0:1),i=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,t
1ype:e,props:t,key:t&&Fs(t),ref:t&&js(t),scopeId:gn,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:mn};return l?(Xs(a,n),128&s&&e.normalize(a)):n&&(a.shapeFlag|=y(n)?8:16),Is>0&&!i&&Ns&&(a.patchFlag>0||6&s)&&32!==a.patchFlag&&Ns.push(a),a}var Hs=function(e,t=null,n=null,r=0,o=null,s=!1){e&&e!==Xr||(e=Os);if(zs(e)){const r=Us(e,t,!0);return n&&Xs(r,n),Is>0&&!s&&Ns&&(6&r.shapeFlag?Ns[Ns.indexOf(e)]=r:Ns.push(r)),r.patchFlag=-2,r}i=e,g(i)&&"__vccOpts"in i&&(e=e.__vccOpts);var i;if(t){t=Ws(t);let{class:e,style:n}=t;e&&!y(e)&&(t.class=W(e)),b(n)&&(St(n)&&!u(n)&&(n=a({},n)),t.style=B(n))}const l=y(e)?1:ys(e)?128:Rn(e)?64:b(e)?4:g(e)?2:0;return Vs(e,t,n,r,o,l,s,!0)};function Ws(e){return e?St(e)||Ko(e)?a({},e):e:null}function Us(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:l,transition:a}=e,c=t?Ys(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Fs(c),ref:t&&t.ref?n&&s?u(s)?s.concat(js(t)):[s,js(t)]:js(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!==Ms?-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&&Us(e.ssContent),ssFallback:e.ssFallback&&Us(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&r&&er(d,a.clone(d)),d}function qs(e=" ",t=0){return Hs(Ts,null,e,t)}function Ks(e,t){const n=Hs(Es,null,e);return n.staticCount=t,n}function Js(e="",t=!1){return t?(Ds(),$s(Os,null,e)):Hs(Os,null,e)}function Gs(e){return null==e||"boolean"==typeof e?Hs(Os):u(e)?Hs(Ms,null,e.slice()):zs(e)?Qs(e):Hs(Ts,null,String(e))}function Qs(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Us(e)}function Xs(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),Xs(e,n()),n._c&&(n._d=!0)))}{n=32;const r=t._;r||Ko(t)?3===r&&mn&&(1===mn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=mn}}else if(g(t)){if(65&r)return void Xs(e,{default:t});t={default:t,_ctx:mn},n=32}else t=String(t),64&r?(n=16,t=[qs(t)]):n=8;e.children=t,e.shapeFlag|=n}function Ys(...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 Zs(e,t,n,r=null){Xt(e,t,7,[n,r])}var ei=Ao(),ti=0;var ni,ri,oi=null,si=()=>oi||mn;{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)}};ni=t("__VUE_INSTANCE_SETTERS__",e=>oi=e),ri=t("__VUE_SSR_SETTERS__",e=>hi=e)}var ii=e=>{const t=oi;return ni(e),e.scope.on(),()=>{e.scope.off(),ni(t)}},li=()=>{oi&&oi.scope.off(),ni(null)};function ai(e){return 4&e.vnode.shapeFlag}var ci,di,hi=!1;function ui(e,t,n){g(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:b(t)&&(e.setupState=Lt(t)),pi(e,n)}function pi(e,t,n){const r=e.type;if(!e.render){if(!t&&ci&&!r.render){const t=r.template||wo(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=ci(t,l)}}e.render=r.render||o,di&&di(e)}{const t=ii(e);Se();try{vo(e)}finally{Ce(),t()}}}var fi={get:(e,t)=>(_e(e,0,""),e[t])};function mi(e){return{attrs:new Proxy(e.attrs,fi),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function gi(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Lt(Mt(e.exposed)),{get:(t,n)=>n in t?t[n]:n in lo?lo[n](e):void 0,has:(e,t)=>t in e||t in lo})):e.proxy}function yi(e,t=!0){return g(e)?e.displayName||e.name:e.name||t&&e.__name}var vi=(e,t)=>function(e,t,n=!1){let r,o;return g(e)?r=e:(r=e.get,o=e.set),new Wt(r,o,n)}(e,0,hi);function bi(e,t,n){try{_s(-1);const r=arguments.length;return 2===r?b(t)&&!u(t)?zs(t)?Hs(e,null,[t]):Hs(e,t):Hs(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):3===r&&zs(n)&&(n=[n]),Hs(e,t,n))}finally{_s(1)}}function ki(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;Is>0&&Ns&&Ns.push(e);return!0}(o,e))return o;const s=t();return s.memo=e.slice(),s.cacheIndex=r,n[r]=s}var wi="3.5.40";function xi(e){this.content=e}function Si(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&&Ti(e.charCodeAt(r-1))&&Mi(e.charCodeAt(r))&&n--,n}if(o.content.size||s.content.size){let e=Si(o.content,s.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function Ci(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&&Ti(e.charCodeAt(o-1))&&Mi(e.charCodeAt(o))&&(n++,r++),{a:n,b:r}}if(i.content.size||l.content.size){let e=Ci(i.content,l.content,n-1,r-1);if(e)return e}n-=a,r-=a}else n-=a,r-=a}}function Mi(e){return e>=56320&&e<57344}function Ti(e){return e>=55296&&e<56320}xi.prototype={constructor:xi,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 xi(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 xi(n)},addToStart:function(e,t){return new xi([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new xi(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 xi(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=xi.from(e)).size?new xi(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=xi.from(e)).size?new xi(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=xi.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}},xi.from=function(e){if(e instanceof xi)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new xi(t)};var Oi=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 Si(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Ci(this,e,t,n)}findIndex(e){if(0==e)return Ai(0,e);if(e==this.size)return Ai(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?Ai(t+1,r):Ai(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)":""))}};Oi.empty=new Oi([],0);var Ei={index:0,offset:0};function Ai(e,t){return Ei.index=e,Ei.offset=t,Ei}function Ni(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(!Ni(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Ni(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Di=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&&Ni(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}};Di.none=[];var Ri=class extends Error{},Ii=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=Pi(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(_i(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(Oi.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 _i(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(_i(s.content,t-o-1,n-o-1)))}function Pi(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=Pi(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 Li(e,t,n){if(n.openStart>e.depth)throw new Ri("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Ri("Inconsistent open depths");return $i(e,t,n,0)}function $i(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=$i(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(Oi.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Vi(s,Hi(e,o,i,t,r))}{let r=e.parent,o=r.content;return Vi(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return Vi(s,Wi(e,t,r))}function zi(e,t){if(!t.type.compatibleContent(e.type))throw new Ri("Cannot join "+t.type.name+" onto "+e.type.n
1ame)}function Bi(e,t,n){let r=e.node(n);return zi(r,t.node(n)),r}function Fi(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 ji(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&&(Fi(e.nodeAfter,r),s++));for(let l=s;l<i;l++)Fi(o.child(l),r);t&&t.depth==n&&t.textOffset&&Fi(t.nodeBefore,r)}function Vi(e,t){if(!e.type.validContent(t))throw new Ri("Invalid content for node "+e.type.name);return e.copy(t)}function Hi(e,t,n,r,o){let s=e.depth>o&&Bi(e,t,o+1),i=r.depth>o&&Bi(n,r,o+1),l=[];return ji(null,e,o,l),s&&i&&t.index(o)==n.index(o)?(zi(s,i),Fi(Vi(s,Hi(e,t,n,r,o+1)),l)):(s&&Fi(Vi(s,Wi(e,t,o+1)),l),ji(t,n,o,l),i&&Fi(Vi(i,Wi(n,r,o+1)),l)),ji(r,null,o,l),new Oi(l)}function Wi(e,t,n){let r=[];return ji(null,e,n,r),e.depth>n&&Fi(Vi(Bi(e,t,n+1),Wi(e,t,n+1)),r),ji(t,null,n,r),new Oi(r)}Ii.empty=new Ii(Oi.empty,0,0);var Ui=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 Di.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 Gi(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=Ji.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 Ji.set(t,r=new qi);let o=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Ki,o}},qi=class{constructor(){this.elts=[],this.i=0}},Ki=12,Ji=new WeakMap,Gi=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)}},Qi=Object.create(null),Xi=class e{constructor(e,t,n,r=Di.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Oi.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&&Ni(this.attrs,t||e.defaultAttrs||Qi)&&Di.sameSet(this.marks,n||Di.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 Ii.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 Ii(l,r.depth-s,o.depth-s)}replace(e,t,n){return Li(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 Ui.resolveCached(this,e)}resolveNoCache(e){return Ui.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()+")"),Zi(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=Oi.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=Di.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(!Di.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=Oi.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,r,n);return o.type.checkAttrs(o.attrs),o}};Xi.prototype.text=void 0;var Yi=class e extends Xi{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):Zi(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 Zi(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var el=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new tl(t,n);if(null==r.next)return e.empty;let o=nl(r);r.next&&r.err("Unexpected trailing text");let s=cl(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 Oi.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")}};el.empty=new el(!0);var tl=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 nl(e){let t=[];do{t.push(rl(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function rl(e){let t=[];do{t.push(ol(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function ol(e){let t=function(e){if(e.eat("(")){let t=nl(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=il(e,t)}return t}function sl(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function il(e,t){let n=sl(e),r=n;return e.eat(",")&&(r="}"!=e.next?sl(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function ll(e,t){return t-e}function al(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(ll)}function cl(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]);
1al(e,n).forEach(e=>{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})})});let s=t[r.join(",")]=new el(r.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let r=o[e][1].sort(ll);s.next.push({type:o[e][0],next:t[r.join(",")]||n(r)})}return s}(al(e,0))}function dl(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 hl(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 ul(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 pl(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new ml(e,r,t[r]);return n}var fl=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=pl(e,n.attrs),this.defaultAttrs=dl(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==el.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:hl(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Xi(this,this.computeAttrs(e),Oi.from(t),Di.setFrom(n))}createChecked(e=null,t,n){return t=Oi.from(t),this.checkContent(t),new Xi(this,this.computeAttrs(e),t,Di.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=Oi.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(Oi.empty,!0);return o?new Xi(this,e,t.append(o),Di.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){ul(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:Di.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 ml=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}},gl=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=pl(e,r.attrs),this.excluded=null;let o=dl(this.attrs);this.instance=o?new Di(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Di(this,hl(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){ul(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},yl=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=xi.from(e.nodes),t.marks=xi.from(e.marks||{}),this.nodes=fl.compile(this.spec.nodes,this),this.marks=gl.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]=el.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?vl(this,o.split(" ")):""!=o&&e.inlineContent?null:[]}for(let r in this.marks){let e=this.marks[r],t=e.spec.excludes;
1e.excluded=null==t?[e]:""==t?[]:vl(this,t.split(" "))}this.nodeFromJSON=e=>Xi.fromJSON(this,e),this.markFromJSON=e=>Di.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 fl))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 Yi(n,n.defaultAttrs,e,Di.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 vl(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],s=e.marks[o],i=s;if(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 bl=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 Ml(this,t,!1);return n.addAll(e,Di.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Ml(this,t,!0);return n.addAll(e,Di.none,t.from,t.to),Ii.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(Tl(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=Ol(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=Ol(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)))}},kl={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},wl={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},xl={ol:!0,ul:!0};function Sl(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}var Cl=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=Di.none,this.match=o||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Oi.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=Oi.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Oi.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&&!kl.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Ml=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=Sl(null,t.preserveWhitespace,0)|(n?4:0);
1r=o?new Cl(o.type,o.attrs,Di.none,!0,t.topMatch||o.type.contentMatch,s):new Cl(n?null:e.schema.topNodeType,null,Di.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(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();xl.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&&xl.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:wl.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(kl.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=Di.none;for(let o of r.concat(e.marks))(t.type?t.type.allowsMarkType(o.type):El(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=Sl(e,o,s.options);4&s.options&&0==s.content.length&&(i|=4);let l=Di.none;return n=n.filter(t=>!(s.type?s.type.allowsMarkType(t.type):El(t.type,e))||(l=t.addToSet(l),!1)),this.nodes.push(new Cl(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 Tl(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Ol(e){let t={};for(let n in e)t[n]=e[n];return t}function El(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 Al=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Dl(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 Dl(t).createTextNode(e.text);let{dom:n,contentDOM:r}=_l(Dl(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&&_l(Dl(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return"string"==typeof t?{dom:e.createTextNode(t)}:_l(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=Nl(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Nl(e.marks)}};function Nl(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Dl(e){return e.document||window.document}var Rl=new WeakMap;function Il(e){let t=Rl.get(e);return void 0===t&&Rl.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 _l(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=Il(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}=_l(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 Pl=Math.pow(2,16);function Ll(e,t){return e+t*Pl}function $l(e){return 65535&e}var zl=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}},Bl=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=$l(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Pl}(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:Ll(i/3,e-l),h=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(h|=8),new zl(o,h,s)}r+=c-a}return n?e+r:new zl(e+r,0,null)}touches(e,t){let n=0,r=$l(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])}};Bl.empty=new Bl([]);var Fl=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 zl(e,r,null)}},jl=Object.create(null),Vl=class{getMap(){return Bl.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=jl[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 jl)throw new RangeError("Duplicate use of step JSON ID "+e);return jl[e]=t,t.prototype.jsonID=e,t}},Hl=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 Ri)return e.fail(s.message);throw s}}};function Wl(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let s=e.child(o);s.content.size&&(s=s.copy(Wl(s.content,t,s))),s.isInline&&(s=t(s,n,o)),r.push(s)}return Oi.fromArray(r)}var Ul=class e extends Vl{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 Ii(Wl(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 Hl.fromReplace(e,this.from,this.to,o)}invert(){return new ql(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))}};Vl.jsonID("addMark",Ul);var ql=class e extends Vl{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 Ii(Wl(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Hl.fromReplace(e,this.from,this.to,n)}invert(){return new Ul(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))}};Vl.jsonID("removeMark",ql);var Kl=class e extends Vl{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Hl.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Hl.fromReplace(e,this.pos,this.pos+1,new Ii(Oi.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 Jl(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))}};Vl.jsonID("addNodeMark",Kl);var Jl=class e extends Vl{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Hl.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Hl.fromReplace(e,this.pos,this.pos+1,new Ii(Oi.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Kl(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))}};Vl.jsonID("removeNodeMark",Jl);var Gl=class e extends Vl{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Xl(e,this.from,this.to)?Hl.fail("Structure replace would overwrite content"):Hl.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Bl([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?Ii.empty:new Ii(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?Ii.empty:new Ii(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,Ii.fromJSON(t,n.slice),!!n.structure)}};Gl.MAP_BIAS=1,Vl.jsonID("replace",Gl);var Ql=class e extends Vl{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&&(Xl(e,this.from,this.gapFrom)||Xl(e,this.gapTo,this.to)))return Hl.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Hl.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Hl.fromReplace(e,this.from,this.to,n):Hl.fail("Content does not fit in gap")}getMap(){return new Bl([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,Ii.fromJSON(t,n.slice),n.insert,!!n.structure)}};function Xl(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 Yl(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 ql(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 Ii(Oi.from(n.schema.text(" ",n.allowedMarks(t.marks))),0,0)),i.push(new Gl(l+e.index,l+e.index+e[0].length,r))}}else i.push(new Gl(l,c,Ii.empty));l=c}if(!r.validEnd){let t=r.fillBefore(Oi.empty,!0);e.replace(l,l,new Ii(t,0,0))}for(let a=i.length-1;a>=0;a--)e.step(i[a])}function Zl(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ea(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||!Zl(s,i,l))break;i&&(r=1),l<s.childCount&&(o=1)}return null}function ta(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(na).concat({type:t,attrs:n}).concat(s.map(na)):null}function na(e){return{type:e,attrs:null}}function ra(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 oa(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 sa(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 ia(e,t){let n=e.resolve(t),r=n.index();return la(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function la(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 aa(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&&la(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 ca(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 da(e,t,n=t,r=Ii.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),s=e.resolve(n);
vendor: 4,595 bytes, line 1
1return ha(o,s,r)?new Gl(t,n,r):new ua(o,s,r).fit()}function ha(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Vl.jsonID("replaceAround",Ql);var ua=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=Oi.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=Oi.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 Ii(o,s,i);return e>-1?new Ql(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new Gl(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=ma(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(Oi.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=ma(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new Ii(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=ma(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new Ii(pa(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new Ii(pa(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(ga(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=fa(this.placed,t,Oi.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?Ii.empty:new Ii(pa(s.content,e-1,1),e-1,u<0?s.openEnd:e-1):new Ii(pa(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||!ya(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=ya(e,t,r,n,o);if(s){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=ya(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=fa(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=fa(this.placed,this.depth,Oi.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Oi.empty,!0);e.childCount&&(this.placed=fa(this.placed,this.frontier.length,e))}};
1function pa(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(pa(e.firstChild.content,t-1,n)))}function fa(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(fa(e.lastChild.content,t-1,n)))}function ma(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function ga(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,ga(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(Oi.empty,!0)))),e.copy(r)}function ya(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 va(e){return e.spec.defining||e.spec.definingForContent}function ba(e,t,n,r,o){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(ba(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(Oi.empty,!0))}return e}function ka(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 wa=class e extends Vl{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 Hl.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 Hl.fromReplace(e,this.pos,this.pos+1,new Ii(Oi.from(r),0,t.isLeaf?0:1))}getMap(){return Bl.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)}};Vl.jsonID("attr",wa);var xa=class e extends Vl{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 Hl.ok(n)}getMap(){return Bl.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)}};Vl.jsonID("docAttr",xa);var Sa=Error;((Sa=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype)).constructor=Sa,Sa.prototype.name="TransformError";var Ca=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Fl}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Sa(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=Ii.empty){let r=da(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new Ii(Oi.from(n),0,0))}delete(e,t){return this.replace(e,t,Ii.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);
1if(ha(o,s,r))return e.step(new Gl(t,n,r));let i=ka(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;i.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=va(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 Ii(ba(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 Ii(Oi.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=ka(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=Oi.empty,h=0;for(let f=s,m=!1;f>n;f--)m||r.index(f)>0?(m=!0,d=Oi.from(r.node(f).copy(d)),h++):a--;let u=Oi.empty,p=0;for(let f=s,m=!1;f>n;f--)m||o.after(f+1)<o.end(f)?(m=!0,u=Oi.from(o.node(f).copy(u)),p++):c++;e.step(new Ql(a,c,i,l,new Ii(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);oa(e,r.node(),r.before(),l)}i.inlineContent&&Yl(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 Gl(c,a.map(t+n,-1),Ii.empty,!0)),!0===r){let t=e.doc.resolve(c);ra(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=Oi.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=Oi.from(n[i].type.create(n[i].attrs,r))}let o=t.start,s=t.end;e.step(new Ql(o,s,o,s,new Ii(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&&oa(e,t,n,s),Yl(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 Ql(a,c,a+1,c-1,new Ii(Oi.from(r.create(i,null,t.marks)),0,0),1,!0)),!0===o&&ra(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 Ql(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new Ii(Oi.from(i),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new wa(e,t,n)),this}setDocAttribute(e,t){return this.step(new xa(e,t)),this}addNodeMark(e,t){return this.step(new Kl(e,t)),this}
1removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof Di)t.isInSet(n.marks)&&this.step(new Jl(e,t));else{let r,o=n.marks,s=[];for(;r=t.isInSet(o);)s.push(new Jl(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=Oi.empty,i=Oi.empty;for(let l=o.depth,a=o.depth-n,c=n-1;l>a;l--,c--){s=Oi.from(o.node(l).copy(s));let e=r&&r[c];i=Oi.from(e?e.type.create(e.attrs,i):o.node(l).copy(i))}e.step(new Gl(t,t,new Ii(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 ql(c,h,d[e])));s&&s.to==c?s.to=h:l.push(s=new Ul(c,h,r))}}),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 gl){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 ql(t.from,t.to,t.style)))}(this,e,t,n),this}clearIncompatible(e,t,n){return Yl(this,e,t,n),this}},Ma=Object.create(null),Ta=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Oa(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=Ii.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?Ii.empty:t),0==i&&$a(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),$a(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Na(e):La(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?La(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):La(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 _a(e.node(0))}static atStart(e){return La(e,e,0,0,1)||new _a(e)}static atEnd(e){return La(e,e,e.content.size,e.childCount,-1)||new _a(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Ma[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 Ma)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ma[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Na.between(this.$anchor,this.$head).getBookmark()}};Ta.prototype.visible=!0;var Oa=class{constructor(e,t){this.$from=e,this.$to=t}},Ea=!1;function Aa(e){Ea||e.parent.inlineContent||(Ea=!0)}var Na=class e extends Ta{constructor(e,t=e){Aa(e),Aa(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 Ta.near(r);let o=t.resolve(n.map(this.anchor));return new e(o.parent.inlineContent?o:r,r)}replace(e,t=Ii.empty){if(super.replace(e,t),t==Ii.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 Da(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=Ta.findFrom(n,r,!0)||Ta.findFrom(n,-r,!0);if(!e)return Ta.near(n,r);n=e.$head}return t.parent.inlineContent||(0==o||(t=(Ta.findFrom(t,-r,!0)||Ta.findFrom(t,r,!0)).$anchor).pos<n.pos!=o<0)&&(t=n),new e(t,n)}};Ta.jsonID("text",Na);var Da=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 Na.between(e.resolve(this.anchor),e.resolve(this.head))}},Ra=class e extends Ta{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?Ta.near(s):new e(s)}content(){return new Ii(Oi.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 Ia(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}};Ra.prototype.visible=!1,Ta.jsonID("node",Ra);var Ia=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Da(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Ra.isSelectable(n)?new Ra(t):Ta.near(t)}},_a=class e extends Ta{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=Ii.empty){if(t==Ii.empty){e.delete(0,e.doc.content.size);let t=Ta.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 Pa}};Ta.jsonID("all",_a);var Pa={map(){return this},resolve:e=>new _a(e)};function La(e,t,n,r,o,s=!1){if(t.inlineContent)return Na.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&&Ra.isSelectable(r))return Ra.create(e,n-(o<0?r.nodeSize:0))}else{let t=La(e,r,n+o,o<0?r.childCount:0,o,s);if(t)return t}n+=r.nodeSize*o}return null}function $a(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,s=e.steps[r];(s instanceof Gl||s instanceof Ql)&&(e.mapping.maps[r].forEach((e,t,n,r)=>{null==o&&(o=r)}),e.setSelection(Ta.near(e.doc.resolve(o),n)))}var za=class extends Ca{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 Di.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)||Di.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(Ta.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 Ba(e,t){return t&&e?e.bind(t):e}var Fa=class{constructor(e,t,n){this.name=e,this.init=Ba(t.init,n),this.apply=Ba(t.apply,n)}},ja=[new Fa("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Fa("selection",{init:(e,t)=>
1e.selection||Ta.atStart(t.doc),apply:e=>e.selection}),new Fa("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new Fa("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})],Va=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ja.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 Fa(e.key,e.spec.state,e))})}},Ha=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 za(this)}static create(t){let n=new Va(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 Va(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 Va(t.schema,t.plugins),s=new e(o);return o.fields.forEach(e=>{if("doc"==e.name)s.doc=Xi.fromJSON(t.schema,n.doc);else if("selection"==e.name)s.selection=Ta.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 Wa(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=Wa(o,t,{})),n[r]=o}return n}var Ua=class{constructor(e){this.spec=e,this.props={},e.props&&Wa(e.props,this,this.props),this.key=e.key?e.key.key:Ka("plugin")}getState(e){return e[this.key]}},qa=Object.create(null);function Ka(e){return e in qa?e+"$"+ ++qa[e]:(qa[e]=0,e+"$")}var Ja=class{constructor(e="key"){this.key=Ka(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Ga=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Qa(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}var Xa=(e,t,n)=>{let r=Qa(e,n);if(!r)return!1;let o=tc(r);if(!o){let n=r.blockRange(),o=n&&ea(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let s=o.nodeBefore;if(pc(e,o,t,-1))return!0;
1if(0==r.parent.content.size&&(Za(s,"end")||Ra.isSelectable(s)))for(let i=r.depth;;i--){let n=da(e.doc,r.before(i),r.after(i),Ii.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Za(s,"end")?Ta.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):Ra.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 Ya(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=da(e.doc,o,i,Ii.empty);if(!l||l.from!=o||l instanceof Gl&&l.slice.size>=i-o)return!1;if(n){let t=e.tr.step(l);t.setSelection(Na.create(t.doc,o)),n(t.scrollIntoView())}return!0}function Za(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 ec=(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=tc(r)}let i=s&&s.nodeBefore;return!(!i||!Ra.isSelectable(i))&&(t&&t(e.tr.setSelection(Ra.create(e.doc,s.pos-i.nodeSize)).scrollIntoView()),!0)};function tc(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 nc(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}var rc=(e,t,n)=>{let r=nc(e,n);if(!r)return!1;let o=sc(r);if(!o)return!1;let s=o.nodeAfter;if(pc(e,o,t,1))return!0;if(0==r.parent.content.size&&(Za(s,"start")||Ra.isSelectable(s))){let n=da(e.doc,r.before(),r.after(),Ii.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Za(s,"start")?Ta.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Ra.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)},oc=(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=sc(r)}let i=s&&s.nodeAfter;return!(!i||!Ra.isSelectable(i))&&(t&&t(e.tr.setSelection(Ra.create(e.doc,s.pos)).scrollIntoView()),!0)};function sc(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 ic=(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 lc(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 ac=(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=lc(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(Ta.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0},cc=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof _a||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=lc(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(Na.create(i.doc,n+1)),t(i.scrollIntoView())}return!0},dc=(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(sa(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&ea(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};var hc,uc=(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof Ra&&e.selection.node.isBlock)return!(!n.parentOffset||!sa(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=lc(n.node(u-1).contentMatchAt(n.indexAfter(u-1)));let e=hc&&hc(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 Na||e.selection instanceof _a)&&c.deleteSelection();let d=c.mapping.map(n.pos),h=sa(c.doc,d,i.length,i);if(h||(i[0]=s?{type:s}:null,h=sa(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 pc(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&&!ia(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=Oi.empty;for(let e=o.length-1;e>=0;e--)s=Oi.from(o[e].create(null,s));s=Oi.from(i.copy(s));let a=e.tr.step(new Ql(t.pos-1,r,t.pos,r,new Ii(s,1,0),o.length,!0)),c=a.doc.resolve(r+2*o.length);c.nodeAfter&&c.nodeAfter.type==i.type&&ia(a.doc,c.pos)&&a.join(c.pos),n(a.scrollIntoView())}return!0}let d=l.type.spec.isolating||r>0&&a?null:Ta.findFrom(t,1),h=d&&d.$from.blockRange(d.$to),u=h&&ea(h);if(null!=u&&u>=t.depth)return n&&n(e.tr.lift(h,u).scrollIntoView()),!0;if(c&&Za(l,"start",!0)&&Za(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=Oi.empty;for(let e=o.length-1;e>=0;e--)r=Oi.from(o[e].copy(r));n(e.tr.step(new Ql(t.pos-o.length,t.pos+l.nodeSize,t.pos+a,t.pos+l.nodeSize-a,new Ii(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function fc(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(Na.create(t.doc,e<0?o.start(s):o.end(s)))),!0)}}var mc=fc(-1),gc=fc(1);function yc(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 vc(...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 bc=vc(Ga,Xa,ec),kc=vc(Ga,rc,oc),wc={Enter:vc(ic,cc,dc,uc),"Mod-Enter":ac,Backspace:bc,"Mod-Backspace":bc,"Shift-Backspace":bc,Delete:kc,"Mod-Delete":kc,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new _a(e.doc))),!0)},xc={"Ctrl-h":wc.Backspace,"Alt-Backspace":wc["Mod-Backspace"],"Ctrl-d":wc.Delete,"Ctrl-Alt-Backspace":wc["Mod-Delete"],"Alt-Delete":wc["Mod-Delete"],"Alt-d":wc["Mod-Delete"],"Ctrl-a":mc,"Ctrl-e":gc};for(let os in wc)xc[os]=wc[os];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();function Sc(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 Gi(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new Gi(t.$from,i.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let l=ta(s,n,r,t);if(!l)return!1;e&&function(e,t,n,r,o){let s=Oi.empty;for(let d=n.length-1;d>=0;d--)s=Oi.from(n[d].type.create(n[d].attrs,s));e.step(new Ql(t.start-(r?2:0),t.end,t.start,t.end,new Ii(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&&sa(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 Cc(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 Ql(s-1,i,s,i,new Ii(Oi.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Gi(o.doc.resolve(r.$from.pos),o.doc.resolve(i),r.depth));const l=ea(r);if(null==l)return!1;o.lift(r,l);let a=o.doc.resolve(o.mapping.map(s,-1)-1);ia(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?Oi.empty:Oi.from(o))))return!1;let h=s.pos,u=h+i.nodeSize;return r.step(new Ql(h-(l?1:0),u+(a?1:0),h+1,u-1,new Ii((l?Oi.empty:Oi.from(o.copy(Oi.empty))).append(a?Oi.empty:Oi.from(o.copy(Oi.empty))),l?0:1,a?0:1),l?0:1)),t(r.scrollIntoView()),!0}(t,n,s)))}}var Mc=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Tc=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},Oc=null,Ec=function(e,t,n){let r=Oc||(Oc=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Ac=function(e,t,n,r){return n&&(Dc(e,t,n,r,-1)||Dc(e,t,n,r,1))},Nc=/^(img|br|input|textarea|hr)$/i;function Dc(e,t,n,r,o){for(var s;;){if(e==n&&t==r)return!0;
1if(t==(o<0?0:Rc(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Ic(e)||Nc.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Mc(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?Rc(e):0}}}}function Rc(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Ic(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 _c=function(e){return e.focusNode&&Ac(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Pc(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}var Lc="undefined"!=typeof navigator?navigator:null,$c="undefined"!=typeof document?document:null,zc=Lc&&Lc.userAgent||"",Bc=/Edge\/(\d+)/.exec(zc),Fc=/MSIE \d/.exec(zc),jc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zc),Vc=!!(Fc||jc||Bc),Hc=Fc?document.documentMode:jc?+jc[1]:Bc?+Bc[1]:0,Wc=!Vc&&/gecko\/(\d+)/i.test(zc);Wc&&(/Firefox\/(\d+)/.exec(zc)||[0,0])[1];var Uc=!Vc&&/Chrome\/(\d+)/.exec(zc),qc=!!Uc,Kc=Uc?+Uc[1]:0,Jc=!Vc&&!!Lc&&/Apple Computer/.test(Lc.vendor),Gc=Jc&&(/Mobile\/\w+/.test(zc)||!!Lc&&Lc.maxTouchPoints>2),Qc=Gc||!!Lc&&/Mac/.test(Lc.platform),Xc=!!Lc&&/Win/.test(Lc.platform),Yc=/Android \d/.test(zc),Zc=!!$c&&"webkitFontSmoothing"in $c.documentElement.style,ed=Zc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function td(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 nd(e,t){return"number"==typeof e?e:e[t]}function rd(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 od(e,t,n){if(!ud(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=Tc(i);continue}
1let e=i,n=e==s.body,l=n?td(s):rd(e),a=0,c=0;if(t.top<l.top+nd(r,"top")?c=-(l.top-t.top+nd(o,"top")):t.bottom>l.bottom-nd(r,"bottom")&&(c=t.bottom-t.top>l.bottom-l.top?t.top+nd(o,"top")-l.top:t.bottom-l.bottom+nd(o,"bottom")),t.left<l.left+nd(r,"left")?a=-(l.left-t.left+nd(o,"left")):t.right>l.right-nd(r,"right")&&(a=t.right-l.right+nd(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:Tc(i)}}function sd(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Tc(r));return t}function id(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 ld=null;function ad(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=Ec(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=pd(o,1);if(r.top!=r.bottom&&cd(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}:ad(n,r)}function cd(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function dd(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(cd(t,o))return dd(n,t,o)}}if((s=(s+1)%r)==o)break}return e}function hd(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(Rc(r.offsetNode),r.offset)}}catch(r){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Rc(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(!cd(t,n))return null;if(l=dd(e.dom,t,n),!l)return null}if(Jc)for(let c=l;n&&c;c=Tc(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(Wc&&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;Zc&&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>
1r.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}=ad(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 ud(e){return e.top<e.bottom||e.left<e.right}function pd(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(ud(e))return e}return Array.prototype.find.call(n,ud)||e.getBoundingClientRect()}var fd=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function md(e,t,n){let{node:r,offset:o,atom:s}=e.docView.domFromPos(t,n<0?-1:1),i=Zc||Wc;if(3==r.nodeType){if(!i||!fd.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++,gd(pd(Ec(r,e,t),s),s<0)}{let e=pd(Ec(r,o,o),n);if(Wc&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=pd(Ec(r,o-1,o-1),-1);if(t.top==e.top){let n=pd(Ec(r,o,o+1),-1);if(n.top!=e.top)return gd(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(null==s&&o&&(n<0||o==Rc(r))){let e=r.childNodes[o-1];if(1==e.nodeType)return yd(e.getBoundingClientRect(),!1)}if(null==s&&o<Rc(r)){let e=r.childNodes[o];if(1==e.nodeType)return yd(e.getBoundingClientRect(),!0)}return yd(r.getBoundingClientRect(),n>=0)}if(null==s&&o&&(n<0||o==Rc(r))){let e=r.childNodes[o-1],t=3==e.nodeType?Ec(e,Rc(e)-(i?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return gd(pd(t,1),!1)}if(null==s&&o<Rc(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Ec(e,0,i?0:1):1==e.nodeType?e:null:null;if(t)return gd(pd(t,-1),!0)}return gd(pd(3==r.nodeType?Ec(r):r,-n),n>=0)}function gd(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 yd(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 vd(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 bd=/[\u0590-\u08ac]/;var kd=null,wd=null,xd=!1;function Sd(e,t,n){return kd==t&&wd==n?xd:(kd=t,wd=n,xd="up"==n||"down"==n?function(e,t,n){let r=t.selection,o="up"==n?r.$from:r.$to;return vd(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=md(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=Ec(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?bd.test(r.parent.textContent)&&l.modify?vd(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 Cd=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>Mc(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 Dd){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 Md&&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?Mc(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?Mc(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=Mc(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=Mc(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((Wc||Jc)&&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:Mc(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(Wc&&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&&Jc)&&Ac(i.node,i.offset,c.anchorNode,c.anchorOffset)&&Ac(l.node,l.offset,c.focusNode,c.focusOffset))return;let h=!1;if((a.extend||e==t)&&(!d||!Wc)){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}},Md=class extends Cd{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}},Td=class extends Cd{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}},Od=class e extends Cd{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=Al.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=Wd(s,n,i,r)),t>0&&(s=Wd(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()}},Ed=class e extends Cd{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=Al.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;
1return d=Bd(d,r,n),c?l=new Rd(t,n,r,o,d,h||null,u,c):n.isText?new Nd(t,n,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=()=>Oi.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)&&Fd(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 Vd(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(Hd);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?Di.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),Id(this.contentDOM,this.children,e),Gc&&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 Na)||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 Td(this,o,t,r);e.input.compositionNodes.push(s),this.children=Wd(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(Fd(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=$d(this.dom,this.nodeDOM,Ld(this.outerDeco,this.node,t),Ld(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 Ad(e,t,n,r,o){Bd(r,t,e);let s=new Ed(void 0,e,t,n,r,r,r);return s.contentDOM&&s.updateChildren(o,0),s}
1var Nd=class e extends Ed{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}},Dd=class extends Cd{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}},Rd=class extends Ed{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 Id(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=jd(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(l,r);if(i instanceof Od){let t=r?r.previousSibling:e.lastChild;Id(i.contentDOM,i.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=jd(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}var _d=function(e){e&&(this.nodeName=e)};_d.prototype=Object.create(null);var Pd=[new _d];function Ld(e,t,n){if(0==e.length)return Pd;let r=n?Pd[0]:new _d,o=[r];for(let s=0;s<e.length;s++){let i=e[s].type.attrs;if(i){i.nodeName&&o.push(r=new _d(i.nodeName));for(let e in i){let s=i[e];null!=s&&(n&&1==o.length&&o.push(r=new _d(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 $d(e,t,n,r){if(n==Pd&&r==Pd)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.nodeName),n.pmIsDeco=!0,n.appendChild(o),i=Pd[0]),o=n}zd(o,i||Pd[0],t)}return o}function zd(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 Bd(e,t,n){return $d(e,e,Pd,Ld(t,n,1!=e.nodeType))}function Fd(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}
1function jd(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Vd=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 Od)){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 Od&&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=Od.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 Ed){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&&Fd(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)||!Fd(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let i=Ed.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=Ed.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 Md(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 Od;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Nd)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Jc||qc)&&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 Dd(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 Hd(e,t){return e.type.side-t.type.side}function Wd(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 Ud(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(_c(n)){for(l=i;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&Ra.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==Rc(e);r||o;){if(e==n)return!0;let t=Mc(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==Rc(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;a=new Ra(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=eh(e,d,c,"pointer"==t||e.state.selection.head<c.pos&&!s?1:-1)}return a}function qd(e){return e.editable?e.hasFocus():nh(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Kd(e,t=!1){let n=e.state.selection;if(Yd(e,n),!qd(e))return;let r=e.input.mouseDown;if(!t&&qc&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Ac(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,Mc(n)+1):t.collapse(n,0);!r&&!e.state.selection.visible&&Vc&&Hc<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let r,o,{anchor:s,head:i}=n;!Jd||n instanceof Na||(n.$from.parent.inlineContent||(r=Gd(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=Gd(e,n.to))),e.docView.setSelection(s,i,e,t),Jd&&(r&&Xd(r),o&&Xd(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(()=>{qd(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var Jd=Jc||qc&&Kc<63;function Gd(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(Jc&&o&&"false"==o.contentEditable)return Qd(o);if(!(o&&"false"!=o.contentEditable||s&&"false"!=s.contentEditable)){if(o)return Qd(o);if(s)return Qd(s)}}function Qd(e){return e.contentEditable="true",Jc&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Xd(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Yd(e,t){if(t instanceof Ra){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Zd(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Zd(e)}function Zd(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function eh(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||Na.between(t,n,r)}function th(e){return!(e.editable&&!e.hasFocus())&&nh(e)}function nh(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.focu
1sNode.parentNode:t.focusNode))}catch(n){return!1}}function rh(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&&Ta.findFrom(s,t)}function oh(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function sh(e,t,n){let r=e.state.selection;if(!(r instanceof Na)){if(r instanceof Ra&&r.node.isInline)return oh(e,new Na(t>0?r.$to:r.$from));{let n=rh(e.state,t);return!!n&&oh(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 oh(e,new Na(r.$anchor,s))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=rh(e.state,t);return!!(n&&n instanceof Ra)&&oh(e,n)}if(!(Qc&&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)&&(Ra.isSelectable(s)?oh(e,new Ra(t<0?e.state.doc.resolve(o.pos-s.nodeSize):o)):!!Zc&&oh(e,new Na(e.state.doc.resolve(t<0?i:i+s.nodeSize))))}}function ih(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function lh(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function ah(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;Wc&&1==n.nodeType&&r<ih(n)&&lh(n.childNodes[r],-1)&&(i=!0);for(;;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(lh(e,-1))o=n,s=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(ch(n))break;{let t=n.previousSibling;for(;t&&lh(t,-1);)o=n.parentNode,s=Mc(t),t=t.previousSibling;if(t)n=t,r=ih(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}i?dh(e,n,r):o&&dh(e,o,s)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,s,i=ih(n);for(;;)if(r<i){if(1!=n.nodeType)break;if(!lh(n.childNodes[r],1))break;o=n,s=++r}else{if(ch(n))break;{let t=n.nextSibling;for(;t&&lh(t,1);)o=t.parentNode,s=Mc(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=ih(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&dh(e,o,s)}(e)}function ch(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function dh(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!Ic(e);)t=Mc(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(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&&!Ic(e);)t=Mc(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(_c(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&&Kd(e)},50)}function hh(e,t){let n=e.state.doc.resolve(t);if(!qc&&!Xc&&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 uh(e,t,n){let r=e.state.selection;if(r instanceof Na&&!r.empty||n.indexOf("s")>-1)return!1;if(Qc&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=rh(e.state,t);if(n&&n instanceof Ra)return oh(e,n)}if(!o.parent.inlineContent){let n=t<0?o:s,i=r instanceof _a?Ta.near(n,t):Ta.findFrom(n,t);return!!i&&oh(e,i)}return!1}function ph(e,t){if(!(e.state.selection instanceof Na))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 fh(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function mh(e,t){let n=t.keyCode,r=function(e){let t="";
1return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||Qc&&72==n&&"c"==r)return ph(e,-1)||ah(e,-1);if(46==n&&!t.shiftKey||Qc&&68==n&&"c"==r)return ph(e,1)||ah(e,1);if(13==n||27==n)return!0;if(37==n||Qc&&66==n&&"c"==r){let t=37==n?"ltr"==hh(e,e.state.selection.from)?-1:1:-1;return sh(e,t,r)||ah(e,t)}if(39==n||Qc&&70==n&&"c"==r){let t=39==n?"ltr"==hh(e,e.state.selection.from)?1:-1:1;return sh(e,t,r)||ah(e,t)}return 38==n||Qc&&80==n&&"c"==r?uh(e,-1,r)||ah(e,-1):40==n||Qc&&78==n&&"c"==r?function(e){if(!Jc||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;fh(e,n,"true"),setTimeout(()=>fh(e,n,"false"),20)}return!1}(e)||uh(e,1,r)||ah(e,1):r==(Qc?"m":"c")&&(66==n||73==n||89==n||90==n)}function gh(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")||Al.fromSchema(e.state.schema),l=Mh(),a=l.createElement("div");a.appendChild(i.serializeFragment(r,{document:l}));let c,d=a.firstChild,h=0;for(;d&&1==d.nodeType&&(c=Ch[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 yh(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 Ii(Oi.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=Al.fromSchema(r);s=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=Mh(),o=r.body,s=/<([a-z][^>\s]+)/i.exec(e);(n=s&&Ch[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;Th||(Th=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e}));return Th.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),Zc&&function(e){let t=e.querySelectorAll(qc?"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")||bl.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!(!a&&!d),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||vh.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=Oi.from(e.create(n[a+1],o)),s++,i++}return new Ii(o,s,i)}(Sh(i,+d[1],+d[2]),d[4]);else if(i=Ii.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;
1n>=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&&kh(n,r,e,s[s.length-1],0))s[s.length-1]=t;else{s.length&&(s[s.length-1]=wh(s[s.length-1],r.length));let t=bh(e,n);s.push(t),o=o.matchType(t.type),r=n}}),s)return Oi.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=Sh(i,e,t)}return e.someProp("transformPasted",t=>{i=t(i,e,a)}),i}var vh=/^(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 bh(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Oi.from(e));return e}function kh(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let s=kh(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(Oi.from(bh(n,e,o+1))))}}function wh(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,wh(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Oi.empty,!0);return e.copy(n.append(r))}function xh(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=xh(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(Oi.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,i.copy(l))}function Sh(e,t,n){return t<e.openStart&&(e=new Ii(xh(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Ii(xh(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Ch={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 Mh(){return document.implementation.createHTMLDocument("title")}var Th=null;var Oh={},Eh={},Ah={touchstart:!0,touchmove:!0},Nh=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 Dh(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Rh(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Ih(e,t))})}function Ih(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function _h(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Ph(e){return{left:e.clientX,top:e.clientY}}function Lh(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 $h(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 zh(e,t,n,r,o){return Lh(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 Ra&&(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(Ra.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}}
1return null!=r&&($h(e,Ra.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&&Ra.isSelectable(r))&&($h(e,new Ra(n),"pointer"),!0)}(e,n))}function Bh(e,t,n,r){return Lh(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}function Fh(e,t,n,r){return Lh(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=jh(e,t,!0),o=e.state.doc;if(!r)return!1;$h(e,r,"pointer"),r instanceof Na&&o.eq(e.state.doc)&&(e.input.mouseDown=new qh(e,r));return!0}(e,n,r)}function jh(e,t,n){let r=e.state.doc;if(-1==t)return r.inlineContent?Na.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 Na.create(r,t+1,t+1+e.content.size);if(n&&Ra.isSelectable(e))return Ra.create(r,t)}return null}function Vh(e){return Yh(e)}Eh.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Kh(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Yc||!qc||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Gc||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",t=>t(e,n))||mh(e,n)?n.preventDefault():Dh(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,Pc(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},Eh.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Eh.keypress=(e,t)=>{let n=t;if(Kh(e)||!n.charCode||n.ctrlKey&&!n.altKey||Qc&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof Na&&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 Hh=Qc?"metaKey":"ctrlKey";Oh.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Vh(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[Hh]&&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(Ph(n));i&&("singleClick"==s?e.input.mouseDown=new Uh(e,i,n,!!r):("doubleClick"==s?Bh:Fh)(e,i.pos,i.inside,n)?n.preventDefault():Dh(e,"pointer"))};var Wh=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}},Uh=class extends Wh{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[Hh],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;this.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 Ra&&a.from<=s&&a.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Wc||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()),Dh(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||Kd(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(Ph(e))),this.updateAllowDefault(e),this.allowDefault||!t?Dh(this.view,"pointer"):zh(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Jc&&this.mightDrag&&!this.mightDrag.node.isAtom||qc&&!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)?($h(this.view,Ta.near
1(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Dh(this.view,"pointer")}move(e){this.updateAllowDefault(e),Dh(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)}},qh=class extends Wh{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(),Dh(this.view,"pointer");let t=this.view.posAtCoords(Ph(e)),n=t&&jh(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];$h(this.view,Na.create(r,s,i),"pointer")}};function Kh(e,t){return!!e.composing||!!(Jc&&Math.abs(Date.now()-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Oh.touchstart=e=>{e.input.lastTouch=Date.now(),Vh(e),Dh(e,"pointer")},Oh.touchmove=e=>{e.input.lastTouch=Date.now(),Dh(e,"pointer")},Oh.contextmenu=e=>Vh(e);var Jh=Yc?5e3:-1;function Gh(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Yh(e),t))}function Qh(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Xh(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=Rc(e=e.childNodes[t-1])}else{if(!e.parentNode||Ic(e))return null;t=Mc(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||Ic(e))return null;t=Mc(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 Yh(e,t=!1){if(!(Yc&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Qh(e),t||e.docView&&e.docView.dirty){let n=Ud(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}}Eh.compositionstart=Eh.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Na&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||qc&&Xc&&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(),Yh(e,!0),e.markCursor=null;else if(Yh(e,!t.selection.empty),Wc&&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}Gh(e,Jh)},Eh.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++,Gh(e,20))};var Zh=Vc&&Hc<15||Gc&&ed<604;function eu(e,t,n,r,o){let s=yh(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,o,s||Ii.empty)))return!0;
1if(!s)return!1;let i=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(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 tu(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," "):""}Oh.copy=Eh.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let s=Zh?null:n.clipboardData,{dom:i,text:l}=gh(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"))},Eh.paste=(e,t)=>{let n=t;if(e.composing&&!Yc)return;let r=Zh?null:n.clipboardData,o=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&eu(e,tu(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?eu(e,r.value,null,o,t):eu(e,r.textContent,r.innerHTML,o,t)},50)}(e,n)};var nu=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},ru=Qc?"altKey":"ctrlKey";function ou(e,t){let n;return e.someProp("dragCopies",e=>{n=n||e(t)}),null!=n?!n:!t[ru]}Oh.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(Ph(n));if(i&&i.pos>=s.from&&i.pos<=(s instanceof Ra?s.to-1:s.to));else if(r&&r.mightDrag)o=Ra.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=Ra.create(e.state.doc,t.posBefore))}let{dom:l,text:a,slice:c}=gh(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!qc||Kc>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Zh?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Zh||n.dataTransfer.setData("text/plain",a),e.dragging=new nu(c,ou(e,n),o)},Oh.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Eh.dragover=Eh.dragenter=(e,t)=>t.preventDefault(),Eh.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Ph(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=yh(e,tu(t.dataTransfer),Zh?null:t.dataTransfer.getData("text/html"),!1,o);let i=!(!n||!ou(e,t));if(e.someProp("handleDrop",n=>n(e,t,s||Ii.empty,i)))return void t.preventDefault();if(!s)return;t.preventDefault();let l=s?ca(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&&Ra.isSelectable(s.content.firstChild)&&u.nodeAfter&&u.nodeAfter.sameMarkup(s.content.firstChild))a.setSelection(new Ra(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(eh(e,u,a.doc.resolve(t)))}e.focus(),e.dispatch(a.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},Oh.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())&&Kd(e)},20))},Oh.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)},Oh.beforeinput=(e,t)=>{if(qc&&Yc&&"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,Pc(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 Eh)Oh[os]=Eh[os];function su(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 iu=class e{constructor(e,t){this.toDOM=e,this.spec=t||hu,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 cu(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&&su(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},lu=class e{constructor(e,t){this.attrs=e,this.spec=t||hu}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 cu(o,s,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&su(this.attrs,t.attrs)&&su(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},au=class e{constructor(e,t){this.attrs=e,this.spec=t||hu}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 cu(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&&su(this.attrs,t.attrs)&&su(this.spec,t.spec)}destroy(){}},cu=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 iu(n,r))}static inline(t,n,r,o){return new e(t,n,new lu(r,o))}
1static node(t,n,r,o){return new e(t,n,new au(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof lu}get widget(){return this.type instanceof iu}},du=[],hu={},uu=class e{constructor(e,t){this.local=e.length?e:du,this.children=t.length?t:du}static create(e,t){return t.length?bu(t,e,0,hu):pu}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==pu||0==e.maps.length?this:this.mapInner(e,t,0,0,n||hu)}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?mu(this.children,i||[],t,n,r,o,s):i?new e(i.sort(ku),du):pu}add(t,n){return n.length?this==pu?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=yu(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,bu(i,e,l+1,hu)),s+=3}});let i=gu(s?vu(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(ku):this.local,o||this.children)}remove(e){return 0==e.length||this==pu?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!=pu?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):pu}forChild(t,n){if(this==pu)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 lu){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(ku),du);return r?new fu([t,r]):t}return r||pu}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 wu(this.localsInner(e))}localsInner(e){if(this==pu)return du;if(e.inlineContent||!this.local.some(lu.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof lu||t.push(this.local[n]);return t}forEachSet(e){e(this)}};uu.empty=new uu([],[]),uu.removeOverlap=wu;var pu=uu.empty,fu=class e{constructor(e){this.members=e}map(t,n){const r=this.members.map(e=>e.map(t,n,hu));return e.from(r)}forChild(t,n){if(n.isLeaf)return uu.empty;let r=[];for(let o=0;o<this.members.length;o++){let s=this.members[o].forChild(t,n);s!=pu&&(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?wu(n?t:t.sort(ku)):du}static from(t){switch(t.length){case 0:return pu;case 1:return t[0];default:return new e(t.every(e=>e instanceof uu)?t:t.reduce((e,t)=>
1e.concat(t instanceof uu?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function mu(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!=pu?(l[c]=d,l[c+1]=h,l[c+2]=r):(l[c+1]=-2,a=!0)}else a=!0}if(a){let a=bu(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 uu(t.sort(ku),l)}function gu(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 cu(o.from+t,o.to+t,o.type))}return n}function yu(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 vu(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function bu(e,t,n,r){let o=[],s=!1;t.forEach((t,i)=>{let l=yu(e,t,i+n);if(l){s=!0;let e=bu(l,t,n+i+1,r);e!=pu&&o.push(i,i+t.nodeSize,e)}});let i=gu(s?vu(e):e,-n).sort(ku);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 uu(i,o):pu}function ku(e,t){return e.from-t.from||e.to-t.to}function wu(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),xu(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),xu(t,o+1,s.copy(r.to,s.to)))}}return t}function xu(e,t,n){for(;t<e.length&&ku(n,e[t])>0;)t++;e.splice(t,0,n)}function Su(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=pu&&t.push(r)}),e.cursorWrapper&&t.push(uu.create(e.state.doc,[e.cursorWrapper.deco])),fu.from(t)}var Cu={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Mu=Vc&&Hc<=11,Tu=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}},Ou=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Tu,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]);Vc&&Hc<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Jc&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Mu&&(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,Cu)),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(th(this.view)){if(this.suppressingSelectionUpdates)return Kd(this.view);if(Vc&&Hc<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ac(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=Tc(o))n.add(o);for(let o=e.anchorNode;o;o=Tc(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)&&th(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||qc&&(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(Wc&&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&&Du(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&&_c(n)&&(a=Ud(e))&&a.eq(Ta.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Kd(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||r)&&(o>-1&&(e.docView.markDirty(o,s),function(e){if(Eu.has(e))return;if(Eu.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=Wc,Au)return;Au=!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)||Kd(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(Vc&&Hc<=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?Mc(r)+1:0,i=n.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?Mc(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})}},Eu=new WeakMap,Au=!1;function Nu(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,s=t.endOffset,i=e.domAtPos(e.state.selection.anchor);return Ac(i.node,i.offset,o,s)&&([n,r,o,s]=[o,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:s}}function Du(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 Ru(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Jc&&/^(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||Jc&&/^(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 Iu=/^(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 _u(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=Ud(e,t);
1if(n&&!e.state.selection.eq(n)){if(qc&&Yc&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,Pc(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}],_c(c)||r.push({node:c.focusNode,offset:c.focusOffset})),qc&&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")||bl.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:Ru,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++,(Gc&&e.input.lastIOSEnter>Date.now()-225||Yc)&&o.some(e=>1==e.nodeType&&!Iu.test(e.nodeName))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",t=>t(e,Pc(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&d instanceof Na&&!d.empty&&d.$head.sameParent(d.$anchor))||e.composing||h.sel&&h.sel.anchor!=h.sel.head){if(h.sel){let t=Pu(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 Na&&(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)),Vc&&Hc<=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((Gc&&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,Pc(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||Lu(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(Lu(s,!0,!0));return!(!i.parent.isTextblock||i.pos>n||Lu(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,Pc(8,"Backspace"))))return void(Yc&&qc&&e.domObserver.suppressSelectionUpdates());qc&&f.endB==f.start&&(e.input.lastChromeDelete=Date.now()),Yc&&!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,Pc(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=Pu(e,n.doc,h.sel);
1t&&!(qc&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==k||t.head==n.mapping.map(w)-1)||Vc&&t.empty&&t.head==k)&&n.setSelection(t)}return s&&n.setMeta("composition",s),n.scrollIntoView()};if(v)if(m.pos==g.pos){Vc&&Hc<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Kd(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(Oi.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 Pu(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:eh(e,t.resolve(n.anchor),t.resolve(n.head))}function Lu(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 $u=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 Nh,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Vu),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=Fu(this),Bu(this),this.nodeViews=ju(this),this.docView=Ad(this.state.doc,zu(this),Su(this),this.dom,this),this.domObserver=new Ou(this,(e,t,n,r)=>_u(this,e,t,n,r)),this.domObserver.start(),function(e){for(let t in Oh){let n=Oh[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!_h(e,t)||Ih(e,t)||!e.editable&&t.type in Eh||n(e,t)},Ah[t]?{passive:!0}:void 0)}Jc&&e.dom.addEventListener("input",()=>null),Rh(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&&Rh(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Vu),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&&(Qh(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=ju(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)&&Rh(this),this.editable=Fu(this),Bu(this);let l=Su(this),a=zu(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:sd(e.dom)}}(this);if(s){this.domObserver.stop();let t=d&&(Vc||qc)&&!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=qc?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Xh(this)),!o&&this.docView.update(e.doc,a,l,this)||(this.docView.updateOuterDeco(a),this.docView.destroy(),this.docView=Ad(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 Ac(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this)&&n.delaySelUpdate())?Kd(this,t):(Yd(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;id(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 Ra){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&od(this,t.getBoundingClientRect(),e)}else od(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 nu(e.slice,e.move,r<0?void 0:Ra.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(Vc){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(ld)return e.focus(ld);let t=sd(e);e.focus(null==ld?{get preventScroll(){return ld={preventScroll:!0},!0}}:void 0),ld||(ld=!1,id(t,0))}(this.dom),Kd(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 hd(this,e)}coordsAtPos(e,t=1){return md(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 Sd(this,t||this.state,e)}pasteHTML(e,t){return eu(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return eu(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return gh(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,[],Su(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Oc=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Ih(e,t)||!Oh[t.type]||!e.editable&&t.type in Eh||Oh[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?Jc&&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 Nu(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?Nu(e,n):null}
1(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function zu(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"),[cu.node(0,e.state.doc.content.size,t)]}function Bu(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:cu.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Fu(e){return!e.someProp("editable",t=>!1===t(e.state))}function ju(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 Vu(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")}$u.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var Hu={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:"'"},Wu={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Uu="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),qu="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ku=0;Ku<10;Ku++)Hu[48+Ku]=Hu[96+Ku]=String(Ku);for(Ku=1;Ku<=24;Ku++)Hu[Ku+111]="F"+Ku;for(Ku=65;Ku<=90;Ku++)Hu[Ku]=String.fromCharCode(Ku+32),Wu[Ku]=String.fromCharCode(Ku);for(var Ju in Hu)Wu.hasOwnProperty(Ju)||(Wu[Ju]=Hu[Ju]);var Gu="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Qu="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function Xu(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);Gu?o=!0:n=!0}}return t&&(i="Alt-"+i),n&&(i="Ctrl-"+i),o&&(i="Meta-"+i),r&&(i="Shift-"+i),i}function Yu(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 Zu(e){let t=function(e){let t=Object.create(null);for(let n in e)t[Xu(n)]=e[n];return t}(e);return function(e,n){let r,o=function(e){var t=!(Uu&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||qu&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Wu:Hu)[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[Yu(o,n)];if(s&&s(e.state,e.dispatch,e))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let r=t[Yu(o,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Qu&&n.ctrlKey&&n.altKey)&&(r=Hu[n.keyCode])&&r!=o){let o=t[Yu(r,n)];if(o&&o(e.state,e.dispatch,e))return!0}}return!1}}var ep=Object.defineProperty,tp=(e,t)=>{for(var n in t)ep(e,n,{get:t[n],enumerable:!0})};function np(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 rp=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:np({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}},op={};tp(op,{blur:()=>sp,clearContent:()=>ip,clearNodes:()=>lp,command:()=>ap,createParagraphNear:()=>cp,cut:()=>dp,deleteCurrentNode:()=>hp,deleteNode:()=>pp,deleteRange:()=>fp,deleteSelection:()=>gp,enter:()=>yp,exitCode:()=>vp,extendMarkRange:()=>Mp,first:()=>Tp,focus:()=>
1Rp,forEach:()=>Ip,insertContent:()=>_p,insertContentAt:()=>zp,joinBackward:()=>jp,joinDown:()=>Fp,joinForward:()=>Vp,joinItemBackward:()=>Hp,joinItemForward:()=>Wp,joinTextblockBackward:()=>Up,joinTextblockForward:()=>qp,joinUp:()=>Bp,keyboardShortcut:()=>Jp,lift:()=>Qp,liftEmptyBlock:()=>Xp,liftListItem:()=>Yp,newlineInCode:()=>Zp,resetAttributes:()=>nf,scrollIntoView:()=>rf,selectAll:()=>of,selectNodeBackward:()=>sf,selectNodeForward:()=>lf,selectParentNode:()=>af,selectTextblockEnd:()=>cf,selectTextblockStart:()=>df,setContent:()=>uf,setMark:()=>qf,setMeta:()=>Kf,setNode:()=>Jf,setNodeSelection:()=>Gf,setTextDirection:()=>Qf,setTextSelection:()=>Xf,sinkListItem:()=>Yf,splitBlock:()=>em,splitListItem:()=>tm,toggleList:()=>im,toggleMark:()=>lm,toggleNode:()=>am,toggleWrap:()=>cm,undoInputRule:()=>dm,unsetAllMarks:()=>hm,unsetMark:()=>um,unsetTextDirection:()=>pm,updateAttributes:()=>fm,wrapIn:()=>mm,wrapInList:()=>gm});var sp=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),ip=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),lp=()=>({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=ea(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)},ap=e=>t=>e(t),cp=()=>({state:e,dispatch:t})=>cc(e,t),dp=(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 Na(r.doc.resolve(Math.max(i-1,0)))),!0},hp=()=>({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 up(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 pp=e=>({tr:t,state:n,dispatch:r})=>{const o=up(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},fp=e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},mp=(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;const 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},gp=()=>({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:mp(l,c,"left"),to:mp(a,c,"right")});var l,a,c;n.deleteRange(s,i)}),n.scrollIntoView(),t(n)}return!0},yp=()=>({commands:e})=>e.keyboardShortcut("Enter"),vp=()=>({state:e,dispatch:t})=>ac(e,t);function bp(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function kp(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:bp(t[r])?t[r].test(e[r]):t[r]===e[r])}function wp(e,t,n={}){return e.find(e=>e.type===t&&kp(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function xp(e,t,n={}){return!!wp(e,t,n)}function Sp(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(!wp([...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&&xp([...e.parent.child(o-1).marks],t,n);)o-=1,s-=e.parent.child(o).nodeSize;
1for(;i<e.parent.childCount&&xp([...e.parent.child(i).marks],t,n);)l+=e.parent.child(i).nodeSize,i+=1;return{from:s,to:l}}function Cp(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 Mp=(e,t)=>({tr:n,state:r,dispatch:o})=>{const s=Cp(e,r.schema),{doc:i,selection:l}=n,{$from:a,from:c,to:d}=l;if(o){const e=Sp(a,s,t);if(e&&e.from<=c&&e.to>=d){const t=Na.create(i,e.from,e.to);n.setSelection(t)}}return!0},Tp=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 Op(e){return e instanceof Na}function Ep(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Ap(e,t=null){if(!t)return null;const n=Ta.atStart(e),r=Ta.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const o=n.from,s=r.to;return"all"===t?Na.create(e,Ep(0,o,s),Ep(e.content.size,o,s)):Na.create(e,Ep(t,o,s),Ep(t,o,s))}function Np(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function Dp(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Rp=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:s})=>{t={scrollIntoView:!0,...t};const i=()=>{(Dp()||Np())&&r.dom.focus(),"undefined"==typeof navigator||!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||Dp()||Np()||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&&!Op(n.state.selection))return i(),!0;const l=Ap(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},Ip=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),_p=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Pp=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&&Pp(r)}return e};function Lp(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 Pp(n)}function $p(e,t,n){if(e instanceof Xi||e instanceof Oi)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 Oi.fromArray(e.map(e=>t.nodeFromJSON(e)));const 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 $p("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,o="";const s=new yl({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?bl.fromSchema(s).parseSlice(Lp(e),n.parseOptions):bl.fromSchema(s).parse(Lp(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const r=bl.fromSchema(t);return n.slice?r.parseSlice(Lp(e),n.parseOptions).content:r.parse(Lp(e),n.parseOptions)}return $p("",t,n)}var zp=(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{$p(t,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(a){c(a)}try{o=$p(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;
1if((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 Oi){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 Gl||o instanceof Ql))return;const s=e.mapping.maps[r];let i=0;s.forEach((e,t,n,r)=>{0===i&&(i=r)}),e.setSelection(Ta.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},Bp=()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection,o=r instanceof Ra;if(o){if(r.node.isTextblock||!ia(e.doc,r.from))return!1;n=r.from}else if(n=aa(e.doc,r.from,-1),null==n)return!1;if(t){let r=e.tr.join(n);o&&r.setSelection(Ra.create(r.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(r.scrollIntoView())}return!0})(e,t),Fp=()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection;if(r instanceof Ra){if(r.node.isTextblock||!ia(e.doc,r.to))return!1;n=r.to}else if(n=aa(e.doc,r.to,1),null==n)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0})(e,t),jp=()=>({state:e,dispatch:t})=>Xa(e,t),Vp=()=>({state:e,dispatch:t})=>rc(e,t),Hp=()=>({state:e,dispatch:t,tr:n})=>{try{const r=aa(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Wp=()=>({state:e,dispatch:t,tr:n})=>{try{const r=aa(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Up=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=Qa(e,n);if(!r)return!1;let o=tc(r);return!!o&&Ya(e,o,t)})(e,t),qp=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=nc(e,n);if(!r)return!1;let o=sc(r);return!!o&&Ya(e,o,t)})(e,t);function Kp(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var Jp=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}`);Dp()||Kp()?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"===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 Gp(e,t,n={}){const{from:r,to:o,empty:s}=e.selection,i=t?up(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=>kp(e.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((e,t)=>e+t.to-t.from,0)>=a}var Qp=(e,t={})=>({state:n,dispatch:r})=>!!Gp(n,up(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),s=o&&ea(o);return null!=s&&(t&&t(e.tr.lift(o,s).scrollIntoView()),!0)})(n,r),Xp=()=>({state:e,dispatch:t})=>dc(e,t),Yp=e=>({state:t,dispatch:n})=>Cc(up(e,t.schema))(t,n),Zp=()=>({state:e,dispatch:t})=>ic(e,t);function ef(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function tf(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 nf=(e,t)=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const l=ef("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(s=up(e,r.schema)),"mark"===l&&(i=Cp(e,r.schema));let a=!1;
1return 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,tf(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(tf(s.attrs,t))))})})}),a},rf=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),of=()=>({tr:e,dispatch:t})=>{if(t){const t=new _a(e.doc);e.setSelection(t)}return!0},sf=()=>({state:e,dispatch:t})=>ec(e,t),lf=()=>({state:e,dispatch:t})=>oc(e,t),af=()=>({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(Ra.create(e.doc,n))),!0)})(e,t),cf=()=>({state:e,dispatch:t})=>gc(e,t),df=()=>({state:e,dispatch:t})=>mc(e,t);function hf(e,t,n={},r={}){return $p(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var uf=(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=hf(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 pf(e,t){const n=Cp(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 ff(e,t){const n=new Ca(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function mf(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 gf(e,t,n){return void 0===e.config[t]&&e.parent?gf(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?gf(e.parent,t,n):null}):e.config[t]}function yf(e){return e.map(e=>{const t=gf(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...yf(t())]:e}).flat(10)}function vf(e,t){const n=Al.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function bf(e){return"function"==typeof e}function kf(e,t=void 0,...n){return bf(e)?t?e.bind(t)(...n):e(...n):e}function wf(e){return{baseExtensions:e.filter(e=>"extension"===e.type),nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function xf(e){const t=[],{nodeExtensions:n,markExtensions:r}=wf(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];return e.forEach(e=>{const n=gf(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=gf(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 Sf(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 Cf(...e){return e.filter(e=>!!e).reduce((e,t)=>
1{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([...Sf(n[e]),...Sf(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t;else n[e]=t}),n},{})}function Mf(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)=>Cf(e,t),{})}function Tf(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 Of(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 Ef(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 Af(e){return e.sort((e,t)=>{const n=gf(e,"priority")||100,r=gf(t,"priority")||100;return n>r?-1:n<r?1:0})}function Nf(e){const t=Af(yf(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 Df(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 Rf(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function If(e,t){const n=ef("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=up(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?pf(e,t):{}}function _f(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 Pf(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}})})}),_f(r)}function Lf(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(t=>{const o=Sp(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 $f(e,t){return t.nodes[e]||t.marks[e]||null}function zf(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 Bf(e,t,n={}){const{empty:r,ranges:o}=e.selection,s=t?Cp(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!s||s.name===e.type.name).find(e=>kp(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=>kp(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>
1e+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 Ff(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function jf(e,t){const{nodeExtensions:n}=wf(t),r=n.find(t=>t.name===e);if(!r)return!1;const o=kf(gf(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function Vf(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&&(Vf(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}var Hf=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function Wf(e,t){const n=t.mapping.mapResult(e.position);return{position:new Hf(n.pos),mapResult:n}}function Uf(e){return new Hf(e)}var qf=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=n,{empty:i,ranges:l}=s,a=Cp(e,r.schema);if(o)if(i){const e=pf(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(Op(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)},Kf=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Jf=(e,t={})=>({state:n,dispatch:r,chain:o})=>{const s=up(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})=>!!yc(s,{...i,...t})(n)||e.clearNodes()).command(({state:e})=>yc(s,{...i,...t})(e,r)).run()},Gf=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=Ep(e,0,n.content.size),o=Ra.create(n,r);t.setSelection(o)}return!0},Qf=(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},Xf=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,s=Na.atStart(n).from,i=Na.atEnd(n).to,l=Ep(r,s,i),a=Ep(o,s,i),c=Na.create(n,l,a);t.setSelection(c)}return!0},Yf=e=>({state:t,dispatch:n})=>{return(r=up(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=Oi.from(n?r.create():null),i=new Ii(Oi.from(r.create(null,Oi.from(l.type.create(null,o)))),n?3:1,0),c=s.start,d=s.end;t(e.tr.step(new Ql(c-(n?3:1),d,c,d,i,1,!0)).scrollIntoView())}return!0})(t,n);var r};function Zf(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}var em=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:i}=t,{$from:l,$to:a}=s,c=zf(o.extensionManager.attributes,l.node().type.name,l.node().attrs);if(s instanceof Ra&&s.node.isBlock)return!(!l.parentOffset||!sa(i,l.pos))&&(r&&(e&&Zf(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=sa(t.doc,t.mapping.map(l.pos),1,u);if(u||p||!sa(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 Na&&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);
1l.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&t.setNodeMarkup(t.mapping.map(l.before()),h)}e&&Zf(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return p},tm=(e,t={})=>({tr:n,state:r,dispatch:o,editor:s})=>{var i;const l=up(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=Oi.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=Oi.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={...zf(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(Oi.from(l.createAndFill(null,c)||void 0));const d=a.before(a.depth-(r-1));n.replace(d,a.after(-o),new Ii(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(Na.near(n.doc.resolve(h))),n.scrollIntoView()}return!0}const p=c.pos===a.end()?h.contentMatchAt(0).defaultType:null,f={...zf(u,h.type.name,h.attrs),...t},m={...zf(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(!sa(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 nm(e){return e&&"1"!==e?e:null}function rm(e,t){return nm(e)===nm(t)}var om=(e,t)=>{const n=mf(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)||!ia(e.doc,n.pos)||(!rm(n.node.attrs.type,null==o?void 0:o.attrs.type)||(e.join(n.pos),!0))},sm=(e,t)=>{const n=mf(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)||!ia(e.doc,r)||(!rm(n.node.attrs.type,null==o?void 0:o.attrs.type)||(e.join(r),!0))};var im=(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=up(e,i.schema),f=up(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=mf(e=>jf(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&&jf(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 Na.between(r,o)}(e);return!!n&&(e.setSelection(n),t&&t(e),!0)}).liftListItem(f).run():c.liftListItem(f);if(jf(T.node.type.name,h)&&p.validContent(T.node.content))return a().command(()=>(s.setNodeMarkup(T.pos,p),!0)).command(()=>om(s,p)).command(()=>sm(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(()=>om(s,p)).command(()=>sm(s,p)).run():a().command(()=>!!d().wrapInList(p,r)||c.clearNodes()).wrapInList(p,r).command(()=>om(s,p)).command(()=>sm(s,p)).run()},lm=(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:s=!1}=n,i=Cp(e,r.schema);return Bf(r,i,t)?o.unsetMark(i,{extendEmptyMarkRange:s}):o.setMark(i,t)},am=(e,t,n={})=>({state:r,commands:o})=>{const s=up(e,r.schema),i=up(t,r.schema),l=Gp(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})},cm=(e,t={})=>({state:n,commands:r})=>{const o=up(e,n.schema);return Gp(n,o,t)?r.lift(o):r.wrapIn(o,t)},dm=()=>({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;
1for(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},hm=(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},um=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var s;const{extendEmptyMarkRange:i=!1}=t,{selection:l}=n,a=Cp(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=Sp(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},pm=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},fm=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const l=ef("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(s=up(e,r.schema)),"mark"===l&&(i=Cp(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},mm=(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&&ta(i,e,t);return!!l&&(r&&r(n.tr.wrap(i,l).scrollIntoView()),!0)}}(up(e,n.schema),t)(n,r),gm=(e,t={})=>({state:n,dispatch:r})=>Sc(up(e,n.schema),t)(n,r),ym=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 vm(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function bm(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-]+)/);s&&(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=>
1{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function km(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 wm(e){const{nodeName:t,name:n,parseAttributes:r=bm,serializeAttributes:o=km,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 xm(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=bm,serializeAttributes:s=km,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 Sm(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 Cm(e){return Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}="${t}"`).join(" ")}function Mm(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=Sm,serializeAttributes:s=Cm,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 Tm(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 Om(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 Em(e,t){const n={...e};return vm(e)&&vm(t)&&Object.keys(t).forEach(r=>{vm(t[r])&&vm(e[r])?n[r]=Em(e[r],t[r]):n[r]=t[r]}),n}tp({},{createAtomBlockMarkdownSpec:()=>wm,createBlockMarkdownSpec:()=>xm,createInlineMarkdownSpec:()=>Mm,parseAttributes:()=>bm,parseIndentedBlocks:()=>Tm,renderNestedMarkdownContent:()=>Om,serializeAttributes:()=>km});var Am=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}};function Nm(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(bp(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=np({state:a.state,transaction:i}),u={from:r-(t[0].length-s.length),to:o},{commands:p,chain:f,can:m}=new rp({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 Dm=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{...kf(gf(this,"addOptions",{name:this.name}))}}get storage(){return{...kf(gf(this,"addStorage",{name:this.name,options:this.options}))}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Em(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}},Rm=class e extends Dm{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)}},Im=class{constructor(e){this.find=e.find,this.handler=e.handler}};function _m(e){const{editor:t,state:n,from:r,to:o,rule:s,pasteEvent:i,dropEvent:l}=e,{commands:a,chain:c,can:d}=new rp({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(bp(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 Pm=null;function Lm(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=np({state:e,transaction:a});if(_m({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 Ua({view(e){const n=n=>{var r;o=(null==(r=e.dom.parentElement)?void 0:r.contains(n.target))?e.dom.parentElement:null,o&&(Pm=t)},r=()=>{Pm&&(Pm=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=Pm;(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=vf(Oi.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 $m=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=Nf(e),this.schema=function(e,t){var n;const r=xf(e),{nodeExtensions:o,markExtensions:s}=wf(e);return new yl({topNode:null==(n=o.find(e=>gf(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=Of({...e.reduce((e,t)=>{const r=gf(t,"extendNodeSchema",s);return{...e,...r?r(n):{}}},{}),content:kf(gf(n,"content",s)),marks:kf(gf(n,"marks",s)),group:kf(gf(n,"group",s)),inline:kf(gf(n,"inline",s)),atom:kf(gf(n,"atom",s)),selectable:kf(gf(n,"selectable",s)),draggable:kf(gf(n,"draggable",s)),code:kf(gf(n,"code",s)),whitespace:kf(gf(n,"whitespace",s)),linebreakReplacement:kf(gf(n,"linebreakReplacement",s)),defining:kf(gf(n,"defining",s)),isolating:kf(gf(n,"isolating",s)),attrs:Object.fromEntries(o.map(Ef))}),l=kf(gf(n,"parseHTML",s));l&&(i.parseDOM=l.map(e=>Tf(e,o)));const a=gf(n,"renderHTML",s);a&&(i.toDOM=e=>a({node:e,HTMLAttributes:Mf(e,o)}));const c=gf(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=Of({...e.reduce((e,t)=>{const r=gf(t,"extendMarkSchema",s);return{...e,...r?r(n):{}}},{}),inclusive:kf(gf(n,"inclusive",s)),excludes:kf(gf(n,"excludes",s)),group:kf(gf(n,"group",s)),spanning:kf(gf(n,"spanning",s)),code:kf(gf(n,"code",s)),attrs:Object.fromEntries(o.map(Ef))}),l=kf(gf(n,"parseHTML",s));l&&(i.parseDOM=l.map(e=>Tf(e,o)));const a=gf(n,"renderHTML",s);return a&&(i.toDOM=e=>a({mark:e,HTMLAttributes:Mf(e,o)})),[n.name,i]}))})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n=gf(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:$f(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){const{editor:e}=this;return Af([...this.extensions].reverse()).flatMap(t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:$f(t.name,this.schema)},r=[],o=gf(t,"addKeyboardShortcuts",n);let s={};if("mark"===t.type&&gf(t,"exitable",n)&&(s.ArrowRight=()=>Rm.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 Ua({props:{handleKeyDown:Zu(s)}});r.push(i);const l=gf(t,"addInputRules",n);if(Ff(t,e.options.enableInputRules)&&l){const t=l();if(t&&t.length){const n=function(e){const{editor:t,rules:n}=e,r=new Ua({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=vf(Oi.from(e),s.schema));const{from:o}=l,i=o+e.length;Nm({editor:t,from:o,to:i,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput:(e,o,s,i)=>Nm({editor:t,from:o,to:s,text:i,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>
1{const{$cursor:o}=e.state.selection;o&&Nm({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&&Nm({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=gf(t,"addPasteRules",n);if(Ff(t,e.options.enablePasteRules)&&a){const t=a();if(t&&t.length){const n=Lm({editor:e,rules:t});r.push(...n)}}const c=gf(t,"addProseMirrorPlugins",n);if(c){const e=c();r.push(...e)}return r})}get attributes(){return xf(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=wf(this.extensions);return Object.fromEntries(t.filter(e=>!!gf(e,"addNodeView")).map(t=>{const n=this.attributes.filter(e=>e.type===t.name),r=gf(t,"addNodeView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:up(t.name,this.schema)});if(!r)return[];const o=r();if(!o)return[];return[t.name,(r,s,i,l,a)=>{const c=Mf(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 Af([...this.extensions].reverse()).reduceRight((e,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:$f(n.name,this.schema)},o=gf(n,"dispatchTransaction",r);return o?t=>{o.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){const{editor:t}=this;return Af([...this.extensions]).reduce((e,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:$f(n.name,this.schema)},o=gf(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}=wf(this.extensions);return Object.fromEntries(t.filter(e=>!!gf(e,"addMarkView")).map(t=>{const n=this.attributes.filter(e=>e.type===t.name),r=gf(t,"addMarkView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Cp(t.name,this.schema)});if(!r)return[];return[t.name,(o,s,i)=>{const l=Mf(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:$f(e.name,this.schema)};"mark"===e.type&&((null==(t=kf(gf(e,"keepOnSplit",r)))||t)&&this.splittableMarks.push(e.name),null==(n=kf(gf(e,"clearable",r)))||n||this.nonClearableMarks.push(e.name));const o=gf(e,"onBeforeCreate",r),s=gf(e,"onCreate",r),i=gf(e,"onUpdate",r),l=gf(e,"onSelectionUpdate",r),a=gf(e,"onTransaction",r),c=gf(e,"onFocus",r),d=gf(e,"onBlur",r),h=gf(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)})}};$m.resolve=Nf,$m.sort=Af,$m.flatten=yf;tp({},{ClipboardTextSerializer:()=>Bm,Commands:()=>Fm,Delete:()=>jm,Drop:()=>Vm,Editable:()=>Hm,FocusEvents:()=>Um,Keymap:()=>qm,Paste:()=>Km,Tabindex:()=>Jm,TextDirection:()=>Gm,focusEventsPluginKey:()=>Wm});var zm=class e extends Dm{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,Bm=zm.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new Ua({key:new Ja("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,s=Rf(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})=>Df(r,{from:e.pos,to:t.pos},l)).join(null!=i?i:"\n\n")}}})]}}),Fm=zm.create({name:"commands",addCommands:()=>({...op})}),jm=zm.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=ff(e.before,[e,...t]);Pf(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 ql){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()}}),Vm=zm.create({name:"drop",addProseMirrorPlugins(){return[new Ua({key:new Ja("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Hm=zm.create({name:"editable",addProseMirrorPlugins(){return[new Ua({key:new Ja("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Wm=new Ja("focusEvents"),Um=zm.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Ua({key:Wm,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}}}})]}}),qm=zm.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:Ta.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 Dp()||Kp()?o:r},addProseMirrorPlugins(){return[new Ua({key:new Ja("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=Ta.atStart(t.doc).from,c=Ta.atEnd(t.doc).to;
1if(s||i!==a||l!==c)return;if(!Vf(n.doc))return;const d=n.tr,h=np({state:n,transaction:d}),{commands:u}=new rp({editor:this.editor,state:h});return u.clearNodes(),d.steps.length?d:void 0}})]}}),Km=zm.create({name:"paste",addProseMirrorPlugins(){return[new Ua({key:new Ja("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),Jm=zm.create({name:"tabindex",addOptions:()=>({value:void 0}),addProseMirrorPlugins(){return[new Ua({key:new Ja("tabindex"),props:{attributes:()=>{var e;return this.editor.isEditable||void 0!==this.options.value?{tabindex:null!=(e=this.options.value)?e:"0"}:{}}}})]}}),Gm=zm.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=wf(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 Ua({key:new Ja("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),Qm=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)}},Xm=class extends ym{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:Wf,createMappablePosition:Uf},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=Ap(t,this.options.autofocus);this.editorState=Ha.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=bf(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?[Hm,Bm.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),Fm,Um,qm,Jm.configure({value:null==(r=null==(n=this.options.coreExtensionOptions)?void 0:n.tabindex)?void 0:r.value}),Vm,Km,jm,Gm.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 $m(o,this)}createCommandManager(){this.commandManager=new rp({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=hf(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=hf(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 $u(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 If(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 Gp(e,null,n)||Bf(e,null,n);const r=ef(t,e.schema);return"node"===r?Gp(e,t,n):"mark"===r&&Bf(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return vf(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return Df(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...Rf(this.schema),...n}})}get isEmpty(){return Vf(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 Qm(t,this,!1,n)}get $doc(){return this.$pos(0)}};function Ym(e){return new Am({find:e.find,handler:({state:t,range:n,match:r})=>{const o=kf(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(Lf(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 Zm(e){return new Am({find:e.find,handler:({state:t,range:n,match:r,chain:o})=>{const s=kf(e.getAttributes,void 0,r)||{},i=t.tr.delete(n.from,n.to),l=i.doc.resolve(n.from).blockRange(),a=l&&ta(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&&ia(i.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&i.join(n.from-1)},undoable:e.undoable})}var eg=class e extends Dm{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 tg(e){return new Im({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{const s=kf(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(Lf(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 ng=(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]},rg=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,og=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,sg=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,ig=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,lg=Rm.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 ng("strong",{...Cf(this.options.HTMLAttributes,e),children:ng("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[Ym({find:rg,type:this.type}),Ym({find:sg,type:this.type})]},addPasteRules(){return[tg({find:og,type:this.type}),tg({find:ig,type:this.type})]}}),ag=lg,cg=Object.defineProperty,dg="textStyle",hg=/^\s*([-+*])\s$/,ug=eg.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",Cf(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(dg)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Zm({find:hg,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Zm({find:hg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(dg),editor:this.editor})),[e]}}),pg=(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,Oi.from(c)),d.setSelection(s.map(d.doc,d.mapping)),t&&t(d),!0})(e.state,e.view.dispatch,t,n),fg=(e,t)=>zm.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const n=()=>pg(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),mg=[[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"]],gg="abcdefghijklmnopqrstuvwxyz",yg=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function vg(e){let t=e,n="";for(const[r,o]of mg)for(;t>=r;)n+=o,t-=r;return n}function bg(e){return vg(e).toUpperCase()}function kg(e){const t=e.toLowerCase();let n=0,r=0;for(;n<t.length;){let e=!1;for(const[o,s]of mg)if(t.startsWith(s,n)){r+=o,n+=s.length,e=!0;break}if(!e)return 0}return r}function wg(e){if(e<=26)return gg[e-1];const t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?gg[n]:gg[t]+gg[n]}function xg(e){if(e&&!/^\d+$/.test(e))return function(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;const t=kg(e);return!(t<=0)&&(e===e.toLowerCase()?vg(t):bg(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 Sg(e){if(/^\d+$/.test(e))return parseInt(e,10);const t=xg(e);
1if("i"===t||"I"===t)return kg(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 Cg(e,t){if("numeric"===e)return String(t);switch(e){case"a":return wg(t);case"A":return wg(t).toUpperCase();case"i":return vg(t);case"I":return bg(t);default:return String(t)}}function Mg(e){const{type:t,start:n}=function(e){return{type:xg(e),start:Sg(e)}}(e),r={};return t&&(r.type=t),1!==n&&(r.start=n),r}function Tg(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:"text",raw:e,text:e}])}var Og=eg.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Cf(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:Tg(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)=>Om(e,t,e=>{var t,n,r,o;if("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`${wg(r)}${n}`;case"A":return`${wg(r).toUpperCase()}${n}`;case"i":return`${vg(r)}${n}`;case"I":return`${bg(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[fg(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)cg(e,n,{get:t[n],enumerable:!0})})({},{findListItemPos:()=>Eg,getNextListDepth:()=>Ag,handleBackspace:()=>Dg,handleDelete:()=>_g,hasListBefore:()=>Ng,hasListItemAfter:()=>Pg,hasListItemBefore:()=>Lg,listItemHasSubList:()=>$g,nextListIsDeeper:()=>Rg,nextListIsHigher:()=>Ig});var Eg=(e,t)=>{const{$from:n}=t.selection,r=up(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}},Ag=(e,t)=>{const n=Eg(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},Ng=(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))},Dg=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Gp(e.state,t)&&Ng(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!!Gp(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())},Rg=(e,t)=>
1{const n=Ag(e,t),r=Eg(e,t);return!(!r||!n)&&n>r.depth},Ig=(e,t)=>{const n=Ag(e,t),r=Eg(e,t);return!(!r||!n)&&n<r.depth},_g=(e,t)=>{if(!Gp(e.state,t))return!1;if(!((e,t)=>{const{$from:n,$to:r,$anchor:o}=e.selection;if(t){const n=mf(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))&&(Rg(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Ig(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},Pg=(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},Lg=(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},$g=(e,t,n)=>{if(!n)return!1;const r=up(e,t.schema);let o=!1;return n.descendants(e=>{e.type===r&&(o=!0)}),o},zg=zm.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]&&_g(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]&&_g(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]&&Dg(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&Dg(e,n,r)&&(t=!0)}),t}}}}),Bg=new RegExp(`^(\\s*)(${yg})([.)])\\s+(.*)$`),Fg=/^\s/,jg={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function Vg(e){const t=e.trimStart();return jg.bulletItem.test(t)||function(e){return Bg.test(e.trimStart())}(t)||jg.heading.test(t)||jg.thematicBreak.test(t)&&!t.startsWith("-")||/^>\s?/.test(t)||jg.codeFence.test(t)}function Hg(e){return Object.values(jg).some(t=>t.test(e))}function Wg(e){const t=[],n=[];let r=!1;return e.forEach(e=>{if(!r)return""===e.trim()||t.length>0&&Vg(e)?(r=!0,void n.push(e)):void t.push(e);n.push(e)}),{paragraphLines:t,blockLines:n}}var Ug=new RegExp(`^(${yg})([.)])\\s+(.+)$`);function qg(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(Ug);
1if(!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=xg(e[0]))?t:"numeric",r=Sg(e[0]);if(r<1)return!1;for(let o=0;o<e.length;o++){const t=Cg(n,r+o);if(e[o]!==t)return!1}return!0}(n.map(e=>e.marker))?{type:"orderedList",attrs:Mg(n[0].marker),content:n.map(e=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:e.content}]}]}))}:null}function Kg(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}=Wg(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=Kg(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 Jg="textStyle",Gg=/^(\d+)\.\s$/;function Qg(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 Xg=eg.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=Qg(n);if(e)return e}const r=e.querySelector("li");if(r){const e=r.getAttribute("style");if(e){const t=Qg(e);if(t)return t}}return null}}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,type:n,...r}=e,o=Cf(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(Bg);if(!s)break;const[,i,l,a,c]=s,d=i.length,h=parseInt(l,10),u=isNaN(h)?xg(l):void 0,p=isNaN(h)?Sg(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(Bg))break;if(""===t.trim())g.push(t),f.push(""),y=!0,m+=1;else if(t.match(Fg)){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||Hg(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=Kg(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(Jg)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}}
1,addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins:()=>[new Ua({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=qg(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=Zm({find:Gg,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Zm({find:Gg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Jg)}),joinPredicate:e,editor:this.editor})),[t]}}),Yg=/^\s*(\[([( |x])?\])\s$/,Zg=eg.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",Cf(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 Om(e,t,`- [${(null==(n=e.attrs)?void 0:n.checked)?"x":" "}] `)},addExtensions(){return this.options.nested?[fg(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=Mf(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[Zm({find:Yg,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),ey=eg.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",Cf(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=Tm(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=Tm(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()}}}),ty=(zm.create({name:"listKit",addExtensions(){const e=[];return!1!==this.options.bulletList&&e.push(ug.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(Og.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(zg.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(Xg.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(Zg.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(ey.configure(this.options.taskList)),e}}),ug);function ny(e={}){return new Ua({view:t=>new ry(t,e)})}var ry=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=ca(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)}},oy=class e extends Ta{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):Ta.near(r)}content(){return Ii.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 sy(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||iy(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||iy(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&&!Ra.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}}};oy.prototype.visible=!1,oy.findFrom=oy.findGapCursorFrom,Ta.jsonID("gapcursor",oy);var sy=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 oy.valid(t)?new oy(t):Ta.near(t)}};function iy(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}var ly=Zu({ArrowLeft:ay("horiz",-1),ArrowRight:ay("horiz",1),ArrowUp:ay("vert",-1),ArrowDown:ay("vert",1)});function ay(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 Na){if(!o.endOfTextblock(n)||0==i.depth)return!1;l=!1,i=e.doc.resolve(t>0?i.after():i.before())}let a=oy.findGapCursorFrom(i,t,l);return!!a&&(r&&r(e.tr.setSelection(new oy(a))),!0)}}function cy(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!oy.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&Ra.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new oy(r))),!0)}function dy(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof oy))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=Oi.empty;for(let i=r.length-1;i>=0;i--)o=Oi.from(r[i].createAndFill(null,o));let s=e.state.tr.replace(n.pos,n.pos,new Ii(o,0,0));return s.setSelection(Na.near(s.doc.resolve(n.pos+1))),e.dispatch(s),!1}function hy(e){if(!(e.selection instanceof oy))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",uu.create(e.doc,[cu.widget(e.selection.head,t,{key:"gapcursor"})])}var uy=200,py=function(){};py.prototype.append=function(e){return e.length?(e=py.from(e),!this.length&&e||e.length<uy&&this.leafAppend(e)||this.length<uy&&e.leafPrepend(this)||this.appendInner(e)):this},py.prototype.prepend=function(e){return e.length?py.from(e).append(this):this},py.prototype.appendInner=function(e){return new my(this,e)},py.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?py.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},py.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},py.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)},py.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},py.from=function(e){return e instanceof py?e:e&&e.length?new fy(e):py.empty};var fy=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<=uy)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=uy)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}(py);py.empty=new fy([]);var my=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}
1(py),gy=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=[];return 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 yy(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 yy(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 yy(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>by&&(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 Fl;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 yy(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 yy(o,i,c))}else r.push(new yy(o))},o);let c=[];for(let e=n;e<i;e++)c.push(new yy(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 yy(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(py.from(o.reverse()),s)}};gy.empty=new gy(py.empty,0);var yy=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)}}},vy=class{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}},by=20;function ky(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 wy(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 xy=!1,Sy=null;function Cy(e){let t=e.plugins;if(Sy!=t){xy=!1,Sy=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){xy=!0;break}}return xy}var My=new Ja("history"),Ty=new Ja("closeHistory");function Oy(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Ua({key:My,state:{init:()=>new vy(gy.empty,gy.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,s=n.getMeta(My);if(s)return s.historyState;n.getMeta(Ty)&&(e=new vy(e.done,e.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(i&&i.getMeta(My))return i.getMeta(My).redo?new vy(e.done.addTransform(n,void 0,r,Cy(t)),e.undone,ky(n.mapping.maps),e.prevTime,e.prevComposition):new vy(e.done,e.undone.addTransform(n,void 0,r,Cy(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||i&&!1===i.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new vy(e.done.rebased(n,o),e.undone.rebased(n,o),wy(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new vy(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),wy(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;
1return 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?wy(e.prevRanges,n.mapping):ky(n.mapping.maps);return new vy(e.done.addTransform(n,s?t.selection.getBookmark():void 0,r,Cy(t)),gy.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?Ay:"historyRedo"==n?Ny:null;return!(!r||!e.editable)&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Ey(e,t){return(n,r)=>{let o=My.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let s=function(e,t,n){let r=Cy(t),o=My.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 vy(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(i).setMeta(My,{redo:n,historyState:a})}(o,n,e);s&&r(t?s.scrollIntoView():s)}return!0}}var Ay=Ey(!1,!0),Ny=Ey(!0,!0),Dy=(Ey(!1,!1),Ey(!0,!1),zm.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 Ua({key:new Ja("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)}})]}})),Ry=(zm.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[ny(this.options)]}}),zm.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new Ua({key:new Ja("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=t,s=[];if(!n||!r)return uu.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(cu.node(t,t+e.nodeSize,{class:this.options.className}))))),uu.create(e,s)}}})]}}),zm.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Ua({props:{decorations:hy,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&oy.valid(n)?new oy(n):null,handleClick:cy,handleKeyDown:ly,handleDOMEvents:{beforeinput
1:dy}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!=(t=kf(gf(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))?t:null}}}),"placeholder"),Iy=new Ja("tiptap__placeholder");function _y(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),cu.node(o,o+s.nodeSize,{class:d.join(" "),[r]:"function"==typeof n?n({editor:t,node:s,pos:o,hasAnchor:l}):n})}function Py(e,t){return"function"==typeof e?e(t):e}function Ly({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&&Vf(r);return r.type.isTextblock?(!s&&t.showOnlyCurrent||!i||a.push(_y({editor:e,isEmptyDoc:c,dataAttribute:n,hasAnchor:s,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:Py(t.emptyNodeClass,{editor:e,node:r,pos:o,hasAnchor:s})},node:r,pos:o})),t.includeChildren):t.includeChildren}),a}function $y({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&&Vf(a)){const r=s>=c&&s<=c+a.nodeSize;i.push(_y({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:Py(t.emptyNodeClass,{editor:e,node:a,pos:c,hasAnchor:r})},node:a,pos:c}))}}else i.push(...Ly({editor:e,options:t,dataAttribute:n,doc:r,selection:o,from:0,to:r.content.size}));return uu.create(r,i)}function zy(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 By(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function Fy(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(By(e,zy(e,t.from))),t.to>t.from?n.push(By(e,zy(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(By(e,zy(e,Math.min(t.from+1,e.content.size)))),n}function jy(e,t,n){const r=[];if(e.docChanged){const t=Pf(e);for(const e of t)r.push(...Fy(n.doc,e.newRange))}return e.selectionSet&&(r.push(By(n.doc,zy(n.doc,e.mapping.map(t.selection.anchor)))),r.push(By(n.doc,zy(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 Vy(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 Hy({editor:e,options:t,dataAttribute:n}){return{init(r,o){const s=$y({editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection});return null!=s?s:uu.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}=Vy(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=Ly({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:jy(r,s,i),editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection}):o}}function Wy({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-${Ry}`;var r;const o=t.showOnlyCurrent&&!t.includeChildren;return new Ua({key:Iy,...o?{}:{state:Hy({editor:e,options:t,dataAttribute:n})},props:{decorations:o?({doc:r,selection:o})=>$y({editor:e,options:t,dataAttribute:n,doc:r,selection:o}):n=>{var r;return t.showOnlyWhenEditable&&!e.isEditable?uu.empty:null!=(r=Iy.getState(n))?r:uu.empty}}})}zm.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:Ry,placeholder:"Write something â¦",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[Wy({editor:this.editor,options:this.options})]}});function Uy(e,t){return!e.selection.empty&&!(e.selection instanceof Ra)&&t.isEditable}zm.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:e,options:t}=this;
1return[new Ua({key:new Ja("selection"),props:{decorations:n=>function(e,t){return Uy(e,t)&&!t.isFocused&&!t.view.dragging}(n,e)?uu.create(n.doc,[cu.inline(n.selection.from,n.selection.to,{class:t.className})]):null,handleDOMEvents:{blur(t){return!!Uy(t.state,e)&&(null==(n=window.getSelection())||n.removeAllRanges(),!1);var n},focus:t=>!!Uy(t.state,e)&&(requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&function(e){e.focus()}(t)}),!1)}}})]}});function qy({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}zm.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;const t=new Ja(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 Ua({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)=>!qy({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>{if(!e.docChanged)return t;if(e.getMeta("__uniqueIDTransaction"))return t;return!qy({node:e.doc.lastChild,types:r})}}})]}});var Ky=zm.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Ay(e,t),redo:()=>({state:e,dispatch:t})=>Ny(e,t)}),addProseMirrorPlugins(){return[Oy(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()}}}),Jy=Dy,Gy=eg.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),Qy=Gy,Xy=eg.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]}`,Cf(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 Am({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),s=kf(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})}}),Yy=Xy,Zy=Ky,ev=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,tv=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,nv=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,rv=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,ov=Rm.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",Cf(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[Ym({find:ev,type:this.type}),Ym({find:nv,type:this.type})]},addPasteRules(){return[tg({find:tv,type:this.type}),tg({find:rv,type:this.type})]}}),sv=ov,iv="numeric",lv="ascii",av="alpha",cv="asciinumeric",dv="alphanumeric",hv="domain",uv="emoji",pv="scheme",fv="slashscheme",mv="whitespace";function gv(e,t){return e in t||(t[e]=[]),t[e]}function yv(e,t,n){t[iv]&&(t[cv]=!0,t[dv]=!0),t[lv]&&(t[cv]=!0,t[av]=!0),t[cv]&&(t[dv]=!0),t[av]&&(t[dv]=!0),t[dv]&&(t[hv]=!0),t[uv]&&(t[hv]=!0);for(const r in t){const t=gv(r,n);t.indexOf(e)<0&&t.push(e)}}function vv(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}vv.groups={},vv.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||vv.groups,t&&t.j?o=t:(o=new vv(t),n&&r&&yv(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||vv.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 vv,Object.assign(i.j,l.j),i.jr.push.apply(i.jr,l.jr),i.jd=l.jd,i.t=l.t):i=new vv,s&&(r&&(i.t&&"string"==typeof i.t?yv(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&&yv(s,n,r)),i.t=s),o.j[e]=i,i}};var bv=(e,t,n,r,o)=>e.ta(t,n,r,o),kv=(e,t,n,r,o)=>e.tr(t,n,r,o),wv=(e,t,n,r,o)=>e.ts(t,n,r,o),xv=(e,t,n,r,o)=>e.tt(t,n,r,o),Sv="WORD",Cv="UWORD",Mv="ASCIINUMERICAL",Tv="ALPHANUMERICAL",Ov="LOCALHOST",Ev="TLD",Av="UTLD",Nv="SCHEME",Dv="SLASH_SCHEME",Rv="NUM",Iv="WS",_v="NL",Pv="OPENBRACE",Lv="CLOSEBRACE",$v="OPENBRACKET",zv="CLOSEBRACKET",Bv="OPENPAREN",Fv="CLOSEPAREN",jv="OPENANGLEBRACKET",Vv="CLOSEANGLEBRACKET",Hv="FULLWIDTHLEFTPAREN",Wv="FULLWIDTHRIGHTPAREN",Uv="LEFTCORNERBRACKET",qv="RIGHTCORNERBRACKET",Kv="LEFTWHITECORNERBRACKET",Jv="RIGHTWHITECORNERBRACKET",Gv="FULLWIDTHLESSTHAN",Qv="FULLWIDTHGREATERTHAN",Xv="AMPERSAND",Yv="APOSTROPHE",Zv="ASTERISK",eb="AT",tb="BACKSLASH",nb="BACKTICK",rb="CARET",ob="COLON",sb="COMMA",ib="DOLLAR",lb="DOT",ab="EQUALS",cb="EXCLAMATION",db="HYPHEN",hb="PERCENT",ub="PIPE",pb="PLUS",fb="POUND",mb="QUERY",gb="QUOTE",yb="FULLWIDTHMIDDLEDOT",vb="SEMI",bb="SLASH",kb="TILDE",wb="UNDERSCORE",xb="EMOJI",Sb="SYM",Cb=Object.freeze({__proto__:null,ALPHANUMERICAL:Tv,AMPERSAND:Xv,APOSTROPHE:Yv,ASCIINUMERICAL:Mv,ASTERISK:Zv,AT:eb,BACKSLASH:tb,BACKTICK:nb,CARET:rb,CLOSEANGLEBRACKET:Vv,CLOSEBRACE:Lv,CLOSEBRACKET:zv,CLOSEPAREN:Fv,COLON:ob,COMMA:sb,DOLLAR:ib,DOT:lb,EMOJI:xb,EQUALS:ab,EXCLAMATION:cb,FULLWIDTHGREATERTHAN:Qv,FULLWIDTHLEFTPAREN:Hv,FULLWIDTHLESSTHAN:Gv,FULLWIDTHMIDDLEDOT:yb,FULLWIDTHRIGHTPAREN:Wv,HYPHEN:db,LEFTCORNERBRACKET:Uv,LEFTWHITECORNERBRACKET:Kv,LOCALHOST:Ov,NL:_v,NUM:Rv,OPENANGLEBRACKET:jv,OPENBRACE:Pv,OPENBRACKET:$v,OPENPAREN:Bv,PERCENT:hb,PIPE:ub,P
1LUS:pb,POUND:fb,QUERY:mb,QUOTE:gb,RIGHTCORNERBRACKET:qv,RIGHTWHITECORNERBRACKET:Jv,SCHEME:Nv,SEMI:vb,SLASH:bb,SLASH_SCHEME:Dv,SYM:Sb,TILDE:kb,TLD:Ev,UNDERSCORE:wb,UTLD:Av,UWORD:Cv,WORD:Sv,WS:Iv}),Mb=/[a-z]/,Tb=/\p{L}/u,Ob=/\p{Emoji}/u,Eb=/\d/,Ab=/\s/,Nb=null,Db=null;function Rb(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 Ib(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 vv(r),s.jr=o.slice(),e.j[n]=s),e=s}return s=new vv(n),s.jr=o.slice(),e.j[t[i-1]]=s,s}function _b(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 Pb={defaultProtocol:"http",events:null,format:$b,formatHref:$b,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};
vendor: 6,459 bytes, line 1
1function Lb(e,t=null){let n=Object.assign({},Pb);e&&(n=Object.assign(n,e instanceof Lb?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 $b(e){return e}function zb(e,t){this.t="token",this.v=e,this.tk=t}function Bb(e,t){class n extends zb{constructor(t,n){super(t,n),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}Lb.prototype={o:Pb,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]:Pb[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)}},zb.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=Pb.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 Fb=Bb("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),jb=Bb("text"),Vb=Bb("nl"),Hb=Bb("url",{isLink:!0,toHref(e=Pb.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Ov&&e[1].t===ob}}),Wb=e=>new vv(e);function Ub(e,t,n){const r=n[0].s,o=n[n.length-1].e;return new e(t.slice(r,o),n)}var qb="undefined"!=typeof console&&console&&console.warn||(()=>{}),Kb={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Jb(e,t=!1){if(Kb.initialized&&qb(`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');Kb.customSchemes.push([e,t])}function Gb(){Kb.scanner=function(e=[]){const t={};vv.groups=t;const n=new vv;null==Nb&&(Nb=_b("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
1ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==Db&&(Db=_b("ελ1Ï
2бг1ел3деÑи4еÑ2каÑолик6ом3мÐ
1ºÐ´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")),xv(n,"'",Yv),xv(n,"{",Pv),xv(n,"}",Lv),xv(n,"[",$v),xv(n,"]",zv),xv(n,"(",Bv),xv(n,")",Fv),xv(n,"<",jv),xv(n,">",Vv),xv(n,"ï¼",Hv),xv(n,"ï¼",Wv),xv(n,"ã",Uv),xv(n,"ã",qv),xv(n,"ã",Kv),xv(n,"ã",Jv),xv(n,"ï¼",Gv),xv(n,"ï¼",Qv),xv(n,"&",Xv),xv(n,"*",Zv),xv(n,"@",eb),xv(n,"`",nb),xv(n,"^",rb),xv(n,":",ob),xv(n,",",sb),xv(n,"$",ib),xv(n,".",lb),xv(n,"=",ab),xv(n,"!",cb),xv(n,"-",db),xv(n,"%",hb),xv(n,"|",ub),xv(n,"+",pb),xv(n,"#",fb),xv(n,"?",mb),xv(n,'"',gb),xv(n,"/",bb),xv(n,";",vb),xv(n,"~",kb),xv(n,"_",wb),xv(n,"\\",tb),xv(n,"ã»",yb);const r=kv(n,Eb,Rv,{[iv]:!0});kv(r,Eb,r);const o=kv(r,Mb,Mv,{[cv]:!0}),s=kv(r,Tb,Tv,{[dv]:!0}),i=kv(n,Mb,Sv,{[lv]:!0});kv(i,Eb,o),kv(i,Mb,i),kv(o,Eb,o),kv(o,Mb,o);const l=kv(n,Tb,Cv,{[av]:!0});kv(l,Mb),kv(l,Eb,s),kv(l,Tb,l),kv(s,Eb,s),kv(s,Mb),kv(s,Tb,s);const a=xv(n,"\n",_v,{[mv]:!0}),c=xv(n,"\r",Iv,{[mv]:!0}),d=kv(n,Ab,Iv,{[mv]:!0});xv(n,"",d),xv(c,"\n",a),xv(c,"",d),kv(c,Ab,d),xv(d,"\r"),xv(d,"\n"),kv(d,Ab,d),xv(d,"",d);const h=kv(n,Ob,xb,{[uv]:!0});xv(h,"#"),kv(h,Ob,h),xv(h,"ï¸",h);const u=xv(h,"â");xv(u,"#"),kv(u,Ob,h);const p=[[Mb,i],[Eb,o]],f=[[Mb,null],[Tb,l],[Eb,s]];for(let m=0;m<Nb.length;m++)Ib(n,Nb[m],Ev,Sv,p);for(let m=0;m<Db.length;m++)Ib(n,Db[m],Av,Cv,f);yv(Ev,{tld:!0,ascii:!0},t),yv(Av,{utld:!0,alpha:!0},t),Ib(n,"file",Nv,Sv,p),Ib(n,"mailto",Nv,Sv,p),Ib(n,"http",Dv,Sv,p),Ib(n,"https",Dv,Sv,p),Ib(n,"ftp",Dv,Sv,p),Ib(n,"ftps",Dv,Sv,p),yv(Nv,{scheme:!0,ascii:!0},t),yv(Dv,{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]?{[pv]:!0}:{[fv]:!0};t.indexOf("-")>=0?r[hv]=!0:Mb.test(t)?Eb.test(t)?r[cv]=!0:r[lv]=!0:r[iv]=!0,wv(n,t,t,r)}return wv(n,"localhost",Ov,{ascii:!0}),n.jd=new vv(Sb),{start:n,tokens:Object.assign({groups:t},Cb)}}(Kb.customSchemes);for(let e=0;e<Kb.tokenQueue.length;e++)Kb.tokenQueue[e][1]({scanner:Kb.scanner});Kb.parser=function({groups:e}){const t=e.domain.concat([Xv,Zv,eb,tb,nb,rb,ib,ab,db,Rv,hb,ub,pb,fb,bb,Sb,kb,wb]),n=[Yv,ob,sb,lb,cb,hb,mb,gb,vb,jv,Vv,Pv,Lv,zv,$v,Bv,Fv,Hv,Wv,Uv,qv,Kv,Jv,Gv,Qv],r=[Xv,Yv,Zv,tb,nb,rb,ib,ab,db,Pv,Lv,hb,ub,pb,fb,mb,bb,Sb,kb,wb],o=Wb(),s=xv(o,kb);bv(s,r,s),bv(s,e.domain,s);const i=Wb(),l=Wb(),a=Wb();bv(o,e.domain,i),bv(o,e.scheme,l),bv(o,e.slashscheme,a),bv(i,r,s),bv(i,e.domain,i);const c=xv(i,eb);xv(s,eb,c),xv(l,eb,c),xv(a,eb,c);const d=xv(s,lb);bv(d,r,s),bv(d,e.domain,s);const h=Wb();bv(c,e.domain,h),bv(h,e.domain,h);const u=xv(h,lb);bv(u,e.domain,h);const p=Wb(Fb);bv(u,e.tld,p),bv(u,e.utld,p),xv(c,Ov,p);const f=xv(h,db);xv(f,db,f),bv(f,e.domain,h),bv(p,e.domain,h),xv(p,lb,u),xv(p,db,f);const m=xv(i,db),g=xv(i,lb);xv(m,db,m),bv(m,e.domain,i),bv(g,r,s),bv(g,e.domain,i);const y=Wb(Hb);bv(g,e.tld,y),bv(g,e.utld,y),bv(y,e.domain,i),bv(y,r,s),xv(y,lb,g),xv(y,db,m),xv(y,eb,c);const v=xv(y,ob),b=Wb(Hb);bv(v,e.numeric,b);const k=Wb(Hb),w=Wb();bv(k,t,k),bv(k,n,w),bv(w,t,k),bv(w,n,w),xv(y,bb,k),xv(b,bb,k);const x=xv(l,ob),S=xv(a,ob),C=xv(S,bb),M=xv(C,bb);bv(l,e.domain,i),xv(l,lb,g),xv(l,db,m),bv(a,e.domain,i),xv(a,lb,g),xv(a,db,m),bv(x,e.domain,k),xv(x,bb,k),xv(x,mb,k),bv(M,e.domain,k),bv(M,t,k),xv(M,bb,k);const T=[[Pv,Lv],[$v,zv],[Bv,Fv],[jv,Vv],[Hv,Wv],[Uv,qv],[Kv,Jv],[Gv,Qv]];for(let O=0;O<T.length;O++){const[e,r]=T[O],o=xv(k,e);xv(w,e,o);const s=Wb(Hb);bv(o,t,s);const i=Wb();bv(o,n,i),xv(o,r,k),bv(s,t,s),bv(s,n,i),bv(i,t,s),bv(i,n,i),xv(s,r,k),xv(i,r,k)}return xv(o,Ov,y),xv(o,_v,Vb),{start:o,tokens:Cb}}(Kb.scanner.tokens);for(let e=0;e<Kb.pluginQueue.length;e++)Kb.pluginQueue[e][1]({scanner:Kb.scanner,parser:Kb.parser});return Kb.initialized=!0,Kb}function Qb(e){return Kb.initialized||Gb(),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(Ub(jb,t,i)),i=[]),o-=u,d-=u;const e=h.t,r=n.slice(o-d,o);s.push(Ub(e,t,r))}}return i.length>0&&s.push(Ub(jb,t,i)),s}(Kb.parser.start,e,Rb(Kb.scanner.start,e))}function Xb(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 Lb(n),o=Qb(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}Qb.scan=Rb;var Yb="[\0-  áá â-\u2029âã]",Zb=new RegExp(Yb),ek=new RegExp(`${Yb}$`),tk=new RegExp(Yb,"g");function nk(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(tk,"").match(new RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}var rk=Rm.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?Jb(e.scheme,e.optionalSlashes):Jb(e)})},onDestroy(){vv.groups={},Kb.scanner=null,Kb.parser=null,Kb.tokenQueue=[],Kb.pluginQueue=[],Kb.customSchemes=[],Kb.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)=>!!nk(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=>!!nk(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!nk(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Cf(this.options.HTMLAttributes,e),0]:["a",Cf(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=>!!nk(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=>!!nk(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[tg({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,o=Xb(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!nk(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=>!!nk(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink},new Ua({key:new Ja("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 Pf(ff(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(!ek.test(r))return;o=t[0],s=n.doc.textBetween(o.pos,e.to,void 0," ")}if(o&&s){const e=s.split(Zb).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=Qb(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=>{Lf(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 Ua({key:new Ja("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=If(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 Ua({key:new Ja("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=Xb(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}}),ok=rk,sk=Og,ik=Xg,lk=" ",ak=eg.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Cf(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!==lk&&n[0].text!==lk&&"Â "!==n[0].raw&&"Â "!==n[0].text||1!==r.length||"text"!==r[0].type||r[0].text!==lk&&"Â "!==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?lk:""}return t.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ck=ak,dk=eg.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""});
1function hk(e){return zt((t,n)=>({get:()=>(t(),e),set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var uk=class extends Xm{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=hk(this.view.state),this.reactiveExtensionStorage=hk(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),Mt(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}},pk=nr({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=At(),n=si();return Mn(()=>{const r=e.editor;r&&r.options.element&&t.value&&ln(()=>{var e;if(!t.value||!(null==(e=r.view.dom)?void 0:e.parentNode))return;const o=It(t.value);t.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()})}),Hr(()=>{const t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:t}},render(){return bi("div",{ref:e=>{this.rootEl=e}})}}),fk=(nr({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 bi(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),nr({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var e,t;return bi(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=Nt();return Fr(()=>{t.value=new uk(e)}),Hr(()=>{var e;null==(e=t.value)||e.destroy()}),t});nr({name:"MarkViewContent",props:{as:{type:String,default:"span"}},render(){return bi(this.as,{style:{whiteSpace:"inherit"},"data-mark-view-content":""})}});export{Rr as $,l as $t,no as A,kt as At,Sn as B,Ct as Bt,vi as C,go as Ct,Ls as D,zt as Dt,Js as E,ki as Et,nr as F,mt as Ft,xn as G,E as Gt,Cr as H,Bt as Ht,si as I,At as It,Ys as J,N as Jt,zs as K,D as Kt,tr as L,gt as Lt,qs as M,Et as Mt,Hs as N,Mt as Nt,as as O,oe as Ot,Tr as P,ie as Pt,Hr as Q,g as Qt,Ws as R,vt as Rt,Us as S,Mn as St,$s as T,bn as Tt,Sr as U,_t as Ut,wr as V,Vt,xr as W,It as Wt,Dr as X,_ as Xt,ln as Y,J as Yt,Br as Z,u as Zt,Ms as _,Io as _t,ik as a,K as an,wn as at,Bn as b,Wn as bt,sv as c,G as cn,ro as ct,Qy as d,W as dn,Xn as dt,b as en,Jr as et,Jy as f,U as fn,_s as ft,qn as g,rr as gt,Gn as h,$ as hn,uo as ht,ck as i,f as in,Ds as it,Ks as j,wt as jt,ls as k,se as kt,Zy as l,Q as ln,Qr as lt,ag as m,ee as mn,so as mt,fk as n,S as nn,Wr as nt,sk as o,y as on,dn as ot,ty as p,B as pn,er as pt,mo as q,a as qt,dk as r,k as rn,Vr as rt,ok as s,v as sn,to as st,pk as t,i as tn,Fr as tt,Yy as u,L as un,Yr as ut,Ar as v,ho as vt,Vs as w,vn as wt,Xt as x,Tn as xt,bs as y,sr as yt,bi 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.