Files
mokeeText/frontend/static/dist/assets/index-BpxV2n8n.js
2026-07-15 16:08:17 +08:00

166 lines
632 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var e=Object.defineProperty,t=(e,t)=>()=>(e&&(t=e(e=0)),t),n=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),r=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function i(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}function a(e){if(S(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=E(r)?o(r):a(r);if(i)for(let e in i)t[e]=i[e]}return t}else if(E(e)||O(e))return e}function o(e){let t={};return e.replace(xe,``).split(ye).forEach(e=>{if(e){let n=e.split(be);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function s(e){let t=``;if(E(e))t=e;else if(S(e))for(let n=0;n<e.length;n++){let r=s(e[n]);r&&(t+=r+` `)}else if(O(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function c(e){return!!e||e===``}function l(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=u(e[r],t[r]);return n}function u(e,t){if(e===t)return!0;let n=ee(e),r=ee(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=D(e),r=D(t),n||r)return e===t;if(n=S(e),r=S(t),n||r)return n&&r?l(e,t):!1;if(n=O(e),r=O(t),n||r){if(!n||!r||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!u(e[n],t[n]))return!1}}return String(e)===String(t)}function d(e,t){return e.findIndex(e=>u(e,t))}var f,p,m,h,g,_,v,y,b,x,S,C,w,ee,T,E,D,O,te,k,ne,re,ie,ae,oe,se,ce,le,ue,A,de,fe,pe,me,he,ge,_e,ve,ye,be,xe,Se,Ce,we,j,Te,Ee,De=t((()=>{f={},p=[],m=()=>{},h=()=>!1,g=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),_=e=>e.startsWith(`onUpdate:`),v=Object.assign,y=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},b=Object.prototype.hasOwnProperty,x=(e,t)=>b.call(e,t),S=Array.isArray,C=e=>ne(e)===`[object Map]`,w=e=>ne(e)===`[object Set]`,ee=e=>ne(e)===`[object Date]`,T=e=>typeof e==`function`,E=e=>typeof e==`string`,D=e=>typeof e==`symbol`,O=e=>typeof e==`object`&&!!e,te=e=>(O(e)||T(e))&&T(e.then)&&T(e.catch),k=Object.prototype.toString,ne=e=>k.call(e),re=e=>ne(e).slice(8,-1),ie=e=>ne(e)===`[object Object]`,ae=e=>E(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,oe=i(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),se=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ce=/-\w/g,le=se(e=>e.replace(ce,e=>e.slice(1).toUpperCase())),ue=/\B([A-Z])/g,A=se(e=>e.replace(ue,`-$1`).toLowerCase()),de=se(e=>e.charAt(0).toUpperCase()+e.slice(1)),fe=se(e=>e?`on${de(e)}`:``),pe=(e,t)=>!Object.is(e,t),me=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},he=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ge=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ve=()=>_e||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},ye=/;(?![^(]*\))/g,be=/:([^]+)/,xe=/\/\*[^]*?\*\//g,Se=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,Ce=i(Se),Se+``,we=e=>!!(e&&e.__v_isRef===!0),j=e=>E(e)?e:e==null?``:S(e)||O(e)&&(e.toString===k||!T(e.toString))?we(e)?j(e.value):JSON.stringify(e,Te,2):String(e),Te=(e,t)=>we(t)?Te(e,t.value):C(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ee(t,r)+` =>`]=n,e),{})}:w(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ee(e))}:D(t)?Ee(t):O(t)&&!S(t)&&!ie(t)?String(t):t,Ee=(e,t=``)=>D(e)?`Symbol(${e.description??t})`:e}));function Oe(){return St}function ke(e,t=!1){if(e.flags|=8,t){e.next=kt,kt=e;return}e.next=Ot,Ot=e}function Ae(){Dt++}function je(){if(--Dt>0)return;if(kt){let e=kt;for(kt=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Ot;){let t=Ot;for(Ot=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}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 Ne(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Ie(r),Le(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Pe(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Fe(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Fe(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Mt)||(e.globalVersion=Mt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Pe(e))))return;e.flags|=2;let t=e.dep,n=wt,r=At;wt=e,At=!0;try{Me(e);let n=e.fn(e._value);(t.version===0||pe(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{wt=n,At=r,Ne(e),e.flags&=-3}}function Ie(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.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)Ie(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Le(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Re(){jt.push(At),At=!1}function ze(){let e=jt.pop();At=e===void 0?!0:e}function Be(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=wt;wt=void 0;try{t()}finally{wt=e}}}function Ve(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Ve(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}function He(e,t,n){if(At&&wt){let t=Ft.get(e);t||Ft.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Pt),r.map=t,r.key=n),r.track()}}function Ue(e,t,n,r,i,a){let o=Ft.get(e);if(!o){Mt++;return}let s=e=>{e&&e.trigger()};if(Ae(),t===`clear`)o.forEach(s);else{let i=S(e),a=i&&ae(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===Rt||!D(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(Rt)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(It)),C(e)&&s(o.get(Lt)));break;case`delete`:i||(s(o.get(It)),C(e)&&s(o.get(Lt)));break;case`set`:C(e)&&s(o.get(It));break}}je()}function We(e){let t=M(e);return t===e?t:(He(t,`iterate`,Rt),ut(e)?t:t.map(an))}function Ge(e){return He(e=M(e),`iterate`,Rt),e}function Ke(e,t){return lt(e)?on(ct(e)?an(t):t):an(t)}function qe(e,t,n){let r=Ge(e),i=r[t]();return r!==e&&!ut(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}function Je(e,t,n,r,i,a){let o=Ge(e),s=o!==e&&!ut(e),c=o[t];if(c!==Bt[t]){let t=c.apply(e,a);return s?an(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,Ke(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function Ye(e,t,n,r){let i=Ge(e),a=i!==e&&!ut(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=Ke(e,t)),n.call(this,t,Ke(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?Ke(e,c):c}function Xe(e,t,n){let r=M(e);He(r,`iterate`,Rt);let i=r[t](...n);return(i===-1||i===!1)&&dt(n[0])?(n[0]=M(n[0]),r[t](...n)):i}function Ze(e,t,n=[]){Re(),Ae();let r=M(e)[t].apply(e,n);return je(),ze(),r}function Qe(e){D(e)||(e=String(e));let t=M(this);return He(t,`has`,e),t.hasOwnProperty(e)}function $e(e,t,n){return function(...r){let i=this.__v_raw,a=M(i),o=C(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Yt:t?on:an;return!t&&He(a,`iterate`,c?Lt:It),v(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function et(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function tt(e,t){let n={get(n){let r=this.__v_raw,i=M(r),a=M(n);e||(pe(n,a)&&He(i,`get`,n),He(i,`get`,a));let{has:o}=Xt(i),s=t?Yt:e?on:an;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&He(M(t),`iterate`,It),t.size},has(t){let n=this.__v_raw,r=M(n),i=M(t);return e||(pe(t,i)&&He(r,`has`,t),He(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=M(a),s=t?Yt:e?on:an;return!e&&He(o,`iterate`,It),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return v(n,e?{add:et(`add`),set:et(`set`),delete:et(`delete`),clear:et(`clear`)}:{add(e){let n=M(this),r=Xt(n),i=M(e),a=!t&&!ut(e)&&!lt(e)?i:e;return r.has.call(n,a)||pe(e,a)&&r.has.call(n,e)||pe(i,a)&&r.has.call(n,i)||(n.add(a),Ue(n,`add`,a,a)),this},set(e,n){!t&&!ut(n)&&!lt(n)&&(n=M(n));let r=M(this),{has:i,get:a}=Xt(r),o=i.call(r,e);o||=(e=M(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?pe(n,s)&&Ue(r,`set`,e,n,s):Ue(r,`add`,e,n),this},delete(e){let t=M(this),{has:n,get:r}=Xt(t),i=n.call(t,e);i||=(e=M(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&Ue(t,`delete`,e,void 0,a),o},clear(){let e=M(this),t=e.size!==0,n=e.clear();return t&&Ue(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=$e(r,e,t)}),n}function nt(e,t){let n=tt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(x(n,r)&&r in t?n:t,r,i)}function rt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function it(e){return lt(e)?e:st(e,!1,Kt,Zt,en)}function at(e){return st(e,!1,Jt,Qt,tn)}function ot(e){return st(e,!0,qt,$t,nn)}function st(e,t,n,r,i){if(!O(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=rt(re(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function ct(e){return lt(e)?ct(e.__v_raw):!!(e&&e.__v_isReactive)}function lt(e){return!!(e&&e.__v_isReadonly)}function ut(e){return!!(e&&e.__v_isShallow)}function dt(e){return e?!!e.__v_raw:!1}function M(e){let t=e&&e.__v_raw;return t?M(t):e}function ft(e){return!x(e,`__v_skip`)&&Object.isExtensible(e)&&he(e,`__v_skip`,!0),e}function pt(e){return e?e.__v_isRef===!0:!1}function N(e){return ht(e,!1)}function mt(e){return ht(e,!0)}function ht(e,t){return pt(e)?e:new sn(e,t)}function gt(e){return pt(e)?e.value:e}function _t(e){return ct(e)?e:new Proxy(e,cn)}function vt(e,t,n=!1){let r,i;return T(e)?r=e:(r=e.get,i=e.set),new ln(r,i,n)}function yt(e,t=!1,n=fn){if(n){let t=dn.get(n);t||dn.set(n,t=[]),t.push(e)}}function bt(e,t,n=f){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>i?e:ut(e)||i===!1||i===0?xt(e,1):xt(e),u,d,p,h,g=!1,_=!1;if(pt(e)?(d=()=>e.value,g=ut(e)):ct(e)?(d=()=>l(e),g=!0):S(e)?(_=!0,g=e.some(e=>ct(e)||ut(e)),d=()=>e.map(e=>{if(pt(e))return e.value;if(ct(e))return l(e);if(T(e))return c?c(e,2):e()})):d=T(e)?t?c?()=>c(e,2):e:()=>{if(p){Re();try{p()}finally{ze()}}let t=fn;fn=u;try{return c?c(e,3,[h]):e(h)}finally{fn=t}}:m,t&&i){let e=d,t=i===!0?1/0:i;d=()=>xt(e(),t)}let v=Oe(),b=()=>{u.stop(),v&&v.active&&y(v.effects,u)};if(a&&t){let e=t;t=(...t)=>{let n=e(...t);return b(),n}}let x=_?Array(e.length).fill(un):un,C=e=>{if(!(!(u.flags&1)||!u.dirty&&!e))if(t){let n=u.run();if(e||i||g||(_?n.some((e,t)=>pe(e,x[t])):pe(n,x))){p&&p();let e=fn;fn=u;try{let e=[n,x===un?void 0:_&&x[0]===un?[]:x,h];x=n,c?c(t,3,e):t(...e)}finally{fn=e}}}else u.run()};return s&&s(C),u=new Et(d),u.scheduler=o?()=>o(C,!1):C,h=e=>yt(e,!1,u),p=u.onStop=()=>{let e=dn.get(u);if(e){if(c)c(e,4);else for(let t of e)t();dn.delete(u)}},t?r?C(!0):x=u.run():o?o(C.bind(null,!0),!0):u.run(),b.pause=u.pause.bind(u),b.resume=u.resume.bind(u),b.stop=b,b}function xt(e,t=1/0,n){if(t<=0||!O(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,pt(e))xt(e.value,t,n);else if(S(e))for(let r=0;r<e.length;r++)xt(e[r],t,n);else if(w(e)||C(e))e.forEach(e=>{xt(e,t,n)});else if(ie(e)){for(let r in e)xt(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&xt(e[r],t,n)}return e}var St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln,un,dn,fn,pn=t((()=>{De(),Ct=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&&St&&(St.active?(this.parent=St,this.index=(St.scopes||=[]).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){let t=St;try{return St=this,e()}finally{St=t}}}on(){++this._on===1&&(this.prevScope=St,St=this)}off(){if(this._on>0&&--this._on===0){if(St===this)St=this.prevScope;else{let e=St;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(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){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}},Tt=new WeakSet,Et=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,St&&(St.active?St.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Tt.has(this)&&(Tt.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ke(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Be(this),Me(this);let e=wt,t=At;wt=this,At=!0;try{return this.fn()}finally{Ne(this),wt=e,At=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Ie(e);this.deps=this.depsTail=void 0,Be(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Tt.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Pe(this)&&this.run()}get dirty(){return Pe(this)}},Dt=0,At=!0,jt=[],Mt=0,Nt=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}},Pt=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(!wt||!At||wt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==wt)t=this.activeLink=new Nt(wt,this),wt.deps?(t.prevDep=wt.depsTail,wt.depsTail.nextDep=t,wt.depsTail=t):wt.deps=wt.depsTail=t,Ve(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=wt.depsTail,t.nextDep=void 0,wt.depsTail.nextDep=t,wt.depsTail=t,wt.deps===t&&(wt.deps=e)}return t}trigger(e){this.version++,Mt++,this.notify(e)}notify(e){Ae();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{je()}}},Ft=new WeakMap,It=Symbol(``),Lt=Symbol(``),Rt=Symbol(``),zt={__proto__:null,[Symbol.iterator](){return qe(this,Symbol.iterator,e=>Ke(this,e))},concat(...e){return We(this).concat(...e.map(e=>S(e)?We(e):e))},entries(){return qe(this,`entries`,e=>(e[1]=Ke(this,e[1]),e))},every(e,t){return Je(this,`every`,e,t,void 0,arguments)},filter(e,t){return Je(this,`filter`,e,t,e=>e.map(e=>Ke(this,e)),arguments)},find(e,t){return Je(this,`find`,e,t,e=>Ke(this,e),arguments)},findIndex(e,t){return Je(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return Je(this,`findLast`,e,t,e=>Ke(this,e),arguments)},findLastIndex(e,t){return Je(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return Je(this,`forEach`,e,t,void 0,arguments)},includes(...e){return Xe(this,`includes`,e)},indexOf(...e){return Xe(this,`indexOf`,e)},join(e){return We(this).join(e)},lastIndexOf(...e){return Xe(this,`lastIndexOf`,e)},map(e,t){return Je(this,`map`,e,t,void 0,arguments)},pop(){return Ze(this,`pop`)},push(...e){return Ze(this,`push`,e)},reduce(e,...t){return Ye(this,`reduce`,e,t)},reduceRight(e,...t){return Ye(this,`reduceRight`,e,t)},shift(){return Ze(this,`shift`)},some(e,t){return Je(this,`some`,e,t,void 0,arguments)},splice(...e){return Ze(this,`splice`,e)},toReversed(){return We(this).toReversed()},toSorted(e){return We(this).toSorted(e)},toSpliced(...e){return We(this).toSpliced(...e)},unshift(...e){return Ze(this,`unshift`,e)},values(){return qe(this,`values`,e=>Ke(this,e))}},Bt=Array.prototype,Vt=i(`__proto__,__v_isRef,__isVue`),Ht=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(D)),Ut=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?rn:nn:i?tn:en).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=S(e);if(!r){let e;if(a&&(e=zt[t]))return e;if(t===`hasOwnProperty`)return Qe}let o=Reflect.get(e,t,pt(e)?e:n);if((D(t)?Ht.has(t):Vt(t))||(r||He(e,`get`,t),i))return o;if(pt(o)){let e=a&&ae(t)?o:o.value;return r&&O(e)?ot(e):e}return O(o)?r?ot(o):it(o):o}},Wt=class extends Ut{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=S(e)&&ae(t);if(!this._isShallow){let e=lt(i);if(!ut(n)&&!lt(n)&&(i=M(i),n=M(n)),!a&&pt(i)&&!pt(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:x(e,t),s=Reflect.set(e,t,n,pt(e)?e:r);return e===M(r)&&(o?pe(n,i)&&Ue(e,`set`,t,n,i):Ue(e,`add`,t,n)),s}deleteProperty(e,t){let n=x(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&Ue(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!D(t)||!Ht.has(t))&&He(e,`has`,t),n}ownKeys(e){return He(e,`iterate`,S(e)?`length`:It),Reflect.ownKeys(e)}},Gt=class extends Ut{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},Kt=new Wt,qt=new Gt,Jt=new Wt(!0),Yt=e=>e,Xt=e=>Reflect.getPrototypeOf(e),Zt={get:nt(!1,!1)},Qt={get:nt(!1,!0)},$t={get:nt(!0,!1)},en=new WeakMap,tn=new WeakMap,nn=new WeakMap,rn=new WeakMap,an=e=>O(e)?it(e):e,on=e=>O(e)?ot(e):e,sn=class{constructor(e,t){this.dep=new Pt,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:M(e),this._value=t?e:an(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||ut(e)||lt(e);e=n?e:M(e),pe(e,t)&&(this._rawValue=e,this._value=n?e:an(e),this.dep.trigger())}},cn={get:(e,t,n)=>t===`__v_raw`?e:gt(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return pt(i)&&!pt(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}},ln=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Pt(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Mt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&wt!==this)return ke(this,!0),!0}get value(){let e=this.dep.track();return Fe(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}},un={},dn=new WeakMap,fn=void 0}));function mn(e,t,n,r){try{return r?e(...r):e()}catch(e){gn(e,t,n)}}function hn(e,t,n,r){if(T(e)){let i=mn(e,t,n,r);return i&&te(i)&&i.catch(e=>{gn(e,t,n)}),i}if(S(e)){let i=[];for(let a=0;a<e.length;a++)i.push(hn(e[a],t,n,r));return i}}function gn(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||f;if(t){let r=t.parent,i=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){Re(),mn(a,null,10,[e,i,o]),ze();return}}_n(e,n,i,r,o)}function _n(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}function vn(e){let t=bi||yi;return e?t.then(this?e.bind(this):e):t}function yn(e){let t=hi+1,n=mi.length;for(;t<n;){let r=t+n>>>1,i=mi[r],a=xi(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function bn(e){if(!(e.flags&1)){let t=xi(e),n=mi[mi.length-1];!n||!(e.flags&2)&&t>=xi(n)?mi.push(e):mi.splice(yn(t),0,e),e.flags|=1,xn()}}function xn(){bi||=yi.then(Tn)}function Sn(e){S(e)?gi.push(...e):_i&&e.id===-1?_i.splice(vi+1,0,e):e.flags&1||(gi.push(e),e.flags|=1),xn()}function Cn(e,t,n=hi+1){for(;n<mi.length;n++){let t=mi[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;mi.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function wn(e){if(gi.length){let e=[...new Set(gi)].sort((e,t)=>xi(e)-xi(t));if(gi.length=0,_i){_i.push(...e);return}for(_i=e,vi=0;vi<_i.length;vi++){let e=_i[vi];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}_i=null,vi=0}}function Tn(e){try{for(hi=0;hi<mi.length;hi++){let e=mi[hi];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),mn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;hi<mi.length;hi++){let e=mi[hi];e&&(e.flags&=-2)}hi=-1,mi.length=0,wn(e),bi=null,(mi.length||gi.length)&&Tn(e)}}function En(e){let t=Si;return Si=e,Ci=e&&e.type.__scopeId||null,t}function Dn(e,t=Si,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&Hr(-1);let i=En(t),a;try{a=e(...n)}finally{En(i),r._d&&Hr(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function On(e,t){if(Si===null)return e;let n=ui(Si),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,o,s=f]=t[e];i&&(T(i)&&(i={mounted:i,updated:i}),i.deep&&xt(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function kn(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(Re(),hn(c,n,8,[e.el,s,e,t]),ze())}}function An(e,t){if(Da){let n=Da.provides,r=Da.parent&&Da.parent.provides;r===n&&(n=Da.provides=Object.create(r)),n[e]=t}}function jn(e,t,n=!1){let r=Oa();if(r||Zi){let i=Zi?Zi._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&T(t)?t.call(r&&r.proxy):t}}function Mn(e,t,n){return Nn(e,t,n)}function Nn(e,t,n=f){let{immediate:r,deep:i,flush:a,once:o}=n,s=v({},n),c=t&&r||!t&&a!==`post`,l;if(Na){if(a===`sync`){let e=Ti();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=m,e.resume=m,e.pause=m,e}}let u=Da;s.call=(e,t,n)=>hn(e,u,t,n);let d=!1;a===`post`?s.scheduler=e=>{ma(e,u&&u.suspense)}:a!==`sync`&&(d=!0,s.scheduler=(e,t)=>{t?e():bn(e)}),s.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let p=bt(e,t,s);return Na&&(l?l.push(p):c&&p()),p}function Pn(e,t,n){let r=this.proxy,i=E(e)?e.includes(`.`)?Fn(r,e):()=>r[e]:e.bind(r,r),a;T(t)?a=t:(a=t.handler,n=t);let o=ja(this),s=Nn(i,a.bind(r),n);return o(),s}function Fn(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}function In(e,t){e.shapeFlag&6&&e.component?(e.transition=t,In(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Ln(e,t){return T(e)?v({name:e.name},t,{setup:e}):e}function Rn(e){e.ids=[e.ids[0]+ e.ids[2]+++`-`,0,0]}function zn(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}function Bn(e,t,n,r,i=!1){if(S(e)){e.forEach((e,a)=>Bn(e,t&&(S(t)?t[a]:t),n,r,i));return}if(Ai(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Bn(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?ui(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,u=s.refs===f?s.refs={}:s.refs,d=s.setupState,p=M(d),m=d===f?h:e=>zn(u,e)?!1:x(p,e),g=(e,t)=>!(t&&zn(u,t));if(l!=null&&l!==c){if(Vn(t),E(l))u[l]=null,m(l)&&(d[l]=null);else if(pt(l)){let e=t;g(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(T(c))mn(c,s,12,[o,u]);else{let t=E(c),r=pt(c);if(t||r){let s=()=>{if(e.f){let n=t?m(c)?d[c]:u[c]:g(c)||!e.k?c.value:u[e.k];if(i)S(n)&&y(n,a);else if(S(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],m(c)&&(d[c]=u[c]);else{let t=[a];g(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,m(c)&&(d[c]=o)):r&&(g(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o))};if(o){let t=()=>{s(),ki.delete(e)};t.id=-1,ki.set(e,t),ma(t,n)}else Vn(e),s()}}}function Vn(e){let t=ki.get(e);t&&(t.flags|=8,ki.delete(e))}function Hn(e,t){Wn(e,`a`,t)}function Un(e,t){Wn(e,`da`,t)}function Wn(e,t,n=Da){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Kn(t,r,n),n){let e=n.parent;for(;e&&e.parent;)ji(e.parent.vnode)&&Gn(r,t,n,e),e=e.parent}}function Gn(e,t,n,r){let i=Kn(t,e,r,!0);Ri(()=>{y(r[t],i)},n)}function Kn(e,t,n=Da,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Re();let i=ja(n),a=hn(t,n,e,r);return i(),ze(),a};return r?i.unshift(a):i.push(a),a}}function qn(e,t=Da){Kn(`ec`,e,t)}function Jn(e,t){return Yn(Hi,e,!0,t)||e}function Yn(e,t,n=!0,r=!1){let i=Si||Da;if(i){let n=i.type;if(e===Hi){let e=di(n,!1);if(e&&(e===t||e===le(t)||e===de(le(t))))return n}let a=Xn(i[e]||n[e],t)||Xn(i.appContext[e],t);return!a&&r?n:a}}function Xn(e,t){return e&&(e[t]||e[le(t)]||e[de(le(t))])}function Zn(e,t,n,r){let i,a=n&&n[r],o=S(e);if(o||E(e)){let n=o&&ct(e),r=!1,s=!1;n&&(r=!ut(e),s=lt(e),e=Ge(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?on(an(e[n])):an(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(O(e))if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}else i=[];return n&&(n[r]=i),i}function Qn(e,t,n={},r,i){if(Si.ce||Si.parent&&Ai(Si.parent)&&Si.parent.ce){let e=Object.keys(n).length>0;return t!=="default"&&(n.name=t),P(),Wr(ga,null,[L(`slot`,n,r&&r())],e?-2:64)}let a=e[t];a&&a._c&&(a._d=!1),P();let o=a&&$n(a(n)),s=n.key||o&&o.key,c=Wr(ga,{key:(s&&!D(s)?s:`_${t}`)+(!o&&r?`_fb`:``)},o||(r?r():[]),o&&e._===1?64:-2);return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),a&&a._c&&(a._d=!0),c}function $n(e){return e.some(e=>Gr(e)?!(e.type===va||e.type===ga&&!$n(e.children)):!0)?e:null}function er(e){return S(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function tr(e){let t=ar(e),n=e.proxy,r=e.ctx;Ji=!1,t.beforeCreate&&rr(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:h,activated:g,deactivated:_,beforeDestroy:v,beforeUnmount:y,destroyed:b,unmounted:x,render:C,renderTracked:w,renderTriggered:ee,errorCaptured:E,serverPrefetch:D,expose:te,inheritAttrs:k,components:ne,directives:re,filters:ie}=t;if(l&&nr(l,r,null),o)for(let e in o){let t=o[e];T(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);O(t)&&(e.data=it(t))}if(Ji=!0,a)for(let e in a){let t=a[e],i=La({get:T(t)?t.bind(n,n):T(t.get)?t.get.bind(n,n):m,set:!T(t)&&T(t.set)?t.set.bind(n):m});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(s)for(let e in s)ir(s[e],r,n,e);if(c){let e=T(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{An(t,e[t])})}u&&rr(u,e,`c`);function ae(e,t){S(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(ae(Ni,d),ae(Pi,f),ae(Fi,p),ae(Ii,h),ae(Hn,g),ae(Un,_),ae(qn,E),ae(Vi,w),ae(Bi,ee),ae(Li,y),ae(Ri,x),ae(zi,D),S(te))if(te.length){let t=e.exposed||={};te.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={};C&&e.render===m&&(e.render=C),k!=null&&(e.inheritAttrs=k),ne&&(e.components=ne),re&&(e.directives=re),D&&Rn(e)}function nr(e,t,n=m){S(e)&&(e=lr(e));for(let n in e){let r=e[n],i;i=O(r)?`default`in r?jn(r.from||n,r.default,!0):jn(r.from||n):jn(r),pt(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function rr(e,t,n){hn(S(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ir(e,t,n,r){let i=r.includes(`.`)?Fn(n,r):()=>n[r];if(E(e)){let n=t[e];T(n)&&Mn(i,n)}else if(T(e))Mn(i,e.bind(n));else if(O(e))if(S(e))e.forEach(e=>ir(e,t,n,r));else{let r=T(e.handler)?e.handler.bind(n):t[e.handler];T(r)&&Mn(i,r,e)}}function ar(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>or(c,e,o,!0)),or(c,t,o)),O(t)&&a.set(t,c),c}function or(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&or(e,a,n,!0),i&&i.forEach(t=>or(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=Yi[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}function sr(e,t){return t?e?function(){return v(T(e)?e.call(this,this):e,T(t)?t.call(this,this):t)}:t:e}function cr(e,t){return dr(lr(e),lr(t))}function lr(e){if(S(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function ur(e,t){return e?[...new Set([].concat(e,t))]:t}function dr(e,t){return e?v(Object.create(null),e,t):t}function fr(e,t){return e?S(e)&&S(t)?[...new Set([...e,...t])]:v(Object.create(null),er(e),er(t??{})):t}function pr(e,t){if(!e)return t;if(!t)return e;let n=v(Object.create(null),e);for(let r in t)n[r]=ur(e[r],t[r]);return n}function mr(){return{app:null,config:{isNativeTag:h,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}}function hr(e,t){return function(n,r=null){T(n)||(n=v({},n)),r!=null&&!O(r)&&(r=null);let i=mr(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:Xi++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:Ra,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&T(e.install)?(a.add(e),e.install(c,...t)):T(e)&&(a.add(e),e(c,...t))),c},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||L(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,ui(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(hn(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=Zi;Zi=c;try{return e()}finally{Zi=t}}};return c}}function gr(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||f,i=n,a=t.startsWith(`update:`),o=a&&Qi(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>E(e)?e.trim():e)),o.number&&(i=n.map(ge)));let s,c=r[s=fe(t)]||r[s=fe(le(t))];!c&&a&&(c=r[s=fe(A(t))]),c&&hn(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,hn(l,e,6,i)}}function _r(e,t,n=!1){let r=n?$i:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!T(e)){let r=e=>{let n=_r(e,t,!0);n&&(s=!0,v(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(O(e)&&r.set(e,null),null):(S(a)?a.forEach(e=>o[e]=null):v(o,a),O(e)&&r.set(e,o),o)}function vr(e,t){return!e||!g(t)?!1:(t=t.slice(2).replace(/Once$/,``),x(e,t[0].toLowerCase()+t.slice(1))||x(e,A(t))||x(e,t))}function yr(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,g=En(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Qr(l.call(t,e,u,d,p,f,m)),y=s}else{let e=t;v=Qr(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),y=t.props?s:ea(s)}}catch(t){ba.length=0,gn(t,e,1),v=L(va)}let b=v;if(y&&h!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(_)&&(y=ta(y,a)),b=Yr(b,y,!1,!0))}return n.dirs&&(b=Yr(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&In(b,n.transition),v=b,En(g),v}function br(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?xr(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(Sr(o,r,n)&&!vr(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?o?xr(r,o,l):!0:!!o;return!1}function xr(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(Sr(t,e,a)&&!vr(n,a))return!0}return!1}function Sr(e,t,n){let r=e[n],i=t[n];return n===`style`&&O(r)&&O(i)?!u(r,i):r!==i}function Cr({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}function wr(e,t,n,r=!1){let i={},a=ra();e.propsDefaults=Object.create(null),Er(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);n?e.props=r?i:at(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function Tr(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=M(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(vr(e.emitsOptions,o))continue;let u=t[o];if(c)if(x(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=le(o);i[t]=Dr(c,s,t,u,e,!1)}else u!==a[o]&&(a[o]=u,l=!0)}}}else{Er(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!x(t,a)&&((r=A(a))===a||!x(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=Dr(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!x(t,e))&&(delete a[e],l=!0)}l&&Ue(e.attrs,`set`,``)}function Er(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(oe(c))continue;let l=t[c],u;i&&x(i,u=le(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:vr(e.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(a){let t=M(n),r=s||f;for(let o=0;o<a.length;o++){let s=a[o];n[s]=Dr(i,t,s,r[s],e,!x(r,s))}}return o}function Dr(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=x(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&T(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=ja(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===A(n))&&(r=!0))}return r}function Or(e,t,n=!1){let r=n?aa:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],c=!1;if(!T(e)){let r=e=>{c=!0;let[n,r]=Or(e,t,!0);v(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return O(e)&&r.set(e,p),p;if(S(a))for(let e=0;e<a.length;e++){let t=le(a[e]);kr(t)&&(o[t]=f)}else if(a)for(let e in a){let t=le(e);if(kr(t)){let n=a[e],r=o[t]=S(n)||T(n)?{type:n}:v({},n),i=r.type,c=!1,l=!0;if(S(i))for(let e=0;e<i.length;++e){let t=i[e],n=T(t)&&t.name;if(n===`Boolean`){c=!0;break}else n===`String`&&(l=!1)}else c=T(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||x(r,`default`))&&s.push(t)}}let l=[o,s];return O(e)&&r.set(e,l),l}function kr(e){return e[0]!==`$`&&!oe(e)}function Ar(e){return jr(e)}function jr(e,t){let n=ve();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:h,setScopeId:g=m,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!Kr(e,t)&&(r=_e(e),de(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case _a:y(e,t,n,r);break;case va:b(e,t,n,r);break;case ya:e??x(t,n,r,o);break;case ga:k(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?ne(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,xe)}u!=null&&i?Bn(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Bn(e.ref,null,a,e,!0)},y=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},b=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=h(e),r(e,n,i),e=a;r(t,n,i)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),i(e),e=n;i(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)ee(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),D(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},ee=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&E(e.children,f,null,i,s,Mr(e,c),l,d),_&&kn(e,null,i,`created`),T(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!oe(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&ni(p,i,e)}_&&kn(e,null,i,`beforeMount`);let v=Pr(s,g);v&&g.beforeEnter(f),r(f,t,n),((p=m&&m.onVnodeMounted)||v||_)&&ma(()=>{try{p&&ni(p,i,e),v&&g.enter(f),_&&kn(e,null,i,`mounted`)}finally{}},s)},T=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||ha(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;T(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},E=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++)v(null,e[l]=s?$r(e[l]):Qr(e[l]),t,n,r,i,a,o,s)},D=(e,t,n,r,i,o,s)=>{let c=t.el=e.el,{patchFlag:l,dynamicChildren:d,dirs:p}=t;l|=e.patchFlag&16;let m=e.props||f,h=t.props||f,g;if(n&&Nr(n,!1),(g=h.onVnodeBeforeUpdate)&&ni(g,n,t,e),p&&kn(t,e,n,`beforeUpdate`),n&&Nr(n,!0),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&u(c,``),d?O(e.dynamicChildren,d,c,n,r,Mr(t,i),o):s||ce(e,t,c,null,n,r,Mr(t,i),o,!1),l>0){if(l&16)te(c,m,h,n,i);else if(l&2&&m.class!==h.class&&a(c,`class`,null,h.class,i),l&4&&a(c,`style`,m.style,h.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=m[r],s=h[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else !s&&d==null&&te(c,m,h,n,i);((g=h.onVnodeUpdated)||p)&&ma(()=>{g&&ni(g,n,t,e),p&&kn(t,e,n,`updated`)},r)},O=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s];v(c,l,c.el&&(c.type===ga||!Kr(c,l)||c.shapeFlag&198)?d(c.el):n,null,r,i,a,o,!0)}},te=(e,t,n,r,i)=>{if(t!==n){if(t!==f)for(let o in t)!oe(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(oe(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},k=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),E(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(O(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&Fr(e,t,!0)):ce(e,t,n,f,a,o,c,l,u)},ne=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):re(t,n,r,i,a,o,c):ie(e,t,c)},re=(e,t,n,r,i,a,o)=>{let s=e.component=ri(e,r,i);if(ji(e)&&(s.ctx.renderer=xe),ai(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,ae,o),!e.el){let r=s.subTree=L(va);b(null,r,t,n),e.placeholder=r.el}}else ae(s,e,t,n,i,a,o)},ie=(e,t,n)=>{let r=t.component=e.component;if(br(e,t,n))if(r.asyncDep&&!r.asyncResolved){se(r,t,n);return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},ae=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Lr(e);if(n){t&&(t.el=c.el,se(e,t,o)),n.asyncDep.then(()=>{ma(()=>{e.isUnmounted||l()},i)});return}}let u=t,f;Nr(e,!1),t?(t.el=c.el,se(e,t,o)):t=c,n&&me(n),(f=t.props&&t.props.onVnodeBeforeUpdate)&&ni(f,s,t,c),Nr(e,!0);let p=yr(e),m=e.subTree;e.subTree=p,v(m,p,d(m.el),_e(m),e,i,a),t.el=p.el,u===null&&Cr(e,p.el),r&&ma(r,i),(f=t.props&&t.props.onVnodeUpdated)&&ma(()=>ni(f,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Ai(t);if(Nr(e,!1),l&&me(l),!m&&(o=c&&c.onVnodeBeforeMount)&&ni(o,d,t),Nr(e,!0),s&&Ce){let t=()=>{e.subTree=yr(e),Ce(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=yr(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&ma(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;ma(()=>ni(o,d,e),i)}(t.shapeFlag&256||d&&Ai(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&ma(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Et(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>bn(u),Nr(e,!0),l()},se=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Tr(e,t.props,r,n),pa(e,t.children,n),Re(),Cn(e),ze()},ce=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){ue(l,f,n,r,i,a,o,s,c);return}else if(p&256){le(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&ge(l,i,a),f!==l&&u(n,f)):d&16?m&16?ue(l,f,n,r,i,a,o,s,c):ge(l,i,a,!0):(d&8&&u(n,``),m&16&&E(f,n,r,i,a,o,s,c))},le=(e,t,n,r,i,a,o,s,c)=>{e||=p,t||=p;let l=e.length,u=t.length,d=Math.min(l,u),f;for(f=0;f<d;f++){let r=t[f]=c?$r(t[f]):Qr(t[f]);v(e[f],r,n,null,i,a,o,s,c)}l>u?ge(e,i,a,!0,!1,d):E(t,n,r,i,a,o,s,c,d)},ue=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?$r(t[l]):Qr(t[l]);if(Kr(r,u))v(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?$r(t[f]):Qr(t[f]);if(Kr(r,l))v(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=e<u?t[e].el:r;for(;l<=f;)v(null,t[l]=c?$r(t[l]):Qr(t[l]),n,d,i,a,o,s,c),l++}}else if(l>f)for(;l<=d;)de(e[l],i,a,!0),l++;else{let m=l,h=l,g=new Map;for(l=h;l<=f;l++){let e=t[l]=c?$r(t[l]):Qr(t[l]);e.key!=null&&g.set(e.key,l)}let _,y=0,b=f-h+1,x=!1,S=0,C=Array(b);for(l=0;l<b;l++)C[l]=0;for(l=m;l<=d;l++){let r=e[l];if(y>=b){de(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=h;_<=f;_++)if(C[_-h]===0&&Kr(r,t[_])){u=_;break}u===void 0?de(r,i,a,!0):(C[u-h]=l+1,u>=S?S=u:x=!0,v(r,t[u],n,null,i,a,o,s,c),y++)}let w=x?Ir(C):p;for(_=w.length-1,l=b-1;l>=0;l--){let e=h+l,d=t[e],f=t[e+1],p=e+1<u?f.el||zr(f):r;C[l]===0?v(null,d,n,p,i,a,o,s,c):x&&(_<0||l!==w[_]?A(d,n,p,2):_--)}}},A=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){A(e.component.subTree,t,n,a);return}if(d&128){e.suspense.move(t,n,a);return}if(d&64){c.move(e,t,n,xe);return}if(c===ga){r(s,t,n);for(let e=0;e<u.length;e++)A(u[e],t,n,a);r(e.anchor,t,n);return}if(c===ya){S(e,t,n);return}if(a!==2&&d&1&&l)if(a===0)l.persisted&&!s[Oi]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),ma(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[Oi];s._isLeaving&&s[Oi](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}else r(s,t,n)},de=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(Re(),Bn(s,null,n,e,!0),ze()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Ai(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&ni(_,t,e),u&6)he(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&kn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,xe,r):l&&!l.hasOnce&&(a!==ga||d>0&&d&64)?ge(l,t,n,!1,!0):(a===ga&&d&384||!i&&u&16)&&ge(c,t,n),r&&fe(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&ma(()=>{_&&ni(_,t,e),h&&kn(e,null,t,`unmounted`),v&&(e.el=null)},n)},fe=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===ga){pe(n,r);return}if(t===ya){C(e);return}let o=()=>{i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(e.shapeFlag&1&&a&&!a.persisted){let{leave:t,delayLeave:r}=a,i=()=>t(n,o);r?r(e.el,o,i):i()}else o()},pe=(e,t)=>{let n;for(;e!==t;)n=h(e),i(e),e=n;i(t)},he=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Rr(c),Rr(l),r&&me(r),i.stop(),a&&(a.flags|=8,de(o,e,t,n)),s&&ma(s,t),ma(()=>{e.isUnmounted=!0},t)},ge=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)de(e[o],t,n,r,i)},_e=e=>{if(e.shapeFlag&6)return _e(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Ei];return n?h(n):t},ye=!1,be=(e,t,n)=>{let r;e==null?t._vnode&&(de(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ye||=(ye=!0,Cn(r),wn(),!1)},xe={p:v,um:de,m:A,r:fe,mt:re,mc:E,pc:ce,pbc:O,n:_e,o:e},Se,Ce;return t&&([Se,Ce]=t(xe)),{render:be,hydrate:Se,createApp:hr(be,Se)}}function Mr({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Nr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Pr(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Fr(e,t,n=!1){let r=e.children,i=t.children;if(S(r)&&S(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=$r(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&Fr(t,a)),a.type===_a&&(a.patchFlag===-1&&(a=i[e]=$r(a)),a.el=t.el),a.type===va&&!a.el&&(a.el=t.el)}}function Ir(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-- >0;)n[a]=o,o=t[o];return n}function Lr(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Lr(t)}function Rr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function zr(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?zr(t.subTree):null}function Br(e,t){t&&t.pendingBranch?S(e)?t.effects.push(...e):t.effects.push(e):Sn(e)}function P(e=!1){ba.push(xa=e?null:[])}function Vr(){ba.pop(),xa=ba[ba.length-1]||null}function Hr(e,t=!1){Sa+=e,e<0&&xa&&t&&(xa.hasOnce=!0)}function Ur(e){return e.dynamicChildren=Sa>0?xa||p:null,Vr(),Sa>0&&xa&&xa.push(e),e}function F(e,t,n,r,i,a){return Ur(I(e,t,n,r,i,a,!0))}function Wr(e,t,n,r,i){return Ur(L(e,t,n,r,i,!0))}function Gr(e){return e?e.__v_isVNode===!0:!1}function Kr(e,t){return e.type===t.type&&e.key===t.key}function I(e,t=null,n=null,r=0,i=null,a=e===ga?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ca(t),ref:t&&wa(t),scopeId:Ci,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:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Si};return s?(ei(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=E(n)?8:16),Sa>0&&!o&&xa&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&xa.push(c),c}function qr(e,t=null,n=null,r=0,i=null,o=!1){if((!e||e===Ui)&&(e=va),Gr(e)){let r=Yr(e,t,!0);return n&&ei(r,n),Sa>0&&!o&&xa&&(r.shapeFlag&6?xa[xa.indexOf(e)]=r:xa.push(r)),r.patchFlag=-2,r}if(fi(e)&&(e=e.__vccOpts),t){t=Jr(t);let{class:e,style:n}=t;e&&!E(e)&&(t.class=s(e)),O(n)&&(dt(n)&&!S(n)&&(n=v({},n)),t.style=a(n))}let c=E(e)?1:ha(e)?128:Di(e)?64:O(e)?4:T(e)?2:0;return I(e,t,n,r,i,c,o,!0)}function Jr(e){return e?dt(e)||ia(e)?v({},e):e:null}function Yr(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?ti(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Ca(l),ref:t&&t.ref?n&&a?S(a)?a.concat(wa(t)):[a,wa(t)]:wa(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ga?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Yr(e.ssContent),ssFallback:e.ssFallback&&Yr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&In(u,c.clone(u)),u}function Xr(e=` `,t=0){return L(_a,null,e,t)}function Zr(e=``,t=!1){return t?(P(),Wr(va,null,e)):L(va,null,e)}function Qr(e){return e==null||typeof e==`boolean`?L(va):S(e)?L(ga,null,e.slice()):Gr(e)?$r(e):L(_a,null,String(e))}function $r(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Yr(e)}function ei(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(S(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),ei(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!ia(t)?t._ctx=Si:r===3&&Si&&(Si.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else T(t)?(t={default:t,_ctx:Si},n=32):(t=String(t),r&64?(n=16,t=[Xr(t)]):n=8);e.children=t,e.shapeFlag|=n}function ti(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=s([t.class,r.class]));else if(e===`style`)t.style=a([t.style,r.style]);else if(g(e)){let n=t[e],i=r[e];i&&n!==i&&!(S(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!_(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function ni(e,t,n,r=null){hn(e,t,7,[n,r])}function ri(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||Ta,a={uid:Ea++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ct(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Or(r,i),emitsOptions:_r(r,i),emit:null,emitted:null,propsDefaults:f,inheritAttrs:r.inheritAttrs,ctx:f,data:f,props:f,attrs:f,slots:f,refs:f,setupState:f,setupContext:null,suspense:n,suspenseId:n?n.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};return a.ctx={_:a},a.root=t?t.root:a,a.emit=gr.bind(null,a),e.ce&&e.ce(a),a}function ii(e){return e.vnode.shapeFlag&4}function ai(e,t=!1,n=!1){t&&Aa(t);let{props:r,children:i}=e.vnode,a=ii(e);wr(e,r,a,t),fa(e,i,n||t);let o=a?oi(e,t):void 0;return t&&Aa(!1),o}function oi(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,qi);let{setup:r}=n;if(r){Re();let n=e.setupContext=r.length>1?li(e):null,i=ja(e),a=mn(r,e,0,[e.props,n]),o=te(a);if(ze(),i(),(o||e.sp)&&!Ai(e)&&Rn(e),o){if(a.then(Ma,Ma),t)return a.then(n=>{si(e,n,t)}).catch(t=>{gn(t,e,0)});e.asyncDep=a}else si(e,a,t)}else ci(e,t)}function si(e,t,n){T(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:O(t)&&(e.setupState=_t(t)),ci(e,n)}function ci(e,t,n){let r=e.type;if(!e.render){if(!t&&Pa&&!r.render){let t=r.template||ar(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=Pa(t,v(v({isCustomElement:n,delimiters:a},i),o))}}e.render=r.render||m,Fa&&Fa(e)}{let t=ja(e);Re();try{tr(e)}finally{ze(),t()}}}function li(e){return{attrs:new Proxy(e.attrs,Ia),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function ui(e){return e.exposed?e.exposeProxy||=new Proxy(_t(ft(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Gi)return Gi[n](e)},has(e,t){return t in e||t in Gi}}):e.proxy}function di(e,t=!0){return T(e)?e.displayName||e.name:e.name||t&&e.__name}function fi(e){return T(e)&&`__vccOpts`in e}function pi(e,t,n){try{Hr(-1);let r=arguments.length;return r===2?O(t)&&!S(t)?Gr(t)?L(e,null,[t]):L(e,t):L(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Gr(n)&&(n=[n]),L(e,t,n))}finally{Hr(1)}}var mi,hi,gi,_i,vi,yi,bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,L,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,za=t((()=>{pn(),De(),mi=[],hi=-1,gi=[],_i=null,vi=0,yi=Promise.resolve(),bi=null,xi=e=>e.id==null?e.flags&2?-1:1/0:e.id,Si=null,Ci=null,wi=Symbol.for(`v-scx`),Ti=()=>jn(wi),Ei=Symbol(`_vte`),Di=e=>e.__isTeleport,Oi=Symbol(`_leaveCb`),ki=new WeakMap,ve().requestIdleCallback,ve().cancelIdleCallback,Ai=e=>!!e.type.__asyncLoader,ji=e=>e.type.__isKeepAlive,Mi=e=>(t,n=Da)=>{(!Na||e===`sp`)&&Kn(e,(...e)=>t(...e),n)},Ni=Mi(`bm`),Pi=Mi(`m`),Fi=Mi(`bu`),Ii=Mi(`u`),Li=Mi(`bum`),Ri=Mi(`um`),zi=Mi(`sp`),Bi=Mi(`rtg`),Vi=Mi(`rtc`),Hi=`components`,Ui=Symbol.for(`v-ndc`),Wi=e=>e?ii(e)?ui(e):Wi(e.parent):null,Gi=v(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=>Wi(e.parent),$root:e=>Wi(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ar(e),$forceUpdate:e=>e.f||=()=>{bn(e.update)},$nextTick:e=>e.n||=vn.bind(e.proxy),$watch:e=>Pn.bind(e)}),Ki=(e,t)=>e!==f&&!e.__isScriptSetup&&x(e,t),qi={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(Ki(r,t))return o[t]=1,r[t];else if(i!==f&&x(i,t))return o[t]=2,i[t];else if(x(a,t))return o[t]=3,a[t];else if(n!==f&&x(n,t))return o[t]=4,n[t];else Ji&&(o[t]=0)}let l=Gi[t],u,d;if(l)return t===`$attrs`&&He(e.attrs,`get`,``),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==f&&x(n,t))return o[t]=4,n[t];if(d=c.config.globalProperties,x(d,t))return d[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return Ki(i,t)?(i[t]=n,!0):r!==f&&x(r,t)?(r[t]=n,!0):x(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||e!==f&&s[0]!==`$`&&x(e,s)||Ki(t,s)||x(a,s)||x(r,s)||x(Gi,s)||x(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?x(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}},Ji=!0,Yi={data:sr,props:fr,emits:fr,methods:dr,computed:dr,beforeCreate:ur,created:ur,beforeMount:ur,mounted:ur,beforeUpdate:ur,updated:ur,beforeDestroy:ur,beforeUnmount:ur,destroyed:ur,unmounted:ur,activated:ur,deactivated:ur,errorCaptured:ur,serverPrefetch:ur,components:dr,directives:dr,watch:pr,provide:sr,inject:cr},Xi=0,Zi=null,Qi=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${le(t)}Modifiers`]||e[`${A(t)}Modifiers`],$i=new WeakMap,ea=e=>{let t;for(let n in e)(n===`class`||n===`style`||g(n))&&((t||={})[n]=e[n]);return t},ta=(e,t)=>{let n={};for(let r in e)(!_(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n},na={},ra=()=>Object.create(na),ia=e=>Object.getPrototypeOf(e)===na,aa=new WeakMap,oa=e=>e===`_`||e===`_ctx`||e===`$stable`,sa=e=>S(e)?e.map(Qr):[Qr(e)],ca=(e,t,n)=>{if(t._n)return t;let r=Dn((...e)=>sa(t(...e)),n);return r._c=!1,r},la=(e,t,n)=>{let r=e._ctx;for(let n in e){if(oa(n))continue;let i=e[n];if(T(i))t[n]=ca(n,i,r);else if(i!=null){let e=sa(i);t[n]=()=>e}}},ua=(e,t)=>{let n=sa(t);e.slots.default=()=>n},da=(e,t,n)=>{for(let r in t)(n||!oa(r))&&(e[r]=t[r])},fa=(e,t,n)=>{let r=e.slots=ra();if(e.vnode.shapeFlag&32){let e=t._;e?(da(r,t,n),n&&he(r,`_`,e,!0)):la(t,r)}else t&&ua(e,t)},pa=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=f;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:da(i,t,n):(a=!t.$stable,la(t,i)),o=t}else t&&(ua(e,t),o={default:1});if(a)for(let e in i)!oa(e)&&o[e]==null&&delete i[e]},ma=Br,ha=e=>e.__isSuspense,ga=Symbol.for(`v-fgt`),_a=Symbol.for(`v-txt`),va=Symbol.for(`v-cmt`),ya=Symbol.for(`v-stc`),ba=[],xa=null,Sa=1,Ca=({key:e})=>e??null,wa=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:E(e)||pt(e)||T(e)?{i:Si,r:e,k:t,f:!!n}:e),L=qr,Ta=mr(),Ea=0,Da=null,Oa=()=>Da||Si;{let e=ve(),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)}};ka=t(`__VUE_INSTANCE_SETTERS__`,e=>Da=e),Aa=t(`__VUE_SSR_SETTERS__`,e=>Na=e)}ja=e=>{let t=Da;return ka(e),e.scope.on(),()=>{e.scope.off(),ka(t)}},Ma=()=>{Da&&Da.scope.off(),ka(null)},Na=!1,Ia={get(e,t){return He(e,`get`,``),e[t]}},La=(e,t)=>vt(e,t,Na),Ra=`3.5.38`}));function Ba(e,t,n){let r=e[So];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}function Va(e,t){e.style.display=t?e[Co]:`none`,e[wo]=!t}function Ha(e,t,n){let r=e.style,i=E(n),a=!1;if(n&&!i){if(t)if(E(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Ua(r,t,``)}else for(let e in t)n[e]??Ua(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Ua(r,i,``):Ga(e,i,!E(t)&&t?t[i]:void 0,o)||Ua(r,i,o)}}else if(i){if(t!==n){let e=r[Eo];e&&(n+=`;`+e),r.cssText=n,a=Do.test(n)}}else t&&e.removeAttribute(`style`);Co in e&&(e[Co]=a?r.display:``,e[wo]&&(r.display=`none`))}function Ua(e,t,n){if(S(n))n.forEach(n=>Ua(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=Wa(e,t);Oo.test(n)?e.setProperty(A(r),n.replace(Oo,``),`important`):e[r]=n}}function Wa(e,t){let n=Ao[t];if(n)return n;let r=le(t);if(r!==`filter`&&r in e)return Ao[t]=r;r=de(r);for(let n=0;n<ko.length;n++){let i=ko[n]+r;if(i in e)return Ao[t]=i}return t}function Ga(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&E(r)&&n===r}function Ka(e,t,n,r,i,a=Ce(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(jo,t.slice(6,t.length)):e.setAttributeNS(jo,t,n):n==null||a&&!c(n)?e.removeAttribute(t):e.setAttribute(t,a?``:D(n)?String(n):n)}function qa(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?go(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=c(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function Ja(e,t,n,r){e.addEventListener(t,n,r)}function Ya(e,t,n,r){e.removeEventListener(t,n,r)}function Xa(e,t,n,r,i=null){let a=e[Mo]||(e[Mo]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Za(t);r?Ja(e,n,a[t]=Qa(r,i),s):o&&(Ya(e,n,o,s),a[t]=void 0)}}function Za(e){let t;if(No.test(e)){t={};let n;for(;n=e.match(No);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===`:`?e.slice(3):A(e.slice(2)),t]}function Qa(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(S(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&hn(e,t,5,a)}}else hn(r,t,5,[e])};return n.value=e,n.attached=Io(),n}function $a(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Lo(t)&&T(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Lo(t)&&E(n)?!1:t in e}function eo(e,t){let n=e._def.props;if(!n)return!1;let r=le(t);return Array.isArray(n)?n.some(e=>le(e)===r):Object.keys(n).some(e=>le(e)===r)}function to(e){e.target.composing=!0}function no(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}function ro(e,t,n){return t&&(e=e.trim()),n&&(e=ge(e)),e}function io(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(S(t))i=d(t,r.props.value)>-1;else if(w(t))i=t.has(r.props.value);else{if(t===n)return;i=u(t,so(e,!0))}e.checked!==i&&(e.checked=i)}function ao(e,t){let n=e.multiple,r=S(t);if(!(n&&!r&&!w(t))){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=oo(a);if(n)if(r){let e=typeof o;e===`string`||e===`number`?a.selected=t.some(e=>String(e)===String(o)):a.selected=d(t,o)>-1}else a.selected=t.has(o);else if(u(oo(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function oo(e){return`_value`in e?e._value:e.value}function so(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}function co(e,t){switch(e){case`SELECT`:return Wo;case`TEXTAREA`:return Vo;default:switch(t){case`checkbox`:return Ho;case`radio`:return Uo;default:return Vo}}}function lo(e,t,n,r,i){let a=co(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function uo(){return Qo||=Ar(Zo)}function fo(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function po(e){return E(e)?document.querySelector(e):e}var mo,ho,go,_o,vo,yo,bo,xo,So,Co,wo,To,Eo,Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es=t((()=>{if(za(),za(),De(),mo=void 0,ho=typeof window<`u`&&window.trustedTypes,ho)try{mo=ho.createPolicy(`vue`,{createHTML:e=>e})}catch{}go=mo?e=>mo.createHTML(e):e=>e,_o=`http://www.w3.org/2000/svg`,vo=`http://www.w3.org/1998/Math/MathML`,yo=typeof document<`u`?document:null,bo=yo&&yo.createElement(`template`),xo={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?yo.createElementNS(_o,e):t===`mathml`?yo.createElementNS(vo,e):n?yo.createElement(e,{is:n}):yo.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>yo.createTextNode(e),createComment:e=>yo.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>yo.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{bo.innerHTML=go(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=bo.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},So=Symbol(`_vtc`),Co=Symbol(`_vod`),wo=Symbol(`_vsh`),To={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Co]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Va(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Va(e,!0),r.enter(e)):r.leave(e,()=>{Va(e,!1)}):Va(e,t))},beforeUnmount(e,{value:t}){Va(e,t)}},Eo=Symbol(``),Do=/(?:^|;)\s*display\s*:/,Oo=/\s*!important$/,ko=[`Webkit`,`Moz`,`ms`],Ao={},jo=`http://www.w3.org/1999/xlink`,Mo=Symbol(`_vei`),No=/(?:Once|Passive|Capture)$/,Po=0,Fo=Promise.resolve(),Io=()=>Po||=(Fo.then(()=>Po=0),Date.now()),Lo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ro=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?Ba(e,r,o):t===`style`?Ha(e,n,r):g(t)?_(t)||Xa(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):$a(e,t,r,o))?(qa(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Ka(e,t,r,o,a,t!==`value`)):e._isVueCE&&(eo(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!E(r)))?qa(e,le(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Ka(e,t,r,o))},zo=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return S(t)?e=>me(t,e):t},Bo=Symbol(`_assign`),Vo={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[Bo]=zo(i);let a=r||i.props&&i.props.type===`number`;Ja(e,t?`change`:`input`,t=>{t.target.composing||e[Bo](ro(e.value,n,a))}),(n||a)&&Ja(e,`change`,()=>{e.value=ro(e.value,n,a)}),t||(Ja(e,`compositionstart`,to),Ja(e,`compositionend`,no),Ja(e,`change`,no))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Bo]=zo(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ge(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Ho={deep:!0,created(e,t,n){e[Bo]=zo(n),Ja(e,`change`,()=>{let t=e._modelValue,n=oo(e),r=e.checked,i=e[Bo];if(S(t)){let e=d(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(w(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(so(e,r))})},mounted:io,beforeUpdate(e,t,n){e[Bo]=zo(n),io(e,t,n)}},Uo={created(e,{value:t},n){e.checked=u(t,n.props.value),e[Bo]=zo(n),Ja(e,`change`,()=>{e[Bo](oo(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Bo]=zo(r),t!==n&&(e.checked=u(t,r.props.value))}},Wo={deep:!0,created(e,{value:t,modifiers:{number:n}},r){let i=w(t);Ja(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ge(oo(e)):oo(e));e[Bo](e.multiple?i?new Set(t):t:t[0]),e._assigning=!0,vn(()=>{e._assigning=!1})}),e[Bo]=zo(r)},mounted(e,{value:t}){ao(e,t)},beforeUpdate(e,t,n){e[Bo]=zo(n)},updated(e,{value:t}){e._assigning||ao(e,t)}},Go={created(e,t,n){lo(e,t,n,null,`created`)},mounted(e,t,n){lo(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){lo(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){lo(e,t,n,r,`updated`)}},Ko=[`ctrl`,`shift`,`alt`,`meta`],qo={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>Ko.some(n=>e[`${n}Key`]&&!t.includes(n))},Jo=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=qo[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Yo={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Xo=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=A(n.key);if(t.some(e=>e===r||Yo[e]===r))return e(n)}))},Zo=v({patchProp:Ro},xo),$o=((...e)=>{let t=uo().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=po(e);if(!r)return;let i=t._component;!T(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,fo(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t})})),ts=t((()=>{es()}));function ns(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function rs(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&ns(e.default)}function is(e,t){let n={};for(let r in t){let i=t[r];n[r]=Us(i)?i.map(e):e(i)}return n}function as(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}function ss(e){return e==null?``:encodeURI(``+e).replace(tc,`|`).replace(Xs,`[`).replace(Zs,`]`)}function cs(e){return ss(e).replace(ec,`{`).replace(nc,`}`).replace(Qs,`^`)}function ls(e){return ss(e).replace(Ys,`%2B`).replace(rc,`+`).replace(Ws,`%23`).replace(Gs,`%26`).replace($s,"`").replace(ec,`{`).replace(nc,`}`).replace(Qs,`^`)}function us(e){return ls(e).replace(qs,`%3D`)}function ds(e){return ss(e).replace(Ws,`%23`).replace(Js,`%3F`)}function fs(e){return ds(e).replace(Ks,`%2F`)}function ps(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}function ms(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=Ss(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:ps(o)}}function hs(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function gs(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function _s(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&vs(t.matched[r],n.matched[i])&&ys(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function vs(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function ys(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!bs(e[n],t[n]))return!1;return!0}function bs(e,t){return Us(e)?xs(e,t):Us(t)?xs(t,e):e?.valueOf()===t?.valueOf()}function xs(e,t){return Us(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function Ss(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o<r.length;o++)if(s=r[o],s!==`.`)if(s===`..`)a>1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}function Cs(e){if(!e)if(Vs){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^\/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),ac(e)}function ws(e,t){return e.replace(lc,`#`)+t}function Ts(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}function Es(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=Ts(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function Ds(e,t){return(history.state?history.state.position-t:-1)+e}function Os(e,t){dc.set(e,t)}function ks(e){let t=dc.get(e);return dc.delete(e),t}function As(e){return typeof e==`string`||e&&typeof e==`object`}function js(e){return typeof e==`string`||typeof e==`symbol`}function Ms(e,t){return R(Error(),{type:e,[pc]:!0},t)}function Ns(e,t){return e instanceof Error&&pc in e&&(t==null||!!(e.type&t))}function Ps(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;e<n.length;++e){let r=n[e].replace(Ys,` `),i=r.indexOf(`=`),a=ps(i<0?r:r.slice(0,i)),o=i<0?null:ps(r.slice(i+1));if(a in t){let e=t[a];Us(e)||(e=t[a]=[e]),e.push(o)}else t[a]=o}return t}function Fs(e){let t=``;for(let n in e){let r=e[n];if(n=us(n),r==null){r!==void 0&&(t+=(t.length?`&`:``)+n);continue}(Us(r)?r.map(e=>e&&ls(e)):[r&&ls(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function Is(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=Us(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}function Ls(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Rs(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(Ms(fc.NAVIGATION_ABORTED,{from:n,to:t})):e instanceof Error?c(e):As(e)?c(Ms(fc.NAVIGATION_GUARD_REDIRECT,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function zs(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(!(t!==`beforeRouteEnter`&&!o.instances[e]))if(ns(s)){let c=(s.__vccOpts||s)[t];c&&a.push(Rs(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=rs(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&Rs(c,n,r,o,e,i)()}))}}return a}function Bs(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;o<a;o++){let a=t.matched[o];a&&(e.matched.find(e=>vs(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>vs(e,s))||i.push(s))}return[n,r,i]}var Vs,R,Hs,Us,Ws,Gs,Ks,qs,Js,Ys,Xs,Zs,Qs,$s,ec,tc,nc,rc,ic,ac,oc,sc,cc,lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc=t((()=>{ts(),Vs=typeof document<`u`,R=Object.assign,Hs=()=>{},Us=Array.isArray,Ws=/#/g,Gs=/&/g,Ks=/\//g,qs=/=/g,Js=/\?/g,Ys=/\+/g,Xs=/%5B/g,Zs=/%5D/g,Qs=/%5E/g,$s=/%60/g,ec=/%7B/g,tc=/%7C/g,nc=/%7D/g,rc=/%20/g,ic=/\/$/,ac=e=>e.replace(ic,``),oc={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0},sc=function(e){return e.pop=`pop`,e.push=`push`,e}({}),cc=function(e){return e.back=`back`,e.forward=`forward`,e.unknown=``,e}({}),lc=/^[^#]+#/,uc=()=>({left:window.scrollX,top:window.scrollY}),dc=new Map,fc=function(e){return e[e.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,e[e.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,e[e.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,e[e.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,e[e.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,e}({}),pc=Symbol(``),fc.MATCHER_NOT_FOUND,fc.NAVIGATION_GUARD_REDIRECT,fc.NAVIGATION_ABORTED,fc.NAVIGATION_CANCELLED,fc.NAVIGATION_DUPLICATED,mc=Symbol(``),hc=Symbol(``),gc=Symbol(``),_c=Symbol(``),vc=Symbol(``)}));function bc(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),gs(n,``)}return gs(n,e)+r+i}function xc(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=bc(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:sc.pop,direction:u?u>0?cc.forward:cc.back:cc.unknown})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(R({},e.state,{scroll:uc()}),``)}}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u),document.removeEventListener(`visibilitychange`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),document.addEventListener(`visibilitychange`,u),{pauseListeners:c,listen:l,destroy:d}}function Sc(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?uc():null}}function Cc(e){let{history:t,location:n}=window,r={value:bc(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:Jc()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,R({},t.state,Sc(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=R({},i.value,t.state,{forward:e,scroll:uc()});a(o.current,o,!0),a(e,R({},Sc(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function wc(e){e=Cs(e);let t=Cc(e),n=xc(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=R({location:``,base:e,go:r,createHref:ws.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}function Tc(e){if(!e)return[[]];if(e===`/`)return[[Zc]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=Xc.Static,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===Xc.Static?a.push({type:Yc.Static,value:l}):n===Xc.Param||n===Xc.ParamRegExp||n===Xc.ParamRegExpEnd?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:Yc.Param,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;s<e.length;){if(c=e[s++],c===`\\`&&n!==Xc.ParamRegExp){r=n,n=Xc.EscapeNext;continue}switch(n){case Xc.Static:c===`/`?(l&&d(),o()):c===`:`?(d(),n=Xc.Param):f();break;case Xc.EscapeNext:f(),n=r;break;case Xc.Param:c===`(`?n=Xc.ParamRegExp:Qc.test(c)?f():(d(),n=Xc.Static,c!==`*`&&c!==`?`&&c!==`+`&&s--);break;case Xc.ParamRegExp:c===`)`?u[u.length-1]==`\\`?u=u.slice(0,-1)+c:n=Xc.ParamRegExpEnd:u+=c;break;case Xc.ParamRegExpEnd:d(),n=Xc.Static,c!==`*`&&c!==`?`&&c!==`+`&&s--,u=``;break;default:t(`Unknown state`);break}}return n===Xc.ParamRegExp&&t(`Unfinished custom RegExp for param "${l}"`),d(),o(),i}function Ec(e,t){let n=R({},el,t),r=[],i=n.start?`^`:``,a=[];for(let t of e){let e=t.length?[]:[tl.Root];n.strict&&!t.length&&(i+=`/`);for(let r=0;r<t.length;r++){let o=t[r],s=tl.Segment+(n.sensitive?tl.BonusCaseSensitive:0);if(o.type===Yc.Static)r||(i+=`/`),i+=o.value.replace(nl,`\\$&`),s+=tl.Static;else if(o.type===Yc.Param){let{value:e,repeatable:n,optional:c,regexp:l}=o;a.push({name:e,repeatable:n,optional:c});let u=l||$c;if(u!==$c){s+=tl.BonusCustomRegExp;try{`${u}`}catch(t){throw Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let d=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(d=c&&t.length<2?`(?:/${d})`:`/`+d),c&&(d+=`?`),i+=d,s+=tl.Dynamic,c&&(s+=tl.BonusOptional),n&&(s+=tl.BonusRepeatable),u===`.*`&&(s+=tl.BonusWildcard)}e.push(s)}r.push(e)}if(n.strict&&n.end){let e=r.length-1;r[e][r[e].length-1]+=tl.BonusStrict}n.strict||(i+=`/?`),n.end?i+=`$`:n.strict&&!i.endsWith(`/`)&&(i+=`(?:/|$)`);let o=new RegExp(i,n.sensitive?``:`i`);function s(e){let t=e.match(o),n={};if(!t)return null;for(let e=1;e<t.length;e++){let r=t[e]||``,i=a[e-1];n[i.name]=r&&i.repeatable?r.split(`/`):r}return n}function c(t){let n=``,r=!1;for(let i of e){(!r||!n.endsWith(`/`))&&(n+=`/`),r=!1;for(let e of i)if(e.type===Yc.Static)n+=e.value;else if(e.type===Yc.Param){let{value:a,repeatable:o,optional:s}=e,c=a in t?t[a]:``;if(Us(c)&&!o)throw Error(`Provided param "${a}" is an array but it is not repeatable (* or + modifiers)`);let l=Us(c)?c.join(`/`):c;if(!l)if(s)i.length<2&&(n.endsWith(`/`)?n=n.slice(0,-1):r=!0);else throw Error(`Missing required param "${a}"`);n+=l}}return n||`/`}return{re:o,score:r,keys:a,parse:s,stringify:c}}function Dc(e,t){let n=0;for(;n<e.length&&n<t.length;){let r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===tl.Static+tl.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===tl.Static+tl.Segment?1:-1:0}function Oc(e,t){let n=0,r=e.score,i=t.score;for(;n<r.length&&n<i.length;){let e=Dc(r[n],i[n]);if(e)return e;n++}if(Math.abs(i.length-r.length)===1){if(kc(r))return 1;if(kc(i))return-1}return i.length-r.length}function kc(e){let t=e[e.length-1];return e.length>0&&t[t.length-1]<0}function Ac(e,t,n){let r=R(Ec(Tc(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function jc(e,t){let n=[],r=new Map;t=as(rl,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=Nc(e);s.aliasOf=r&&r.record;let l=as(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(Nc(R({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&u[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=Ac(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!Fc(d)&&o(e.name)),zc(d)&&c(d),s.children){let e=s.children;for(let t=0;t<e.length;t++)a(e[t],d,r&&r.children[t])}r||=d}return f?()=>{o(f)}:Hs}function o(e){if(js(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=Lc(e,n);n.splice(t,0,e),e.record.name&&!Fc(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw Ms(fc.MATCHER_NOT_FOUND,{location:e});s=i.record.name,a=R(Mc(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&Mc(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name);else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw Ms(fc.MATCHER_NOT_FOUND,{location:e,currentLocation:t});s=i.record.name,a=R({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:Ic(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function Mc(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Nc(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Pc(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Pc(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function Fc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ic(e){return e.reduce((e,t)=>R(e,t.meta),{})}function Lc(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;Oc(e,t[i])<0?r=i:n=i+1}let i=Rc(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function Rc(e){let t=e;for(;t=t.parent;)if(zc(t)&&Oc(e,t)===0)return t}function zc({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Bc(e){let t=jn(gc),n=jn(_c),r=La(()=>{let n=gt(e.to);return t.resolve(n)}),i=La(()=>{let{matched:e}=r.value,{length:t}=e,i=e[t-1],a=n.matched;if(!i||!a.length)return-1;let o=a.findIndex(vs.bind(null,i));if(o>-1)return o;let s=Wc(e[t-2]);return t>1&&Wc(i)===s&&a[a.length-1].path!==s?a.findIndex(vs.bind(null,e[t-2])):o}),a=La(()=>i.value>-1&&Uc(n.params,r.value.params)),o=La(()=>i.value>-1&&i.value===n.matched.length-1&&ys(n.params,r.value.params));function s(n={}){if(Hc(n)){let n=t[gt(e.replace)?`replace`:`push`](gt(e.to)).catch(Hs);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:r,href:La(()=>r.value.href),isActive:a,isExactActive:o,navigate:s}}function Vc(e){return e.length===1?e[0]:e}function Hc(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Uc(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!Us(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function Wc(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}function Gc(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}function Kc(e){let t=jc(e.routes,e),n=e.parseQuery||Ps,r=e.stringifyQuery||Fs,i=e.history,a=Ls(),o=Ls(),s=Ls(),c=mt(oc),l=oc;Vs&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let u=is.bind(null,e=>``+e),d=is.bind(null,fs),f=is.bind(null,ps);function p(e,n){let r,i;return js(e)?(r=t.getRecordMatcher(e),i=n):i=e,t.addRoute(i,r)}function m(e){let n=t.getRecordMatcher(e);n&&t.removeRoute(n)}function h(){return t.getRoutes().map(e=>e.record)}function g(e){return!!t.getRecordMatcher(e)}function _(e,a){if(a=R({},a||c.value),typeof e==`string`){let r=ms(n,e,a.path),o=t.resolve({path:r.path},a),s=i.createHref(r.fullPath);return R(r,o,{params:f(o.params),hash:ps(r.hash),redirectedFrom:void 0,href:s})}let o;if(e.path!=null)o=R({},e,{path:ms(n,e.path,a.path).path});else{let t=R({},e.params);for(let e in t)t[e]??delete t[e];o=R({},e,{params:d(t)}),a.params=d(a.params)}let s=t.resolve(o,a),l=e.hash||``;s.params=u(f(s.params));let p=hs(r,R({},e,{hash:cs(l),path:s.path})),m=i.createHref(p);return R({fullPath:p,hash:l,query:r===Fs?Is(e.query):e.query||{}},s,{redirectedFrom:void 0,href:m})}function v(e){return typeof e==`string`?ms(n,e,c.value.path):R({},e)}function y(e,t){if(l!==e)return Ms(fc.NAVIGATION_CANCELLED,{from:t,to:e})}function b(e){return C(e)}function x(e){return b(R(v(e),{replace:!0}))}function S(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=v(i):{path:i},i.params={}),R({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function C(e,t){let n=l=_(e),i=c.value,a=e.state,o=e.force,s=e.replace===!0,u=S(n,i);if(u)return C(R(v(u),{state:typeof u==`object`?R({},a,u.state):a,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&&_s(r,i,n)&&(f=Ms(fc.NAVIGATION_DUPLICATED,{to:d,from:i}),se(i,i,!0,!1)),(f?Promise.resolve(f):T(d,i)).catch(e=>Ns(e)?Ns(e,fc.NAVIGATION_GUARD_REDIRECT)?e:oe(e):ie(e,d,i)).then(e=>{if(e){if(Ns(e,fc.NAVIGATION_GUARD_REDIRECT))return C(R({replace:s},v(e.to),{state:typeof e.to==`object`?R({},a,e.to.state):a,force:o}),t||d)}else e=D(d,i,!0,s,a);return E(d,i,e),e})}function w(e,t){let n=y(e,t);return n?Promise.reject(n):Promise.resolve()}function ee(e){let t=ue.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function T(e,t){let n,[r,i,s]=Bs(e,t);n=zs(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(Rs(r,e,t))});let c=w.bind(null,e,t);return n.push(c),de(n).then(()=>{n=[];for(let r of a.list())n.push(Rs(r,e,t));return n.push(c),de(n)}).then(()=>{n=zs(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(Rs(r,e,t))});return n.push(c),de(n)}).then(()=>{n=[];for(let r of s)if(r.beforeEnter)if(Us(r.beforeEnter))for(let i of r.beforeEnter)n.push(Rs(i,e,t));else n.push(Rs(r.beforeEnter,e,t));return n.push(c),de(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=zs(s,`beforeRouteEnter`,e,t,ee),n.push(c),de(n))).then(()=>{n=[];for(let r of o.list())n.push(Rs(r,e,t));return n.push(c),de(n)}).catch(e=>Ns(e,fc.NAVIGATION_CANCELLED)?e:Promise.reject(e))}function E(e,t,n){s.list().forEach(r=>ee(()=>r(e,t,n)))}function D(e,t,n,r,a){let o=y(e,t);if(o)return o;let s=t===oc,l=Vs?history.state:{};n&&(r||s?i.replace(e.fullPath,R({scroll:s&&l&&l.scroll},a)):i.push(e.fullPath,a)),c.value=e,se(e,t,n,s),oe()}let O;function te(){O||=i.listen((e,t,n)=>{if(!A.listening)return;let r=_(e),a=S(r,A.currentRoute.value);if(a){C(R(a,{replace:!0,force:!0}),r).catch(Hs);return}l=r;let o=c.value;Vs&&Os(Ds(o.fullPath,n.delta),uc()),T(r,o).catch(e=>Ns(e,fc.NAVIGATION_ABORTED|fc.NAVIGATION_CANCELLED)?e:Ns(e,fc.NAVIGATION_GUARD_REDIRECT)?(C(R(v(e.to),{force:!0}),r).then(e=>{Ns(e,fc.NAVIGATION_ABORTED|fc.NAVIGATION_DUPLICATED)&&!n.delta&&n.type===sc.pop&&i.go(-1,!1)}).catch(Hs),Promise.reject()):(n.delta&&i.go(-n.delta,!1),ie(e,r,o))).then(e=>{e||=D(r,o,!1),e&&(n.delta&&!Ns(e,fc.NAVIGATION_CANCELLED)?i.go(-n.delta,!1):n.type===sc.pop&&Ns(e,fc.NAVIGATION_ABORTED|fc.NAVIGATION_DUPLICATED)&&i.go(-1,!1)),E(r,o,e)}).catch(Hs)})}let k=Ls(),ne=Ls(),re;function ie(e,t,n){oe(e);let r=ne.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function ae(){return re&&c.value!==oc?Promise.resolve():new Promise((e,t)=>{k.add([e,t])})}function oe(e){return re||(re=!e,te(),k.list().forEach(([t,n])=>e?n(e):t()),k.reset()),e}function se(t,n,r,i){let{scrollBehavior:a}=e;if(!Vs||!a)return Promise.resolve();let o=!r&&ks(Ds(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return vn().then(()=>a(t,n,o)).then(e=>e&&Es(e)).catch(e=>ie(e,t,n))}let ce=e=>i.go(e),le,ue=new Set,A={currentRoute:c,listening:!0,addRoute:p,removeRoute:m,clearRoutes:t.clearRoutes,hasRoute:g,getRoutes:h,resolve:_,options:e,push:b,replace:x,go:ce,back:()=>ce(-1),forward:()=>ce(1),beforeEach:a.add,beforeResolve:o.add,afterEach:s.add,onError:ne.add,isReady:ae,install(e){e.component(`RouterLink`,il),e.component(`RouterView`,sl),e.config.globalProperties.$router=A,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>gt(c)}),Vs&&!le&&c.value===oc&&(le=!0,b(i.location).catch(e=>{}));let t={};for(let e in oc)Object.defineProperty(t,e,{get:()=>c.value[e],enumerable:!0});e.provide(gc,A),e.provide(_c,at(t)),e.provide(vc,c);let n=e.unmount;ue.add(e),e.unmount=function(){ue.delete(e),ue.size<1&&(l=oc,O&&O(),O=null,c.value=oc,le=!1,re=!1),n()}}};function de(e){return e.reduce((e,t)=>e.then(()=>ee(t)),Promise.resolve())}return A}function qc(){return jn(gc)}var Jc,Yc,Xc,Zc,Qc,$c,el,tl,nl,rl,il,al,ol,sl,cl=t((()=>{yc(),ts(),Jc=()=>location.protocol+`//`+location.host,Yc=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.Group=2]=`Group`,e}({}),Xc=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.ParamRegExp=2]=`ParamRegExp`,e[e.ParamRegExpEnd=3]=`ParamRegExpEnd`,e[e.EscapeNext=4]=`EscapeNext`,e}(Xc||{}),Zc={type:Yc.Static,value:``},Qc=/[a-zA-Z0-9_]/,$c=`[^/]+?`,el={sensitive:!1,strict:!1,start:!0,end:!0},tl=function(e){return e[e._multiplier=10]=`_multiplier`,e[e.Root=90]=`Root`,e[e.Segment=40]=`Segment`,e[e.SubSegment=30]=`SubSegment`,e[e.Static=40]=`Static`,e[e.Dynamic=20]=`Dynamic`,e[e.BonusCustomRegExp=10]=`BonusCustomRegExp`,e[e.BonusWildcard=-50]=`BonusWildcard`,e[e.BonusRepeatable=-20]=`BonusRepeatable`,e[e.BonusOptional=-8]=`BonusOptional`,e[e.BonusStrict=.7000000000000001]=`BonusStrict`,e[e.BonusCaseSensitive=.25]=`BonusCaseSensitive`,e}(tl||{}),nl=/[.+*?^${}()[\]/\\]/g,rl={strict:!1,end:!0,sensitive:!1},il=Ln({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:Bc,setup(e,{slots:t}){let n=it(Bc(e)),{options:r}=jn(gc),i=La(()=>({[al(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[al(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&Vc(t.default(n));return e.custom?r:pi(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}}),al=(e,t,n)=>e??t??n,ol=Ln({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){let r=jn(vc),i=La(()=>e.route||r.value),a=jn(hc,0),o=La(()=>{let e=gt(a),{matched:t}=i.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),s=La(()=>i.value.matched[o.value]);An(hc,La(()=>o.value+1)),An(mc,s),An(vc,i);let c=N();return Mn(()=>[c.value,s.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!vs(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let r=i.value,a=e.name,o=s.value,l=o&&o.components[a];if(!l)return Gc(n.default,{Component:l,route:r});let u=o.props[a],d=u?u===!0?r.params:typeof u==`function`?u(r):u:null,f=pi(l,R({},d,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(o.instances[a]=null)},ref:c}));return Gc(n.default,{Component:f,route:r})||f}}}),sl=ol})),ll=t((()=>{})),ul,dl=t((()=>{ul=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n}})),fl,pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl,wl=t((()=>{ts(),cl(),ll(),dl(),fl={class:`app-shell`},pl={key:0},ml={key:1},hl={class:`nav-menu`},gl={class:`nav-bottom`},_l={class:`nav-icon`},vl={class:`app-main`},yl={class:`topbar`},bl={class:`header-left`},xl=[`title`],Sl={__name:`App`,setup(e){let t=qc(),n=N(!1),r=N(!1);return Mn(()=>t.currentRoute.value,()=>{r.value=!1}),(e,t)=>{let i=Jn(`router-link`),a=Jn(`router-view`);return P(),F(`div`,fl,[I(`button`,{class:`hamburger`,onClick:t[0]||=e=>r.value=!r.value},``),r.value?(P(),F(`div`,{key:0,class:`nav-overlay`,onClick:t[1]||=e=>r.value=!1})):Zr(``,!0),I(`aside`,{class:s([`app-nav`,{collapsed:n.value,open:r.value}])},[I(`div`,{class:`nav-brand`,onClick:t[2]||=t=>e.$router.push(`/`)},[n.value?(P(),F(`span`,pl,`M`)):(P(),F(`span`,ml,`mokee编辑器`))]),I(`nav`,hl,[L(i,{to:`/notes`,class:`nav-item`,title:`笔记`},{default:Dn(()=>[...t[5]||=[I(`span`,{class:`nav-icon`},`📝`,-1),I(`span`,{class:`nav-label`},`笔记`,-1)]]),_:1}),L(i,{to:`/websites`,class:`nav-item`,title:`网站管理`},{default:Dn(()=>[...t[6]||=[I(`span`,{class:`nav-icon`},`🔐`,-1),I(`span`,{class:`nav-label`},`网站管理`,-1)]]),_:1}),L(i,{to:`/shares`,class:`nav-item`,title:`分享管理`},{default:Dn(()=>[...t[7]||=[I(`span`,{class:`nav-icon`},`🔗`,-1),I(`span`,{class:`nav-label`},`分享管理`,-1)]]),_:1})]),I(`div`,gl,[I(`div`,{class:`nav-item`,onClick:t[3]||=e=>n.value=!n.value,title:`收起菜单`},[I(`span`,_l,j(n.value?``:``),1)])])],2),I(`div`,vl,[I(`header`,yl,[I(`div`,bl,[I(`button`,{class:`toggle-sidebar-btn`,onClick:t[4]||=e=>n.value=!n.value,title:n.value?`展开侧边栏`:`收起侧边栏`},j(n.value?``:``),9,xl),t[8]||=I(`span`,{class:`header-title`},`MoKeeText`,-1)]),t[9]||=I(`div`,{style:{flex:`1`}},null,-1),t[10]||=I(`a`,{class:`switch-system-btn`,href:`https://web.gw.zgitm.com/select`,title:`切换系统`},[I(`span`,{class:`switch-icon`},`🔄`),I(`span`,{class:`switch-label`},`切换系统`)],-1)]),L(a),t[11]||=I(`footer`,{class:`app-footer`},[I(`span`,null,`湘ICP备19021539号`),I(`span`,null,`MoKeeText v1.0`)],-1)])])}}},Cl=ul(Sl,[[`__scopeId`,`data-v-727c46b1`]])}));function Tl(e,t){return function(){return e.apply(t,arguments)}}var El=t((()=>{}));function Dl(e){return e!==null&&!Gl(e)&&e.constructor!==null&&!Gl(e.constructor)&&Jl(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}function Ol(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Kl(e.buffer),t}function kl(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}function Al(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),Wl(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Dl(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function jl(e,t){if(Dl(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}function Ml(...e){let{caseless:t,skipUndefined:n}=_u(this)&&this||{},r={},i=(e,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=t&&typeof i==`string`&&jl(r,i)||i,o=Rl(r,a)?r[a]:void 0;Ql(o)&&Ql(e)?r[a]=Ml(o,e):Ql(e)?r[a]=Ml({},e):Wl(e)?r[a]=e.slice():(!n||!Gl(e))&&(r[a]=e)};for(let t=0,n=e.length;t<n;t++){let n=e[t];if(!n||Dl(n)||(Al(n,i),typeof n!=`object`||Wl(n)))continue;let r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){let t=r[e];ku.call(n,t)&&i(n[t],t)}}return r}function Nl(e){return!!(e&&Jl(e.append)&&e[Ll]===`FormData`&&e[Il])}var Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,z,Uu=t((()=>{El(),{toString:Pl}=Object.prototype,{getPrototypeOf:Fl}=Object,{iterator:Il,toStringTag:Ll}=Symbol,Rl=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),zl=(e,t)=>{let n=e,r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),Rl(n,t))return!0;n=Fl(n)}return!1},Bl=(e,t)=>e!=null&&zl(e,t)?e[t]:void 0,Vl=(e=>t=>{let n=Pl.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Hl=e=>(e=e.toLowerCase(),t=>Vl(t)===e),Ul=e=>t=>typeof t===e,{isArray:Wl}=Array,Gl=Ul(`undefined`),Kl=Hl(`ArrayBuffer`),ql=Ul(`string`),Jl=Ul(`function`),Yl=Ul(`number`),Xl=e=>typeof e==`object`&&!!e,Zl=e=>e===!0||e===!1,Ql=e=>{if(!Xl(e))return!1;let t=Fl(e);return(t===null||t===Object.prototype||Fl(t)===null)&&!zl(e,Ll)&&!zl(e,Il)},$l=e=>{if(!Xl(e)||Dl(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},eu=Hl(`Date`),tu=Hl(`File`),nu=e=>!!(e&&e.uri!==void 0),ru=e=>e&&e.getParts!==void 0,iu=Hl(`Blob`),au=Hl(`FileList`),ou=e=>Xl(e)&&Jl(e.pipe),su=kl(),cu=su.FormData===void 0?void 0:su.FormData,lu=e=>{if(!e)return!1;if(cu&&e instanceof cu)return!0;let t=Fl(e);if(!t||t===Object.prototype||!Jl(e.append))return!1;let n=Vl(e);return n===`formdata`||n===`object`&&Jl(e.toString)&&e.toString()===`[object FormData]`},uu=Hl(`URLSearchParams`),[du,fu,pu,mu]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(Hl),hu=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``),gu=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,_u=e=>!Gl(e)&&e!==gu,vu=(e,t,n,{allOwnKeys:r}={})=>(Al(t,(t,r)=>{n&&Jl(t)?Object.defineProperty(e,r,{__proto__:null,value:Tl(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),yu=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),bu=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},xu=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&Fl(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Su=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},Cu=e=>{if(!e)return null;if(Wl(e))return e;let t=e.length;if(!Yl(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},wu=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&Fl(Uint8Array)),Tu=(e,t)=>{let n=(e&&e[Il]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},Eu=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Du=Hl(`HTMLFormElement`),Ou=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),{propertyIsEnumerable:ku}=Object.prototype,Au=Hl(`RegExp`),ju=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};Al(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},Mu=e=>{ju(e,(t,n)=>{if(Jl(e)&&[`arguments`,`caller`,`callee`].includes(n))return!1;let r=e[n];if(Jl(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},Nu=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Wl(e)?r(e):r(String(e).split(t)),n},Pu=()=>{},Fu=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Iu=e=>{let t=new WeakSet,n=e=>{if(Xl(e)){if(t.has(e))return;if(Dl(e))return e;if(!(`toJSON`in e)){t.add(e);let r=Wl(e)?[]:{};return Al(e,(e,t)=>{let i=n(e);!Gl(i)&&(r[t]=i)}),t.delete(e),r}}return e};return n(e)},Lu=Hl(`AsyncFunction`),Ru=e=>e&&(Xl(e)||Jl(e))&&Jl(e.then)&&Jl(e.catch),zu=((e,t)=>e?setImmediate:t?((e,t)=>(gu.addEventListener(`message`,({source:n,data:r})=>{n===gu&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),gu.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,Jl(gu.postMessage)),Bu=typeof queueMicrotask<`u`?queueMicrotask.bind(gu):typeof process<`u`&&process.nextTick||zu,Vu=e=>e!=null&&Jl(e[Il]),Hu=e=>e!=null&&zl(e,Il)&&Vu(e),z={isArray:Wl,isArrayBuffer:Kl,isBuffer:Dl,isFormData:lu,isArrayBufferView:Ol,isString:ql,isNumber:Yl,isBoolean:Zl,isObject:Xl,isPlainObject:Ql,isEmptyObject:$l,isReadableStream:du,isRequest:fu,isResponse:pu,isHeaders:mu,isUndefined:Gl,isDate:eu,isFile:tu,isReactNativeBlob:nu,isReactNative:ru,isBlob:iu,isRegExp:Au,isFunction:Jl,isStream:ou,isURLSearchParams:uu,isTypedArray:wu,isFileList:au,forEach:Al,merge:Ml,extend:vu,trim:hu,stripBOM:yu,inherits:bu,toFlatObject:xu,kindOf:Vl,kindOfTest:Hl,endsWith:Su,toArray:Cu,forEachEntry:Tu,matchAll:Eu,isHTMLForm:Du,hasOwnProperty:Rl,hasOwnProp:Rl,hasOwnInPrototypeChain:zl,getSafeProp:Bl,reduceDescriptors:ju,freezeMethods:Mu,toObjectSet:Nu,toCamelCase:Ou,noop:Pu,toFiniteNumber:Fu,findKey:jl,global:gu,isContextDefined:_u,isSpecCompliantForm:Nl,toJSONObject:Iu,isAsyncFn:Lu,isThenable:Ru,setImmediate:zu,asap:Bu,isIterable:Vu,isSafeIterable:Hu}})),Wu,Gu,Ku=t((()=>{Uu(),Wu=z.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),Gu=e=>{let t={},n,r,i;return e&&e.split(`
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&Wu[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t}}));function qu(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}function Ju(e,t){return z.isArray(e)?e.map(e=>Ju(e,t)):qu(String(e).replace(t,``))}function Yu(e){let t=Object.create(null);return z.forEach(e.toJSON(),(e,n)=>{t[n]=$u(e)}),t}var Xu,Zu,Qu,$u,ed=t((()=>{Uu(),Xu=RegExp(`[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+`,`g`),Zu=RegExp(`[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+`,`g`),Qu=e=>Ju(e,Xu),$u=e=>Ju(e,Zu)}));function td(e){return e&&String(e).trim().toLowerCase()}function nd(e){return e===!1||e==null?e:z.isArray(e)?e.map(nd):Qu(String(e))}function rd(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}function id(e,t,n,r,i){if(z.isFunction(r))return r.call(this,t,n);if(i&&(t=n),z.isString(t)){if(z.isString(r))return t.indexOf(r)!==-1;if(z.isRegExp(r))return r.test(t)}}function ad(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function od(e,t){let n=z.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var sd,cd,ld,ud=t((()=>{Uu(),Ku(),ed(),sd=Symbol(`internals`),cd=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()),ld=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=td(t);if(!i)return;let a=z.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=nd(e))}let a=(e,t)=>z.forEach(e,(e,n)=>i(e,n,t));if(z.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(z.isString(e)&&(e=e.trim())&&!cd(e))a(Gu(e),t);else if(z.isObject(e)&&z.isSafeIterable(e)){let n=Object.create(null),r,i;for(let t of e){if(!z.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);i=t[0],z.hasOwnProp(n,i)?(r=n[i],n[i]=z.isArray(r)?[...r,t[1]]:[r,t[1]]):n[i]=t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=td(e),e){let n=z.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return rd(e);if(z.isFunction(t))return t.call(this,e,n);if(z.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=td(e),e){let n=z.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||id(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=td(e),e){let i=z.findKey(n,e);i&&(!t||id(n,n[i],i,t))&&(delete n[i],r=!0)}}return z.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||id(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return z.forEach(this,(r,i)=>{let a=z.findKey(n,i);if(a){t[a]=nd(r),delete t[i];return}let o=e?ad(i):String(i).trim();o!==i&&delete t[i],t[o]=nd(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return z.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&z.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[sd]=this[sd]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=td(e);t[r]||(od(n,e),t[r]=!0)}return z.isArray(e)?e.forEach(r):r(e),this}},ld.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),z.reduceDescriptors(ld.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),z.freezeMethods(ld)}));function dd(e){if(z.hasOwnProp(e,`toJSON`))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(z.hasOwnProp(t,`toJSON`))return!0;t=Object.getPrototypeOf(t)}return!1}function fd(e,t){let n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(typeof e!=`object`||!e||z.isBuffer(e))return e;if(r.indexOf(e)!==-1)return;e instanceof ld&&(e=e.toJSON()),r.push(e);let t;if(z.isArray(e))t=[],e.forEach((e,n)=>{let r=i(e);z.isUndefined(r)||(t[n]=r)});else{if(!z.isPlainObject(e)&&dd(e))return r.pop(),e;t=Object.create(null);for(let[r,a]of Object.entries(e)){let e=n.has(r.toLowerCase())?pd:i(a);z.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}var pd,B,md=t((()=>{Uu(),ud(),pd=`[REDACTED ****]`,B=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return Object.defineProperty(s,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){let e=this.config,t=e&&z.hasOwnProp(e,`redact`)?e.redact:void 0,n=z.isArray(t)&&t.length>0?fd(e,t):z.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}},B.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,B.ERR_BAD_OPTION=`ERR_BAD_OPTION`,B.ECONNABORTED=`ECONNABORTED`,B.ETIMEDOUT=`ETIMEDOUT`,B.ECONNREFUSED=`ECONNREFUSED`,B.ERR_NETWORK=`ERR_NETWORK`,B.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,B.ERR_DEPRECATED=`ERR_DEPRECATED`,B.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,B.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,B.ERR_CANCELED=`ERR_CANCELED`,B.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,B.ERR_INVALID_URL=`ERR_INVALID_URL`,B.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`})),hd=t((()=>{}));function gd(e){return z.isPlainObject(e)||z.isArray(e)}function _d(e){return z.endsWith(e,`[]`)?e.slice(0,-2):e}function vd(e,t,n){return e?e.concat(t).map(function(e,t){return e=_d(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function yd(e){return z.isArray(e)&&!e.some(gd)}function bd(e,t,n){if(!z.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!z.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||m,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=n.maxDepth===void 0?100:n.maxDepth,l=s&&z.isSpecCompliantForm(t),u=[];if(!z.isFunction(i))throw TypeError(`visitor must be a function`);function d(e){if(e===null)return``;if(z.isDate(e))return e.toISOString();if(z.isBoolean(e))return e.toString();if(!l&&z.isBlob(e))throw new B(`Blob is not supported. Use a Buffer instead.`);if(z.isArrayBuffer(e)||z.isTypedArray(e)){if(l&&typeof s==`function`)return new s([e]);if(typeof Buffer<`u`)return Buffer.from(e);throw new B(`Blob is not supported. Use a Buffer instead.`,B.ERR_NOT_SUPPORT)}return e}function f(e){if(e>c)throw new B(`Object is too deeply nested (`+e+` levels). Max depth: `+c,B.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(e,t){if(c===1/0)return JSON.stringify(e);let n=[];return JSON.stringify(e,function(e,r){if(!z.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),f(t+n.length-1),r})}function m(e,n,i){let s=e;if(z.isReactNative(t)&&z.isReactNativeBlob(e))return t.append(vd(i,n,a),d(e)),!1;if(e&&!i&&typeof e==`object`){if(z.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=p(e,1);else if(z.isArray(e)&&yd(e)||(z.isFileList(e)||z.endsWith(n,`[]`))&&(s=z.toArray(e)))return n=_d(n),s.forEach(function(e,r){!(z.isUndefined(e)||e===null)&&t.append(o===!0?vd([n],r,a):o===null?n:n+`[]`,d(e))}),!1}return gd(e)?!0:(t.append(vd(i,n,a),d(e)),!1)}let h=Object.assign(xd,{defaultVisitor:m,convertValue:d,isVisitable:gd});function g(e,n,r=0){if(!z.isUndefined(e)){if(f(r),u.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));u.push(e),z.forEach(e,function(e,a){(!(z.isUndefined(e)||e===null)&&i.call(t,e,z.isString(a)?a.trim():a,n,h))===!0&&g(e,n?n.concat(a):[a],r+1)}),u.pop()}}if(!z.isObject(e))throw TypeError(`data must be an object`);return g(e),t}var xd,Sd=t((()=>{Uu(),md(),hd(),xd=z.toFlatObject(z,{},null,function(e){return/^is[A-Z]/.test(e)})}));function Cd(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function wd(e,t){this._pairs=[],e&&bd(e,this,t)}var Td,Ed=t((()=>{Sd(),Td=wd.prototype,Td.append=function(e,t){this._pairs.push([e,t])},Td.toString=function(e){let t=e?t=>e.call(this,t,Cd):Cd;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)}}));function Dd(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function Od(e,t,n){if(!t)return e;e||=``;let r=z.isFunction(n)?{serialize:n}:n,i=z.getSafeProp(r,`encode`)||Dd,a=z.getSafeProp(r,`serialize`),o;if(o=a?a(t,r):z.isURLSearchParams(t)?t.toString():new wd(t,r).toString(i),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var kd=t((()=>{Uu(),Ed()})),Ad,jd=t((()=>{Uu(),Ad=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){z.forEach(this.handlers,function(t){t!==null&&e(t)})}}})),Md,Nd=t((()=>{Md={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0}})),Pd,Fd=t((()=>{Ed(),Pd=typeof URLSearchParams<`u`?URLSearchParams:wd})),Id,Ld=t((()=>{Id=typeof FormData<`u`?FormData:null})),Rd,zd=t((()=>{Rd=typeof Blob<`u`?Blob:null})),Bd,Vd=t((()=>{Fd(),Ld(),zd(),Bd={isBrowser:!0,classes:{URLSearchParams:Pd,FormData:Id,Blob:Rd},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]}})),Hd=r({hasBrowserEnv:()=>Ud,hasStandardBrowserEnv:()=>Gd,hasStandardBrowserWebWorkerEnv:()=>Kd,navigator:()=>Wd,origin:()=>qd}),Ud,Wd,Gd,Kd,qd,Jd=t((()=>{Ud=typeof window<`u`&&typeof document<`u`,Wd=typeof navigator==`object`&&navigator||void 0,Gd=Ud&&(!Wd||[`ReactNative`,`NativeScript`,`NS`].indexOf(Wd.product)<0),Kd=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,qd=Ud&&window.location.href||`http://localhost`})),Yd,Xd=t((()=>{Vd(),Jd(),Yd={...Hd,...Bd}}));function Zd(e,t){return bd(e,new Yd.classes.URLSearchParams,{visitor:function(e,t,n,r){return Yd.isNode&&z.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}var Qd=t((()=>{Uu(),Sd(),Xd()}));function $d(e){if(e>rf)throw new B(`FormData field is too deeply nested (`+e+` levels). Max depth: `+rf,B.ERR_FORM_DATA_DEPTH_EXCEEDED)}function ef(e){let t=[],n=/\w+|\[(\w*)]/g,r;for(;(r=n.exec(e))!==null;)$d(t.length),t.push(r[0]===`[]`?``:r[1]||r[0]);return t}function tf(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function nf(e){function t(e,n,r,i){$d(i);let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&z.isArray(r)?r.length:a,s?(z.hasOwnProp(r,a)?r[a]=z.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!z.hasOwnProp(r,a)||!z.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&z.isArray(r[a])&&(r[a]=tf(r[a])),!o)}if(z.isFormData(e)&&z.isFunction(e.entries)){let n={};return z.forEachEntry(e,(e,r)=>{t(ef(e),r,n,0)}),n}return null}var rf,af=t((()=>{Uu(),md(),Sd(),rf=100}));function of(e,t,n){if(z.isString(e))try{return(t||JSON.parse)(e),z.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var sf,cf,lf=t((()=>{Uu(),md(),Nd(),Sd(),Qd(),Xd(),af(),sf=(e,t)=>e!=null&&z.hasOwnProp(e,t)?e[t]:void 0,cf={transitional:Md,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=z.isObject(e);if(i&&z.isHTMLForm(e)&&(e=new FormData(e)),z.isFormData(e))return r?JSON.stringify(nf(e)):e;if(z.isArrayBuffer(e)||z.isBuffer(e)||z.isStream(e)||z.isFile(e)||z.isBlob(e)||z.isReadableStream(e))return e;if(z.isArrayBufferView(e))return e.buffer;if(z.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=sf(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return Zd(e,t).toString();if((a=z.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=sf(this,`env`),r=n&&n.FormData;return bd(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),of(e)):e}],transformResponse:[function(e){let t=sf(this,`transitional`)||cf.transitional,n=t&&t.forcedJSONParsing,r=sf(this,`responseType`),i=r===`json`;if(z.isResponse(e)||z.isReadableStream(e))return e;if(e&&z.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,sf(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?B.from(e,B.ERR_BAD_RESPONSE,this,null,sf(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:Yd.classes.FormData,Blob:Yd.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}},z.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`],e=>{cf.headers[e]={}})}));function uf(e,t){let n=this||cf,r=t||n,i=ld.from(r.headers),a=r.data;return z.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}var df=t((()=>{Uu(),lf(),ud()}));function ff(e){return!!(e&&e.__CANCEL__)}var pf=t((()=>{})),mf,hf=t((()=>{md(),mf=class extends B{constructor(e,t,n){super(e??`canceled`,B.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}}}));function gf(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new B(`Request failed with status code `+n.status,n.status>=400&&n.status<500?B.ERR_BAD_REQUEST:B.ERR_BAD_RESPONSE,n.config,n.request,n))}var _f=t((()=>{md()}));function vf(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||``}var yf=t((()=>{}));function bf(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}var xf=t((()=>{}));function Sf(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var Cf=t((()=>{})),wf,Tf,Ef,Df=t((()=>{xf(),Cf(),Uu(),wf=(e,t,n=3)=>{let r=0,i=bf(50,250);return Sf(n=>{if(!n||typeof n.loaded!=`number`)return;let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},Tf=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ef=e=>(...t)=>z.asap(()=>e(...t))})),Of,kf=t((()=>{Xd(),Of=Yd.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Yd.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Yd.origin),Yd.navigator&&/(msie|trident)/i.test(Yd.navigator.userAgent)):()=>!0})),Af,jf=t((()=>{Uu(),Xd(),Af=Yd.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];z.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),z.isString(r)&&s.push(`path=${r}`),z.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),z.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.split(`;`);for(let n=0;n<t.length;n++){let r=t[n].replace(/^\s+/,``),i=r.indexOf(`=`);if(i!==-1&&r.slice(0,i)===e)try{return decodeURIComponent(r.slice(i+1))}catch{return r.slice(i+1)}}return null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}}}));function Mf(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}var Nf=t((()=>{}));function Pf(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}var Ff=t((()=>{}));function If(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function Lf(e){return If(e).replace(Vf,``)}function Rf(e,t){if(typeof e==`string`&&Bf.test(Lf(e)))throw new B(`Invalid URL: missing "//" after protocol`,B.ERR_INVALID_URL,t)}function zf(e,t,n,r){Rf(t,r);let i=!Mf(t);return e&&(i||n===!1)?(Rf(e,r),Pf(e,t)):t}var Bf,Vf,Hf=t((()=>{md(),Nf(),Ff(),Bf=/^https?:(?!\/\/)/i,Vf=/[\t\n\r]/g}));function Uf(e,t){e||={},t||={};let n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return z.isPlainObject(e)&&z.isPlainObject(t)?z.merge.call({caseless:r},e,t):z.isPlainObject(t)?z.merge({},t):z.isArray(t)?t.slice():t}function i(e,t,n,i){if(!z.isUndefined(t))return r(e,t,n,i);if(!z.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!z.isUndefined(t))return r(void 0,t)}function o(e,t){if(!z.isUndefined(t))return r(void 0,t);if(!z.isUndefined(e))return r(void 0,e)}function s(n){let r=z.hasOwnProp(t,`transitional`)?t.transitional:void 0;if(!z.isUndefined(r))if(z.isPlainObject(r)){if(z.hasOwnProp(r,n))return r[n]}else return;let i=z.hasOwnProp(e,`transitional`)?e.transitional:void 0;if(z.isPlainObject(i)&&z.hasOwnProp(i,n))return i[n]}function c(n,i,a){if(z.hasOwnProp(t,a))return r(n,i);if(z.hasOwnProp(e,a))return r(void 0,n)}let l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:c,headers:(e,t,n)=>i(Wf(e),Wf(t),n,!0)};return z.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=z.hasOwnProp(l,r)?l[r]:i,o=a(z.hasOwnProp(e,r)?e[r]:void 0,z.hasOwnProp(t,r)?t[r]:void 0,r);z.isUndefined(o)&&a!==c||(n[r]=o)}),z.hasOwnProp(t,`validateStatus`)&&z.isUndefined(t.validateStatus)&&s(`validateStatusUndefinedResolves`)===!1&&(z.hasOwnProp(e,`validateStatus`)?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}var Wf,Gf=t((()=>{Uu(),ud(),Wf=e=>e instanceof ld?{...e}:e}));function Kf(e,t,n){if(n!==`content-only`){e.set(t);return}Object.entries(t||{}).forEach(([t,n])=>{Jf.includes(t.toLowerCase())&&e.set(t,n)})}function qf(e){let t=Uf({},e),n=e=>z.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=ld.from(s),t.url=Od(zf(l,d,u,t),n(`params`),n(`paramsSerializer`)),c){let t=z.getSafeProp(c,`username`)||``,n=z.getSafeProp(c,`password`)||``;try{s.set(`Authorization`,`Basic `+btoa(t+`:`+(n?Yf(n):``)))}catch(t){throw B.from(t,B.ERR_BAD_OPTION_VALUE,e)}}if(z.isFormData(r)&&(Yd.hasStandardBrowserEnv||Yd.hasStandardBrowserWebWorkerEnv||z.isReactNative(r)?s.setContentType(void 0):z.isFunction(r.getHeaders)&&Kf(s,r.getHeaders(),n(`formDataHeaderPolicy`))),Yd.hasStandardBrowserEnv&&(z.isFunction(i)&&(i=i(t)),i===!0||i==null&&Of(t.url))){let e=a&&o&&Af.read(o);e&&s.set(a,e)}return t}var Jf,Yf,Xf=t((()=>{Xd(),Uu(),md(),kf(),jf(),Hf(),Gf(),ud(),kd(),Jf=[`content-type`,`content-length`],Yf=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)))})),Zf,Qf,$f=t((()=>{Uu(),_f(),Nd(),md(),hf(),yf(),Xd(),ud(),Df(),Xf(),ed(),Zf=typeof XMLHttpRequest<`u`,Qf=Zf&&function(e){return new Promise(function(t,n){let r=qf(e),i=r.data,a=ld.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=ld.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());gf(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.startsWith(`file:`))||setTimeout(g)},h.onabort=function(){h&&=(n(new B(`Request aborted`,B.ECONNABORTED,e,h)),m(),null)},h.onerror=function(t){let r=new B(t&&t.message?t.message:`Network Error`,B.ERR_NETWORK,e,h);r.event=t||null,n(r),m(),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||Md;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new B(t,i.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,h)),m(),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&z.forEach(Yu(a),function(e,t){h.setRequestHeader(t,e)}),z.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=wf(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=wf(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new mf(null,e,h):t),h.abort(),m(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=vf(r.url);if(_&&!Yd.protocols.includes(_)){n(new B(`Unsupported protocol `+_+`:`,B.ERR_BAD_REQUEST,e)),m();return}h.send(i||null)})}})),ep,tp=t((()=>{hf(),md(),Uu(),ep=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,r=!1,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof B?t:new mf(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new B(`timeout of ${t}ms exceeded`,B.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i,{once:!0}));let{signal:s}=n;return s.unsubscribe=()=>z.asap(o),s}})),np,rp,ip,ap,op=t((()=>{np=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},rp=async function*(e,t){for await(let n of ip(e))yield*np(n,t)},ip=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ap=(e,t,n,r)=>{let i=rp(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})}}));function sp(e){if(!e||typeof e!=`string`||!e.startsWith(`data:`))return 0;let t=e.indexOf(`,`);if(t<0)return 0;let n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length,t=r.length;for(let n=0;n<t;n++)if(r.charCodeAt(n)===37&&n+2<t){let t=r.charCodeAt(n+1),i=r.charCodeAt(n+2);cp(t)&&cp(i)&&(e-=2,n+=2)}let n=0,i=t-1,a=e=>e>=2&&r.charCodeAt(e-2)===37&&r.charCodeAt(e-1)===51&&(r.charCodeAt(e)===68||r.charCodeAt(e)===100);i>=0&&(r.charCodeAt(i)===61?(n++,i--):a(i)&&(n++,i-=3)),n===1&&i>=0&&(r.charCodeAt(i)===61||a(i))&&n++;let o=Math.floor(e/4)*3-(n||0);return o>0?o:0}let i=0;for(let e=0,t=r.length;e<t;e++){let n=r.charCodeAt(e);if(n===37&&lp(r,e,t))i+=1,e+=2;else if(n<128)i+=1;else if(n<2048)i+=2;else if(n>=55296&&n<=56319&&e+1<t){let t=r.charCodeAt(e+1);t>=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}var cp,lp,up=t((()=>{cp=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,lp=(e,t,n)=>t+2<n&&cp(e.charCodeAt(t+1))&&cp(e.charCodeAt(t+2))})),dp,fp=t((()=>{dp=`1.18.1`})),pp,mp,hp,gp,_p,vp,yp,bp,xp,Sp=t((()=>{Xd(),Uu(),md(),tp(),op(),ud(),Df(),Xf(),_f(),up(),fp(),ed(),pp=64*1024,{isFunction:mp}=z,hp=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),gp=e=>{if(!z.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},_p=(e,...t)=>{try{return!!e(...t)}catch{return!1}},vp=e=>{let t=e.indexOf(`://`),n=e;return t!==-1&&(n=n.slice(t+3)),n.includes(`@`)||n.includes(`:`)},yp=e=>{let t=z.global!==void 0&&z.global!==null?z.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=z.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:i,Request:a,Response:o}=e,s=i?mp(i):typeof fetch==`function`,c=mp(a),l=mp(o);if(!s)return!1;let u=s&&mp(n),d=s&&(typeof r==`function`?(e=>t=>e.encode(t))(new r):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=c&&u&&_p(()=>{let e=!1,t=new a(Yd.origin,{body:new n,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),p=l&&u&&_p(()=>z.isReadableStream(new o(``).body)),m={stream:p&&(e=>e.body)};s&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new B(`Response type '${e}' is not supported`,B.ERR_NOT_SUPPORT,n)})});let h=async e=>{if(e==null)return 0;if(z.isBlob(e))return e.size;if(z.isSpecCompliantForm(e))return(await new a(Yd.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(z.isArrayBufferView(e)||z.isArrayBuffer(e))return e.byteLength;if(z.isURLSearchParams(e)&&(e+=``),z.isString(e))return(await d(e)).byteLength},g=async(e,t)=>z.toFiniteNumber(e.getContentLength())??h(t);return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:d,timeout:_,onDownloadProgress:v,onUploadProgress:y,responseType:b,headers:x,withCredentials:S=`same-origin`,fetchOptions:C,maxContentLength:w,maxBodyLength:ee}=qf(e),T=z.isNumber(w)&&w>-1,E=z.isNumber(ee)&&ee>-1,D=t=>z.hasOwnProp(e,t)?e[t]:void 0,O=i||fetch;b=b?(b+``).toLowerCase():`text`;let te=ep([l,d&&d.toAbortSignal()],_),k=null,ne=te&&te.unsubscribe&&(()=>{te.unsubscribe()}),re,ie=null,ae=()=>new B(`Request body larger than maxBodyLength limit`,B.ERR_BAD_REQUEST,e,k);try{let i,l=D(`auth`);if(l&&(i={username:z.getSafeProp(l,`username`)||``,password:z.getSafeProp(l,`password`)||``}),vp(t)){let e=new URL(t,Yd.origin);!i&&(e.username||e.password)&&(i={username:gp(e.username),password:gp(e.password)}),(e.username||e.password)&&(e.username=``,e.password=``,t=e.href)}if(i&&(x.delete(`authorization`),x.set(`Authorization`,`Basic `+btoa(hp((i.username||``)+`:`+(i.password||``))))),T&&typeof t==`string`&&t.startsWith(`data:`)&&sp(t)>w)throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,k);if(E&&n!==`get`&&n!==`head`){let e=await h(s);if(typeof e==`number`&&isFinite(e)&&(re=e,e>ee))throw ae()}let d=E&&(z.isReadableStream(s)||z.isStream(s)),_=(e,t,n)=>ap(e,pp,e=>{if(E&&e>ee)throw ie=ae();t&&t(e)},n);if(f&&n!==`get`&&n!==`head`&&(y||d)){if(re??=await g(x,s),re!==0||d){let e=new a(t,{method:`POST`,body:s,duplex:`half`}),n;if(z.isFormData(s)&&(n=e.headers.get(`content-type`))&&x.setContentType(n),e.body){let[t,n]=y&&Tf(re,wf(Ef(y)))||[];s=_(e.body,t,n)}}}else if(d&&!c&&u&&n!==`get`&&n!==`head`)s=_(s);else if(d&&c&&!f&&n!==`get`&&n!==`head`)throw new B(`Stream request bodies are not supported by the current fetch implementation`,B.ERR_NOT_SUPPORT,e,k);z.isString(S)||(S=S?`include`:`omit`);let oe=c&&`credentials`in a.prototype;if(z.isFormData(s)){let e=x.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&x.delete(`content-type`)}x.set(`User-Agent`,`axios/`+dp,!1);let se={...C,signal:te,method:n.toUpperCase(),headers:Yu(x.normalize()),body:s,duplex:`half`,credentials:oe?S:void 0};k=c&&new a(t,se);let ce=await(c?O(k,C):O(t,se)),le=ld.from(ce.headers);if(T){let t=z.toFiniteNumber(le.getContentLength());if(t!=null&&t>w)throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,k)}let ue=p&&(b===`stream`||b===`response`);if(p&&ce.body&&(v||T||ue&&ne)){let t={};[`status`,`statusText`,`headers`].forEach(e=>{t[e]=ce[e]});let n=z.toFiniteNumber(le.getContentLength()),[r,i]=v&&Tf(n,wf(Ef(v),!0))||[],a=0;ce=new o(ap(ce.body,pp,t=>{if(T&&(a=t,a>w))throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,k);r&&r(t)},()=>{i&&i(),ne&&ne()}),t)}b||=`text`;let A=await m[z.findKey(m,b)||`text`](ce,e);if(T&&!p&&!ue){let t;if(A!=null&&(typeof A.byteLength==`number`?t=A.byteLength:typeof A.size==`number`?t=A.size:typeof A==`string`&&(t=typeof r==`function`?new r().encode(A).byteLength:A.length)),typeof t==`number`&&t>w)throw new B(`maxContentLength size of `+w+` exceeded`,B.ERR_BAD_RESPONSE,e,k)}return!ue&&ne&&ne(),await new Promise((t,n)=>{gf(t,n,{data:A,headers:ld.from(ce.headers),status:ce.status,statusText:ce.statusText,config:e,request:k})})}catch(t){if(ne&&ne(),te&&te.aborted&&te.reason instanceof B){let n=te.reason;throw n.config=e,k&&(n.request=k),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(ie)throw k&&!ie.request&&(ie.request=k),ie;if(t instanceof B)throw k&&!t.request&&(t.request=k),t;if(t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)){let n=new B(`Network Error`,B.ERR_NETWORK,e,k,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw B.from(t,t&&t.code,e,k,t&&t.response)}}},bp=new Map,xp=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=bp;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:yp(t)),l=c;return c},xp()}));function Cp(e,t){e=z.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!Ep(r)&&(i=wp[(n=String(r)).toLowerCase()],i===void 0))throw new B(`Unknown adapter '${n}'`);if(i&&(z.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new B(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
`+e.map(Tp).join(`
`):` `+Tp(e[0]):`as no adapter specified`),B.ERR_NOT_SUPPORT)}return i}var wp,Tp,Ep,Dp,Op=t((()=>{Uu(),hd(),$f(),Sp(),md(),wp={http:null,xhr:Qf,fetch:{get:xp}},z.forEach(wp,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}),Tp=e=>`- ${e}`,Ep=e=>z.isFunction(e)||e===null||e===!1,Dp={getAdapter:Cp,adapters:wp}}));function kp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new mf(null,e)}function Ap(e){return kp(e),e.headers=ld.from(e.headers),e.data=uf.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),Dp.getAdapter(e.adapter||cf.adapter,e)(e).then(function(t){kp(e),e.response=t;try{t.data=uf.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=ld.from(t.headers),t},function(t){if(!ff(t)&&(kp(e),t&&t.response)){e.response=t.response;try{t.response.data=uf.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=ld.from(t.response.headers)}return Promise.reject(t)})}var jp=t((()=>{df(),pf(),lf(),hf(),ud(),Op()}));function Mp(e,t,n){if(typeof e!=`object`||!e)throw new B(`options must be an object`,B.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new B(`option `+a+` must be `+n,B.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new B(`Unknown option `+a,B.ERR_BAD_OPTION)}}var Np,Pp,Fp,Ip=t((()=>{fp(),md(),Np={},[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{Np[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}}),Pp={},Np.transitional=function(e,t,n){function r(e,t){return`[Axios v`+dp+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new B(r(i,` has been removed`+(t?` in `+t:``)),B.ERR_DEPRECATED);return t&&!Pp[i]&&(Pp[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},Np.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)},Fp={assertOptions:Mp,validators:Np}})),Lp,Rp,zp=t((()=>{Uu(),kd(),jd(),jp(),Gf(),Hf(),Ip(),ud(),Nd(),Lp=Fp.validators,Rp=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ad,response:new Ad}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>{if(!t.stack)return``;let e=t.stack.indexOf(`
`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(`
`),r=t===-1?-1:n.indexOf(`
`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=`
`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=Uf(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&Fp.assertOptions(n,{silentJSONParsing:Lp.transitional(Lp.boolean),forcedJSONParsing:Lp.transitional(Lp.boolean),clarifyTimeoutError:Lp.transitional(Lp.boolean),legacyInterceptorReqResOrdering:Lp.transitional(Lp.boolean),advertiseZstdAcceptEncoding:Lp.transitional(Lp.boolean),validateStatusUndefinedResolves:Lp.transitional(Lp.boolean)},!1),r!=null&&(z.isFunction(r)?t.paramsSerializer={serialize:r}:Fp.assertOptions(r,{encode:Lp.function,serialize:Lp.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),Fp.assertOptions(t,{baseUrl:Lp.spelling(`baseURL`),withXsrfToken:Lp.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&z.merge(i.common,i[t.method]);i&&z.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`,`common`],e=>{delete i[e]}),t.headers=ld.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||Md;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[Ap.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=Ap.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=Uf(this.defaults,e),Od(zf(e.baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}},z.forEach([`delete`,`get`,`head`,`options`],function(e){Rp.prototype[e]=function(t,n){return this.request(Uf(n||{},{method:e,url:t,data:n&&z.hasOwnProp(n,`data`)?n.data:void 0}))}}),z.forEach([`post`,`put`,`patch`,`query`],function(e){function t(t){return function(n,r,i){return this.request(Uf(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}Rp.prototype[e]=t(),e!==`query`&&(Rp.prototype[e+`Form`]=t(!0))})})),Bp,Vp=t((()=>{hf(),Bp=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new mf(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}}}));function Hp(e){return function(t){return e.apply(null,t)}}var Up=t((()=>{}));function Wp(e){return z.isObject(e)&&e.isAxiosError===!0}var Gp=t((()=>{Uu()})),Kp,qp=t((()=>{Kp={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526},Object.entries(Kp).forEach(([e,t])=>{Kp[t]=e})}));function Jp(e){let t=new Rp(e),n=Tl(Rp.prototype.request,t);return z.extend(n,Rp.prototype,t,{allOwnKeys:!0}),z.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return Jp(Uf(e,t))},n}var Yp,Xp=t((()=>{Uu(),El(),zp(),Gf(),lf(),af(),hf(),Vp(),pf(),fp(),Sd(),md(),Up(),Gp(),ud(),Op(),qp(),Yp=Jp(cf),Yp.Axios=Rp,Yp.CanceledError=mf,Yp.CancelToken=Bp,Yp.isCancel=ff,Yp.VERSION=dp,Yp.toFormData=bd,Yp.AxiosError=B,Yp.Cancel=Yp.CanceledError,Yp.all=function(e){return Promise.all(e)},Yp.spread=Hp,Yp.isAxiosError=Wp,Yp.mergeConfig=Uf,Yp.AxiosHeaders=ld,Yp.formToJSON=e=>nf(z.isHTMLForm(e)?new FormData(e):e),Yp.getAdapter=Dp.getAdapter,Yp.HttpStatusCode=Kp,Yp.default=Yp})),Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm=t((()=>{Xp(),{Axios:Zp,AxiosError:Qp,CanceledError:$p,isCancel:em,CancelToken:tm,VERSION:nm,all:rm,Cancel:im,isAxiosError:am,spread:om,toFormData:sm,AxiosHeaders:cm,HttpStatusCode:lm,formToJSON:um,getAdapter:dm,mergeConfig:fm,create:pm}=Yp}));function hm(){let e=document.cookie.match(/(?:^|;\s*)token=([^;]*)/);return e?decodeURIComponent(e[1]):null}var gm,_m,vm,ym,bm=t((()=>{mm(),gm=`mokeetext-edit`,_m=`https://gw.server.zgitm.com`,vm=`https://login.user.zgitm.com`,ym=Yp.create({baseURL:_m,timeout:3e4}),ym.interceptors.request.use(e=>{let t=hm();return t&&(e.headers.Authorization=`Bearer ${t}`),e.headers[`X-System-Code`]=gm,e}),ym.interceptors.response.use(e=>{let t=e.data;return t&&typeof t==`object`&&(t.code===200||t.code===0)?t:e},e=>(e.response?.status===401&&(window.location.href=`${vm}?systemCode=${gm}`),Promise.reject(e)))}));async function xm(e,t={}){let n=await fetch(Tm+e,{headers:{"Content-Type":`application/json`,"X-Dev-Mock-User":`admin`,...t.headers},...t});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.detail||n.statusText)}return n.json()}async function Sm(e,t={}){let n={method:(t.method||`GET`).toLowerCase(),url:e};return t.headers&&(n.headers=t.headers),t.body&&(n.data=JSON.parse(t.body)),(await ym(n)).data}function Cm(){return{listNotes:e=>Em(e?`/api/notes?folder_id=${e}`:`/api/notes`),getNote:e=>Em(`/api/notes/${e}`),createNote:e=>Em(`/api/notes`,{method:`POST`,body:JSON.stringify(e)}),updateNote:(e,t)=>Em(`/api/notes/${e}`,{method:`PUT`,body:JSON.stringify(t)}),deleteNote:e=>Em(`/api/notes/${e}`,{method:`DELETE`}),shareNote:(e,t)=>Em(`/api/notes/${e}/share`,{method:`POST`,body:JSON.stringify({ttl:t})}),unshareNote:e=>Em(`/api/notes/${e}/share`,{method:`DELETE`}),moveNote:(e,t)=>Em(`/api/notes/${e}/move`,{method:`PUT`,body:JSON.stringify({folder_id:t})}),listWebsites:e=>Em(e?`/api/websites?folder_id=${e}`:`/api/websites`),getWebsite:e=>Em(`/api/websites/${e}`),createWebsite:e=>Em(`/api/websites`,{method:`POST`,body:JSON.stringify(e)}),updateWebsite:(e,t)=>Em(`/api/websites/${e}`,{method:`PUT`,body:JSON.stringify(t)}),deleteWebsite:e=>Em(`/api/websites/${e}`,{method:`DELETE`}),getAccount:e=>Em(`/api/accounts/${e}`),addAccount:(e,t)=>Em(`/api/websites/${e}/accounts`,{method:`POST`,body:JSON.stringify(t)}),updateAccount:(e,t)=>Em(`/api/accounts/${e}`,{method:`PUT`,body:JSON.stringify(t)}),deleteAccount:e=>Em(`/api/accounts/${e}`,{method:`DELETE`}),moveAccount:(e,t)=>Em(`/api/accounts/${e}/move`,{method:`PUT`,body:JSON.stringify({direction:t})}),listFolders:e=>Em(`/api/folders?type=${e}`),createFolder:e=>Em(`/api/folders`,{method:`POST`,body:JSON.stringify(e)}),updateFolder:(e,t)=>Em(`/api/folders/${e}`,{method:`PUT`,body:JSON.stringify(t)}),deleteFolder:e=>Em(`/api/folders/${e}`,{method:`DELETE`}),parseImport:e=>Em(`/api/import/parse`,{method:`POST`,body:JSON.stringify({text:e})})}}var wm,Tm,Em,Dm=t((()=>{bm(),wm=window.location.hostname===`localhost`,Tm=`http://localhost:4006`,Em=wm?xm:Sm}));function Om(e){this.content=e}var km=t((()=>{Om.prototype={constructor:Om,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 t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new Om(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Om(n)},addToStart:function(e,t){return new Om([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Om(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new Om(i)},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=Om.from(e),e.size?new Om(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Om.from(e),e.size?new Om(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Om.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}},Om.from=function(e){if(e instanceof Om)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Om(t)}}));function Am(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&Nm(e.charCodeAt(r-1))&&Mm(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=Am(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function jm(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&Nm(e.charCodeAt(i-1))&&Mm(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=jm(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function Mm(e){return e>=56320&&e<57344}function Nm(e){return e>=55296&&e<56320}function Pm(e,t){return Th.index=e,Th.offset=t,Th}function Fm(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))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(!Fm(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Fm(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}function Im(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Im(a.content,t-i-1,n-i-1)))}function Lm(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=Lm(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function Rm(e,t,n){if(n.openStart>e.depth)throw new Eh(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Eh(`Inconsistent open depths`);return zm(e,t,n,0)}function zm(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=zm(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return Wm(a,Km(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Wm(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=qm(n,e);return Wm(a,Gm(e,i,o,t,r))}}function Bm(e,t){if(!t.type.compatibleContent(e.type))throw new Eh(`Cannot join `+t.type.name+` onto `+e.type.name)}function Vm(e,t,n){let r=e.node(n);return Bm(r,t.node(n)),r}function Hm(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 Um(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Hm(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Hm(i.child(e),r);t&&t.depth==n&&t.textOffset&&Hm(t.nodeBefore,r)}function Wm(e,t){if(!e.type.validContent(t))throw new Eh(`Invalid content for node `+e.type.name);return e.copy(t)}function Gm(e,t,n,r,i){let a=e.depth>i&&Vm(e,t,i+1),o=r.depth>i&&Vm(n,r,i+1),s=[];return Um(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Bm(a,o),Hm(Wm(a,Gm(e,t,n,r,i+1)),s)):(a&&Hm(Wm(a,Km(e,t,i+1)),s),Um(t,n,i,s),o&&Hm(Wm(o,Km(n,r,i+1)),s)),Um(r,null,i,s),new V(s)}function Km(e,t,n){let r=[];return Um(null,e,n,r),e.depth>n&&Hm(Wm(Vm(e,t,n+1),Km(e,t,n+1)),r),Um(t,null,n,r),new V(r)}function qm(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(V.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}function Jm(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function Ym(e){let t=[];do t.push(Xm(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Xm(e){let t=[];do t.push(Zm(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Zm(e){let t=th(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(`{`))t=$m(e,t);else break;return t}function Qm(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function $m(e,t){let n=Qm(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Qm(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function eh(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function th(e){if(e.eat(`(`)){let t=Ym(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=eh(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function nh(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function rh(e,t){return t-e}function ih(e,t){let n=[];return r(t),n.sort(rh);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function ah(e){let t=Object.create(null);return n(ih(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);ih(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Fh(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(rh);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function oh(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function sh(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 ch(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function lh(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}function uh(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Rh(e,r,t[r]);return n}function dh(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}function fh(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function ph(e){return e.tag!=null}function mh(e){return e.style!=null}function hh(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?Gh:0)|(t===`full`?Kh:0)}function gh(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Wh.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function _h(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function vh(e){let t={};for(let n in e)t[n]=e[n];return t}function yh(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}function bh(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function xh(e){return e.document||window.document}function Sh(e){let t=Zh.get(e);return t===void 0&&Zh.set(e,t=Ch(e)),t}function Ch(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)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}function wh(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Sh(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=wh(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var V,Th,H,Eh,U,Dh,Oh,kh,Ah,jh,Mh,Nh,Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh,Hh,Uh,Wh,Gh,Kh,qh,Jh,Yh,Xh,Zh,Qh=t((()=>{km(),V=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&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 i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}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 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 Am(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return jm(this,e,t,n)}findIndex(e){if(e==0)return Pm(0,e);if(e==this.size)return Pm(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Pm(t+1,i):Pm(t,n);n=i}}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 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 i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}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 RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}},V.empty=new V([],0),Th={index:0,offset:0},H=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 i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return 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&&Fm(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 RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw 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)&&t.length==0)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}},H.none=[],Eh=class extends Error{},U=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=Lm(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(Im(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,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(V.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=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)i++;return new e(t,r,i)}},U.empty=new U(V.empty,0,0),Dh=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,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):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return H.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 i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}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 i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].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 jh(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 RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Ah.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 Ah.set(t,r=new Oh);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%kh,i}},Oh=class{constructor(){this.elts=[],this.i=0}},kh=12,Ah=new WeakMap,jh=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)}},Mh=Object.create(null),Nh=class e{constructor(e,t,n,r=H.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||V.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,``)}textBetween(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&&Fm(this.attrs,t||e.defaultAttrs||Mh)&&H.sameSet(this.marks,n||H.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 e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return U.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new U(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return Rm(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(e==0)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 Dh.resolveCached(this,e)}resolveNoCache(e){return Dh.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()+`)`),Jm(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=V.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=H.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(!H.sameSet(e,this.marks))throw 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 RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=V.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}},Nh.prototype.text=void 0,Ph=class e extends Nh{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Jm(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}mark(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 e==0&&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}},Fh=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Ih(t,n);if(r.next==null)return e.empty;let i=Ym(r);r.next&&r.err(`Unexpected trailing text`);let a=ah(nh(i));return oh(a,r),a}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 i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type: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];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return V.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+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(),i=r.match;if(i.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<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
`)}},Fh.empty=new Fh(!0),Ih=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 SyntaxError(e+` (in content expression '`+this.string+`')`)}},Lh=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=uh(e,n.attrs),this.defaultAttrs=sh(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Fh.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:ch(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new Nh(this,this.computeAttrs(e),V.from(t),H.setFrom(n))}createChecked(e=null,t,n){return t=V.from(t),this.checkContent(t),new Nh(this,this.computeAttrs(e),t,H.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=V.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(V.empty,!0);return i?new Nh(this,e,t.append(i),H.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){lh(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:H.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}},Rh=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?dh(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},zh=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=uh(e,r.attrs),this.excluded=null;let i=sh(this.attrs);this.instance=i?new H(this,i):null}create(e=null){return!e&&this.instance?this.instance:new H(this,ch(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),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){lh(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},Bh=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=Om.from(e.nodes),t.marks=Om.from(e.marks||{}),this.nodes=Lh.compile(this.spec.nodes,this),this.marks=zh.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Fh.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?fh(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:fh(this,n.split(` `))}this.nodeFromJSON=e=>Nh.fromJSON(this,e),this.markFromJSON=e=>H.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Lh))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw 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 Ph(n,n.defaultAttrs,e,H.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}},Vh=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(ph(e))this.tags.push(e);else if(mh(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 Yh(this,t,!1);return n.addAll(e,H.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Yh(this,t,!0);return n.addAll(e,H.none,t.from,t.to),U.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(_h(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=vh(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=vh(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},Hh={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Uh={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Wh={ol:!0,ul:!0},Gh=1,Kh=2,qh=4,Jh=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=H.none,this.match=i||(a&qh?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(V.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Gh)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=V.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(V.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&&!Hh.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Yh=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=hh(null,t.preserveWhitespace,0)|(n?qh:0);i=r?new Jh(r.type,r.attrs,H.none,!0,t.topMatch||r.type.contentMatch,a):n?new Jh(null,null,H.none,!0,null,a):new Jh(e.schema.topNodeType,null,H.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Kh?`full`:this.localPreserveWS||(r.options&Gh)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){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],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Wh.hasOwnProperty(a)&&this.parser.normalizeLists&&gh(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:Uh.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(Hh.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!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 e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.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;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],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.matchType(e.type);let n=H.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):yh(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=hh(e,i,a.options);a.options&qh&&a.content.length==0&&(o|=qh);let s=H.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):yh(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new Jh(e,t,s,r,null,o)),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;else this.localPreserveWS&&(this.nodes[t].options|=Gh);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++)this.find[t].pos==null&&e.nodeType==1&&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++)this.find[r].pos==null&&e.nodeType==1&&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),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(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 e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}},Xh=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=xh(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return xh(t).createTextNode(e.text);let{dom:n,contentDOM:r}=wh(xh(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw 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 i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&wh(xh(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:wh(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=bh(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return bh(e.marks)}},Zh=new WeakMap}));function $h(e,t){return e+t*Wg}function eg(e){return e&Ug}function tg(e){return(e-(e&Ug))/Wg}function ng(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(ng(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return V.fromArray(r)}function rg(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function ig(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new n_(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new t_(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function ag(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof zh){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new n_(t.from,t.to,t.style)))}function og(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new a_(s,l,U.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new n_(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new U(V.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new a_(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(V.empty,!0);e.replace(s,s,new U(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function sg(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function cg(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!sg(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function lg(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=V.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=V.from(r.node(e).copy(u)),d++):c--;let f=V.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=V.from(i.node(e).copy(f)),p++):l++;e.step(new o_(c,l,o,s,new U(u.append(f),d,p),u.size-d,!0))}function ug(e,t,n=null,r=e){let i=fg(e,t),a=i&&pg(r,t);return a?i.map(dg).concat({type:t,attrs:n}).concat(a.map(dg)):null}function dg(e){return{type:e,attrs:null}}function fg(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function pg(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function mg(e,t,n){let r=V.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=V.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new o_(i,a,i,a,new U(r,0,0),n.length,!0))}function hg(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&vg(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&_g(e,t,n,a),og(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new o_(c,l,c+1,l-1,new U(V.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&gg(e,t,n,a),!1}})}function gg(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function _g(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
`))}})}function vg(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function yg(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new o_(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new U(V.from(o),0,0),1,!0))}function bg(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function xg(e,t,n=1,r){let i=e.doc.resolve(t),a=V.empty,o=V.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=V.from(i.node(e).copy(a));let t=r&&r[s];o=V.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new a_(t,t,new U(a.append(o),n,n),!0))}function Sg(e,t){let n=e.resolve(t),r=n.index();return wg(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Cg(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function wg(e,t){return!!(e&&t&&!e.isLeaf&&Cg(e,t))}function Tg(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&wg(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function Eg(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);_g(e,r.node(),r.before(),s)}o.inlineContent&&og(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new a_(l,c.map(t+n,-1),U.empty,!0)),r===!0){let t=e.doc.resolve(l);gg(e,t.node(),t.before(),e.steps.length)}return e}function Dg(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function Og(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function kg(e,t,n=t,r=U.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Ag(i,a,r)?new a_(t,n,r):new s_(i,a,r).fit()}function Ag(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}function jg(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(jg(e.firstChild.content,t-1,n)))}function Mg(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Mg(e.lastChild.content,t-1,n)))}function Ng(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Pg(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Pg(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(V.empty,!0)))),e.copy(r)}function Fg(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!Ig(n,a.content,o)?s:null}function Ig(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function Lg(e){return e.spec.defining||e.spec.definingForContent}function Rg(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Ag(i,a,r))return e.step(new a_(t,n,r));let o=Hg(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=Lg(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new U(zg(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function zg(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(zg(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(V.empty,!0))}return e}function Bg(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Dg(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new U(V.from(r),0,0))}function Vg(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=Hg(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function Hg(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var Ug,Wg,Gg,Kg,qg,Jg,Yg,Xg,Zg,Qg,$g,e_,t_,n_,r_,i_,a_,o_,s_,c_,l_,u_,d_,f_=t((()=>{Qh(),Ug=65535,Wg=2**16,Gg=1,Kg=2,qg=4,Jg=8,Yg=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Jg)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&qg)>0}},Xg=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=eg(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+tg(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,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:$h(o/3,e-s),f=e==s?Kg:e==u?Gg:qg;return(t<0?e!=s:e!=u)&&(f|=Jg),new Yg(a,f,d)}r+=l-c}return n?e+r:new Yg(e+r,0,null)}touches(e,t){let n=0,r=eg(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}},Xg.empty=new Xg([]),Zg=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(),!0),this.to=this._maps.push(e),t!=null&&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],r!=null&&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.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(),r!=null&&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 n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Yg(e,r,null)}},Qg=Object.create(null),$g=class{getMap(){return Xg.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Qg[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Qg)throw RangeError(`Duplicate use of step JSON ID `+e);return Qg[e]=t,t.prototype.jsonID=e,t}},e_=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,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Eh)return e.fail(t.message);throw t}}},t_=class e extends $g{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)),i=new U(ng(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return e_.fromReplace(e,this.from,this.to,i)}invert(){return new n_(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(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}},$g.jsonID(`addMark`,t_),n_=class e extends $g{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=new U(ng(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return e_.fromReplace(e,this.from,this.to,n)}invert(){return new t_(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(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}},$g.jsonID(`removeMark`,n_),r_=class e extends $g{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return e_.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return e_.fromReplace(e,this.pos,this.pos+1,new U(V.from(n),0,+!t.isLeaf))}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 i_(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(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}},$g.jsonID(`addNodeMark`,r_),i_=class e extends $g{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return e_.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return e_.fromReplace(e,this.pos,this.pos+1,new U(V.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new r_(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:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}},$g.jsonID(`removeNodeMark`,i_),a_=class e extends $g{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&rg(e,this.from,this.to)?e_.fail(`Structure replace would overwrite content`):e_.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Xg([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){let n=this.slice.size+t.slice.size==0?U.empty:new U(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)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?U.empty:new U(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,U.fromJSON(t,n.slice),!!n.structure)}},a_.MAP_BIAS=1,$g.jsonID(`replace`,a_),o_=class e extends $g{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(rg(e,this.from,this.gapFrom)||rg(e,this.gapTo,this.to)))return e_.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return e_.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?e_.fromReplace(e,this.from,this.to,n):e_.fail(`Content does not fit in gap`)}getMap(){return new Xg([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),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,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(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,U.fromJSON(t,n.slice),n.insert,!!n.structure)}},$g.jsonID(`replaceAround`,o_),s_=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=V.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=V.from(e.node(t).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 i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new U(i,a,o);return e>-1?new o_(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new a_(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Ng(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(V.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Ng(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new U(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=Ng(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new U(jg(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new U(jg(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(Pg(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=Mg(this.placed,t,V.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?U.empty:new U(jg(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new U(jg(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Fg(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.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){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Fg(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Fg(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?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=Mg(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=Mg(this.placed,this.depth,V.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(V.empty,!0);e.childCount&&(this.placed=Mg(this.placed,this.frontier.length,e))}},c_=class e extends $g{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 e_.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return e_.fromReplace(e,this.pos,this.pos+1,new U(V.from(r),0,+!t.isLeaf))}getMap(){return Xg.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(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}},$g.jsonID(`attr`,c_),l_=class e extends $g{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return e_.ok(n)}getMap(){return Xg.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(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}},$g.jsonID(`docAttr`,l_),u_=class extends Error{},u_=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},u_.prototype=Object.create(Error.prototype),u_.prototype.constructor=u_,u_.prototype.name=`TransformError`,d_=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Zg}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new u_(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,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?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=U.empty){let r=kg(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new U(V.from(n),0,0))}delete(e,t){return this.replace(e,t,U.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return Rg(this,e,t,n),this}replaceRangeWith(e,t,n){return Bg(this,e,t,n),this}deleteRange(e,t){return Vg(this,e,t),this}lift(e,t){return lg(this,e,t),this}join(e,t=1){return Eg(this,e,t),this}wrap(e,t){return mg(this,e,t),this}setBlockType(e,t=e,n,r=null){return hg(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return yg(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new c_(e,t,n)),this}setDocAttribute(e,t){return this.step(new l_(e,t)),this}addNodeMark(e,t){return this.step(new r_(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof H)t.isInSet(n.marks)&&this.step(new i_(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new i_(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return xg(this,e,t,n),this}addMark(e,t,n){return ig(this,e,t,n),this}removeMark(e,t,n){return ag(this,e,t,n),this}clearIncompatible(e,t,n){return og(this,e,t,n),this}}})),p_=t((()=>{f_()}));function m_(e){!S_&&!e.parent.inlineContent&&(S_=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}function h_(e,t,n,r,i,a=!1){if(t.inlineContent)return G.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=h_(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&K.isSelectable(r))return K.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function g_(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof a_||i instanceof o_))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(W.near(e.doc.resolve(o),n))}function __(e,t){return!t||!e?e:e.bind(t)}function v_(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=v_(i,t,{})),n[r]=i}return n}function y_(e){return e in I_?e+`$`+ ++I_[e]:(I_[e]=0,e+`$`)}var b_,W,x_,S_,G,C_,K,w_,T_,E_,D_,O_,k_,A_,j_,M_,N_,P_,F_,I_,L_,R_=t((()=>{Qh(),f_(),b_=Object.create(null),W=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new x_(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=U.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?U.empty:t),o==0&&g_(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),g_(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new G(e):h_(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?h_(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):h_(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new T_(e.node(0))}static atStart(e){return h_(e,e,0,0,1)||new T_(e)}static atEnd(e){return h_(e,e,e.content.size,e.childCount,-1)||new T_(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=b_[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in b_)throw RangeError(`Duplicate use of selection JSON ID `+e);return b_[e]=t,t.prototype.jsonID=e,t}getBookmark(){return G.between(this.$anchor,this.$head).getBookmark()}},W.prototype.visible=!0,x_=class{constructor(e,t){this.$from=e,this.$to=t}},S_=!1,G=class e extends W{constructor(e,t=e){m_(e),m_(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 W.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=U.empty){if(super.replace(e,t),t==U.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 C_(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw 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 i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=W.findFrom(n,r,!0)||W.findFrom(n,-r,!0);if(e)n=e.$head;else return W.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(W.findFrom(t,-r,!0)||W.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}},W.jsonID(`text`,G),C_=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 G.between(e.resolve(this.anchor),e.resolve(this.head))}},K=class e extends W{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:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?W.near(a):new e(a)}content(){return new U(V.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 w_(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw 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&&e.type.spec.selectable!==!1}},K.prototype.visible=!1,W.jsonID(`node`,K),w_=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new C_(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&K.isSelectable(n)?new K(t):W.near(t)}},T_=class e extends W{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=U.empty){if(t==U.empty){e.delete(0,e.doc.content.size);let t=W.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 E_}},W.jsonID(`all`,T_),E_={map(){return this},resolve(e){return new T_(e)}},D_=1,O_=2,k_=4,A_=class extends d_{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 RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|D_)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&D_)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=O_,this}ensureMarks(e){return H.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&O_)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,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)||H.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(W.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=k_,this}get scrolledIntoView(){return(this.updated&k_)>0}},j_=class{constructor(e,t,n){this.name=e,this.init=__(t.init,n),this.apply=__(t.apply,n)}},M_=[new j_(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new j_(`selection`,{init(e,t){return e.selection||W.atStart(t.doc)},apply(e){return e.selection}}),new j_(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new j_(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],N_=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=M_.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw 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 j_(e.key,e.spec.state,e))})}},P_=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 i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new A_(this)}static create(t){let n=new N_(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 N_(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new N_(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=Nh.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=W.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}},F_=class{constructor(e){this.spec=e,this.props={},e.props&&v_(e.props,this,this.props),this.key=e.key?e.key.key:y_(`plugin`)}getState(e){return e[this.key]}},I_=Object.create(null),L_=class{constructor(e=`key`){this.key=y_(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}}));function z_(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}function B_(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=kg(e.doc,i,o,U.empty);if(!s||s.from!=i||s instanceof a_&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(G.create(t.doc,i)),n(t.scrollIntoView())}return!0}function V_(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}function H_(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 U_(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}function W_(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}function G_(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function K_(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof K&&t.selection.node.isBlock)return!r.parentOffset||!bg(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=G_(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof G||t.selection instanceof T_)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=bg(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,bg(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}function q_(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Sg(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function J_(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&q_(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=V.empty;for(let e=o.length-1;e>=0;e--)s=V.from(o[e].create(null,s));s=V.from(i.copy(s));let c=e.tr.step(new o_(t.pos-1,r,t.pos,r,new U(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&Sg(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:W.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&cg(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&V_(a,`start`,!0)&&V_(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=V.empty;for(let e=o.length-1;e>=0;e--)r=V.from(o[e].copy(r));n(e.tr.step(new o_(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new U(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Y_(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(G.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}function X_(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&ug(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Z_(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function Q_(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var $_,ev,tv,nv,rv,iv,av,ov,sv,cv,lv,uv,dv,fv,pv,mv,hv,gv,_v,vv,yv,bv,xv,Sv=t((()=>{f_(),Qh(),R_(),$_=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0),ev=(e,t,n)=>{let r=z_(e,n);if(!r)return!1;let i=H_(r);if(!i){let n=r.blockRange(),i=n&&cg(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(J_(e,i,t,-1))return!0;if(r.parent.content.size==0&&(V_(a,`end`)||K.isSelectable(a)))for(let n=r.depth;;n--){let o=kg(e.doc,r.before(n),r.after(n),U.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(V_(a,`end`)?W.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):K.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},tv=(e,t,n)=>{let r=z_(e,n);if(!r)return!1;let i=H_(r);return i?B_(e,i,t):!1},nv=(e,t,n)=>{let r=U_(e,n);if(!r)return!1;let i=W_(r);return i?B_(e,i,t):!1},rv=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=H_(r)}let o=a&&a.nodeBefore;return!o||!K.isSelectable(o)?!1:(t&&t(e.tr.setSelection(K.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)},iv=(e,t,n)=>{let r=U_(e,n);if(!r)return!1;let i=W_(r);if(!i)return!1;let a=i.nodeAfter;if(J_(e,i,t,1))return!0;if(r.parent.content.size==0&&(V_(a,`start`)||K.isSelectable(a))){let n=kg(e.doc,r.before(),r.after(),U.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(V_(a,`start`)?W.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):K.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},av=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=W_(r)}let o=a&&a.nodeAfter;return!o||!K.isSelectable(o)?!1:(t&&t(e.tr.setSelection(K.create(e.doc,a.pos)).scrollIntoView()),!0)},ov=(e,t)=>{let n=e.selection,r=n instanceof K,i;if(r){if(n.node.isTextblock||!Sg(e.doc,n.from))return!1;i=n.from}else if(i=Tg(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(K.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},sv=(e,t)=>{let n=e.selection,r;if(n instanceof K){if(n.node.isTextblock||!Sg(e.doc,n.to))return!1;r=n.to}else if(r=Tg(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},cv=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&cg(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},lv=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
`).scrollIntoView()),!0)},uv=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=G_(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(W.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},dv=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof T_||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=G_(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(G.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},fv=(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(bg(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&cg(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},pv=K_(),mv=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(K.create(e.doc,i))),!0)},hv=(e,t)=>(t&&t(e.tr.setSelection(new T_(e.doc))),!0),gv=Y_(-1),_v=Y_(1),vv=Q_($_,ev,rv),yv=Q_($_,iv,av),bv={Enter:Q_(lv,dv,fv,pv),"Mod-Enter":uv,Backspace:vv,"Mod-Backspace":vv,"Shift-Backspace":vv,Delete:yv,"Mod-Delete":yv,"Mod-a":hv},xv={"Ctrl-h":bv.Backspace,"Alt-Backspace":bv[`Mod-Backspace`],"Ctrl-d":bv.Delete,"Ctrl-Alt-Backspace":bv[`Mod-Delete`],"Alt-Delete":bv[`Mod-Delete`],"Alt-d":bv[`Mod-Delete`],"Ctrl-a":gv,"Ctrl-e":_v};for(let e in bv)xv[e]=bv[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform()})),Cv=t((()=>{Sv()})),wv=t((()=>{R_()})),Tv=t((()=>{Qh()}));function Ev(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return Dv(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function Dv(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new jh(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new jh(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=ug(a,n,r,t);return s?(e&&Ov(e,t,s,i,n),!0):!1}function Ov(e,t,n,r,i){let a=V.empty;for(let e=n.length-1;e>=0;e--)a=V.from(n[e].type.create(n[e].attrs,a));e.step(new o_(t.start-(r?2:0),t.end,t.start,t.end,new U(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&bg(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function kv(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?Av(t,n,e,a):jv(t,n,a):!0:!1}}function Av(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new o_(a-1,o,a,o,new U(V.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new jh(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=cg(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Sg(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function jv(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?V.empty:V.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new o_(d-+!!s,f+ +!!c,d+1,f-1,new U((s?V.empty:V.from(i.copy(V.empty))).append(c?V.empty:V.from(i.copy(V.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function Mv(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=V.from(r?e.create():null),o=new U(V.from(e.create(null,V.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new o_(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var Nv=t((()=>{f_(),Qh()})),Pv=t((()=>{Nv()}));function Fv(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Iv(e))){let n=e.parentNode;if(!n||n.nodeType!=1||Bv(e)||Lx.test(e.nodeName)||e.contentEditable==`false`)return!1;t=jx(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?Iv(e):0}else return!1}}function Iv(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Lv(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=Iv(e)}else if(e.parentNode&&!Bv(e))t=jx(e),e=e.parentNode;else return null}}function Rv(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Bv(e))t=jx(e)+1,e=e.parentNode;else return null}}function zv(e,t,n){for(let r=t==0,i=t==Iv(e);r||i;){if(e==n)return!0;let t=jx(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==Iv(e)}}function Bv(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)}function Vv(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function Hv(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Uv(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Iv(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Iv(r.startContainer),r.startOffset)}}}function Wv(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 Gv(e,t){return typeof e==`number`?e:e[t]}function Kv(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 qv(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=Mx(o);continue}let e=o,n=e==a.body,s=n?Wv(a):Kv(e),c=0,l=0;if(t.top<s.top+Gv(r,`top`)?l=-(s.top-t.top+Gv(i,`top`)):t.bottom>s.bottom-Gv(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Gv(i,`top`)-s.top:t.bottom-s.bottom+Gv(i,`bottom`)),t.left<s.left+Gv(r,`left`)?c=-(s.left-t.left+Gv(i,`left`)):t.right>s.right-Gv(r,`right`)&&(c=t.right-s.right+Gv(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:Mx(o)}}function Jv(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:Yv(e.dom)}}function Yv(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Mx(r));return t}function Xv({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Zv(n,r==0?0:r-t)}function Zv(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}function Qv(e){if(e.setActive)return e.setActive();if(iS)return e.focus(iS);let t=Yv(e);e.focus(iS==null?{get preventScroll(){return iS={preventScroll:!0},!0}}:void 0),iS||(iS=!1,Zv(t,0))}function $v(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=Px(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={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)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?ey(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:$v(n,i)}function ey(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=cy(r,1);if(n.top!=n.bottom&&ty(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function ty(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function ny(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function ry(e,t,n){let{node:r,offset:i}=$v(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function iy(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function ay(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(ty(t,i))return ay(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function oy(e,t){let n=e.dom.ownerDocument,r,i=0,a=Uv(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!ty(t,n)||(o=ay(e.dom,t,n),!o))return null}if(Zx)for(let e=o;r&&e;e=Mx(e))e.draggable&&(r=void 0);if(o=ny(o,t),r){if(qx&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;nS&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=iy(e,r,i,t))}s??=ry(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function sy(e){return e.top<e.bottom||e.left<e.right}function cy(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(sy(e))return e}return Array.prototype.find.call(n,sy)||e.getBoundingClientRect()}function ly(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=nS||qx;if(r.nodeType==3)if(o&&(aS.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=cy(Px(r,i,i),n);if(qx&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=cy(Px(r,i-1,i-1),-1);if(t.top==e.top){let n=cy(Px(r,i,i+1),-1);if(n.top!=e.top)return uy(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,uy(cy(Px(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==Iv(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return dy(e.getBoundingClientRect(),!1)}if(a==null&&i<Iv(r)){let e=r.childNodes[i];if(e.nodeType==1)return dy(e.getBoundingClientRect(),!0)}return dy(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==Iv(r))){let e=r.childNodes[i-1],t=e.nodeType==3?Px(e,Iv(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return uy(cy(t,1),!1)}if(a==null&&i<Iv(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?Px(e,0,+!o):e.nodeType==1?e:null:null;if(t)return uy(cy(t,-1),!0)}return uy(cy(r.nodeType==3?Px(r):r,-n),n>=0)}function uy(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function dy(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function fy(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function py(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return fy(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-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=ly(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=Px(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}function my(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!oS.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:fy(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}function hy(e,t,n){return sS==t&&cS==n?lS:(sS=t,cS=n,lS=n==`up`||n==`down`?py(e,t,n):my(e,t,n))}function gy(e,t,n,r,i){xy(r,t,e);let a=new vS(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}function _y(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=Cy(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof _S){let t=r?r.previousSibling:e.lastChild;_y(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Cy(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}function vy(e,t,n){if(e.length==0)return CS;let r=n?CS[0]:new SS,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new SS(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new SS(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function yy(e,t,n,r){if(n==CS&&r==CS)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=CS[0],i=t)}by(i,o||CS[0],a)}return i}function by(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function xy(e,t,n){return yy(e,e,CS,vy(t,n,e.nodeType!=1))}function Sy(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Cy(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}function wy(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof _S)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Ty(e,t){return e.type.side-t.type.side}function Ey(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(Ty);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function Dy(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Oy(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function ky(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function Ay(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(Rx(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&K.isSelectable(e)&&i.parent&&!(e.isInline&&zv(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new K(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=By(e,u,s,n)}return l}function jy(e){return e.editable?e.hasFocus():Hy(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function My(e,t=!1){let n=e.state.selection;if(Ry(e,n),!jy(e))return;let r=e.input.mouseDown;if(!t&&Yx&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Ix(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Ly(e);else{let{anchor:r,head:i}=n,a,o;TS&&!(n instanceof G)&&(n.$from.parent.inlineContent||(a=Ny(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Ny(e,n.to))),e.docView.setSelection(r,i,e,t),TS&&(a&&Fy(a),o&&Fy(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Iy(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}function Ny(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(Zx&&i&&i.contentEditable==`false`)return Py(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Py(i);if(a)return Py(a)}}function Py(e){return e.contentEditable=`true`,Zx&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Fy(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Iy(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!jy(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function Ly(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,jx(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Gx&&Kx<=11&&(n.disabled=!0,n.disabled=!1)}function Ry(e,t){if(t instanceof K){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(zy(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else zy(e)}function zy(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function By(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||G.between(t,n,r)}function Vy(e){return e.editable&&!e.hasFocus()?!1:Hy(e)}function Hy(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Uy(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Ix(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Wy(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&W.findFrom(a,t)}function Gy(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ky(e,t,n){let r=e.state.selection;if(r instanceof G){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return Gy(e,new G(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=Wy(e.state,t);return n&&n instanceof K?Gy(e,n):!1}else if(!($x&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?K.isSelectable(i)?Gy(e,new K(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):nS?Gy(e,new G(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof K&&r.node.isInline)return Gy(e,new G(t>0?r.$to:r.$from));else{let n=Wy(e.state,t);return n?Gy(e,n):!1}}function qy(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Jy(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function Yy(e,t){return t<0?Xy(e):Zy(e)}function Xy(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(qx&&n.nodeType==1&&r<qy(n)&&Jy(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(Jy(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(Qy(n))break;else{let t=n.previousSibling;for(;t&&Jy(t,-1);)i=n.parentNode,a=jx(t),t=t.previousSibling;if(t)n=t,r=qy(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?tb(e,n,r):i&&tb(e,i,a)}function Zy(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=qy(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(Jy(e,1))a=n,o=++r;else break}else if(Qy(n))break;else{let t=n.nextSibling;for(;t&&Jy(t,1);)a=t.parentNode,o=jx(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=qy(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&tb(e,a,o)}function Qy(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function $y(e,t){for(;e&&t==e.childNodes.length&&!Bv(e);)t=jx(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function eb(e,t){for(;e&&!t&&!Bv(e);)t=jx(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function tb(e,t,n){if(t.nodeType!=3){let e,r;(r=$y(t,n))?(t=r,n=0):(e=eb(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Rx(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:i}=e;setTimeout(()=>{e.state==i&&My(e)},50)}function nb(e,t){let n=e.state.doc.resolve(t);if(!(Yx||eS)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<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),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function rb(e,t,n){let r=e.state.selection;if(r instanceof G&&!r.empty||n.indexOf(`s`)>-1||$x&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=Wy(e.state,t);if(n&&n instanceof K)return Gy(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof T_?W.near(n,t):W.findFrom(n,t);return o?Gy(e,o):!1}return!1}function ib(e,t){if(!(e.state.selection instanceof G))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function ab(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ob(e){if(!Zx||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;ab(e,n,`true`),setTimeout(()=>ab(e,n,`false`),20)}return!1}function sb(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function cb(e,t){let n=t.keyCode,r=sb(t);if(n==8||$x&&n==72&&r==`c`)return ib(e,-1)||Yy(e,-1);if(n==46&&!t.shiftKey||$x&&n==68&&r==`c`)return ib(e,1)||Yy(e,1);if(n==13||n==27)return!0;if(n==37||$x&&n==66&&r==`c`){let t=n==37?nb(e,e.state.selection.from)==`ltr`?-1:1:-1;return Ky(e,t,r)||Yy(e,t)}else if(n==39||$x&&n==70&&r==`c`){let t=n==39?nb(e,e.state.selection.from)==`ltr`?1:-1:1;return Ky(e,t,r)||Yy(e,t)}else if(n==38||$x&&n==80&&r==`c`)return rb(e,-1,r)||Yy(e,-1);else if(n==40||$x&&n==78&&r==`c`)return ob(e)||rb(e,1,r)||Yy(e,1);else if(r==($x?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function lb(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||Xh.fromSchema(e.state.schema),s=_b(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=DS[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
`),slice:t}}function ub(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new U(V.from(e.state.schema.text(t.replace(/\r\n?/g,`
`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=Xh.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=yb(n),nS&&bb(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||Vh.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!ES.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=xb(gb(s,+u[1],+u[2]),u[4]);else if(s=U.maxOpen(db(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=gb(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}function db(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&pb(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=mb(a[a.length-1],i.length));let n=fb(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return V.from(a)}return e}function fb(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,V.from(e));return e}function pb(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=pb(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(V.from(fb(n,e,i+1))))}}function mb(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,mb(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(V.empty,!0);return e.copy(n.append(r))}function hb(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=hb(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(V.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function gb(e,t,n){return t<e.openStart&&(e=new U(hb(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new U(hb(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}function _b(){return OS||=document.implementation.createHTMLDocument(`title`)}function vb(e){let t=window.trustedTypes;return t?(kS||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),kS.createHTML(e)):e}function yb(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=_b().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&DS[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=vb(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function bb(e){let t=e.querySelectorAll(Yx?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function xb(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=V.from(t.create(r[e+1],i)),a++,o++}return new U(i,a,o)}function Sb(e){for(let t in AS){let n=AS[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{Db(e,t)&&!Eb(e,t)&&(e.editable||!(t.type in jS))&&n(e,t)},MS[t]?{passive:!0}:void 0)}Zx&&e.dom.addEventListener(`input`,()=>null),Tb(e)}function Cb(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function wb(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)}function Tb(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Eb(e,t))})}function Eb(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Db(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||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Ob(e,t){!Eb(e,t)&&AS[t.type]&&(e.editable||!(t.type in jS))&&AS[t.type](e,t)}function kb(e){return{left:e.clientX,top:e.clientY}}function Ab(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function jb(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function Mb(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function Nb(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&K.isSelectable(r)?(Mb(e,new K(n),`pointer`),!0):!1}function Pb(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof K&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(K.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(Mb(e,K.create(e.state.doc,i),`pointer`),!0)}function Fb(e,t,n,r,i){return jb(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?Pb(e,n):Nb(e,n))}function Ib(e,t,n,r){return jb(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function Lb(e,t,n,r){return jb(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||Rb(e,n,r)}function Rb(e,t,n){if(n.button!=0)return!1;let r=zb(e,t,!0),i=e.state.doc;return r?(Mb(e,r,`pointer`),r instanceof G&&i.eq(e.state.doc)&&(e.input.mouseDown=new LS(e,r)),!0):!1}function zb(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?G.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),a=i.before(e);if(t.inlineContent)return G.create(r,a+1,a+1+t.content.size);if(n&&K.isSelectable(t))return K.create(r,a)}return null}function Bb(e){return Kb(e)}function Vb(e,t){return e.composing?!0:Zx&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}function Hb(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}function Ub(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Kb(e),t))}function Wb(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Gb(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Lv(t.focusNode,t.focusOffset),r=Rv(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;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 Kb(e,t=!1){if(!(tS&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Wb(e),t||e.docView&&e.docView.dirty){let n=Ay(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.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function qb(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(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}function Jb(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Yb(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 i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Xb(e,r.value,null,i,t):Xb(e,r.textContent,r.innerHTML,i,t)},50)}function Xb(e,t,n,r,i){let a=ub(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||U.empty)))return!0;if(!a)return!1;let o=Jb(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function Zb(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,` `):``}function Qb(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[VS]:!n}function $b(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(kb(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=ub(e,Zb(t.dataTransfer),zS?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&Qb(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||U.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Og(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&K.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new K(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(By(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}function ex(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}function tx(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==YS?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=ox(rx(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new JS(t.sort(sx),s)}function nx(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new GS(i.from+t,i.to+t,i.type))}return n}function rx(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function ix(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function ax(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function ox(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=ix(e,t,o+n);if(s){a=!0;let e=ox(s,t,n+o+1,r);e!=YS&&i.push(o,o+t.nodeSize,e)}});let o=nx(a?ax(e):e,-n).sort(sx);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new JS(o,i):YS}function sx(e,t){return e.from-t.from||e.to-t.to}function cx(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),lx(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),lx(t,i,r.copy(a.from,r.to)));break}}}return t}function lx(e,t,n){for(;t<e.length&&sx(n,e[t])>0;)t++;e.splice(t,0,n)}function ux(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=YS&&t.push(r)}),e.cursorWrapper&&t.push(JS.create(e.state.doc,[e.cursorWrapper.deco])),XS.from(t)}function dx(e){if(!tC.has(e)&&(tC.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=qx,nC)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),nC=!0}}function fx(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return Ix(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function px(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return fx(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?fx(e,n):null}function mx(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 hx(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function gx(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],Rx(c)||l.push({node:c.focusNode,offset:c.focusOffset})),Yx&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||Vh.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:_x,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function _x(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(Zx&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||Zx&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}function vx(e,t,n,r,i){let a=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=Ay(e,t);if(n&&!e.state.selection.eq(n)){if(Yx&&tS&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,Vv(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=gx(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=Cx(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(Qx&&e.input.lastIOSEnter>Date.now()-225||tS)&&i.some(e=>e.nodeType==1&&!rC.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,Vv(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof G&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=yx(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof G&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Gx&&Kx<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((Qx&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,Vv(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&xx(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,Vv(8,`Backspace`)))){tS&&Yx&&e.domObserver.suppressSelectionUpdates();return}Yx&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),tS&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,Vv(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=yx(e,n.doc,l.sel);t&&!(Yx&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||Gx&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){Gx&&Kx<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>My(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=bx(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function yx(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:By(e,t.resolve(n.anchor),t.resolve(n.head))}function bx(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(V.from(l).eq(e))return{mark:s,type:o}}function xx(e,t,n,r,i){if(n-t<=i.pos-r.pos||Sx(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(Sx(a,!0,!0));return!o.parent.isTextblock||o.pos>n||Sx(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Sx(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function Cx(e,t,n,r,i){let a=e.findDiffStart(t,n),o=n+e.size,s=n+t.size;if(a==null)return null;let{a:c,b:l}=e.findDiffEnd(t,o,s);if(i==`end`){let e=Math.max(0,a-Math.min(c,l));r-=c+e-a}if(c<a&&o<s){let e=r<=a&&r>=c?a-r:0;a-=e,l=a+(l-c),c=a}else if(l<a){let e=r<=a&&r>=l?a-r:0;a-=e,c=a+(c-l),l=a}return{start:a,endA:c,endB:l}}function wx(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[GS.node(0,e.state.doc.content.size,t)]}function Tx(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:GS.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Ex(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function Dx(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)}function Ox(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 kx(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function Ax(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}var jx,Mx,Nx,Px,Fx,Ix,Lx,Rx,zx,Bx,Vx,Hx,Ux,Wx,Gx,Kx,qx,Jx,Yx,Xx,Zx,Qx,$x,eS,tS,nS,rS,iS,aS,oS,sS,cS,lS,uS,dS,fS,pS,mS,hS,gS,_S,vS,yS,bS,xS,SS,CS,wS,TS,ES,DS,OS,kS,AS,jS,MS,NS,PS,FS,IS,LS,RS,zS,BS,VS,HS,US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,rC,iC,aC=t((()=>{R_(),Qh(),f_(),jx=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Mx=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Nx=null,Px=function(e,t,n){let r=Nx||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Fx=function(){Nx=null},Ix=function(e,t,n,r){return n&&(Fv(e,t,n,r,-1)||Fv(e,t,n,r,1))},Lx=/^(img|br|input|textarea|hr)$/i,Rx=function(e){return e.focusNode&&Ix(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)},zx=typeof navigator<`u`?navigator:null,Bx=typeof document<`u`?document:null,Vx=zx&&zx.userAgent||``,Hx=/Edge\/(\d+)/.exec(Vx),Ux=/MSIE \d/.exec(Vx),Wx=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Vx),Gx=!!(Ux||Wx||Hx),Kx=Ux?document.documentMode:Wx?+Wx[1]:Hx?+Hx[1]:0,qx=!Gx&&/gecko\/(\d+)/i.test(Vx),qx&&+(/Firefox\/(\d+)/.exec(Vx)||[0,0])[1],Jx=!Gx&&/Chrome\/(\d+)/.exec(Vx),Yx=!!Jx,Xx=Jx?+Jx[1]:0,Zx=!Gx&&!!zx&&/Apple Computer/.test(zx.vendor),Qx=Zx&&(/Mobile\/\w+/.test(Vx)||!!zx&&zx.maxTouchPoints>2),$x=Qx||(zx?/Mac/.test(zx.platform):!1),eS=zx?/Win/.test(zx.platform):!1,tS=/Android \d/.test(Vx),nS=!!Bx&&`webkitFontSmoothing`in Bx.documentElement.style,rS=nS?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,iS=null,aS=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,oS=/[\u0590-\u08ac]/,sS=null,cS=null,lS=!1,uS=0,dS=1,fS=2,pS=3,mS=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=uS,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(e.nodeType==1?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}else{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>jx(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=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<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof bS){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof hS&&e.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?jx(e.dom)+1:0}}else{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?jx(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=jx(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=jx(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((qx||Zx)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
`),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:jx(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(qx&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&Zx)&&Ix(o.node,o.offset,l.anchorNode,l.anchorOffset)&&Ix(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&qx)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}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 i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?fS:dS,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=pS:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?fS:pS}n=a}this.dirty=fS}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?fS:dS;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},hS=class extends mS{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==uS&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},gS=class extends mS{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.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},_S=class e extends mS{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=Xh.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&pS||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=pS&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=uS){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=uS}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=ky(a,n,o,r)),t>0&&(a=ky(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},vS=class e extends mS{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=Xh.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=xy(u,r,n),l?c=new xS(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new yS(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let 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=()=>V.empty)}return e}matchesNode(e,t,n){return this.dirty==uS&&e.eq(this.node)&&Sy(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new wS(this,a&&a.node,e);Ey(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?H.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==fS)&&(a&&this.protectLocalComposition(e,a),_y(this.contentDOM,this.children,e),Qx&&Dy(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof G)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=Oy(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new gS(this,i,t,r);e.input.compositionNodes.push(a),this.children=ky(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==pS||!e.sameMarkup(this.node)?!1:(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=uS}updateOuterDeco(e){if(Sy(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=yy(this.dom,this.nodeDOM,vy(this.outerDeco,this.node,t),vy(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}},yS=class e extends vS{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}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 this.dirty==pS||this.dirty!=uS&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=uS||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=uS,!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 e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=pS)}get domAtom(){return!1}isText(e){return this.node.text==e}},bS=class extends mS{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==uS&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},xS=class extends vS{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==pS)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return 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):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}},SS=function(e){e&&(this.nodeName=e)},SS.prototype=Object.create(null),CS=[new SS],wS=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=wy(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 i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=uS,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=_S.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==pS&&a.dom==a.contentDOM&&(a.dirty=fS),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}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,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof vS){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=pS&&Sy(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=fS,u.updateChildren(r,a+1),u.dirty=uS),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Sy(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=vS.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=vS.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),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))this.index++;else{let r=new hS(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof _S;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof yS)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Zx||Yx)&&e&&e.dom.contentEditable==`false`&&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);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new bS(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}},TS=Zx||Yx&&Xx<63,ES=/^(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,DS={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},OS=null,kS=null,AS={},jS={},MS={touchstart:!0,touchmove:!0},NS=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}},jS.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Vb(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(tS&&Yx&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Qx&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,Vv(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||cb(e,n)?n.preventDefault():Cb(e,`key`)},jS.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},jS.keypress=(e,t)=>{let n=t;if(Vb(e)||!n.charCode||n.ctrlKey&&!n.altKey||$x&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof G)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}},PS=$x?`metaKey`:`ctrlKey`,AS.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Bb(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&Ab(n,e.input.lastClick)&&!n[PS]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(kb(n));o&&(a==`singleClick`?e.input.mouseDown=new IS(e,o,n,!!r):(a==`doubleClick`?Ib:Lb)(e,o.pos,o.inside,n)?n.preventDefault():Cb(e,`pointer`))},FS=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){e.buttons==0&&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}},IS=class extends FS{constructor(e,t,n,r){super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[PS],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof K&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&qx&&!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()),Cb(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||My(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(kb(e))),this.updateAllowDefault(e),this.allowDefault||!t?Cb(this.view,`pointer`):Fb(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Zx&&this.mightDrag&&!this.mightDrag.node.isAtom||Yx&&!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)?(Mb(this.view,W.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):Cb(this.view,`pointer`)}move(e){this.updateAllowDefault(e),Cb(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):!1}},LS=class extends FS{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),Cb(this.view,`pointer`);let t=this.view.posAtCoords(kb(e)),n=t&&zb(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[a,o]=n.from<i.from?[i.to,n.from]:[i.from,n.to];Mb(this.view,G.create(r,a,o),`pointer`)}},AS.touchstart=e=>{e.input.lastTouch=Date.now(),Bb(e),Cb(e,`pointer`)},AS.touchmove=e=>{e.input.lastTouch=Date.now(),Cb(e,`pointer`)},AS.contextmenu=e=>Bb(e),RS=tS?5e3:-1,jS.compositionstart=jS.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof G&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||Yx&&eS&&Hb(e)))e.markCursor=e.state.storedMarks||n.marks(),Kb(e,!0),e.markCursor=null;else if(Kb(e,!t.selection.empty),qx&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}Ub(e,RS)},jS.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++,Ub(e,20))},zS=Gx&&Kx<15||Qx&&rS<604,AS.copy=jS.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=zS?null:n.clipboardData,{dom:o,text:s}=lb(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):qb(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))},jS.paste=(e,t)=>{let n=t;if(e.composing&&!tS)return;let r=zS?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Xb(e,Zb(r),r.getData(`text/html`),i,n)?n.preventDefault():Yb(e,n)},BS=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},VS=$x?`altKey`:`ctrlKey`,AS.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(kb(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof K?i.to-1:i.to))){if(r&&r.mightDrag)o=K.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=K.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=lb(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!Yx||Xx>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(zS?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,zS||n.dataTransfer.setData(`text/plain`,c),e.dragging=new BS(l,Qb(e,n),o)},AS.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},jS.dragover=jS.dragenter=(e,t)=>t.preventDefault(),jS.drop=(e,t)=>{try{$b(e,t,e.dragging)}finally{e.dragging=null}},AS.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())&&My(e)},20))},AS.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(),!1)},AS.beforeinput=(e,t)=>{if(Yx&&tS&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,Vv(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 e in jS)AS[e]=jS[e];HS=class e{constructor(e,t){this.toDOM=e,this.spec=t||qS,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new GS(i-n,i-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&&ex(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},US=class e{constructor(e,t){this.attrs=e,this.spec=t||qS}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new GS(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&ex(this.attrs,t.attrs)&&ex(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},WS=class e{constructor(e,t){this.attrs=e,this.spec=t||qS}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new GS(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&ex(this.attrs,t.attrs)&&ex(this.spec,t.spec)}destroy(){}},GS=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 HS(n,r))}static inline(t,n,r,i){return new e(t,n,new US(r,i))}static node(t,n,r,i){return new e(t,n,new WS(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof US}get widget(){return this.type instanceof HS}},KS=[],qS={},JS=class e{constructor(e,t){this.local=e.length?e:KS,this.children=t.length?t:KS}static create(e,t){return t.length?ox(t,e,0,qS):YS}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==YS||e.maps.length==0?this:this.mapInner(e,t,0,0,n||qS)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?tx(this.children,o||[],t,n,r,i,a):o?new e(o.sort(sx),KS):YS}add(t,n){return n.length?this==YS?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=ix(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,ox(s,e,o+1,qS)),a+=3}});let o=nx(a?ax(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(sx):this.local,i||this.children)}remove(e){return e.length==0||this==YS?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==YS?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):YS}forChild(t,n){if(this==YS)return this;if(n.isLeaf)return e.empty;let r,i;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 a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof US){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(sx),KS);return r?new XS([t,r]):t}return r||YS}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 cx(this.localsInner(e))}localsInner(e){if(this==YS)return KS;if(e.inlineContent||!this.local.some(US.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof US||t.push(this.local[e]);return t}forEachSet(e){e(this)}},JS.empty=new JS([],[]),JS.removeOverlap=cx,YS=JS.empty,XS=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,qS));return e.from(r)}forChild(t,n){if(n.isLeaf)return JS.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=YS&&(a instanceof e?r=r.concat(a.members):r.push(a))}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 i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?cx(n?t:t.sort(sx)):KS}static from(t){switch(t.length){case 0:return YS;case 1:return t[0];default:return new e(t.every(e=>e instanceof JS)?t:t.reduce((e,t)=>e.concat(t instanceof JS?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}},ZS={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},QS=Gx&&Kx<=11,$S=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}},eC=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new $S,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]);Gx&&Kx<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Zx&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),QS&&(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,ZS)),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(Vy(this.view)){if(this.suppressingSelectionUpdates)return My(this.view);if(Gx&&Kx<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ix(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=new Set,n;for(let n=e.focusNode;n;n=Mx(n))t.add(n);for(let r=e.anchorNode;r;r=Mx(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Vy(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||Yx&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>e.type==`childList`&&e.removedNodes.length))){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(qx&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){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&&t.nodeName==`LI`&&(!n||mx(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Rx(n)&&(c=Ay(e))&&c.eq(W.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,My(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),dx(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,hx(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||My(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(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(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,i=e.nextSibling;if(Gx&&Kx<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?jx(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?jx(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},tC=new WeakMap,nC=!1,rC=/^(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,iC=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 NS,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Ax),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Ex(this),Tx(this),this.nodeViews=Ox(this),this.docView=gy(this.state.doc,wx(this),ux(this),this.dom,this),this.domObserver=new eC(this,(e,t,n,r)=>vx(this,e,t,n,r)),this.domObserver.start(),Sb(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&&Tb(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Ax),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];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){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Wb(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Ox(this);kx(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Tb(this),this.editable=Ex(this),Tx(this);let o=ux(this),s=wx(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&Jv(this);if(i){this.domObserver.stop();let t=l&&(Gx||Yx)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&Dx(n.selection,e.selection);if(l){let n=Yx?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Gb(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=gy(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}let i=this.input.mouseDown;t||!(i&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Uy(this)&&i.delaySelUpdate())?My(this,t):(Ry(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&Xv(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof K){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&qv(this,t.getBoundingClientRect(),e)}else qv(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let 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))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}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 BS(e.slice,e.move,r<0?void 0:K.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(Gx){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Qv(this.dom),My(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return oy(this,e)}coordsAtPos(e,t=1){return ly(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(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return hy(this,t||this.state,e)}pasteHTML(e,t){return Xb(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return Xb(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return lb(this,e)}destroy(){this.docView&&(wb(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ux(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Fx())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Ob(this,e)}domSelectionRange(){let e=this.domSelection();return e?Zx&&this.root.nodeType===11&&Hv(this.dom.ownerDocument)==this.dom&&px(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}},iC.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}})),oC=t((()=>{aC()}));function sC(e){var t=!(uC&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||dC&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?lC:cC)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var cC,lC,uC,dC,fC,pC=t((()=>{for(cC={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:`'`},lC={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},uC=typeof navigator<`u`&&/Mac/.test(navigator.platform),dC=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),fC=0;fC<10;fC++)cC[48+fC]=cC[96+fC]=String(fC);for(fC=1;fC<=24;fC++)cC[fC+111]=`F`+fC;for(fC=65;fC<=90;fC++)cC[fC]=String.fromCharCode(fC+32),lC[fC]=String.fromCharCode(fC);for(var e in cC)lC.hasOwnProperty(e)||(lC[e]=cC[e])}));function mC(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))yC?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function hC(e){let t=Object.create(null);for(let n in e)t[mC(n)]=e[n];return t}function gC(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 _C(e){return new F_({props:{handleKeyDown:vC(e)}})}function vC(e){let t=hC(e);return function(e,n){let r=sC(n),i,a=t[gC(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[gC(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(bC&&n.ctrlKey&&n.altKey)&&(i=cC[n.keyCode])&&i!=r){let r=t[gC(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var yC,bC,xC=t((()=>{pC(),R_(),yC=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),bC=typeof navigator<`u`&&/Win/.test(navigator.platform)})),SC=t((()=>{xC()}));function CC(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=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 a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}function wC(e,t){if(typeof e==`string`){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}function TC(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function EC(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:TC(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function DC(e,t,n={}){return e.find(e=>e.type===t&&EC(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function OC(e,t,n={}){return!!DC(e,t,n)}function kC(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){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!DC([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&OC([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&OC([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function AC(e,t){if(typeof e==`string`){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}function jC(e){return e instanceof G}function MC(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function NC(e,t=null){if(!t)return null;let n=W.atStart(e),r=W.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?G.create(e,MC(0,i,a),MC(e.content.size,i,a)):G.create(e,MC(t,i,a),MC(t,i,a))}function PC(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function FC(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function IC(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}function LC(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return FT(n)}function RC(e,t,n){if(e instanceof Nh||e instanceof V)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return V.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),RC(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new Bh({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,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?Vh.fromSchema(a).parseSlice(LC(e),n.parseOptions):Vh.fromSchema(a).parse(LC(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=Vh.fromSchema(t);return n.slice?r.parseSlice(LC(e),n.parseOptions).content:r.parse(LC(e),n.parseOptions)}return RC(``,t,n)}function zC(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof a_||i instanceof o_))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(W.near(e.doc.resolve(o),n))}function BC(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function VC(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))FC()||BC()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}function HC(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?wC(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>EC(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}function UC(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function WC(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}function GC(e,t,n={},r={}){return RC(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}function KC(e,t){let n=AC(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function qC(e,t){let n=new d_(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function JC(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function YC(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function XC(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function ZC(e){return t=>XC(t.$from,e)}function q(e,t,n){return e.config[t]===void 0&&e.parent?q(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?q(e.parent,t,n):null}):e.config[t]}function QC(e){return e.map(e=>{let t=q(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...QC(t())]:e}).flat(10)}function $C(e,t){let n=Xh.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function ew(e){return typeof e==`function`}function J(e,t=void 0,...n){return ew(e)?t?e.bind(t)(...n):e(...n):e}function tw(e={}){return Object.keys(e).length===0&&e.constructor===Object}function nw(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function rw(e){let t=[],{nodeExtensions:n,markExtensions:r}=nw(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=q(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=q(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function iw(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function aw(e){let t=[],n=iw(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function Y(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...aw(n[e]),...aw(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function ow(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)=>Y(e,t),{})}function sw(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function cw(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):sw(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function lw(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&tw(t)?!1:t!=null))}function uw(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function dw(e,t){let n=rw(e),{nodeExtensions:r,markExtensions:i}=nw(e);return new Bh({topNode:r.find(e=>q(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=lw({...e.reduce((e,t)=>{let n=q(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:J(q(r,`content`,a)),marks:J(q(r,`marks`,a)),group:J(q(r,`group`,a)),inline:J(q(r,`inline`,a)),atom:J(q(r,`atom`,a)),selectable:J(q(r,`selectable`,a)),draggable:J(q(r,`draggable`,a)),code:J(q(r,`code`,a)),whitespace:J(q(r,`whitespace`,a)),linebreakReplacement:J(q(r,`linebreakReplacement`,a)),defining:J(q(r,`defining`,a)),isolating:J(q(r,`isolating`,a)),attrs:Object.fromEntries(i.map(uw))}),s=J(q(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>cw(e,i)));let c=q(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:ow(e,i)}));let l=q(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=lw({...e.reduce((e,t)=>{let n=q(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:J(q(r,`inclusive`,a)),excludes:J(q(r,`excludes`,a)),group:J(q(r,`group`,a)),spanning:J(q(r,`spanning`,a)),code:J(q(r,`code`,a)),attrs:Object.fromEntries(i.map(uw))}),s=J(q(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>cw(e,i)));let c=q(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:ow(e,i)})),[r.name,o]}))})}function fw(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function pw(e){return e.sort((e,t)=>{let n=q(e,`priority`)||100,r=q(t,`priority`)||100;return n>r?-1:+(n<r)})}function mw(e){let t=pw(QC(e)),n=fw(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function hw(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function gw(e,t){return hw(e,{from:0,to:e.content.size},t)}function _w(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function vw(e,t){let n=wC(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function yw(e,t){let n=UC(typeof t==`string`?t:t.name,e.schema);return n===`node`?vw(e,t):n===`mark`?KC(e,t):{}}function bw(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function xw(e){let t=bw(e);return t.length===1?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 Sw(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),xw(r)}function Cw(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=kC(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function ww(e,t){return t.nodes[e]||t.marks[e]||null}function Tw(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}function Ew(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?AC(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>EC(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>EC(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Dw(e,t,n={}){if(!t)return HC(e,null,n)||Ew(e,null,n);let r=UC(t,e.schema);return r===`node`?HC(e,t,n):r===`mark`?Ew(e,t,n):!1}function Ow(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function kw(e,t){let{nodeExtensions:n}=nw(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=J(q(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function Aw(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(Aw(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function jw(e){return e instanceof K}function Mw(e,t){let n=t.mapping.mapResult(e.position);return{position:new uE(n.pos),mapResult:n}}function Nw(e){return new uE(e)}function Pw(e,t,n){let{selection:r}=t,i=null;if(jC(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}function Fw(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}function Iw(e){return!e||e===`1`?null:e}function Lw(e,t){return Iw(e)===Iw(t)}function Rw(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return G.between(r,i)}function zw(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof K){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function Bw(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function Vw(e,t){let n=e.getAttribute(`style`);if(!n)return null;let r=n.split(`;`).map(e=>e.trim()).filter(Boolean),i=t.toLowerCase();for(let e=r.length-1;e>=0;--e){let t=r[e],n=t.indexOf(`:`);if(n!==-1&&t.slice(0,n).trim().toLowerCase()===i)return t.slice(n+1).trim()}return null}function Hw(e){return typeof e==`number`}function Uw(e){return Object.prototype.toString.call(e).slice(8,-1)}function Ww(e){return Uw(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function Gw(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([\w-]+)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([\w-]+)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([\w-]+)/g,``).replace(/(?:^|\s)#([\w-]+)/g,``).replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function Kw(e){if(!e||Object.keys(e).length===0)return``;let 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])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function qw(e){let{nodeName:t,name:n,parseAttributes:r=Gw,serializeAttributes:i=Kw,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function Jw(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=Gw,serializeAttributes:a=Kw,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``}
${t.renderChildren(e.content||[],`
`)}
:::`}}}function Yw(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function Xw(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function Zw(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=Yw,serializeAttributes:a=Xw,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function Qw(e,t,n){let r=e.split(`
`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
`;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
`;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
`,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
`,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
`);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function $w(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
`).map(e=>e?t.indent(e):t.indent(``)).join(`
`);s+=e.type===`paragraph`?`
${n}`:`
${n}`}}),s}function eT(e,t){let n={...e};return Ww(e)&&Ww(t)&&Object.keys(t).forEach(r=>{Ww(t[r])&&Ww(e[r])?n[r]=eT(e[r],t[r]):n[r]=t[r]}),n}function tT(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}function nT(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=sE(c)+i;return a.forEach(e=>{if(l)return;let a=IE(u,e.find);if(!a)return;let c=s.state.tr,d=CC({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new pT({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function rT(e){let{editor:t,rules:n}=e,r=new F_({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:$C(V.from(e),a.schema);let{from:i}=s;nT({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return nT({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&nT({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?nT({editor:t,from:a.pos,to:a.pos,text:`
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function iT(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new pT({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||BE(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}function aT(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!iT({editor:t,state:CC({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new F_({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(VE=t)},i=()=>{VE&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=VE;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:$C(V.from(t),r.schema);let{from:n}=d,i=n+t.length,a=HE(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!Hw(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}function oT(e){return new FE({find:e.find,handler:({state:t,range:n,match:r})=>{let i=J(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(Cw(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>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function sT(e){return new FE({find:e.find,handler:({state:t,range:n,match:r})=>{let i=J(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function cT(e){return new FE({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=J(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function lT(e){return new FE({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=J(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&ug(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Sg(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}function uT(e){return new zE({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=J(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(Cw(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>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var dT,fT,pT,mT,hT,gT,_T,vT,yT,bT,xT,ST,CT,wT,TT,ET,DT,OT,kT,AT,jT,MT,NT,PT,FT,IT,LT,RT,zT,BT,VT,HT,UT,WT,GT,KT,qT,JT,YT,XT,ZT,QT,$T,eE,tE,nE,rE,iE,aE,oE,sE,cE,lE,uE,dE,fE,pE,mE,hE,gE,_E,vE,yE,bE,xE,SE,CE,wE,TE,EE,DE,OE,kE,AE,jE,ME,NE,PE,FE,IE,LE,RE,zE,BE,VE,HE,UE,WE,X,GE,KE,qE,JE,YE,XE,ZE,QE,$E,eD,tD,nD,rD,iD,aD,oD,sD,cD=t((()=>{p_(),Cv(),wv(),Tv(),Pv(),oC(),SC(),dT=Object.defineProperty,fT=(e,t)=>{for(var n in t)dT(e,n,{get:t[n],enumerable:!0})},pT=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(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:CC({state:i,transaction:e}),dispatch:t?()=>void 0: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)(o)]))}};return o}},mT={},fT(mT,{blur:()=>hT,clearContent:()=>gT,clearNodes:()=>_T,command:()=>vT,createParagraphNear:()=>yT,cut:()=>bT,deleteCurrentNode:()=>xT,deleteNode:()=>ST,deleteRange:()=>CT,deleteSelection:()=>DT,enter:()=>OT,exitCode:()=>kT,extendMarkRange:()=>AT,first:()=>jT,focus:()=>MT,forEach:()=>NT,insertContent:()=>PT,insertContentAt:()=>LT,joinBackward:()=>BT,joinDown:()=>zT,joinForward:()=>VT,joinItemBackward:()=>HT,joinItemForward:()=>UT,joinTextblockBackward:()=>WT,joinTextblockForward:()=>GT,joinUp:()=>RT,keyboardShortcut:()=>KT,lift:()=>qT,liftEmptyBlock:()=>JT,liftListItem:()=>YT,newlineInCode:()=>XT,resetAttributes:()=>ZT,scrollIntoView:()=>QT,selectAll:()=>$T,selectNodeBackward:()=>eE,selectNodeForward:()=>tE,selectParentNode:()=>nE,selectTextblockEnd:()=>rE,selectTextblockStart:()=>iE,setContent:()=>aE,setMark:()=>dE,setMeta:()=>fE,setNode:()=>pE,setNodeSelection:()=>mE,setTextDirection:()=>hE,setTextSelection:()=>gE,sinkListItem:()=>_E,splitBlock:()=>vE,splitListItem:()=>yE,toggleList:()=>SE,toggleMark:()=>CE,toggleNode:()=>wE,toggleWrap:()=>TE,undoInputRule:()=>EE,unsetAllMarks:()=>DE,unsetMark:()=>OE,unsetTextDirection:()=>kE,updateAttributes:()=>AE,wrapIn:()=>jE,wrapInList:()=>ME}),hT=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),gT=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),_T=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=cg(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},vT=e=>t=>e(t),yT=()=>({state:e,dispatch:t})=>dv(e,t),bT=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new G(r.doc.resolve(Math.max(o-1,0)))),!0},xT=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1},ST=e=>({tr:t,state:n,dispatch:r})=>{let i=wC(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},CT=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},wT=e=>e.content?/^text(\*|\+)/.test(e.content):!1,TT=(e,t,n)=>{if(!e.parent.isInline||n===`left`&&e.pos>e.start()||n===`right`&&e.pos<e.end())return e.pos;let r=t.nodes[e.parent.type.name].spec;return wT(r)?n===`left`?e.start()-1:e.end()+1:e.pos},ET=(e,t,n)=>({from:TT(e,n,`left`),to:TT(t,n,`right`)}),DT=()=>({state:e,dispatch:t})=>{let{$from:n,$to:r}=e.selection;if(e.selection.empty)return!1;let{from:i,to:a}=ET(n,r,e.schema);return t&&(e.tr.deleteRange(i,a).scrollIntoView(),t(e.tr)),!0},OT=()=>({commands:e})=>e.keyboardShortcut(`Enter`),kT=()=>({state:e,dispatch:t})=>uv(e,t),AT=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=AC(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=kC(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=G.create(o,e.from,e.to);n.setSelection(t)}}return!0},jT=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},MT=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(FC()||PC())&&r.dom.focus(),IC()&&!FC()&&!PC()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!jC(n.state.selection))return o(),!0;let s=NC(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},NT=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),PT=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),FT=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&FT(r)}return e},IT=e=>!(`type`in e),LT=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{RC(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=RC(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((IT(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof V){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&zC(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},RT=()=>({state:e,dispatch:t})=>ov(e,t),zT=()=>({state:e,dispatch:t})=>sv(e,t),BT=()=>({state:e,dispatch:t})=>ev(e,t),VT=()=>({state:e,dispatch:t})=>iv(e,t),HT=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Tg(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},UT=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Tg(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},WT=()=>({state:e,dispatch:t})=>tv(e,t),GT=()=>({state:e,dispatch:t})=>nv(e,t),KT=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=VC(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0},qT=(e,t={})=>({state:n,dispatch:r})=>HC(n,wC(e,n.schema),t)?cv(n,r):!1,JT=()=>({state:e,dispatch:t})=>fv(e,t),YT=e=>({state:t,dispatch:n})=>kv(wC(e,t.schema))(t,n),XT=()=>({state:e,dispatch:t})=>lv(e,t),ZT=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=UC(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=wC(e,r.schema)),s===`mark`&&(o=AC(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,WC(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(WC(a.attrs,t))))})})}),c},QT=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),$T=()=>({tr:e,dispatch:t})=>{if(t){let t=new T_(e.doc);e.setSelection(t)}return!0},eE=()=>({state:e,dispatch:t})=>rv(e,t),tE=()=>({state:e,dispatch:t})=>av(e,t),nE=()=>({state:e,dispatch:t})=>mv(e,t),rE=()=>({state:e,dispatch:t})=>_v(e,t),iE=()=>({state:e,dispatch:t})=>gv(e,t),aE=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=GC(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})},oE=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]},sE=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n},cE=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=ZC(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},lE=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)},uE=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}},dE=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=AC(e,r.schema);if(i)if(o){let e=KC(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return Pw(r,n,c)},fE=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),pE=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=wC(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>Z_(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>Z_(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},mE=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=MC(e,0,n.content.size),i=K.create(n,r);t.setSelection(i)}return!0},hE=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},gE=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=G.atStart(n).from,o=G.atEnd(n).to,s=MC(r,a,o),c=MC(i,a,o),l=G.create(n,s,c);t.setSelection(l)}return!0},_E=e=>({state:t,dispatch:n})=>Mv(wC(e,t.schema))(t,n),vE=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=Tw(l,s.node().type.name,s.node().attrs);if(a instanceof K&&a.node.isBlock)return!s.parentOffset||!bg(o,s.pos)?!1:(r&&(e&&Fw(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:JC(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=bg(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&bg(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof G&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&Fw(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},yE=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=wC(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=V.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=V.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...Tw(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(V.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new U(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(G.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...Tw(d,u.type.name,u.attrs),...t},m={...Tw(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!bg(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},bE=(e,t)=>{let n=ZC(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&Sg(e.doc,n.pos))||!Lw(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},xE=(e,t)=>{let n=ZC(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&Sg(e.doc,r))||!Lw(n.node.attrs.type,i?.attrs.type)||e.join(r),!0},SE=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=wC(e,o.schema),m=wC(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=ZC(e=>kw(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,ee=S&&w&&kw(w.type.name,d)?{node:w,pos:0,depth:0}:null,T=x??ee,E=!!x&&y.depth>=1&&y.depth-x.depth<=1,D=!!ee;if((E||D)&&T){if(T.node.type===p)return S&&D?c().command(({tr:e,dispatch:t})=>{let n=Rw(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(kw(T.node.type.name,d)&&p.validContent(T.node.content))return c().command(()=>(a.setNodeMarkup(T.pos,p),!0)).command(()=>bE(a,p)).command(()=>xE(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>bE(a,p)).command(()=>xE(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>bE(a,p)).command(()=>xE(a,p)).run()},CE=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=AC(e,r.schema);return Ew(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},wE=(e,t,n={})=>({state:r,commands:i})=>{let a=wC(e,r.schema),o=wC(t,r.schema),s=HC(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},TE=(e,t={})=>({state:n,commands:r})=>{let i=wC(e,n.schema);return HC(n,i,t)?r.lift(i):r.wrapIn(i,t)},EE=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},DE=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:a}=t,{empty:o,ranges:s}=a;if(o)return!0;let{nonClearableMarks:c}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!c.includes(e.name));s.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},OE=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=AC(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=kC(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},kE=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},AE=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=UC(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=wC(e,r.schema)),s===`mark`&&(o=AC(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},jE=(e,t={})=>({state:n,dispatch:r})=>X_(wC(e,n.schema),t)(n,r),ME=(e,t={})=>({state:n,dispatch:r})=>Ev(wC(e,n.schema),t)(n,r),NE=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},PE={},fT(PE,{createAtomBlockMarkdownSpec:()=>qw,createBlockMarkdownSpec:()=>Jw,createInlineMarkdownSpec:()=>Zw,parseAttributes:()=>Gw,parseIndentedBlocks:()=>Qw,renderNestedMarkdownContent:()=>$w,serializeAttributes:()=>Kw}),FE=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},IE=(e,t)=>{if(TC(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r},LE=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{...J(q(this,`addOptions`,{name:this.name}))}}get storage(){return{...J(q(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>eT(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let 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}},RE=class e extends LE{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},zE=class{constructor(e){this.find=e.find,this.handler=e.handler}},BE=(e,t,n)=>{if(TC(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]},VE=null,HE=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n},UE=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=mw(e),this.schema=dw(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=q(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:ww(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return pw([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:ww(t.name,this.schema)},r=[],i=q(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&q(t,`exitable`,n)&&(a.ArrowRight=()=>RE.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=_C(a);r.push(o);let s=q(t,`addInputRules`,n);if(Ow(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=rT({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=q(t,`addPasteRules`,n);if(Ow(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=aT({editor:e,rules:t});r.push(...n)}}let l=q(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return rw(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=nw(this.extensions);return Object.fromEntries(t.filter(e=>!!q(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=q(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:wC(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:ow(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return pw([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:ww(n.name,this.schema)},i=q(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return pw([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:ww(n.name,this.schema)},i=q(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=nw(this.extensions);return Object.fromEntries(t.filter(e=>!!q(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=q(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:AC(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=ow(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{tT(i,e,t)}})}]:[]}))}destroy(){this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:ww(e.name,this.schema)};e.type===`mark`&&((J(q(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(J(q(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=q(e,`onBeforeCreate`,t),r=q(e,`onCreate`,t),i=q(e,`onUpdate`,t),a=q(e,`onSelectionUpdate`,t),o=q(e,`onTransaction`,t),s=q(e,`onFocus`,t),c=q(e,`onBlur`,t),l=q(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}},UE.resolve=mw,UE.sort=pw,UE.flatten=QC,WE={},fT(WE,{ClipboardTextSerializer:()=>GE,Commands:()=>KE,Delete:()=>qE,Drop:()=>JE,Editable:()=>YE,FocusEvents:()=>ZE,Keymap:()=>QE,Paste:()=>$E,Tabindex:()=>eD,TextDirection:()=>tD,focusEventsPluginKey:()=>XE}),X=class e extends LE{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},GE=X.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new F_({key:new L_(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=_w(n),{blockSeparator:o}=this.options,s={...o===void 0?{}:{blockSeparator:o},textSerializers:a};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>hw(r,{from:e.pos,to:t.pos},s)).join(o??`
`)}}})]}}),KE=X.create({name:`commands`,addCommands(){return{...mT}}}),qE=X.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=qC(e.before,[e,...t]);Sw(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof n_){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0?r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)):!1,u=r.doc.nodeAt(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:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),JE=X.create({name:`drop`,addProseMirrorPlugins(){return[new F_({key:new L_(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),YE=X.create({name:`editable`,addProseMirrorPlugins(){return[new F_({key:new L_(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),XE=new L_(`focusEvents`),ZE=X.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new F_({key:XE,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),QE=X.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:W.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1: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},i={...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 FC()||BC()?i:r},addProseMirrorPlugins(){return[new F_({key:new L_(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=W.atStart(t.doc).from,l=W.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!Aw(n.doc))return;let u=n.tr,d=CC({state:n,transaction:u}),{commands:f}=new pT({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),$E=X.create({name:`paste`,addProseMirrorPlugins(){return[new F_({key:new L_(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),eD=X.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new F_({key:new L_(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),tD=X.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=nw(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new F_({key:new L_(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),nD=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(){return this.actualDepth??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(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);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}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),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(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let 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){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])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||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},rD=`.ProseMirror {
position: relative;
}
.ProseMirror {
word-wrap: break-word;
white-space: pre-wrap;
white-space: break-spaces;
-webkit-font-variant-ligatures: none;
font-variant-ligatures: none;
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}
.ProseMirror [contenteditable="false"] {
white-space: normal;
}
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
white-space: pre-wrap;
}
.ProseMirror pre {
white-space: pre-wrap;
}
img.ProseMirror-separator {
display: inline !important;
border: none !important;
margin: 0 !important;
width: 0 !important;
height: 0 !important;
}
.ProseMirror-gapcursor {
display: none;
pointer-events: none;
position: absolute;
margin: 0;
}
.ProseMirror-gapcursor:after {
content: "";
display: block;
position: absolute;
top: -2px;
width: 20px;
border-top: 1px solid black;
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}
@keyframes ProseMirror-cursor-blink {
to {
visibility: hidden;
}
}
.ProseMirror-hideselection *::selection {
background: transparent;
}
.ProseMirror-hideselection *::-moz-selection {
background: transparent;
}
.ProseMirror-hideselection * {
caret-color: transparent;
}
.ProseMirror-focused .ProseMirror-gapcursor {
display: block;
}`,iD=class extends NE{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:typeof document<`u`?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:Mw,createMappablePosition:Nw},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event: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);let t=this.createDoc(),n=NC(t,this.options.autofocus);this.editorState=P_.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=Bw(rD,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(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw 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){let n=ew(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;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){let e=[...this.options.enableCoreExtensions?[YE,GE.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),KE,ZE,QE,eD.configure({value:this.options.coreExtensionOptions?.tabindex?.value}),JE,$E,qE,tD.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new UE(e,this)}createCommandManager(){this.commandManager=new pT({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=GC(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&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=GC(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new iC(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.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;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return yw(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return Dw(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return $C(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
`,textSerializers:n={}}=e||{};return gw(this.state.doc,{blockSeparator:t,textSerializers:{..._w(this.schema),...n}})}get isEmpty(){return Aw(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(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText?t.nodeAfter:null;return new nD(t,this,!1,n)}get $doc(){return this.$pos(0)}},aD=e=>`touches`in e,oD=class{constructor(e){this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.element.draggable=!1,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e?.options?.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type?(this.node=e,this.onUpdate?this.onUpdate(e,t,n):!0):!1}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,aD(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}},sD=class e extends LE{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}}})),lD,uD=t((()=>{lD=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]}})),dD=t((()=>{uD()}));function fD(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=fD(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function pD(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=pD(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function mD(e,t){return ZD.index=e,ZD.offset=t,ZD}function hD(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))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(!hD(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!hD(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}function gD(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(gD(a.content,t-i-1,n-i-1)))}function _D(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=_D(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function vD(e,t,n){if(n.openStart>e.depth)throw new $D(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new $D(`Inconsistent open depths`);return yD(e,t,n,0)}function yD(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=yD(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return wD(a,ED(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return wD(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=DD(n,e);return wD(a,TD(e,i,o,t,r))}}function bD(e,t){if(!t.type.compatibleContent(e.type))throw new $D(`Cannot join `+t.type.name+` onto `+e.type.name)}function xD(e,t,n){let r=e.node(n);return bD(r,t.node(n)),r}function SD(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 CD(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(SD(e.nodeAfter,r),a++));for(let e=a;e<o;e++)SD(i.child(e),r);t&&t.depth==n&&t.textOffset&&SD(t.nodeBefore,r)}function wD(e,t){return e.type.checkContent(t),e.copy(t)}function TD(e,t,n,r,i){let a=e.depth>i&&xD(e,t,i+1),o=r.depth>i&&xD(n,r,i+1),s=[];return CD(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(bD(a,o),SD(wD(a,TD(e,t,n,r,i+1)),s)):(a&&SD(wD(a,ED(e,t,i+1)),s),CD(t,n,i,s),o&&SD(wD(o,ED(n,r,i+1)),s)),CD(r,null,i,s),new XD(s)}function ED(e,t,n){let r=[];return CD(null,e,n,r),e.depth>n&&SD(wD(xD(e,t,n+1),ED(e,t,n+1)),r),CD(t,null,n,r),new XD(r)}function DD(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(XD.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}function OD(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function kD(e){let t=[];do t.push(AD(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function AD(e){let t=[];do t.push(jD(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function jD(e){let t=FD(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(`{`))t=ND(e,t);else break;return t}function MD(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function ND(e,t){let n=MD(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:MD(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function PD(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function FD(e){if(e.eat(`(`)){let t=kD(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=PD(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function ID(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function LD(e,t){return t-e}function RD(e,t){let n=[];return r(t),n.sort(LD);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function zD(e){let t=Object.create(null);return n(RD(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);RD(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new cO(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(LD);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function BD(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function VD(e,t){return e+t*dO}function HD(e){return e&uO}function UD(e){return(e-(e&uO))/dO}function WD(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(WD(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return XD.fromArray(r)}function GD(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function KD(e){!NO&&!e.parent.inlineContent&&(NO=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}function qD(e,t,n,r,i,a=!1){if(t.inlineContent)return PO.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=qD(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&IO.isSelectable(r))return IO.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function JD(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof TO||i instanceof EO))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(jO.near(e.doc.resolve(o),n))}function YD(e,t){return!t||!e?e:e.bind(t)}var XD,ZD,QD,$D,eO,tO,nO,rO,iO,aO,oO,sO,cO,lO,uO,dO,fO,pO,mO,hO,gO,_O,vO,yO,bO,xO,SO,CO,wO,TO,EO,DO,OO,kO,AO,jO,MO,NO,PO,FO,IO,LO,RO,zO,BO,VO,HO,UO,WO=t((()=>{cD(),dD(),XD=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&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 i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}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 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 fD(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return pD(this,e,t,n)}findIndex(e){if(e==0)return mD(0,e);if(e==this.size)return mD(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?mD(t+1,i):mD(t,n);n=i}}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 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 i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}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 RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}},XD.empty=new XD([],0),ZD={index:0,offset:0},QD=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 i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return 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&&hD(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 RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw 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)&&t.length==0)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}},QD.none=[],$D=class extends Error{},eO=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=_D(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(gD(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,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(XD.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=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)i++;return new e(t,r,i)}},eO.empty=new eO(XD.empty,0,0),tO=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,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):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return QD.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 i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}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 i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].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 aO(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 RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=iO.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 iO.set(t,r=new nO);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%rO,i}},nO=class{constructor(){this.elts=[],this.i=0}},rO=12,iO=new WeakMap,aO=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)}},oO=Object.create(null),sO=class e{constructor(e,t,n,r=QD.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||XD.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,``)}textBetween(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&&hD(this.attrs,t||e.defaultAttrs||oO)&&QD.sameSet(this.marks,n||QD.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 e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return eO.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new eO(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return vD(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(e==0)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 tO.resolveCached(this,e)}resolveNoCache(e){return tO.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()+`)`),OD(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=XD.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=QD.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(!QD.sameSet(e,this.marks))throw 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 RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=XD.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}},sO.prototype.text=void 0,cO=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new lO(t,n);if(r.next==null)return e.empty;let i=kD(r);r.next&&r.err(`Unexpected trailing text`);let a=zD(ID(i));return BD(a,r),a}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 i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type: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];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return XD.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+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(),i=r.match;if(i.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<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
`)}},cO.empty=new cO(!0),lO=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 SyntaxError(e+` (in content expression '`+this.string+`')`)}},uO=65535,dO=2**16,fO=1,pO=2,mO=4,hO=8,gO=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&hO)>0}get deletedBefore(){return(this.delInfo&(fO|mO))>0}get deletedAfter(){return(this.delInfo&(pO|mO))>0}get deletedAcross(){return(this.delInfo&mO)>0}},_O=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=HD(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+UD(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,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:VD(o/3,e-s),f=e==s?pO:e==u?fO:mO;return(t<0?e!=s:e!=u)&&(f|=hO),new gO(a,f,d)}r+=l-c}return n?e+r:new gO(e+r,0,null)}touches(e,t){let n=0,r=HD(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}},_O.empty=new _O([]),vO=Object.create(null),yO=class{getMap(){return _O.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=vO[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in vO)throw RangeError(`Duplicate use of step JSON ID `+e);return vO[e]=t,t.prototype.jsonID=e,t}},bO=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,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof $D)return e.fail(t.message);throw t}}},xO=class e extends yO{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)),i=new eO(WD(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return bO.fromReplace(e,this.from,this.to,i)}invert(){return new SO(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(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}},yO.jsonID(`addMark`,xO),SO=class e extends yO{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=new eO(WD(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return bO.fromReplace(e,this.from,this.to,n)}invert(){return new xO(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(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}},yO.jsonID(`removeMark`,SO),CO=class e extends yO{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return bO.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return bO.fromReplace(e,this.pos,this.pos+1,new eO(XD.from(n),0,+!t.isLeaf))}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 wO(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(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}},yO.jsonID(`addNodeMark`,CO),wO=class e extends yO{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return bO.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return bO.fromReplace(e,this.pos,this.pos+1,new eO(XD.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new CO(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:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}},yO.jsonID(`removeNodeMark`,wO),TO=class e extends yO{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&GD(e,this.from,this.to)?bO.fail(`Structure replace would overwrite content`):bO.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new _O([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){let n=this.slice.size+t.slice.size==0?eO.empty:new eO(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)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?eO.empty:new eO(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,eO.fromJSON(t,n.slice),!!n.structure)}},TO.MAP_BIAS=1,yO.jsonID(`replace`,TO),EO=class e extends yO{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(GD(e,this.from,this.gapFrom)||GD(e,this.gapTo,this.to)))return bO.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return bO.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?bO.fromReplace(e,this.from,this.to,n):bO.fail(`Content does not fit in gap`)}getMap(){return new _O([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),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,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(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,eO.fromJSON(t,n.slice),n.insert,!!n.structure)}},yO.jsonID(`replaceAround`,EO),DO=class e extends yO{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 bO.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return bO.fromReplace(e,this.pos,this.pos+1,new eO(XD.from(r),0,+!t.isLeaf))}getMap(){return _O.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(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}},yO.jsonID(`attr`,DO),OO=class e extends yO{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return bO.ok(n)}getMap(){return _O.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(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}},yO.jsonID(`docAttr`,OO),kO=class extends Error{},kO=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},kO.prototype=Object.create(Error.prototype),kO.prototype.constructor=kO,kO.prototype.name=`TransformError`,AO=Object.create(null),jO=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new MO(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=eO.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?eO.empty:t),o==0&&JD(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),JD(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new PO(e):qD(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?qD(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):qD(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new RO(e.node(0))}static atStart(e){return qD(e,e,0,0,1)||new RO(e)}static atEnd(e){return qD(e,e,e.content.size,e.childCount,-1)||new RO(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=AO[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in AO)throw RangeError(`Duplicate use of selection JSON ID `+e);return AO[e]=t,t.prototype.jsonID=e,t}getBookmark(){return PO.between(this.$anchor,this.$head).getBookmark()}},jO.prototype.visible=!0,MO=class{constructor(e,t){this.$from=e,this.$to=t}},NO=!1,PO=class e extends jO{constructor(e,t=e){KD(e),KD(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 jO.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=eO.empty){if(super.replace(e,t),t==eO.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 FO(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw 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 i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=jO.findFrom(n,r,!0)||jO.findFrom(n,-r,!0);if(e)n=e.$head;else return jO.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(jO.findFrom(t,-r,!0)||jO.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}},jO.jsonID(`text`,PO),FO=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 PO.between(e.resolve(this.anchor),e.resolve(this.head))}},IO=class e extends jO{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:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?jO.near(a):new e(a)}content(){return new eO(XD.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 LO(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw 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&&e.type.spec.selectable!==!1}},IO.prototype.visible=!1,jO.jsonID(`node`,IO),LO=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new FO(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&IO.isSelectable(n)?new IO(t):jO.near(t)}},RO=class e extends jO{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=eO.empty){if(t==eO.empty){e.delete(0,e.doc.content.size);let t=jO.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 zO}},jO.jsonID(`all`,RO),zO={map(){return this},resolve(e){return new RO(e)}},BO=class{constructor(e,t,n){this.name=e,this.init=YD(t.init,n),this.apply=YD(t.apply,n)}},new BO(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new BO(`selection`,{init(e,t){return e.selection||jO.atStart(t.doc)},apply(e){return e.selection}}),new BO(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new BO(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}}),VO=(e,t)=>{let{state:n,view:r}=e,{selection:i}=n;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0)return!1;let o=a.depth-1,s=a.node(o),c=a.index(o);if(c===0)return!1;if(s.type===t)return e.commands.lift(t.name);let l=s.child(c-1);if(l.type!==t||!l.lastChild?.isTextblock)return!1;let u=a.before(),d=u-1-1,{tr:f}=n;return f.delete(u,a.after()).insert(d,a.parent.content),f.setSelection(PO.create(f.doc,d)),r.dispatch(f.scrollIntoView()),!0},HO=/^\s*>\s$/,UO=sD.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return lD(`blockquote`,{...Y(this.options.HTMLAttributes,e),children:lD(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
`))}),n.join(`
>
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>VO(this.editor,this.type)}},addInputRules(){return[lT({find:HO,type:this.type})]}})})),GO,KO,qO,JO,YO,XO=t((()=>{cD(),dD(),GO=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,KO=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,qO=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,JO=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,YO=RE.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&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 lD(`strong`,{...Y(this.options.HTMLAttributes,e),children:lD(`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[oT({find:GO,type:this.type}),oT({find:qO,type:this.type})]},addPasteRules(){return[uT({find:KO,type:this.type}),uT({find:JO,type:this.type})]}})})),ZO,QO,$O,ek=t((()=>{cD(),ZO=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},QO=e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},$O=RE.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,Y(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[oT({find:ZO,type:this.type})]},addPasteRules(){return[uT({find:QO,type:this.type})]}})})),tk,nk,rk,ik,ak=t((()=>{cD(),wv(),tk=4,nk=/^```([a-z]+)?[\s\n]$/,rk=/^~~~([a-z]+)?[\s\n]$/,ik=sD.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:tk,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,Y(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
`):`\`\`\`${r}
\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??tk,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
`,`
`).split(`
`).map(e=>o+e).join(`
`);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??tk,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
`,`
`).split(`
`),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(G.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
`,`
`).split(`
`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
`);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(W.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[cT({find:nk,type:this.type,getAttributes:e=>({language:e[1]})}),cT({find:rk,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new F_({key:new L_(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(G.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}})})),ok,sk=t((()=>{cD(),ok=sD.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):``})})),ck,lk=t((()=>{cD(),ck=sD.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,Y(this.options.HTMLAttributes,e)]},renderText(){return`
`},renderMarkdown:()=>`
`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}})})),uk,dk=t((()=>{cD(),uk=sD.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(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]}`,Y(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},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=>cT({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}})})),fk,pk=t((()=>{cD(),wv(),fk=sD.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,Y(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!zw(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return jw(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(G.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(K.create(t.doc,n.pos)):t.setSelection(G.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(G.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[sT({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}})})),mk,hk,gk,_k,vk,yk=t((()=>{cD(),mk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,hk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,gk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,_k=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,vk=RE.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,Y(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[oT({find:mk,type:this.type}),oT({find:gk,type:this.type})]},addPasteRules(){return[uT({find:hk,type:this.type}),uT({find:_k,type:this.type})]}})}));function bk(e,t){return e in t||(t[e]=[]),t[e]}function xk(e,t,n){t[Uk]&&(t[Kk]=!0,t[qk]=!0),t[Wk]&&(t[Kk]=!0,t[Gk]=!0),t[Kk]&&(t[qk]=!0),t[Gk]&&(t[qk]=!0),t[qk]&&(t[Jk]=!0),t[Yk]&&(t[Jk]=!0);for(let r in t){let t=bk(r,n);t.indexOf(e)<0&&t.push(e)}}function Sk(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Ck(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}function wk(e=[]){let t={};Ck.groups=t;let n=new Ck;pj??=Ok(Vk),mj??=Ok(Hk),Q(n,`'`,AA),Q(n,`{`,pA),Q(n,`}`,mA),Q(n,`[`,hA),Q(n,`]`,gA),Q(n,`(`,_A),Q(n,`)`,vA),Q(n,`<`,yA),Q(n,`>`,bA),Q(n,``,xA),Q(n,``,SA),Q(n,``,CA),Q(n,``,wA),Q(n,``,TA),Q(n,``,EA),Q(n,``,DA),Q(n,``,OA),Q(n,`&`,kA),Q(n,`*`,jA),Q(n,`@`,MA),Q(n,"`",PA),Q(n,`^`,FA),Q(n,`:`,IA),Q(n,`,`,LA),Q(n,`$`,RA),Q(n,`.`,zA),Q(n,`=`,BA),Q(n,`!`,VA),Q(n,`-`,HA),Q(n,`%`,UA),Q(n,`|`,WA),Q(n,`+`,GA),Q(n,`#`,KA),Q(n,`?`,qA),Q(n,`"`,JA),Q(n,`/`,ZA),Q(n,`;`,XA),Q(n,`~`,QA),Q(n,`_`,$A),Q(n,`\\`,NA),Q(n,``,YA);let r=$k(n,oj,uA,{[Uk]:!0});$k(r,oj,r);let i=$k(r,rj,rA,{[Kk]:!0}),a=$k(r,ij,iA,{[qk]:!0}),o=$k(n,rj,tA,{[Wk]:!0});$k(o,oj,i),$k(o,rj,o),$k(i,oj,i),$k(i,rj,i);let s=$k(n,ij,nA,{[Gk]:!0});$k(s,rj),$k(s,oj,a),$k(s,ij,s),$k(a,oj,a),$k(a,rj),$k(a,ij,a);let c=Q(n,lj,fA,{[Qk]:!0}),l=Q(n,cj,dA,{[Qk]:!0}),u=$k(n,sj,dA,{[Qk]:!0});Q(n,fj,u),Q(l,lj,c),Q(l,fj,u),$k(l,sj,u),Q(u,cj),Q(u,lj),$k(u,sj,u),Q(u,fj,u);let d=$k(n,aj,ej,{[Yk]:!0});Q(d,`#`),$k(d,aj,d),Q(d,uj,d);let f=Q(d,dj);Q(f,`#`),$k(f,aj,d);let p=[[rj,o],[oj,i]],m=[[rj,null],[ij,s],[oj,a]];for(let e=0;e<pj.length;e++)Dk(n,pj[e],oA,tA,p);for(let e=0;e<mj.length;e++)Dk(n,mj[e],sA,nA,m);xk(oA,{tld:!0,ascii:!0},t),xk(sA,{utld:!0,alpha:!0},t),Dk(n,`file`,cA,tA,p),Dk(n,`mailto`,cA,tA,p),Dk(n,`http`,lA,tA,p),Dk(n,`https`,lA,tA,p),Dk(n,`ftp`,lA,tA,p),Dk(n,`ftps`,lA,tA,p),xk(cA,{scheme:!0,ascii:!0},t),xk(lA,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[Xk]:!0}:{[Zk]:!0};r.indexOf(`-`)>=0?i[Jk]=!0:rj.test(r)?oj.test(r)?i[Kk]=!0:i[Wk]=!0:i[Uk]=!0,eA(n,r,r,i)}return eA(n,`localhost`,aA,{ascii:!0}),n.jd=new Ck(tj),{start:n,tokens:Object.assign({groups:t},nj)}}function Tk(e,t){let n=Ek(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function Ek(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function Dk(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new Ck(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new Ck(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function Ok(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}function kk(e,t=null){let n=Object.assign({},hj);e&&(n=Object.assign(n,e instanceof kk?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}function Ak(e){return e}function jk(e,t){this.t=`token`,this.v=e,this.tk=t}function Mk(e,t){class n extends jk{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}function Nk({groups:e}){let t=e.domain.concat([kA,jA,MA,NA,PA,FA,RA,BA,HA,uA,UA,WA,GA,KA,ZA,tj,QA,$A]),n=[AA,IA,LA,zA,VA,UA,qA,JA,XA,yA,bA,pA,mA,gA,hA,_A,vA,xA,SA,CA,wA,TA,EA,DA,OA],r=[kA,AA,jA,NA,PA,FA,RA,BA,HA,pA,mA,UA,WA,GA,KA,qA,ZA,tj,QA,$A],i=bj(),a=Q(i,QA);Z(a,r,a),Z(a,e.domain,a);let o=bj(),s=bj(),c=bj();Z(i,e.domain,o),Z(i,e.scheme,s),Z(i,e.slashscheme,c),Z(o,r,a),Z(o,e.domain,o);let l=Q(o,MA);Q(a,MA,l),Q(s,MA,l),Q(c,MA,l);let u=Q(a,zA);Z(u,r,a),Z(u,e.domain,a);let d=bj();Z(l,e.domain,d),Z(d,e.domain,d);let f=Q(d,zA);Z(f,e.domain,d);let p=bj(gj);Z(f,e.tld,p),Z(f,e.utld,p),Q(l,aA,p);let m=Q(d,HA);Q(m,HA,m),Z(m,e.domain,d),Z(p,e.domain,d),Q(p,zA,f),Q(p,HA,m);let h=Q(o,HA),g=Q(o,zA);Q(h,HA,h),Z(h,e.domain,o),Z(g,r,a),Z(g,e.domain,o);let _=bj(yj);Z(g,e.tld,_),Z(g,e.utld,_),Z(_,e.domain,o),Z(_,r,a),Q(_,zA,g),Q(_,HA,h),Q(_,MA,l);let v=Q(_,IA),y=bj(yj);Z(v,e.numeric,y);let b=bj(yj),x=bj();Z(b,t,b),Z(b,n,x),Z(x,t,b),Z(x,n,x),Q(_,ZA,b),Q(y,ZA,b);let S=Q(s,IA),C=Q(Q(Q(c,IA),ZA),ZA);Z(s,e.domain,o),Q(s,zA,g),Q(s,HA,h),Z(c,e.domain,o),Q(c,zA,g),Q(c,HA,h),Z(S,e.domain,b),Q(S,ZA,b),Q(S,qA,b),Z(C,e.domain,b),Z(C,t,b),Q(C,ZA,b);let w=[[pA,mA],[hA,gA],[_A,vA],[yA,bA],[xA,SA],[CA,wA],[TA,EA],[DA,OA]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=Q(b,r);Q(x,r,a);let o=bj(yj);Z(a,t,o);let s=bj();Z(a,n,s),Q(a,i,b),Z(o,t,o),Z(o,n,s),Z(s,t,o),Z(s,n,s),Q(o,i,b),Q(s,i,b)}return Q(i,aA,_),Q(i,fA,vj),{start:i,tokens:nj}}function Pk(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(Fk(_j,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(Fk(e,t,r))}}return o.length>0&&a.push(Fk(_j,t,o)),a}function Fk(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}function Ik(){return Ck.groups={},Cj.scanner=null,Cj.parser=null,Cj.tokenQueue=[],Cj.pluginQueue=[],Cj.customSchemes=[],Cj.initialized=!1,Cj}function Lk(e,t=!1){if(Cj.initialized&&xj(`linkifyjs: already initialized - will not register custom scheme "${e}" ${Sj}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);Cj.customSchemes.push([e,t])}function Rk(){Cj.scanner=wk(Cj.customSchemes);for(let e=0;e<Cj.tokenQueue.length;e++)Cj.tokenQueue[e][1]({scanner:Cj.scanner});Cj.parser=Nk(Cj.scanner.tokens);for(let e=0;e<Cj.pluginQueue.length;e++)Cj.pluginQueue[e][1]({scanner:Cj.scanner,parser:Cj.parser});return Cj.initialized=!0,Cj}function zk(e){return Cj.initialized||Rk(),Pk(Cj.parser.start,e,Tk(Cj.scanner.start,e))}function Bk(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new kk(n),i=zk(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var Vk,Hk,Uk,Wk,Gk,Kk,qk,Jk,Yk,Xk,Zk,Qk,Z,$k,eA,Q,tA,nA,rA,iA,aA,oA,sA,cA,lA,uA,dA,fA,pA,mA,hA,gA,_A,vA,yA,bA,xA,SA,CA,wA,TA,EA,DA,OA,kA,AA,jA,MA,NA,PA,FA,IA,LA,RA,zA,BA,VA,HA,UA,WA,GA,KA,qA,JA,YA,XA,ZA,QA,$A,ej,tj,nj,rj,ij,aj,oj,sj,cj,lj,uj,dj,fj,pj,mj,hj,gj,_j,vj,yj,bj,xj,Sj,Cj,wj=t((()=>{Vk=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,Hk=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт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همراهاکستان7ڀارت4कम3नट3भरत0म3त5सगठन5ব5রত2ৰত4ਭਰਤ4ભરત4ଭରତ4இநி6லங6ிகப11రత5ರತ4ഭരത54คอม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`,Uk=`numeric`,Wk=`ascii`,Gk=`alpha`,Kk=`asciinumeric`,qk=`alphanumeric`,Jk=`domain`,Yk=`emoji`,Xk=`scheme`,Zk=`slashscheme`,Qk=`whitespace`,Ck.groups={},Ck.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=Ck.groups;let i;return t&&t.j?i=t:(i=new Ck(t),n&&r&&xk(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=Ck.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new Ck,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new Ck,a&&(r&&(o.t&&typeof o.t==`string`?xk(a,Object.assign(Sk(o.t,r),n),r):n&&xk(a,n,r)),o.t=a),i.j[e]=o,o}},Z=(e,t,n,r,i)=>e.ta(t,n,r,i),$k=(e,t,n,r,i)=>e.tr(t,n,r,i),eA=(e,t,n,r,i)=>e.ts(t,n,r,i),Q=(e,t,n,r,i)=>e.tt(t,n,r,i),tA=`WORD`,nA=`UWORD`,rA=`ASCIINUMERICAL`,iA=`ALPHANUMERICAL`,aA=`LOCALHOST`,oA=`TLD`,sA=`UTLD`,cA=`SCHEME`,lA=`SLASH_SCHEME`,uA=`NUM`,dA=`WS`,fA=`NL`,pA=`OPENBRACE`,mA=`CLOSEBRACE`,hA=`OPENBRACKET`,gA=`CLOSEBRACKET`,_A=`OPENPAREN`,vA=`CLOSEPAREN`,yA=`OPENANGLEBRACKET`,bA=`CLOSEANGLEBRACKET`,xA=`FULLWIDTHLEFTPAREN`,SA=`FULLWIDTHRIGHTPAREN`,CA=`LEFTCORNERBRACKET`,wA=`RIGHTCORNERBRACKET`,TA=`LEFTWHITECORNERBRACKET`,EA=`RIGHTWHITECORNERBRACKET`,DA=`FULLWIDTHLESSTHAN`,OA=`FULLWIDTHGREATERTHAN`,kA=`AMPERSAND`,AA=`APOSTROPHE`,jA=`ASTERISK`,MA=`AT`,NA=`BACKSLASH`,PA=`BACKTICK`,FA=`CARET`,IA=`COLON`,LA=`COMMA`,RA=`DOLLAR`,zA=`DOT`,BA=`EQUALS`,VA=`EXCLAMATION`,HA=`HYPHEN`,UA=`PERCENT`,WA=`PIPE`,GA=`PLUS`,KA=`POUND`,qA=`QUERY`,JA=`QUOTE`,YA=`FULLWIDTHMIDDLEDOT`,XA=`SEMI`,ZA=`SLASH`,QA=`TILDE`,$A=`UNDERSCORE`,ej=`EMOJI`,tj=`SYM`,nj=Object.freeze({__proto__:null,ALPHANUMERICAL:iA,AMPERSAND:kA,APOSTROPHE:AA,ASCIINUMERICAL:rA,ASTERISK:jA,AT:MA,BACKSLASH:NA,BACKTICK:PA,CARET:FA,CLOSEANGLEBRACKET:bA,CLOSEBRACE:mA,CLOSEBRACKET:gA,CLOSEPAREN:vA,COLON:IA,COMMA:LA,DOLLAR:RA,DOT:zA,EMOJI:ej,EQUALS:BA,EXCLAMATION:VA,FULLWIDTHGREATERTHAN:OA,FULLWIDTHLEFTPAREN:xA,FULLWIDTHLESSTHAN:DA,FULLWIDTHMIDDLEDOT:YA,FULLWIDTHRIGHTPAREN:SA,HYPHEN:HA,LEFTCORNERBRACKET:CA,LEFTWHITECORNERBRACKET:TA,LOCALHOST:aA,NL:fA,NUM:uA,OPENANGLEBRACKET:yA,OPENBRACE:pA,OPENBRACKET:hA,OPENPAREN:_A,PERCENT:UA,PIPE:WA,PLUS:GA,POUND:KA,QUERY:qA,QUOTE:JA,RIGHTCORNERBRACKET:wA,RIGHTWHITECORNERBRACKET:EA,SCHEME:cA,SEMI:XA,SLASH:ZA,SLASH_SCHEME:lA,SYM:tj,TILDE:QA,TLD:oA,UNDERSCORE:$A,UTLD:sA,UWORD:nA,WORD:tA,WS:dA}),rj=/[a-z]/,ij=/\p{L}/u,aj=/\p{Emoji}/u,oj=/\d/,sj=/\s/,cj=`\r`,lj=`
`,uj=``,dj=``,fj=``,pj=null,mj=null,hj={defaultProtocol:`http`,events:null,format:Ak,formatHref:Ak,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null},kk.prototype={o:hj,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:hj[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}},jk.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let 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=hj.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){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}},gj=Mk(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),_j=Mk(`text`),vj=Mk(`nl`),yj=Mk(`url`,{isLink:!0,toHref(e=hj.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==aA&&e[1].t===IA}}),bj=e=>new Ck(e),xj=typeof console<`u`&&console&&console.warn||(()=>{}),Sj=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,Cj={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1},zk.scan=Tk}));function Tj(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function Ej(e){return new F_({key:new L_(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(Sw(qC(n.doc,[...t])).forEach(({newRange:t})=>{let n=YC(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!Mj.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(jj).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=zk(n).map(t=>t.toObject(e.defaultProtocol));if(!Tj(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{Cw(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function Dj(e){return new F_({key:new L_(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=yw(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function Oj(e){return new F_({key:new L_(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=Bk(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function kj(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(Nj,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var Aj,jj,Mj,Nj,Pj,Fj=t((()=>{cD(),wj(),wv(),Aj=`[\0- \xA0 -\u2029 ]`,jj=new RegExp(Aj),Mj=RegExp(`${Aj}$`),Nj=new RegExp(Aj,`g`),Pj=RE.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){Lk(e);return}Lk(e.scheme,e.optionalSlashes)})},onDestroy(){Ik()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!kj(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let 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;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!kj(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!kj(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,Y(this.options.HTMLAttributes,e),0]:[`a`,Y(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)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!kj(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!kj(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1: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[uT({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=Bk(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!kj(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(Ej({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!kj(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(Dj({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(Oj({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}})}));function Ij(e){let t=e,n=``;for(let[e,r]of hM)for(;t>=e;)n+=r,t-=e;return n}function Lj(e){return Ij(e).toUpperCase()}function Rj(e){let t=e.toLowerCase(),n=0,r=0;for(;n<t.length;){let e=!1;for(let[i,a]of hM)if(t.startsWith(a,n)){r+=i,n+=a.length,e=!0;break}if(!e)return 0}return r}function zj(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=Rj(e);return t<=0?!1:(e===e.toLowerCase()?Ij(t):Lj(t))===e}function Bj(e){let t=e.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){let e=t.charCodeAt(0)-97,n=t.charCodeAt(1)-97;return(e+1)*26+n+1}return 0}function Vj(e){if(e<=26)return gM[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?gM[n]:gM[t]+gM[n]}function Hj(e){if(!(!e||/^\d+$/.test(e))){if(zj(e))return e===e.toLowerCase()?`i`:`I`;if(/^[a-z]{1,2}$/.test(e))return`a`;if(/^[A-Z]{1,2}$/.test(e))return`A`}}function Uj(e){if(/^\d+$/.test(e))return parseInt(e,10);let t=Hj(e);if(t===`i`||t===`I`)return Rj(e);if(t===`a`||t===`A`){let t=Bj(e);return t>0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function Wj(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return Vj(t);case`A`:return Vj(t).toUpperCase();case`i`:return Ij(t);case`I`:return Lj(t);default:return String(t)}}function Gj(e){if(e.length===0)return!1;let t=Hj(e[0])??`numeric`,n=Uj(e[0]);if(n<1)return!1;for(let r=0;r<e.length;r++){let i=Wj(t,n+r);if(e[r]!==i)return!1}return!0}function Kj(e){return{type:Hj(e),start:Uj(e)}}function qj(e){let{type:t,start:n}=Kj(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function Jj(e,t,n=`. `){let r=t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${Vj(r)}${n}`;case`A`:return`${Vj(r).toUpperCase()}${n}`;case`i`:return`${Ij(r)}${n}`;case`I`:return`${Lj(r)}${n}`;default:return`${r}${n}`}}function Yj(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function Xj(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}function Zj(e){return jM.test(e.trimStart())}function Qj(e){let t=e.trimStart();return/^[-+*]\s+/.test(t)||Zj(t)||/^>\s?/.test(t)||/^```/.test(t)||/^~~~/.test(t)}function $j(e){let t=[],n=[],r=!1;return e.forEach(e=>{if(r){n.push(e);return}if(e.trim()===``){r=!0,n.push(e);return}if(t.length>0&&Qj(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function eM(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(jM);if(!a)break;let[,o,s,c,l]=a,u=o.length,d=parseInt(s,10),f=isNaN(d)?Hj(s):void 0,p=isNaN(d)?Uj(s):d,m=[l],h=n+1,g=[i],_=!1;for(;h<e.length;){let t=e[h];if(t.match(jM))break;if(t.trim()===``)g.push(t),m.push(``),_=!0,h+=1;else if(t.match(NM)){let e=t.length-t.trimStart().length,n=u+s.length+1;g.push(t),m.push(t.slice(Math.min(e,n))),h+=1}else{if(_)break;g.push(t),m.push(t),h+=1}}t.push({indent:u,number:p,type:f,content:m.join(`
`).trim(),contentLines:m,raw:g.join(`
`)}),r=h,n=h}return[t,r]}function tM(e){let t=e.split(`
`).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(PM);if(!t)return null;n.push({marker:t[1],content:t[3]})}return Gj(n.map(e=>e.marker))?{type:`orderedList`,attrs:qj(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function nM(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=$j(a.contentLines),c=o.join(`
`).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(`
`).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let e=nM(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,typeMarker:f[0].type,items:e,raw:f.map(e=>e.raw).join(`
`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function rM(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}function iM(e){let 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 aM,oM,sM,cM,lM,uM,dM,fM,pM,mM,hM,gM,_M,vM,yM,bM,xM,SM,CM,wM,TM,EM,DM,OM,kM,AM,jM,MM,NM,PM,FM,IM,LM,RM,zM,BM,VM,HM=t((()=>{cD(),Tv(),wv(),aM=Object.defineProperty,oM=(e,t)=>{for(var n in t)aM(e,n,{get:t[n],enumerable:!0})},sM=`listItem`,cM=`textStyle`,lM=/^\s*([-+*])\s$/,uM=sD.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,Y(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(sM,this.editor.getAttributes(cM)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=lT({find:lM,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=lT({find:lM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(cM),editor:this.editor})),[e]}}),dM=(e,t,n)=>{let{selection:r}=e;if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let e=i.depth;e>0;--e)if(i.node(e).type.name===t){a=e;break}if(a<0)return null;let o=i.node(a),s=i.index(a);if(s+1>=o.childCount)return null;let c=o.child(s+1);if(!n.includes(c.type.name))return null;let l=e.schema.nodes[t],u=!1;if(c.forEach(e=>{e.type===l&&e.childCount>1&&(u=!0)}),!u)return null;let d=e.doc.resolve(i.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(e=>{f.push(e)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},fM=(e,t,n,r)=>{let i=dM(e,n,r);if(!i)return!1;let{selection:a}=e,{nestedList:o,nestedListPos:s,insertPos:c,items:l}=i,u=e.tr;u.delete(s,s+o.nodeSize);let d=u.mapping.map(c);return u.insert(d,V.from(l)),u.setSelection(a.map(u.doc,u.mapping)),t&&t(u),!0},pM=(e,t,n)=>fM(e.state,e.view.dispatch,t,n),mM=(e,t)=>X.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>pM(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),hM=[[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`]],gM=`abcdefghijklmnopqrstuvwxyz`,_M=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`,vM=sD.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,Y(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(Yj(e))return{type:`listItem`,content:[{type:`paragraph`,content:Xj(e.text||``,t)}]};if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>$w(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){let t=e.meta?.parentAttrs?.start||1;return Jj(e.meta?.parentAttrs?.type,t-1+(e.index||0),`. `)}return`- `},n),addExtensions(){return[mM(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)}}}),yM={},oM(yM,{findListItemPos:()=>bM,getNextListDepth:()=>xM,handleBackspace:()=>CM,handleDelete:()=>EM,hasListBefore:()=>SM,hasListItemAfter:()=>DM,hasListItemBefore:()=>OM,listItemHasSubList:()=>kM,nextListIsDeeper:()=>wM,nextListIsHigher:()=>TM}),bM=(e,t)=>{let{$from:n}=t.selection,r=wC(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},xM=(e,t)=>{let n=bM(e,t);if(!n)return!1;let[,r]=oE(t,e,n.$pos.pos+4);return r},SM=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},CM=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!HC(e.state,t)&&SM(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}return!HC(e.state,t)||!lE(e.state)?!1:e.chain().liftListItem(t).run()},wM=(e,t)=>{let n=xM(e,t),r=bM(e,t);return!r||!n?!1:n>r.depth},TM=(e,t)=>{let n=xM(e,t),r=bM(e,t);return!r||!n?!1:n<r.depth},EM=(e,t)=>{if(!HC(e.state,t)||!cE(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:wM(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():TM(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},DM=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},OM=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},kM=(e,t,n)=>{if(!n)return!1;let r=wC(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},AM=X.create({name:`listKeymap`,addOptions(){return{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})=>{e.state.schema.nodes[n]!==void 0&&EM(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&EM(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&CM(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&CM(e,n,r)&&(t=!0)}),t}}}}),jM=RegExp(`^(\\s*)(${_M})([.)])\\s+(.*)$`),MM=RegExp(`^(\\s*)(${_M})([.)])\\s+`),NM=/^\s/,PM=RegExp(`^(${_M})([.)])\\s+(.+)$`),FM=`listItem`,IM=`textStyle`,LM=/^(\d+)\.\s$/,RM=sD.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>{let t=e.getAttribute(`type`);if(t)return t;let n=e.getAttribute(`style`);if(n){let e=iM(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=iM(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=Y(this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!==`1`&&(i.type=n),[`ol`,i,0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.typeMarker,i=e.items?rM(e.items,t):[],a={};return n!==1&&(a.start=n),r&&(a.type=r),Object.keys(a).length>0?{type:`orderedList`,attrs:a,content:i}:{type:`orderedList`,content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(MM)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
`),[i,a]=eM(r);if(i.length===0)return;let o=nM(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,typeMarker:i[0]?.type,items:o,raw:r.slice(0,a).join(`
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(FM,this.editor.getAttributes(IM)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new F_({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=tM(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=lT({find:LM,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=lT({find:LM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(IM)}),joinPredicate:e,editor:this.editor})),[t]}}),zM=/^\s*(\[([( |x])?\])\s$/,BM=sD.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,Y(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let 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){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>$w(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[mM(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let 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})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=ow(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[lT({find:zM,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),VM=sD.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,Y(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,`
`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=Qw(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),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);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=Qw(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),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(i)return{type:`taskList`,raw:i.raw,items:i.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()}}}),X.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(uM.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(vM.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(AM.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(RM.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(BM.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(VM.configure(this.options.taskList)),e}})})),UM,WM,GM,KM=t((()=>{cD(),UM=`&nbsp;`,WM=`\xA0`,GM=sD.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,Y(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===UM||n[0].text===UM||n[0].raw===WM||n[0].text===WM)&&r.length===1&&r[0].type===`text`&&(r[0].text===UM||r[0].text===WM)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?UM:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})})),qM,JM,YM,XM=t((()=>{cD(),qM=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,JM=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,YM=RE.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,Y(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[oT({find:qM,type:this.type})]},addPasteRules(){return[uT({find:JM,type:this.type})]}})})),ZM,QM=t((()=>{cD(),ZM=sD.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``})})),$M,eN=t((()=>{cD(),$M=RE.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,Y(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}})}));function tN(e={}){return new F_({view(t){return new nN(t,e)}})}var nN,rN=t((()=>{R_(),f_(),nN=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?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){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.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`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;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,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=Og(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}})),iN=t((()=>{rN()}));function aN(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function oN(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||aN(e.type))return!0;if(e.inlineContent)return!1}}return!0}function sN(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||aN(e.type))return!0;if(e.inlineContent)return!1}}return!0}function cN(){return new F_({props:{decorations:fN,createSelectionBetween(e,t,n){return t.pos==n.pos&&pN.valid(n)?new pN(n):null},handleClick:uN,handleKeyDown:hN,handleDOMEvents:{beforeinput:dN}}})}function lN(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof G){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=pN.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new pN(c))),!0):!1}}function uN(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!pN.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&K.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new pN(r))),!0)}function dN(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof pN))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 i=V.empty;for(let e=r.length-1;e>=0;e--)i=V.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new U(i,0,0));return a.setSelection(G.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function fN(e){if(!(e.selection instanceof pN))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,JS.create(e.doc,[GS.widget(e.selection.head,t,{key:`gapcursor`})])}var pN,mN,hN,gN=t((()=>{xC(),R_(),Qh(),aC(),pN=class e extends W{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):W.near(r)}content(){return U.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new mN(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!oN(e)||!sN(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!K.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}},pN.prototype.visible=!1,pN.findFrom=pN.findGapCursorFrom,W.jsonID(`gapcursor`,pN),mN=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 pN.valid(t)?new pN(t):W.near(t)}},hN=vC({ArrowLeft:lN(`horiz`,-1),ArrowRight:lN(`horiz`,1),ArrowUp:lN(`vert`,-1),ArrowDown:lN(`vert`,1)})})),_N=t((()=>{gN()})),vN,yN,bN,xN,SN=t((()=>{vN=200,yN=function(){},yN.prototype.append=function(e){return e.length?(e=yN.from(e),!this.length&&e||e.length<vN&&this.leafAppend(e)||this.length<vN&&e.leafPrepend(this)||this.appendInner(e)):this},yN.prototype.prepend=function(e){return e.length?yN.from(e).append(this):this},yN.prototype.appendInner=function(e){return new xN(this,e)},yN.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?yN.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},yN.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},yN.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},yN.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},yN.from=function(e){return e instanceof yN?e:e&&e.length?new bN(e):yN.empty},bN=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 e==0&&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 i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=vN)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=vN)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}(yN),yN.empty=new bN([]),xN=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 i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&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}(yN)}));function CN(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}function wN(e,t,n,r){let i=n.getMeta(zN),a;if(i)return i.historyState;n.getMeta(BN)&&(e=new FN(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(zN))return o.getMeta(zN).redo?new FN(e.done.addTransform(n,void 0,r,kN(t)),e.undone,EN(n.mapping.maps),e.prevTime,e.prevComposition):new FN(e.done,e.undone.addTransform(n,void 0,r,kN(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!TN(n,e.prevRanges)),s=o?DN(e.prevRanges,n.mapping):EN(n.mapping.maps);return new FN(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,kN(t)),NN.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new FN(e.done.rebased(n,a),e.undone.rebased(n,a),DN(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new FN(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),DN(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function TN(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function EN(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function DN(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function ON(e,t,n){let r=kN(t),i=zN.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new FN(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(zN,{redo:n,historyState:c})}function kN(e){let t=e.plugins;if(RN!=t){LN=!1,RN=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){LN=!0;break}}return LN}function AN(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new F_({key:zN,state:{init(){return new FN(NN.empty,NN.empty,null,0,-1)},apply(t,n,r){return wN(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?VN:n==`historyRedo`?HN:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function jN(e,t){return(n,r)=>{let i=zN.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=ON(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var MN,NN,PN,FN,IN,LN,RN,zN,BN,VN,HN,UN=t((()=>{SN(),f_(),R_(),MN=500,NN=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new PN(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new PN(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new PN(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>IN&&(s=CN(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Zg;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new PN(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new PN(i,o,l))}else r.push(new PN(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new PN(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>MN&&(u=u.compress(this.items.length-r.length)),u}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,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new PN(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(yN.from(i.reverse()),a)}},NN.empty=new NN(yN.empty,0),PN=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)}}},FN=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},IN=20,LN=!1,RN=null,zN=new L_(`history`),BN=new L_(`closeHistory`),VN=jN(!1,!0),HN=jN(!0,!0)})),WN=t((()=>{UN()}));function GN(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),GS.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function KN(e,t){return typeof e==`function`?e(t):e}function qN({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!(e.isEditable||!t.showOnlyWhenEditable))return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&Aw(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(GN({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:KN(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else{let i=aP.getState(e.state),c=i?.topPos??0,l=i?.bottomPos??r.content.size;r.nodesBetween(c,l,(r,i)=>{let c=a>=i&&a<=i+r.nodeSize,l=!r.isLeaf&&Aw(r);return r.type.isTextblock&&(c||!t.showOnlyCurrent)&&l&&o.push(GN({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:c,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:KN(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:c})},node:r,pos:i})),t.includeChildren})}return JS.create(r,o)}function JN(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function YN(e){let t=getComputedStyle(e),n=`${t.overflow} ${t.overflowY} ${t.overflowX}`;return/auto|scroll|overlay/.test(n)}function XN(e){let t=e;for(;t;){if(YN(t))return t;let e=t.parentElement;if(!e){let e=t.getRootNode();if(e instanceof ShadowRoot){t=e.host;continue}return window}t=e}return window}function ZN(e){return e===window?{top:0,bottom:window.innerHeight}:e.getBoundingClientRect()}function QN({view:e,scrollContainer:t}){let n=e.dom.getBoundingClientRect();if(n.width<=0||n.height<=0)return null;let r=t?ZN(t):{top:0,bottom:window.innerHeight},i=Math.max(n.top,r.top)-oP,a=Math.min(n.bottom,r.bottom)+oP;if(i>=a)return null;let o=n.left+1,s=n.right-1;if(o>s)return null;let c=getComputedStyle(e.dom).direction===`rtl`?n.right-2:n.left+2,l=Math.min(Math.max(c,o),s),u=Math.max(i+2,n.top+1),d=Math.min(a-2,n.bottom-1);if(u>d)return null;let f=e.posAtCoords({left:l,top:u}),p=e.posAtCoords({left:l,top:d});return!f||!p?null:{top:f.pos,bottom:p.pos}}function $N(e){let t=XN(e.dom),n=()=>{let n=QN({view:e,scrollContainer:t});if(n===null)return;let r=aP.getState(e.state);if(r?.topPos===n.top&&r?.bottomPos===n.bottom)return;let i=e.state.tr.setMeta(aP,{positions:n});e.dispatch(i)},r=null,i=0,a=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null;let e=performance.now();e-i>=150?(i=e,n()):a()}))};t.addEventListener(`scroll`,a,{passive:!0});let o=typeof ResizeObserver<`u`?new ResizeObserver(a):null;o?.observe(e.dom);let s=typeof IntersectionObserver<`u`?new IntersectionObserver(a):null;return s?.observe(e.dom),e.dom.addEventListener(`focus`,a),n(),{update(t,n){e.state.doc.content.size!==n.doc.content.size&&a()},destroy:()=>{r!==null&&cancelAnimationFrame(r),t.removeEventListener(`scroll`,a),o?.disconnect(),s?.disconnect(),e.dom.removeEventListener(`focus`,a)}}}function eP({editor:e,options:t}){let n=t.dataAttribute?`data-${JN(t.dataAttribute)}`:`data-${iP}`;return new F_({key:aP,state:sP,view:$N,props:{decorations:({doc:r,selection:i})=>qN({editor:e,options:t,dataAttribute:n,doc:r,selection:i})}})}function tP({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var nP,rP,iP,aP,oP,sP,cP,lP,uP,dP=t((()=>{cD(),wv(),iN(),oC(),_N(),WN(),X.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new F_({key:new L_(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}}),nP=X.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[tN(this.options)]}}),X.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new F_({key:new L_(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return JS.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(GS.node(t,t+e.nodeSize,{class:this.options.className}))}),JS.create(e,a)}}})]}}),rP=X.create({name:`gapCursor`,addProseMirrorPlugins(){return[cN()]},extendNodeSchema(e){return{allowGapCursor:J(q(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),iP=`placeholder`,aP=new L_(`tiptap__placeholder`),oP=200,sP={init(){return{topPos:null,bottomPos:null}},apply(e,t){let n=e.getMeta(aP);return n?.positions?{topPos:n.positions.top,bottomPos:n.positions.bottom}:e.docChanged?{topPos:t.topPos===null?null:e.mapping.map(t.topPos),bottomPos:t.bottomPos===null?null:e.mapping.map(t.bottomPos)}:t}},X.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:iP,placeholder:`Write something `,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[eP({editor:this.editor,options:this.options})]}}),cP=`.ProseMirror:not(.ProseMirror-focused) *::selection {
background: transparent;
}
.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {
background: transparent;
}`,X.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return e.options.injectCSS&&typeof document<`u`&&Bw(cP,e.options.injectNonce,`selection`),[new F_({key:new L_(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||jw(n.selection)||e.view.dragging?null:JS.create(n.doc,[GS.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}}),lP=X.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new L_(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new F_({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!tP({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!tP({node:r,types:n})}}})]}}),uP=X.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>VN(e,t),redo:()=>({state:e,dispatch:t})=>HN(e,t)}},addProseMirrorPlugins(){return[AN(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()}}})})),fP,pP=t((()=>{cD(),WO(),XO(),ek(),ak(),sk(),lk(),dk(),pk(),yk(),Fj(),HM(),KM(),XM(),QM(),eN(),dP(),fP=X.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(YO.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(UO.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(uM.configure(this.options.bulletList)),this.options.code!==!1&&e.push($O.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(ik.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(ok.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(nP.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(rP.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(ck.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(uk.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(uP.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(fk.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(vk.configure(this.options.italic)),this.options.listItem!==!1&&e.push(vM.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(AM.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(Pj.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(RM.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(GM.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(YM.configure(this.options.strike)),this.options.text!==!1&&e.push(ZM.configure(this.options.text)),this.options.underline!==!1&&e.push($M.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(lP.configure(this.options?.trailingNode)),e}})})),mP,hP,gP,_P,vP,yP,bP,xP,SP,CP=t((()=>{cD(),mP=20,hP=(e,t=0)=>{let n=[];return!e.children.length||t>mP||Array.from(e.children).forEach(e=>{e.tagName===`SPAN`?n.push(e):e.children.length&&n.push(...hP(e,t+1))}),n},gP=e=>{if(!e.children.length)return;let t=hP(e);t&&t.forEach(e=>{let t=e.getAttribute(`style`),n=(e.parentElement?.closest(`span`))?.getAttribute(`style`);e.setAttribute(`style`,`${n};${t}`)})},_P=RE.create({name:`textStyle`,priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:`span`,consuming:!1,getAttrs:e=>e.hasAttribute(`style`)?(this.options.mergeNestedSpanStyles&&gP(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return[`span`,Y(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{let{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(e=>e.type===this.type).some(e=>Object.values(e.attrs).some(e=>!!e))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),vP=X.create({name:`backgroundColor`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>(Vw(e,`background-color`)??e.style.backgroundColor)?.replace(/['"]+/g,``),renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:e=>({chain:t})=>t().setMark(`textStyle`,{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark(`textStyle`,{backgroundColor:null}).removeEmptyTextStyle().run()}}}),yP=X.create({name:`color`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>(Vw(e,`color`)??e.style.color)?.replace(/['"]+/g,``),renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark(`textStyle`,{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark(`textStyle`,{color:null}).removeEmptyTextStyle().run()}}}),bP=X.create({name:`fontFamily`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>Vw(e,`font-family`)??e.style.fontFamily,renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:e=>({chain:t})=>t().setMark(`textStyle`,{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark(`textStyle`,{fontFamily:null}).removeEmptyTextStyle().run()}}}),xP=X.create({name:`fontSize`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>Vw(e,`font-size`)??e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark(`textStyle`,{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark(`textStyle`,{fontSize:null}).removeEmptyTextStyle().run()}}}),SP=X.create({name:`lineHeight`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>Vw(e,`line-height`)??e.style.lineHeight,renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:e=>({chain:t})=>t().setMark(`textStyle`,{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark(`textStyle`,{lineHeight:null}).removeEmptyTextStyle().run()}}}),X.create({name:`textStyleKit`,addExtensions(){let e=[];return this.options.backgroundColor!==!1&&e.push(vP.configure(this.options.backgroundColor)),this.options.color!==!1&&e.push(yP.configure(this.options.color)),this.options.fontFamily!==!1&&e.push(bP.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(xP.configure(this.options.fontSize)),this.options.lineHeight!==!1&&e.push(SP.configure(this.options.lineHeight)),this.options.textStyle!==!1&&e.push(_P.configure(this.options.textStyle)),e}})})),wP=t((()=>{CP()})),TP,EP,DP,OP=t((()=>{cD(),TP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,EP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,DP=RE.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||Vw(e,`background-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,Y(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[oT({find:TP,type:this.type})]},addPasteRules(){return[uT({find:EP,type:this.type})]}})})),kP,AP,jP=t((()=>{cD(),kP=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,AP=sD.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,Y(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);c.draggable=!1;let l=Y(this.options.HTMLAttributes,o);Object.entries(l).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t);break}}),l.src!==null&&(c.src=l.src);let u=new oD({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),d=u.dom;return d.style.visibility=`hidden`,d.style.pointerEvents=`none`,c.onload=()=>{d.style.visibility=``,d.style.pointerEvents=``},u}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[sT({find:kP,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}})}));function MP(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=NP(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new sI(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&PP(s,o,e),s}function NP(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function PP(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=FP(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function FP(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function IP(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}function LP(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function RP(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function zP(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function BP(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=LP(t.$head)||VP(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function VP(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function HP(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function UP(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function WP(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function GP(e,t,n){let r=e.node(-1),i=sI.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function KP(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function qP(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function JP(e,t,n){let r=IP(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}function YP(e){if(!(e.selection instanceof $))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(GS.node(n,n+e.nodeSize,{class:`selectedCell`}))}),JS.create(e.doc,t)}function XP({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function ZP({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function QP(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof K&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=$.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=$.rowSelection(e,e)}else if(!n){let e=sI.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=$.create(i,t+1,n)}}else r instanceof G&&XP(r)?a=G.create(i,r.from):r instanceof G&&ZP(r)&&(a=G.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}function $P(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?$P(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function eF(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=tF(e,t,r,n))};return t?t.doc!=e.doc&&$P(t.doc,e.doc,0,r):e.doc.descendants(r),n}function tF(e,t,n,r){let i=sI.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,KP(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=IP(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(uI,{fixTables:!0})}function nF(e){let t=e.selection,n=BP(e),r=n.node(-1),i=n.start(-1),a=sI.get(r);return{...t instanceof $?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function rF(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;JP(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,qP(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?IP(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function iF(e,t){if(!zP(e))return!1;if(t){let n=nF(e);t(rF(e.tr,n,n.left))}return!0}function aF(e,t){if(!zP(e))return!1;if(t){let n=nF(e);t(rF(e.tr,n,n.right))}return!0}function oF(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,KP(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function sF(e,t){if(!zP(e))return!1;if(t){let n=nF(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;oF(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=sI.get(e)}t(r)}return!0}function cF(e,t,n){let r=IP(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function lF(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;cF(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?IP(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,IP(r.type.schema).row.create(null,o)),e}function uF(e,t){if(!zP(e))return!1;if(t){let n=nF(e);t(lF(e.tr,n,n.top))}return!0}function dF(e,t){if(!zP(e))return!1;if(t){let n=nF(e);t(lF(e.tr,n,n.bottom))}return!0}function fF(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function pF(e,t){if(!zP(e))return!1;if(t){let n=nF(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;fF(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=sI.get(n.table)}t(r)}return!0}function mF(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function hF({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function gF(e,t){let n=e.selection;if(!(n instanceof $)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=nF(e),{map:i}=r;if(hF(i,r))return!1;if(t){let n=e.tr,a={},o=V.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{mF(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...qP(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=mF(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new $(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function _F(e,t){let n=IP(e.schema);return vF(({node:e})=>n[e.type.spec.tableRole])(e,t)}function vF(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof $){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=RP(r.$from),!i)return!1;a=LP(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=nF(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof $&&u.setSelection(new $(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function yF(e,t){return function(n,r){if(!zP(n))return!1;let i=BP(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof $?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function bF(e){return function(t,n){if(!zP(t))return!1;if(n){let r=IP(t.schema),i=nF(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function xF(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function SF(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?bF(e):function(t,n){if(!zP(t))return!1;if(n){let r=IP(t.schema),i=nF(t),a=t.tr,o=xF(`row`,i,r),s=xF(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}function CF(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function wF(e){return function(t,n){if(!zP(t))return!1;let r=CF(BP(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(G.between(e,UP(e))).scrollIntoView())}return!0}}function TF(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function EF(e,t){let n=e.selection;if(!(n instanceof $))return!1;if(t){let r=e.tr,i=IP(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new U(i,0,0))}),r.docChanged&&t(r)}return!0}function DF(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=kF(IP(o).row,new U(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?kF(IP(o).row,new U(t,n,r)).content:t);else return null;return OF(o,s)}function OF(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(V.empty),n[i]<r){let a=IP(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(V.from(o))}return{height:t.length,width:r,rows:t}}function kF(e,t){let n=e.createAndFill();return new d_(n).replace(0,n.content.size,t).doc}function AF({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(KP(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(V.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(V.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function jF(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=IP(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,V.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function MF(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function NF(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,KP(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(KP(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function PF(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=sI.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=sI.get(a),f=d.mapping.maps.length}jF(d,o,a,n,l,u,f)&&p(),MF(d,o,a,n,c,l,s,f)&&p(),MF(d,o,a,n,c,l,u,f)&&p(),NF(d,o,a,n,s,u,c,f)&&p(),NF(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new U(i.rows[e-s],0,0))}p(),d.setSelection(new $(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}function FF(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function IF(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof $)return FF(n,r,W.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=VF(i,e,t);if(o==null)return!1;if(e==`horiz`)return FF(n,r,W.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=GP(i,e,t),s;return s=a?W.near(a,1):t<0?W.near(n.doc.resolve(i.before(-1)),-1):W.near(n.doc.resolve(i.after(-1)),1),FF(n,r,s)}}}function LF(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof $)o=a;else{let r=VF(i,e,t);if(r==null)return!1;o=new $(n.doc.resolve(r))}let s=GP(o.$headCell,e,t);return s?FF(n,r,new $(o.$anchorCell,s)):!1}}function RF(e,t){let n=e.state.doc,r=LP(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new $(r))),!0):!1}function zF(e,t,n){if(!zP(e.state))return!1;let r=DF(n),i=e.state.selection;if(i instanceof $){r||={width:1,height:1,rows:[V.from(kF(IP(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=sI.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=AF(r,o.right-o.left,o.bottom-o.top),PF(e.state,e.dispatch,a,o,r),!0}else if(r){let t=BP(e.state),n=t.start(-1);return PF(e.state,e.dispatch,n,sI.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function BF(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=HF(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof $)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=LP(e.state.selection.$anchor))!=null&&UF(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=UF(e,n),i=cI.getState(e.state)==null;if(!r||!WP(t,r))if(i)r=t;else return;let a=new $(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(cI,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),cI.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(cI,-1))}function o(r){let o=r,s=cI.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(HF(e,o.target)!=n&&(c=UF(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function VF(e,t,n){if(!(e.state.selection instanceof G))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function HF(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function UF(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&LP(e.state.doc.resolve(r))||LP(e.state.doc.resolve(i))}function WF(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}function GF({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=pI,lastColumnResizable:i=!0}={}){let a=new F_({key:mI,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=IP(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new hI(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=mI.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{KF(t,n,e,i)},mouseleave:e=>{qF(e)},mousedown:(e,r)=>{JF(e,r,t,n)}},decorations:e=>{let t=mI.getState(e);if(t&&t.activeHandle>-1)return rI(e,t.activeHandle)},nodeViews:{}}});return a}function KF(e,t,n,r){if(!e.editable)return;let i=mI.getState(e.state);if(i&&!i.dragging){let a=XF(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=ZF(e,t,`left`,n):i-t.clientX<=n&&(o=ZF(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=sI.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}$F(e,o)}}}function qF(e){if(!e.editable)return;let t=mI.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$F(e,-1)}function JF(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=mI.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=YF(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(mI,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=mI.getState(e.state);r?.dragging&&(eI(e,r.activeHandle,QF(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(mI,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=mI.getState(e.state);if(i&&i.dragging){let a=QF(i.dragging,t,n);tI(e,i.activeHandle,a,r)}}return tI(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function YF(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function XF(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function ZF(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=LP(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=sI.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function QF(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function $F(e,t){e.dispatch(e.state.tr.setMeta(mI,{setHandle:t}))}function eI(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=sI.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():nI(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function tI(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=sI.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&WF(a,c.firstChild,c,r,s,n)}function nI(e){return Array(e).fill(0)}function rI(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return JS.empty;let a=sI.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,mI.getState(e)?.dragging&&n.push(GS.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(GS.widget(s,c))}}return JS.create(e.doc,n)}function iI({allowTableNodeSelection:e=!1}={}){return new F_({key:cI,state:{init(){return null},apply(e,t){let n=e.getMeta(cI);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:YP,handleDOMEvents:{mousedown:BF},createSelectionBetween(e){return cI.getState(e.state)==null?null:e.state.selection},handleTripleClick:RF,handleKeyDown:fI,handlePaste:zF},appendTransaction(t,n,r){return QP(r,eF(r,n),e)}})}var aI,oI,sI,cI,$,lI,uI,dI,fI,pI,mI,hI,gI=t((()=>{if(R_(),Qh(),aC(),xC(),f_(),typeof WeakMap<`u`){let e=new WeakMap;aI=t=>e.get(t),oI=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;aI=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},oI=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}sI=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return aI(e)||oI(e,MP(e))}},cI=new L_(`selectingCells`),$=class e extends W{constructor(e,t=e){let n=e.node(-1),r=sI.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new x_(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(HP(r)&&HP(i)&&WP(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return G.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=sI.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=KP(e,0,l)),u>0&&(e=KP(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(V.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new U(V.from(o),1,1)}replace(e,t=U.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?U.empty:t)}let i=W.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new U(V.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=sI.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=sI.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=sI.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=sI.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new lI(this.$anchorCell.pos,this.$headCell.pos)}},$.prototype.visible=!1,W.jsonID(`cell`,$),lI=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){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&WP(t,n)?new $(t,n):W.near(n,1)}},uI=new L_(`fix-tables`),SF(`row`,{useDeprecatedLogic:!0}),SF(`column`,{useDeprecatedLogic:!0}),dI=SF(`cell`,{useDeprecatedLogic:!0}),fI=vC({ArrowLeft:IF(`horiz`,-1),ArrowRight:IF(`horiz`,1),ArrowUp:IF(`vert`,-1),ArrowDown:IF(`vert`,1),"Shift-ArrowLeft":LF(`horiz`,-1),"Shift-ArrowRight":LF(`horiz`,1),"Shift-ArrowUp":LF(`vert`,-1),"Shift-ArrowDown":LF(`vert`,1),Backspace:EF,"Mod-Backspace":EF,Delete:EF,"Mod-Delete":EF}),pI=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),WF(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,WF(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}},mI=new L_(`tableColumnResizing`),hI=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(mI);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return HP(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}}})),_I=t((()=>{gI()}));function vI(e){return e===`left`||e===`right`||e===`center`?e:null}function yI(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return vI(t||n)}function bI(e){return vI(e?.align)}function xI(){return{default:null,parseHTML:e=>yI(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}function SI(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function CI(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=SI(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=SI(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}function wI(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=SI(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function TI(e,t){return t?e.createChecked(null,t):e.createAndFill()}function EI(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function DI(e,t,n,r,i){let a=EI(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=TI(a.cell,i);if(e&&s.push(e),r){let e=TI(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function OI(e){return e instanceof $}function kI(e){return(e||``).replace(/\s+/g,` `).trim()}function AI(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=kI(i),o=e.type===`tableHeader`,s=bI(e.attrs);n.push({text:a,isHeader:o,align:s})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array.from({length:a}).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=Array.from({length:a}).fill(null);i.forEach(e=>{for(let t=0;t<a;t+=1)!u[t]&&e[t]?.align&&(u[t]=e[t].align)});let d=`
`,f=Array.from({length:a}).map((e,t)=>l&&c[t]&&c[t].text||``);return d+=`| ${f.map((e,t)=>s(e,o[t])).join(` | `)} |
`,d+=`| ${o.map((e,t)=>{let n=Math.max(3,e),r=u[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |
`,(l?i.slice(1):i).forEach(e=>{d+=`| ${Array.from({length:a}).fill(0).map((t,n)=>s(e[n]&&e[n].text||``,o[n])).join(` | `)} |
`}),d}var jI,MI,NI,PI,FI,II,LI,RI=t((()=>{cD(),wv(),_I(),jI=sD.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}},align:xI()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,Y(this.options.HTMLAttributes,e),0]}}),MI=sD.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}},align:xI()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,Y(this.options.HTMLAttributes,e),0]}}),NI=sD.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,Y(this.options.HTMLAttributes,e),0]}}),PI=class{constructor(e,t,n,r={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`));for(let[e,t]of Object.entries(r))t!=null&&(e===`style`?this.table.style.cssText=String(t):this.table.setAttribute(e,String(t)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),CI(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type?(this.node=e,CI(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}},FI=({editor:e})=>{let{selection:t}=e.state;if(!OI(t))return!1;let n=0;return XC(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1},II=AI,LI=sD.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:PI,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=wI(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,Y(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=vI(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=vI(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>II(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=DI(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(G.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>iF(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>aF(e,t),deleteColumn:()=>({state:e,dispatch:t})=>sF(e,t),addRowBefore:()=>({state:e,dispatch:t})=>uF(e,t),addRowAfter:()=>({state:e,dispatch:t})=>dF(e,t),deleteRow:()=>({state:e,dispatch:t})=>pF(e,t),deleteTable:()=>({state:e,dispatch:t})=>TF(e,t),mergeCells:()=>({state:e,dispatch:t})=>gF(e,t),splitCell:()=>({state:e,dispatch:t})=>_F(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>SF(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>SF(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>dI(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>gF(e,t)?!0:_F(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>yF(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>wF(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>wF(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&eF(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=$.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:FI,"Mod-Backspace":FI,Delete:FI,"Mod-Delete":FI}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[GF({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],iI({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){let e=this.options.resizable&&this.editor.isEditable,t=this.options.View;return e||!t?null:({node:e,view:n,HTMLAttributes:r})=>{let i=Y(this.options.HTMLAttributes,r);return new t(e,this.options.cellMinWidth,n,i)}},extendNodeSchema(e){return{tableRole:J(q(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}}),X.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(LI.configure(this.options.table)),this.options.tableCell!==!1&&e.push(jI.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(MI.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(NI.configure(this.options.tableRow)),e}})})),zI=t((()=>{RI()})),BI=t((()=>{RI()})),VI=t((()=>{RI()})),HI=t((()=>{HM()})),UI=t((()=>{HM()})),WI,GI,KI,qI,JI,YI,XI,ZI,QI=t((()=>{ts(),cD(),pP(),CP(),wP(),OP(),jP(),RI(),zI(),BI(),VI(),HI(),UI(),WI={class:`editor-wrap`},GI={class:`editor-pane`},KI={class:`editor-inner`},qI={class:`tb-bar`},JI={class:`editor-pane`},YI=[`innerHTML`],XI=[`src`],ZI={__name:`NoteEditor`,props:{viewMode:String},emits:[`update`],setup(e,{expose:t,emit:n}){let r=n,i=null,a=N(``),o=N(``);Pi(()=>{i=new iD({element:document.querySelector(`#tiptap-editor`),extensions:[fP,_P,yP,DP.configure({multicolor:!0}),AP.configure({inline:!0}),LI,NI,jI,MI,VM,BM.configure({nested:!0})],onUpdate:()=>{a.value=i.getHTML(),r(`update`,i.getHTML())},editorProps:{handlePaste:(e,t)=>{let n=t.clipboardData?.items;if(!n)return!1;for(let e of n)if(e.type.startsWith(`image/`))return t.preventDefault(),p(e.getAsFile()),!0;return!1},handleDrop:(e,t)=>{let n=t.dataTransfer?.files;if(!n?.length)return!1;for(let e of n)if(e.type.startsWith(`image/`))return t.preventDefault(),p(e),!0;return!1}}}),i.view.dom.addEventListener(`click`,e=>{e.target.tagName===`IMG`&&(o.value=e.target.src)})}),Ri(()=>{i?.destroy()});function s(e,...t){i?.chain().focus()[e](...t).run()}function c(e){i&&i.commands.setContent(e||``)}function l(){return i?.getHTML()||``}let u=window.location.hostname===`localhost`,d=u?`http://localhost:4006`:`https://gw.server.zgitm.com`,f=u?`http://localhost:4006`:`https://mokeetext.server.zgitm.com`;async function p(e){let t=new FormData;t.append(`file`,e);try{let e={};if(u)e[`X-Dev-Mock-User`]=`admin`;else{let t=document.cookie.match(/(?:^|;\s*)token=([^;]*)/)?.[1];t&&(e.Authorization=`Bearer ${t}`),e[`X-System-Code`]=`mokeetext-edit`}let n=await fetch(d+`/api/upload/image`,{method:`POST`,body:t,headers:e});if(!n.ok){m((await n.text()).substring(0,100));return}let r=await n.json();if(r.url){let e=r.url.startsWith(`http`)?r.url:f+r.url;i?.chain().focus().setImage({src:e}).run()}else m(r.error||`上传失败`)}catch(e){m(`上传失败: `+e.message)}}function m(e){let t=document.createElement(`div`);t.className=`toast`,t.textContent=e,document.body.appendChild(t),setTimeout(()=>t.remove(),3e3)}function h(){let e=document.createElement(`input`);e.type=`file`,e.accept=`image/*`,e.onchange=()=>{let t=e.files[0];t&&p(t)},e.click()}function g(){i?.chain().focus().insertContent(`😊`).run()}return t({setContent:c,getHTML:l}),(t,n)=>(P(),F(ga,null,[I(`div`,WI,[On(I(`div`,GI,[I(`div`,KI,[I(`div`,qI,[I(`button`,{class:`tb-btn`,onClick:n[0]||=e=>s(`toggleHeading`,{level:1})},`H1`),I(`button`,{class:`tb-btn`,onClick:n[1]||=e=>s(`toggleHeading`,{level:2})},`H2`),I(`button`,{class:`tb-btn`,onClick:n[2]||=e=>s(`toggleHeading`,{level:3})},`H3`),n[17]||=I(`span`,{class:`tb-divider`},null,-1),I(`button`,{class:`tb-btn`,onClick:n[3]||=e=>s(`toggleBold`),style:{"font-weight":`bold`}},`B`),I(`button`,{class:`tb-btn`,onClick:n[4]||=e=>s(`toggleItalic`),style:{"font-style":`italic`}},`I`),I(`button`,{class:`tb-btn`,onClick:n[5]||=e=>s(`toggleStrike`),style:{"text-decoration":`line-through`}},`S`),n[18]||=I(`span`,{class:`tb-divider`},null,-1),I(`input`,{type:`color`,class:`tb-color`,title:`文字颜色`,onInput:n[6]||=e=>s(`setColor`,e.target.value)},null,32),I(`input`,{type:`color`,class:`tb-color`,title:`背景高亮`,value:`#FFF3CD`,onInput:n[7]||=e=>s(`toggleHighlight`,{color:e.target.value})},null,32),n[19]||=I(`span`,{class:`tb-divider`},null,-1),I(`button`,{class:`tb-btn`,onClick:h},`🖼 图片`),I(`button`,{class:`tb-btn`,onClick:g},`😊 表情`),n[20]||=I(`span`,{class:`tb-divider`},null,-1),I(`button`,{class:`tb-btn`,onClick:n[8]||=e=>s(`toggleBulletList`)},`• 列表`),I(`button`,{class:`tb-btn`,onClick:n[9]||=e=>s(`toggleOrderedList`)},`1. 列表`),I(`button`,{class:`tb-btn`,onClick:n[10]||=e=>s(`toggleTaskList`)},`✅ 任务`),I(`button`,{class:`tb-btn`,onClick:n[11]||=e=>s(`toggleBlockquote`)},`❝ 引用`),I(`button`,{class:`tb-btn`,onClick:n[12]||=e=>s(`toggleCodeBlock`)},`</> 代码`),n[21]||=I(`span`,{class:`tb-divider`},null,-1),I(`button`,{class:`tb-btn`,onClick:n[13]||=e=>s(`insertTable`,{rows:3,cols:3,withHeaderRow:!0})},`📋 表格`)]),n[22]||=I(`div`,{id:`tiptap-editor`},null,-1)])],512),[[To,e.viewMode!==`preview`]]),On(I(`div`,JI,[I(`div`,{class:`editor-inner`,innerHTML:a.value},null,8,YI)],512),[[To,e.viewMode!==`edit`]])]),o.value?(P(),F(`div`,{key:0,class:`lightbox`,onClick:n[16]||=e=>o.value=null},[I(`button`,{class:`lightbox-close`,onClick:n[14]||=e=>o.value=null},`✕`),I(`img`,{src:o.value,onClick:n[15]||=Jo(()=>{},[`stop`])},null,8,XI)])):Zr(``,!0)],64))}}})),$I,eL,tL,nL,rL,iL=t((()=>{ts(),$I={class:`modal-header`},eL={class:`modal-title`},tL={class:`modal-body`},nL={key:0,class:`modal-footer`},rL={__name:`Modal`,props:{show:Boolean,title:String,width:Number},emits:[`close`],setup(e){return(t,n)=>e.show?(P(),F(`div`,{key:0,class:`modal-overlay`,onClick:n[1]||=Jo(e=>t.$emit(`close`),[`self`])},[I(`div`,{class:`modal`,style:a(e.width?{width:e.width+`px`}:{})},[I(`div`,$I,[I(`span`,eL,j(e.title),1),I(`button`,{class:`modal-close`,onClick:n[0]||=e=>t.$emit(`close`)},`×`)]),I(`div`,tL,[Qn(t.$slots,`default`)]),t.$slots.footer?(P(),F(`div`,nL,[Qn(t.$slots,`footer`)])):Zr(``,!0)],4)])):Zr(``,!0)}}})),aL,oL,sL=t((()=>{ts(),iL(),aL={style:{color:`var(--text-secondary)`,"font-size":`14px`,"line-height":`1.6`}},oL={__name:`ConfirmModal`,props:{show:Boolean,title:String,message:String,confirmText:String,cancelText:String},emits:[`confirm`,`cancel`],setup(e){return(t,n)=>(P(),Wr(rL,{show:e.show,title:e.title,width:420,onClose:n[2]||=e=>t.$emit(`cancel`)},{footer:Dn(()=>[e.cancelText?(P(),F(`button`,{key:0,class:`btn btn-ghost`,onClick:n[0]||=e=>t.$emit(`cancel`)},j(e.cancelText),1)):Zr(``,!0),I(`button`,{class:`btn btn-primary`,onClick:n[1]||=e=>t.$emit(`confirm`)},j(e.confirmText||`确定`),1)]),default:Dn(()=>[I(`p`,aL,j(e.message),1)]),_:1},8,[`show`,`title`]))}}})),cL,lL,uL,dL,fL=t((()=>{ts(),iL(),cL={class:`form-group`},lL={class:`form-label`},uL=[`placeholder`],dL={__name:`PromptModal`,props:{show:Boolean,title:String,label:String,placeholder:String,initial:String},emits:[`confirm`,`cancel`],setup(e){let t=e,n=N(t.initial||``);return Mn(()=>t.show,e=>{e&&(n.value=t.initial||``)}),(t,r)=>(P(),Wr(rL,{show:e.show,title:e.title,width:400,onClose:r[4]||=e=>t.$emit(`cancel`)},{footer:Dn(()=>[I(`button`,{class:`btn btn-ghost`,onClick:r[2]||=e=>t.$emit(`cancel`)},`取消`),I(`button`,{class:`btn btn-primary`,onClick:r[3]||=e=>t.$emit(`confirm`,n.value)},`确定`)]),default:Dn(()=>[I(`div`,cL,[I(`label`,lL,j(e.label),1),On(I(`input`,{class:`input`,"onUpdate:modelValue":r[0]||=e=>n.value=e,placeholder:e.placeholder,onKeyup:r[1]||=Xo(e=>t.$emit(`confirm`,n.value),[`enter`])},null,40,uL),[[Vo,n.value]])])]),_:1},8,[`show`,`title`]))}}})),pL=t((()=>{})),mL,hL,gL,_L,vL,yL,bL,xL,SL,CL,wL,TL,EL,DL,OL,kL,AL,jL,ML,NL,PL,FL,IL,LL,RL,zL,BL,VL,HL,UL,WL,GL,KL,qL,JL,YL,XL,ZL,QL,$L=t((()=>{ts(),Dm(),QI(),iL(),sL(),fL(),pL(),dl(),mL={class:`layout`},hL={class:`sidebar-label`},gL=[`title`],_L={style:{flex:`1`,"overflow-y":`auto`}},vL={class:`count`},yL=[`onClick`],bL={style:{flex:`1`}},xL={class:`count`},SL=[`onClick`],CL={class:`folder-menu`},wL=[`onClick`],TL=[`onClick`],EL={key:0,class:`content`},DL={class:`content-header`},OL={style:{"font-size":`15px`,"font-weight":`600`}},kL={style:{display:`flex`,"align-items":`center`,gap:`8px`}},AL={style:{flex:`1`,"overflow-y":`auto`,padding:`0 20px 20px`}},jL={key:0,style:{"text-align":`center`,padding:`80px 20px`,color:`var(--text-placeholder)`}},ML={key:1,class:`doc-table`},NL=[`onClick`],PL={class:`doc-title-cell`,"data-label":`标题`},FL={"data-label":`创建人`,style:{"font-size":`12px`,color:`var(--text-secondary)`}},IL={"data-label":`创建时间`,style:{"font-size":`12px`,color:`var(--text-tertiary)`,"font-family":`monospace`}},LL={"data-label":`修改时间`,style:{"font-size":`12px`,color:`var(--text-tertiary)`,"font-family":`monospace`}},RL=[`onClick`],zL={key:1,class:`content`},BL={class:`content-header`,style:{"flex-wrap":`wrap`,gap:`8px`}},VL={style:{"font-size":`11px`,color:`var(--text-tertiary)`,"white-space":`nowrap`,display:`flex`,"align-items":`center`,gap:`4px`}},HL={class:`toggle-group`},UL={class:`save-badge`},WL={class:`form-group`},GL=[`value`],KL={style:{display:`flex`,"flex-direction":`column`,gap:`6px`,"margin-bottom":`16px`}},qL={key:0,style:{background:`#F0FAF0`,border:`1px solid #A3E4A7`,"border-radius":`8px`,padding:`12px 14px`}},JL={style:{display:`flex`,gap:`6px`}},YL=[`value`],XL={style:{"font-size":`10px`,color:`var(--text-tertiary)`,"margin-top":`4px`}},ZL={__name:`NotesView`,setup(e){let t=Cm(),n=N(null),r=N([]),i=N([]),a=it({}),o=N(null),c=N(!1),l=N(``),u=N(null),d=N(null),f=N(`edit`),p=N(`已保存`),m=N(``),h=N(`forever`),g=N(``),_=N(!1),v=N(!1),y=N(null),b=null,x=null,S=it({show:!1,title:``,message:``}),C=null;function w(e,t){return new Promise(n=>{S.title=e,S.message=t,S.show=!0,C=n})}function ee(){S.show=!1,C&&C(!0)}function T(){S.show=!1,C&&C(!1)}let E=it({show:!1,title:``,label:``,initial:``}),D=null,O=N(``);function te(e,t,n){return new Promise(r=>{E.title=e,E.label=t,E.initial=n||``,E.show=!0,O.value=n||``,D=r})}function k(e){E.show=!1,D&&D(e)}function ne(){E.show=!1,D&&D(null)}let re=La(()=>{let e=i.value;if(o.value&&(e=e.filter(e=>(e.folder_id||x)===o.value)),l.value){let t=l.value.toLowerCase();e=e.filter(e=>(e.title||``).toLowerCase().includes(t))}return e});Pi(async()=>{let[e,n]=await Promise.all([t.listFolders(`note`),t.listNotes()]);r.value=e,i.value=n,x=e.find(e=>e.name===`未分类`)?.id||null,ie(n)});function ie(e){e||=i.value,Object.keys(a).forEach(e=>delete a[e]),e.forEach(e=>{let t=e.folder_id||x||0;a[t]=(a[t]||0)+1})}function ae(e){if(!e)return`未分类`;let t=r.value.find(t=>t.id===e);return t?t.name:`未分类`}function oe(e){return e?e.replace(`T`,` `).substring(0,19):`-`}async function se(e){let r=await t.getNote(e.id);d.value=r,await vn(),await vn(),n.value?.setContent(r.content||``)}function ce(){fe(),d.value=null,ue()}async function le(){se(await t.createNote({title:`无标题笔记`,content:``,folder_id:o.value||x})),await ue()}async function ue(){i.value=await t.listNotes(),ie()}function A(e){d.value&&(d.value.content=e),de()}function de(){p.value=`保存中…`,clearTimeout(b),b=setTimeout(fe,800)}async function fe(){d.value?.id&&(await t.updateNote(d.value.id,{title:d.value.title,content:d.value.content}),p.value=`已保存`)}async function pe(){let e=d.value?.title||`无标题`;!d.value?.id||!await w(`删除笔记`,`确定删除「${e}」吗?`)||(await t.deleteNote(d.value.id),d.value=null,await ue())}async function me(e){await w(`删除笔记`,`确定删除「${i.value.find(t=>t.id===e)?.title||`无标题`}」吗?`)&&(await t.deleteNote(e),await ue())}async function he(){let e=await te(`新建文件夹`,`名称`,``);if(!e)return;let n=await t.createFolder({name:e,type:`note`});r.value.push(n)}async function ge(e){let n=await te(`重命名`,`新名称`,e.name);n&&(await t.updateFolder(e.id,{name:n}),e.name=n)}async function _e(e){await w(`删除文件夹`,`确定删除文件夹「${e.name}」吗?\n内容将移至「未分类」`)&&(await t.deleteFolder(e.id),r.value=r.value.filter(t=>t.id!==e.id),o.value===e.id&&(o.value=null),await ue())}function ve(e){u.value=u.value===e.id?null:e.id}async function ye(e){if(!d.value?.id)return;let n=await t.shareNote(d.value.id,e);m.value=(window.location.hostname===`localhost`?``:`https://mokeetext.server.zgitm.com`)+n.url,g.value=`有效期至 `+n.expires_at}function be(){m.value&&(navigator.clipboard.writeText(m.value),Se(`链接已复制`))}function xe(){_.value=!1,h.value=`forever`,m.value=``}function Se(e){let t=document.createElement(`div`);t.className=`toast`,t.textContent=e,document.body.appendChild(t),setTimeout(()=>t.remove(),2e3)}async function Ce(){!d.value?.id||!y.value||(await t.moveNote(d.value.id,y.value),d.value.folder_id=y.value,v.value=!1,Se(`已移动`),await ue())}function we(e){(e.ctrlKey||e.metaKey)&&e.key===`s`&&(e.preventDefault(),fe().then(()=>Se(`已保存Ctrl+S`)))}function Te(){u.value=null}return Pi(()=>{document.addEventListener(`click`,Te),document.addEventListener(`keydown`,we)}),Ri(()=>{document.removeEventListener(`click`,Te),document.removeEventListener(`keydown`,we)}),(e,t)=>(P(),F(`div`,mL,[I(`aside`,{class:s([`sidebar`,{collapsed:c.value}])},[I(`div`,hL,[I(`span`,{class:`add-btn`,onClick:t[0]||=e=>c.value=!c.value,title:c.value?`展开`:`收起`,style:{cursor:`pointer`}},j(c.value?`▶`:`◀`),9,gL),c.value?Zr(``,!0):(P(),F(`span`,{key:0,class:`add-btn`,onClick:he,style:{"font-size":`11px`,"font-weight":`600`,width:`auto`,padding:`0 6px`}},`新增文件夹`))]),On(I(`div`,_L,[I(`div`,{class:s([`folder-item`,{active:o.value===null}]),onClick:t[1]||=e=>o.value=null},[t[18]||=I(`span`,{class:`folder-dot`,style:{opacity:`.8`,width:`8px`,height:`8px`}},null,-1),t[19]||=I(`span`,{style:{flex:`1`}},`全部笔记`,-1),I(`span`,vL,j(i.value.length),1)],2),(P(!0),F(ga,null,Zn(r.value,e=>(P(),F(`div`,{key:e.id},[I(`div`,{class:s([`folder-item`,{active:o.value===e.id}]),onClick:t=>o.value=o.value===e.id?null:e.id,style:{position:`relative`}},[t[20]||=I(`span`,{class:`folder-dot`},null,-1),I(`span`,bL,j(e.name),1),I(`span`,xL,j(a[e.id]||0),1),I(`span`,{class:`folder-more`,onClick:Jo(t=>ve(e),[`stop`])},`⋮`,8,SL),On(I(`div`,CL,[I(`div`,{class:`folder-menu-item`,onClick:Jo(t=>ge(e),[`stop`])},`✏️ 重命名`,8,wL),I(`div`,{class:`folder-menu-item danger`,onClick:Jo(t=>_e(e),[`stop`])},`🗑 删除`,8,TL)],512),[[To,u.value===e.id]])],10,yL)]))),128))],512),[[To,!c.value]])],2),d.value?(P(),F(`section`,zL,[I(`div`,BL,[I(`button`,{class:`btn btn-ghost btn-sm`,onClick:ce},`← 返回`),On(I(`input`,{class:`content-title`,"onUpdate:modelValue":t[3]||=e=>d.value.title=e,placeholder:`无标题笔记`,onInput:de,style:{"min-width":`120px`}},null,544),[[Vo,d.value.title]]),I(`span`,VL,` 📂 `+j(ae(d.value.folder_id)),1),I(`button`,{class:`btn btn-ghost btn-sm`,onClick:t[4]||=e=>v.value=!0,title:`移动到其他文件夹`},`📦 移动`),m.value?(P(),F(`button`,{key:1,class:`btn btn-ghost btn-sm`,onClick:be,style:{color:`var(--success)`}},`✅ 已分享`)):(P(),F(`button`,{key:0,class:`btn btn-ghost btn-sm`,onClick:t[5]||=e=>_.value=!0},`🔗 分享`)),I(`div`,HL,[I(`button`,{class:s({active:f.value===`edit`}),onClick:t[6]||=e=>f.value=`edit`},`编辑`,2),I(`button`,{class:s({active:f.value===`preview`}),onClick:t[7]||=e=>f.value=`preview`},`预览`,2),I(`button`,{class:s({active:f.value===`split`}),onClick:t[8]||=e=>f.value=`split`},`分屏`,2)]),I(`span`,UL,j(p.value),1),I(`button`,{class:`btn btn-danger-ghost btn-sm`,onClick:pe},`删除`)]),L(ZI,{ref_key:`editorRef`,ref:n,viewMode:f.value,onUpdate:A},null,8,[`viewMode`])])):(P(),F(`section`,EL,[I(`div`,DL,[I(`span`,OL,j(o.value?ae(o.value):`全部笔记`),1),I(`div`,kL,[On(I(`input`,{class:`input`,style:{width:`200px`},type:`text`,placeholder:`搜索标题…`,"onUpdate:modelValue":t[2]||=e=>l.value=e},null,512),[[Vo,l.value]]),I(`button`,{class:`btn btn-primary btn-sm`,onClick:le},`+ 新建笔记`)])]),I(`div`,AL,[re.value.length?(P(),F(`table`,ML,[t[22]||=I(`thead`,null,[I(`tr`,null,[I(`th`,{style:{width:`40%`}},`标题`),I(`th`,{style:{width:`10%`}},`创建人`),I(`th`,{style:{width:`22%`}},`创建时间`),I(`th`,{style:{width:`22%`}},`修改时间`),I(`th`,{style:{width:`6%`}},`操作`)])],-1),I(`tbody`,null,[(P(!0),F(ga,null,Zn(re.value,e=>(P(),F(`tr`,{key:e.id,onClick:t=>se(e),class:`clickable-row`},[I(`td`,PL,j(e.title||`无标题笔记`),1),I(`td`,FL,j(e.created_by||`admin`),1),I(`td`,IL,j(oe(e.created_at)),1),I(`td`,LL,j(oe(e.updated_at)),1),I(`td`,null,[I(`button`,{class:`btn btn-danger-ghost btn-xs`,onClick:Jo(t=>me(e.id),[`stop`])},`删除`,8,RL)])],8,NL))),128))])])):(P(),F(`div`,jL,[...t[21]||=[I(`p`,null,`暂无笔记`,-1)]]))])])),L(rL,{show:v.value,title:`移动到文件夹`,onClose:t[11]||=e=>v.value=!1},{footer:Dn(()=>[I(`button`,{class:`btn btn-ghost`,onClick:t[10]||=e=>v.value=!1},`取消`),I(`button`,{class:`btn btn-primary`,onClick:Ce},`移动`)]),default:Dn(()=>[I(`div`,WL,[t[23]||=I(`label`,{class:`form-label`},`选择目标文件夹`,-1),On(I(`select`,{class:`select`,"onUpdate:modelValue":t[9]||=e=>y.value=e},[(P(!0),F(ga,null,Zn(r.value,e=>(P(),F(`option`,{key:e.id,value:e.id},j(e.name),9,GL))),128))],512),[[Wo,y.value]])])]),_:1},8,[`show`]),L(rL,{show:_.value,title:`生成分享链接`,width:420,onClose:xe},{footer:Dn(()=>[m.value?Zr(``,!0):(P(),F(`button`,{key:0,class:`btn btn-ghost`,onClick:xe},`取消`)),m.value?(P(),F(`button`,{key:2,class:`btn btn-primary`,onClick:xe},`完成`)):(P(),F(`button`,{key:1,class:`btn btn-primary`,onClick:t[17]||=e=>ye(h.value)},`生成链接`))]),default:Dn(()=>[t[29]||=I(`p`,{style:{color:`var(--text-secondary)`,"font-size":`13px`,"margin-bottom":`12px`}},`选择有效期:`,-1),I(`div`,KL,[I(`label`,{class:s([`share-radio`,{active:h.value===`7d`}]),onClick:t[12]||=e=>h.value=`7d`},[...t[24]||=[I(`span`,{class:`share-radio-dot`},null,-1),Xr(` 7 天`,-1),I(`span`,{style:{"font-size":`11px`,color:`var(--text-tertiary)`,"margin-left":`8px`}},`一周后失效`,-1)]],2),I(`label`,{class:s([`share-radio`,{active:h.value===`30d`}]),onClick:t[13]||=e=>h.value=`30d`},[...t[25]||=[I(`span`,{class:`share-radio-dot`},null,-1),Xr(` 30 天`,-1),I(`span`,{style:{"font-size":`11px`,color:`var(--text-tertiary)`,"margin-left":`8px`}},`一个月后失效`,-1)]],2),I(`label`,{class:s([`share-radio`,{active:h.value===`1y`}]),onClick:t[14]||=e=>h.value=`1y`},[...t[26]||=[I(`span`,{class:`share-radio-dot`},null,-1),Xr(` 1 年`,-1),I(`span`,{style:{"font-size":`11px`,color:`var(--text-tertiary)`,"margin-left":`8px`}},`一年后失效`,-1)]],2),I(`label`,{class:s([`share-radio`,{active:h.value===`forever`}]),onClick:t[15]||=e=>h.value=`forever`},[...t[27]||=[I(`span`,{class:`share-radio-dot`},null,-1),Xr(` 永久有效 `,-1)]],2)]),m.value?(P(),F(`div`,qL,[t[28]||=I(`div`,{style:{"font-size":`12px`,"font-weight":`600`,color:`#166534`,"margin-bottom":`6px`}},`✅ 链接已生成`,-1),I(`div`,JL,[I(`input`,{class:`input`,style:{"font-size":`12px`},value:m.value,readonly:``,onFocus:t[16]||=e=>e.target.select()},null,40,YL),I(`button`,{class:`btn btn-primary btn-sm`,onClick:be},`复制`)]),I(`div`,XL,j(g.value),1)])):Zr(``,!0)]),_:1},8,[`show`]),L(oL,{show:S.show,title:S.title,message:S.message,onConfirm:ee,onCancel:T},null,8,[`show`,`title`,`message`]),L(dL,{show:E.show,title:E.title,label:E.label,initial:E.initial,onConfirm:k,onCancel:ne},null,8,[`show`,`title`,`label`,`initial`])]))}},QL=ul(ZL,[[`__scopeId`,`data-v-e7f3da17`]])})),eR,tR,nR,rR,iR,aR,oR,sR,cR,lR,uR,dR,fR,pR,mR,hR,gR,_R,vR,yR,bR,xR,SR,CR,wR,TR,ER,DR,OR,kR,AR,jR,MR,NR,PR,FR,IR,LR,RR,zR,BR,VR,HR,UR,WR,GR,KR,qR,JR,YR,XR,ZR,QR,$R,ez,tz,nz,rz,iz,az,oz,sz,cz,lz,uz,dz,fz,pz,mz,hz,gz,_z=t((()=>{ts(),Dm(),iL(),sL(),fL(),eR={class:`layout`},tR={class:`sidebar`},nR={class:`stat-row`},rR={class:`stat`},iR={class:`stat-num`,style:{color:`var(--brand)`}},aR={class:`stat`},oR={class:`stat-num`,style:{color:`var(--success)`}},sR={style:{flex:`1`,"overflow-y":`auto`}},cR=[`onClick`],lR={class:`folder-arrow`},uR={style:{flex:`1`,"font-weight":`500`}},dR={class:`count`},fR=[`onClick`],pR={class:`folder-menu`},mR=[`onClick`],hR=[`onClick`],gR={class:`folder-children`},_R=[`onClick`],vR={class:`site-name`},yR={class:`site-count`},bR=[`onClick`],xR={class:`site-name`},SR={class:`site-count`},CR={class:`content`},wR={class:`content-header`},TR={key:0,style:{display:`flex`,"align-items":`center`,gap:`8px`}},ER={style:{"font-size":`11px`,color:`var(--text-tertiary)`}},DR={style:{"font-size":`15px`,"font-weight":`600`}},OR=[`href`],kR={key:1,class:`text-muted`},AR={key:2,style:{display:`flex`,gap:`6px`}},jR={class:`editor-pane`,style:{flex:`1`}},MR={key:0,style:{"text-align":`center`,padding:`80px 20px`,color:`var(--text-placeholder)`}},NR={key:1,style:{"text-align":`center`,padding:`80px 20px`,color:`var(--text-placeholder)`}},PR={key:2},FR={class:`card-header`},IR={class:`card-title`},LR={style:{display:`flex`,gap:`4px`,"align-items":`center`}},RR=[`onClick`,`disabled`],zR=[`onClick`,`disabled`],BR=[`onClick`],VR=[`onClick`],HR={class:`card-body`},UR={style:{"font-family":`monospace`}},WR=[`onClick`],GR={style:{"font-family":`monospace`}},KR={style:{display:`flex`,gap:`4px`}},qR=[`onClick`],JR=[`onClick`],YR={style:{color:`var(--text-secondary)`,"font-size":`12px`}},XR={class:`form-group`},ZR={class:`form-group`},QR={class:`form-group`},$R=[`value`],ez={class:`form-group`},tz={class:`form-group`},nz={class:`form-row`},rz=[`type`],iz={class:`form-group`},az={class:`form-group`},oz={class:`form-group`},sz={key:0,class:`result-box`},cz={class:`result-grid`},lz={style:{"font-family":`monospace`}},uz={style:{"font-family":`monospace`}},dz={class:`form-group`,style:{"margin-top":`12px`}},fz={class:`form-row`},pz=[`value`],mz={key:0,class:`alert alert-warning mb-md`},hz={class:`modal-footer`,style:{padding:`0`,border:`none`}},gz={__name:`WebsitesView`,setup(e){let t=Cm(),n=N([]),r=N([]),i=N(null),a=N(``),o=it({}),c=N(null),l=it({}),u=La(()=>n.value.reduce((e,t)=>e+(t.accounts?.length||0),0)),d=La(()=>{let e={};return n.value.forEach(t=>{let n=t.folder_id||`__none__`;e[n]=(e[n]||0)+1}),e});function f(e){return n.value.filter(t=>t.folder_id===e)}let p=La(()=>n.value.filter(e=>!e.folder_id)),m=N(!1),h=N(null),g=it({name:``,url:``,folder_id:null}),_=N(!1),v=N(null),y=it({username:``,password:``,remark:``,sort_order:0}),b=N(!1),x=N(!1),S=N(``),C=N(null),w=N(null),ee=N(``),T=it({show:!1,title:``,message:``}),E=null;function D(e,t){return new Promise(n=>{T.title=e,T.message=t,T.show=!0,E=n})}function O(){T.show=!1,E&&E(!0)}function te(){T.show=!1,E&&E(!1)}let k=it({show:!1,title:``,label:``,initial:``}),ne=null;function re(e,t,n){return new Promise(r=>{k.title=e,k.label=t,k.initial=n||``,k.show=!0,ne=r})}function ie(e){k.show=!1,ne&&ne(e)}function ae(){k.show=!1,ne&&ne(null)}function oe(e,t){T.title=e,T.message=t,T.show=!0,E=()=>{T.show=!1}}Pi(async()=>{let[e,i]=await Promise.all([t.listWebsites(),t.listFolders(`website`)]);n.value=e,r.value=i,i.forEach(e=>{o[e.id]=!0})});function se(e){i.value=e}function ce(e){if(!e)return`未分类`;let t=r.value.find(t=>t.id===e);return t?t.name:`未分类`}function le(e){o[e.id]=!o[e.id]}function ue(e,t){c.value=c.value===e.id?null:e.id}async function A(){let e=await re(`新建文件夹`,`文件夹名称`,``);if(!e)return;let n=await t.createFolder({name:e,type:`website`});r.value.push(n),o[n.id]=!0}async function de(e){let n=await re(`重命名文件夹`,`新名称`,e.name);n&&(await t.updateFolder(e.id,{name:n}),e.name=n)}function fe(e){h.value=e||null,e?(g.name=e.name,g.url=e.url,g.folder_id=e.folder_id):(g.name=``,g.url=``,g.folder_id=null),m.value=!0}async function pe(){h.value?await t.updateWebsite(h.value.id,{...g}):await t.createWebsite({...g}),m.value=!1,await Ce()}function me(e){v.value=e||null,b.value=!1,e?(y.username=e.username,y.password=e.password,y.remark=e.remark||``,y.sort_order=e.sort_order||0):(y.username=``,y.password=``,y.remark=``,y.sort_order=(i.value?.accounts?.length||0)+1),_.value=!0}async function he(){let e={username:y.username,password:y.password,remark:y.remark,sort_order:y.sort_order};v.value?await t.updateAccount(v.value.id,e):await t.addAccount(i.value.id,e),_.value=!1,i.value=await t.getWebsite(i.value.id)}async function ge(){!i.value||!await D(`删除网站`,`确定删除「${i.value.name}」及其所有账号?`)||(await t.deleteWebsite(i.value.id),i.value=null,await Ce())}async function _e(e,n){await t.moveAccount(e,n),i.value=await t.getWebsite(i.value.id)}async function ve(e){let n=i.value?.accounts?.find(t=>t.id===e);await D(`删除账号`,`确定删除「${n?.remark||n?.username||`账号`}」吗?`)&&(await t.deleteAccount(e),i.value=await t.getWebsite(i.value.id))}async function ye(e){await D(`删除文件夹`,`确定删除文件夹「${e.name}」吗?内容将移至「未分类」`)&&(await t.deleteFolder(e.id),r.value=r.value.filter(t=>t.id!==e.id),await Ce())}async function be(){let e=S.value.trim();if(!e)return oe(`提示`,`请先粘贴文本`);let n=await t.parseImport(e);if(!n.ok)return oe(`识别失败`,n.error);C.value=n,n.matched_site?.folder_id&&(w.value=n.matched_site.folder_id)}async function xe(){let e=C.value;if(!e)return;let n=w.value;ee.value&&(n=(await t.createFolder({name:ee.value,type:`website`})).id);let r=e.matched_site;r||=await t.createWebsite({name:e.site_name,url:e.url,folder_id:n}),await t.addAccount(r.id,{username:e.username,password:e.password,remark:e.remark}),x.value=!1,await Ce()}function Se(e){navigator.clipboard.writeText(e)}async function Ce(){n.value=await t.listWebsites()}function we(){c.value=null}return Pi(()=>document.addEventListener(`click`,we)),Ri(()=>document.removeEventListener(`click`,we)),(e,t)=>(P(),F(`div`,eR,[I(`aside`,tR,[I(`div`,nR,[I(`div`,rR,[I(`div`,iR,j(n.value.length),1),t[22]||=I(`div`,{class:`stat-label`},`网站`,-1)]),I(`div`,aR,[I(`div`,oR,j(u.value),1),t[23]||=I(`div`,{class:`stat-label`},`账号`,-1)])]),I(`button`,{class:`btn btn-primary btn-block`,onClick:t[0]||=e=>fe()},`添加网站`),I(`button`,{class:`btn btn-outline btn-block`,onClick:t[1]||=e=>x.value=!0},`智能导入`),I(`div`,{class:`sidebar-label`},[t[24]||=I(`span`,null,`文件夹`,-1),I(`span`,{class:`add-btn`,onClick:A},`+`)]),On(I(`input`,{class:`input mb-sm`,type:`text`,placeholder:`搜索网站或网址…`,"onUpdate:modelValue":t[2]||=e=>a.value=e},null,512),[[Vo,a.value]]),I(`div`,sR,[(P(!0),F(ga,null,Zn(r.value,e=>(P(),F(`div`,{key:e.id,class:`folder-group`},[I(`div`,{class:`folder-item`,onClick:t=>le(e),style:{position:`relative`}},[I(`span`,lR,j(o[e.id]?`▼`:`▶`),1),I(`span`,uR,`📁 `+j(e.name),1),I(`span`,dR,j(d.value[e.id]||0),1),I(`span`,{class:`folder-more`,onClick:Jo(t=>ue(e,t),[`stop`])},`⋮`,8,fR),On(I(`div`,pR,[I(`div`,{class:`folder-menu-item`,onClick:Jo(t=>de(e),[`stop`])},`✏️ 重命名`,8,mR),I(`div`,{class:`folder-menu-item danger`,onClick:Jo(t=>ye(e),[`stop`])},`🗑 删除`,8,hR)],512),[[To,c.value===e.id]])],8,cR),On(I(`div`,gR,[(P(!0),F(ga,null,Zn(f(e.id),e=>(P(),F(`div`,{key:e.id,class:s([`site-item`,{active:i.value?.id===e.id}]),onClick:t=>se(e)},[t[25]||=I(`span`,null,`🌐`,-1),I(`span`,vR,j(e.name),1),I(`span`,yR,j(e.accounts?.length||0)+`个`,1)],10,_R))),128))],512),[[To,o[e.id]]])]))),128)),t[27]||=I(`div`,{class:`sidebar-label`},`未分类`,-1),(P(!0),F(ga,null,Zn(p.value,e=>(P(),F(`div`,{key:e.id,class:s([`site-item`,{active:i.value?.id===e.id}]),onClick:t=>se(e)},[t[26]||=I(`span`,null,`🌐`,-1),I(`span`,xR,j(e.name),1),I(`span`,SR,j(e.accounts?.length||0)+`个`,1)],10,bR))),128))])]),I(`section`,CR,[I(`div`,wR,[i.value?(P(),F(`div`,TR,[I(`span`,ER,j(ce(i.value.folder_id))+` /`,1),I(`span`,DR,j(i.value.name),1),I(`a`,{href:i.value.url,target:`_blank`,style:{"font-size":`11px`,color:`var(--brand)`,"text-decoration":`none`}},j(i.value.url),9,OR)])):(P(),F(`div`,kR,`选择左侧网站查看账号`)),i.value?(P(),F(`div`,AR,[I(`button`,{class:`btn btn-ghost btn-sm`,onClick:t[3]||=e=>fe(i.value)},`✏️ 编辑`),I(`button`,{class:`btn btn-outline btn-sm`,onClick:t[4]||=e=>me()},`+ 添加账号`),I(`button`,{class:`btn btn-danger-ghost btn-sm`,onClick:ge},`🗑 删除网站`)])):Zr(``,!0)]),I(`div`,jR,[i.value?i.value.accounts?.length?(P(),F(`div`,PR,[(P(!0),F(ga,null,Zn(i.value.accounts,(e,n)=>(P(),F(`div`,{key:e.id,class:`card`},[I(`div`,FR,[I(`span`,IR,`👤 `+j(e.remark||`账号`),1),I(`div`,LR,[I(`button`,{class:`card-btn`,onClick:t=>_e(e.id,`up`),disabled:n===0,title:`上移`},`↑`,8,RR),I(`button`,{class:`card-btn`,onClick:t=>_e(e.id,`down`),disabled:n===i.value.accounts.length-1,title:`下移`},`↓`,8,zR),I(`button`,{class:`card-btn edit-btn`,onClick:t=>me(e)},`✏️ 编辑`,8,BR),I(`button`,{class:`card-btn danger-btn`,onClick:t=>ve(e.id)},`🗑 删除`,8,VR)])]),I(`div`,HR,[t[30]||=I(`span`,{class:`label`},`账号`,-1),I(`span`,UR,j(e.username),1),I(`button`,{class:`card-btn`,onClick:t=>Se(e.username)},`复制`,8,WR),t[31]||=I(`span`,{class:`label`},`密码`,-1),I(`span`,GR,j(l[e.id]?e.password:`••••••••`),1),I(`div`,KR,[I(`button`,{class:`card-btn`,onClick:t=>l[e.id]=!l[e.id]},j(l[e.id]?`隐藏`:`显示`),9,qR),I(`button`,{class:`card-btn`,onClick:t=>Se(e.password)},`复制`,8,JR)]),t[32]||=I(`span`,{class:`label`},`说明`,-1),I(`span`,YR,j(e.remark||`-`),1),t[33]||=I(`span`,null,null,-1)])]))),128))])):(P(),F(`div`,NR,[...t[29]||=[I(`p`,null,`暂无账号`,-1)]])):(P(),F(`div`,MR,[...t[28]||=[I(`div`,{style:{"font-size":`48px`,"margin-bottom":`16px`,opacity:`0.4`}},`🔐`,-1),I(`p`,null,`选择左侧网站查看账号密码`,-1)]]))])]),L(rL,{show:m.value,title:h.value?`编辑网站`:`添加网站`,onClose:t[9]||=e=>m.value=!1},{footer:Dn(()=>[I(`button`,{class:`btn btn-ghost`,onClick:t[8]||=e=>m.value=!1},`取消`),I(`button`,{class:`btn btn-primary`,onClick:pe},`保存`)]),default:Dn(()=>[I(`div`,XR,[t[34]||=I(`label`,{class:`form-label`},`网站名`,-1),On(I(`input`,{class:`input`,"onUpdate:modelValue":t[5]||=e=>g.name=e,placeholder:`例如GitHub`},null,512),[[Vo,g.name]])]),I(`div`,ZR,[t[35]||=I(`label`,{class:`form-label`},`网址`,-1),On(I(`input`,{class:`input`,"onUpdate:modelValue":t[6]||=e=>g.url=e,placeholder:`https://github.com`},null,512),[[Vo,g.url]])]),I(`div`,QR,[t[37]||=I(`label`,{class:`form-label`},`文件夹`,-1),On(I(`select`,{class:`select`,"onUpdate:modelValue":t[7]||=e=>g.folder_id=e},[t[36]||=I(`option`,{value:null},`未分类`,-1),(P(!0),F(ga,null,Zn(r.value,e=>(P(),F(`option`,{key:e.id,value:e.id},j(e.name),9,$R))),128))],512),[[Wo,g.folder_id]])])]),_:1},8,[`show`,`title`]),L(rL,{show:_.value,title:v.value?`编辑账号`:`添加账号`,onClose:t[16]||=e=>_.value=!1},{footer:Dn(()=>[I(`button`,{class:`btn btn-ghost`,onClick:t[15]||=e=>_.value=!1},`取消`),I(`button`,{class:`btn btn-primary`,onClick:he},`保存`)]),default:Dn(()=>[I(`div`,ez,[t[38]||=I(`label`,{class:`form-label`},`账号 / 用户名`,-1),On(I(`input`,{class:`input`,"onUpdate:modelValue":t[10]||=e=>y.username=e,placeholder:`user@example.com`},null,512),[[Vo,y.username]])]),I(`div`,tz,[t[39]||=I(`label`,{class:`form-label`},`密码`,-1),I(`div`,nz,[On(I(`input`,{class:`input`,type:b.value?`text`:`password`,"onUpdate:modelValue":t[11]||=e=>y.password=e,placeholder:`输入密码`,style:{flex:`1`}},null,8,rz),[[Go,y.password]]),I(`button`,{class:`btn btn-ghost btn-sm`,type:`button`,onClick:t[12]||=e=>b.value=!b.value},j(b.value?`隐藏`:`显示`),1)])]),I(`div`,iz,[t[40]||=I(`label`,{class:`form-label`},`备注`,-1),On(I(`textarea`,{class:`textarea`,"onUpdate:modelValue":t[13]||=e=>y.remark=e,rows:`2`,placeholder:`例如:主账号、小号…`},null,512),[[Vo,y.remark]])]),I(`div`,az,[t[41]||=I(`label`,{class:`form-label`},`排序`,-1),On(I(`input`,{class:`input`,"onUpdate:modelValue":t[14]||=e=>y.sort_order=e,type:`number`,placeholder:`数字越小越靠前`,style:{width:`120px`}},null,512),[[Vo,y.sort_order,void 0,{number:!0}]])])]),_:1},8,[`show`,`title`]),L(rL,{show:x.value,title:`智能导入`,width:520,onClose:t[21]||=e=>x.value=!1},{default:Dn(()=>[I(`div`,oz,[t[42]||=I(`label`,{class:`form-label`},`粘贴账号信息`,-1),On(I(`textarea`,{class:`import-textarea`,"onUpdate:modelValue":t[17]||=e=>S.value=e,placeholder:`https://github.com 代码网站
zhangsan@qq.com
Abc123
个人开发账号`},null,512),[[Vo,S.value]]),t[43]||=I(`div`,{class:`import-hint`},`首行=网址+空格+网站名 | 第2行=账号 | 第3行=密码 | 第4行=备注`,-1)]),I(`button`,{class:`btn btn-primary btn-block mb-md`,onClick:be},`🔍 自动识别`),C.value?(P(),F(`div`,sz,[t[53]||=I(`div`,{style:{"font-weight":`600`,color:`#166534`,"margin-bottom":`10px`}},`识别结果`,-1),I(`div`,cz,[t[44]||=I(`span`,{style:{color:`var(--text-secondary)`}},`网址`,-1),I(`span`,null,j(C.value.url),1),t[45]||=I(`span`,{style:{color:`var(--text-secondary)`}},`网站名`,-1),I(`span`,null,j(C.value.site_name),1),t[46]||=I(`span`,{style:{color:`var(--text-secondary)`}},`账号`,-1),I(`span`,lz,j(C.value.username),1),t[47]||=I(`span`,{style:{color:`var(--text-secondary)`}},`密码`,-1),I(`span`,uz,j(C.value.password),1),t[48]||=I(`span`,{style:{color:`var(--text-secondary)`}},`备注`,-1),I(`span`,null,j(C.value.remark||`()`),1)]),I(`div`,dz,[t[51]||=I(`label`,{class:`form-label`},`存放文件夹`,-1),I(`div`,fz,[On(I(`select`,{class:`select`,"onUpdate:modelValue":t[18]||=e=>w.value=e},[t[49]||=I(`option`,{value:null},`已有文件夹`,-1),(P(!0),F(ga,null,Zn(r.value,e=>(P(),F(`option`,{key:e.id,value:e.id},j(e.name),9,pz))),128))],512),[[Wo,w.value]]),t[50]||=I(`span`,{class:`text-muted`},``,-1),On(I(`input`,{class:`input`,"onUpdate:modelValue":t[19]||=e=>ee.value=e,placeholder:`新建文件夹`,style:{flex:`1`}},null,512),[[Vo,ee.value]])])]),C.value.matched_site?(P(),F(`div`,mz,[t[52]||=Xr(` `,-1),I(`strong`,null,j(C.value.matched_site.name),1),Xr(` 已存在`+j(C.value.matched_site.account_count)+`个账号将追加进去 `,1)])):Zr(``,!0),I(`div`,hz,[I(`button`,{class:`btn btn-ghost`,onClick:t[20]||=e=>x.value=!1},`取消`),I(`button`,{class:`btn btn-primary`,onClick:xe},`确认添加`)])])):Zr(``,!0)]),_:1},8,[`show`]),L(oL,{show:T.show,title:T.title,message:T.message,onConfirm:O,onCancel:te},null,8,[`show`,`title`,`message`]),L(dL,{show:k.show,title:k.title,label:k.label,initial:k.initial,onConfirm:ie,onCancel:ae},null,8,[`show`,`title`,`label`,`initial`])]))}}})),vz=t((()=>{})),yz,bz,xz,Sz,Cz,wz,Tz,Ez,Dz,Oz,kz,Az,jz,Mz,Nz,Pz,Fz,Iz,Lz=t((()=>{ts(),sL(),vz(),dl(),yz={class:`layout`},bz={class:`content`},xz={class:`content-header`},Sz={class:`text-muted`},Cz={style:{flex:`1`,"overflow-y":`auto`,padding:`0 20px 20px`}},wz={key:0,style:{"text-align":`center`,padding:`80px 20px`,color:`var(--text-placeholder)`}},Tz={key:1,class:`doc-table`},Ez={class:`doc-title-cell`,"data-label":`标题`},Dz={"data-label":`链接`,style:{"font-size":`12px`,"font-family":`monospace`}},Oz=[`href`],kz={"data-label":`有效期`,style:{"font-size":`12px`,color:`var(--text-secondary)`}},Az={"data-label":`创建人`,style:{"font-size":`12px`,color:`var(--text-secondary)`}},jz={"data-label":`更新时间`,style:{"font-size":`12px`,color:`var(--text-tertiary)`,"font-family":`monospace`}},Mz={style:{display:`flex`,gap:`4px`}},Nz=[`onClick`],Pz=[`onClick`],Fz={__name:`SharesView`,setup(e){let t=N([]),n=it({show:!1,title:``,message:``}),r=null;function i(e,t){return new Promise(i=>{n.title=e,n.message=t,n.show=!0,r=i})}function a(){n.show=!1,r&&r(!0)}function o(){n.show=!1,r&&r(!1)}let s=window.location.hostname===`localhost`?``:`https://mokeetext.server.zgitm.com`;Pi(c);async function c(){t.value=await(await fetch(s+`/api/shares`)).json()}function l(e){return e?e.replace(`T`,` `).substring(0,19):`-`}function u(e){let t=s+e.share_url;navigator.clipboard.writeText(t);let n=document.createElement(`div`);n.className=`toast`,n.textContent=`已复制`,document.body.appendChild(n),setTimeout(()=>n.remove(),1500)}async function d(e){await i(`取消分享`,`确定取消「${e.title}」的分享链接?`)&&(await fetch(s+`/api/notes/${e.id}/share`,{method:`DELETE`}),await c())}return(e,r)=>(P(),F(`div`,yz,[I(`section`,bz,[I(`div`,xz,[r[0]||=I(`span`,{style:{"font-size":`15px`,"font-weight":`600`}},`分享管理`,-1),I(`span`,Sz,j(t.value.length)+` 条分享`,1)]),I(`div`,Cz,[t.value.length?(P(),F(`table`,Tz,[r[2]||=I(`thead`,null,[I(`tr`,null,[I(`th`,{style:{width:`25%`}},`笔记标题`),I(`th`,{style:{width:`30%`}},`分享链接`),I(`th`,{style:{width:`12%`}},`有效期`),I(`th`,{style:{width:`8%`}},`创建人`),I(`th`,{style:{width:`12%`}},`更新时间`),I(`th`,{style:{width:`13%`}},`操作`)])],-1),I(`tbody`,null,[(P(!0),F(ga,null,Zn(t.value,e=>(P(),F(`tr`,{key:e.id},[I(`td`,Ez,j(e.title||`无标题`),1),I(`td`,Dz,[I(`a`,{href:gt(s)+e.share_url,target:`_blank`,style:{color:`var(--brand)`,"text-decoration":`none`}},j(gt(s)+e.share_url),9,Oz)]),I(`td`,kz,j(e.share_expires_at),1),I(`td`,Az,j(e.created_by),1),I(`td`,jz,j(l(e.updated_at)),1),I(`td`,null,[I(`div`,Mz,[I(`button`,{class:`card-btn`,onClick:t=>u(e)},`复制`,8,Nz),I(`button`,{class:`card-btn danger-btn`,onClick:t=>d(e)},`取消分享`,8,Pz)])])]))),128))])])):(P(),F(`div`,wz,[...r[1]||=[I(`p`,null,`暂无分享记录`,-1)]]))])]),L(oL,{show:n.show,title:n.title,message:n.message,onConfirm:a,onCancel:o},null,8,[`show`,`title`,`message`])]))}},Iz=ul(Fz,[[`__scopeId`,`data-v-04fd67c6`]])})),Rz,zz,Bz,Vz,Hz,Uz=t((()=>{cl(),$L(),_z(),Lz(),Rz=`mokeetext-edit`,zz=`https://login.user.zgitm.com`,Bz=window.location.origin,Vz=[{path:`/`,redirect:`/notes`},{path:`/notes`,name:`notes`,component:QL},{path:`/websites`,name:`websites`,component:gz},{path:`/shares`,name:`shares`,component:Iz}],Hz=Kc({history:wc(),routes:Vz}),Hz.beforeEach((e,t,n)=>{if(window.location.hostname===`localhost`){n();return}if(!document.cookie.match(/(?:^|;\s*)token=([^;]*)/)?.[1]){window.location.href=`${zz}?systemCode=${Rz}&redirect=${encodeURIComponent(Bz)}`;return}n()})}));function Wz(){let e=document.cookie.match(/(?:^|;\s*)token=([^;]*)/)?.[1];if(!e)return[];try{return JSON.parse(atob(e.split(`.`)[1])).permissions??[]}catch{return[]}}var Gz,Kz=t((()=>{Gz={mounted(e,t){let n=Wz(),r=t.value;r&&!n.includes(r)&&e.parentNode?.removeChild(e)}}})),qz=t((()=>{}));n((()=>{ts(),wl(),Uz(),Kz(),qz();var e=$o(Cl);e.use(Hz),e.directive(`permission`,Gz),e.mount(`#app`)}))();