1790 lines
1.5 MiB
JavaScript
1790 lines
1.5 MiB
JavaScript
|
|
var F2=Object.defineProperty;var q2=(t,e,n)=>e in t?F2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var mn=(t,e,n)=>(q2(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const h of l.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();/**
|
|||
|
|
* @vue/shared v3.5.20
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**//*! #__NO_SIDE_EFFECTS__ */function Ap(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const gn={},Jo=[],xi=()=>{},h4=()=>!1,Ac=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Mp=t=>t.startsWith("onUpdate:"),sr=Object.assign,Cp=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},j2=Object.prototype.hasOwnProperty,rn=(t,e)=>j2.call(t,e),It=Array.isArray,Qo=t=>Mc(t)==="[object Map]",p4=t=>Mc(t)==="[object Set]",Bt=t=>typeof t=="function",Vn=t=>typeof t=="string",io=t=>typeof t=="symbol",Rn=t=>t!==null&&typeof t=="object",f4=t=>(Rn(t)||Bt(t))&&Bt(t.then)&&Bt(t.catch),m4=Object.prototype.toString,Mc=t=>m4.call(t),$2=t=>Mc(t).slice(8,-1),g4=t=>Mc(t)==="[object Object]",Lp=t=>Vn(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,gl=Ap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Cc=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},U2=/-(\w)/g,Xa=Cc(t=>t.replace(U2,(e,n)=>n?n.toUpperCase():"")),V2=/\B([A-Z])/g,ao=Cc(t=>t.replace(V2,"-$1").toLowerCase()),v4=Cc(t=>t.charAt(0).toUpperCase()+t.slice(1)),Dd=Cc(t=>t?`on${v4(t)}`:""),Ka=(t,e)=>!Object.is(t,e),L0=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},b4=(t,e,n,r=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:r,value:n})},Ch=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let E1;const Lc=()=>E1||(E1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function os(t){if(It(t)){const e={};for(let n=0;n<t.length;n++){const r=t[n],o=Vn(r)?X2(r):os(r);if(o)for(const l in o)e[l]=o[l]}return e}else if(Vn(t)||Rn(t))return t}const W2=/;(?![^(]*\))/g,G2=/:([^]+)/,K2=/\/\*[^]*?\*\//g;function X2(t){const e={};return t.replace(K2,"").split(W2).forEach(n=>{if(n){const r=n.split(G2);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function ss(t){let e="";if(Vn(t))e=t;else if(It(t))for(let n=0;n<t.length;n++){const r=ss(t[n]);r&&(e+=r+" ")}else if(Rn(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const Z2="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Y2=Ap(Z2);function y4(t){return!!t||t===""}const w4=t=>!!(t&&t.__v_isRef===!0),Jr=t=>Vn(t)?t:t==null?"":It(t)||Rn(t)&&(t.toString===m4||!Bt(t.toString))?w4(t)?Jr(t.value):JSON.stringify(t,x4,2):String(t),x4=(t,e)=>w4(e)?x4(t,e.value):Qo(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[r,o],l)=>(n[Rd(r,l)+" =>"]=o,n),{})}:p4(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Rd(n))}:io(e)?Rd(e):Rn(e)&&!It(e)&&!g4(e)?String(e):e,Rd=(t,e="")=>{var n;return io(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/**
|
|||
|
|
* @vue/reactivity v3.5.20
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**/let Cr;class J2{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Cr,!e&&Cr&&(this.index=(Cr.scopes||(Cr.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=Cr;try{return Cr=this,e()}finally{Cr=n}}}on(){++this._on===1&&(this.prevScope=Cr,Cr=this)}off(){this._on>0&&--this._on===0&&(Cr=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function Q2(){return Cr}let yn;const Id=new WeakSet;class k4{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,Cr&&Cr.active&&Cr.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Id.has(this)&&(Id.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||E4(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,T1(this),T4(this);const e=yn,n=ki;yn=this,ki=!0;try{return this.fn()}finally{A4(this),yn=e,ki=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Dp(e);this.deps=this.depsTail=void 0,T1(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Id.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Lh(this)&&this.run()}get dirty(){return Lh(this)}}let S4=0,vl,bl;function E4(t,e=!1){if(t.flags|=8,e){t.next=bl,bl=t;return}t.next=vl,vl=t}function _p(){S4++}function Np(){if(--S4>0)return;if(bl){let e=bl;for(bl=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;vl;){let e=vl;for(vl=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){t||(t=r)}e=n}}if(t)throw t}function T4(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function A4(t){let e,n=t.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),Dp(r),e5(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}t.deps=e,t.depsTail=n}function Lh(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(M4(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function M4(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Ll)||(t.globalVersion=Ll,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Lh(t))))return;t.flags|=2;const e=t.dep,n=yn,r=ki;yn=t,ki=!0;try{T4(t);const o=t.fn(t._value);(e.version===0||Ka(o,t._value))&&(t.flags|=128,t._value=o,e.version++)}catch(o){throw e.version++,o}finally{yn=n,ki=r,A4(t),t.flags&=-3}}function Dp(t,e=!1){const{dep:n,prevSub:r,nextSub:o}=t;if(r&&(r.nextSub=o,t.prevSub=void 0),o&&(o.prevSub=r,t.nextSub=void 0),n.subs===t&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let l=n.computed.deps;l;l=l.nextDep)Dp(l,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function e5(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let ki=!0;const C4=[];function Sa(){C4.push(ki),ki=!1}function Ea(){const t=C4.pop();ki=t===void 0?!0:t}function T1(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=yn;yn=void 0;try{e()}finally{yn=n}}}let Ll=0;class t5{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=t
|
|||
|
|
* @vue/runtime-core v3.5.20
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**/function Bl(t,e,n,r){try{return r?t(...r):t()}catch(o){Nc(o,e,n)}}function Ui(t,e,n,r){if(Bt(t)){const o=Bl(t,e,n,r);return o&&f4(o)&&o.catch(l=>{Nc(l,e,n)}),o}if(It(t)){const o=[];for(let l=0;l<t.length;l++)o.push(Ui(t[l],e,n,r));return o}}function Nc(t,e,n,r=!0){const o=e?e.vnode:null,{errorHandler:l,throwUnhandledErrorInProduction:h}=e&&e.appContext.config||gn;if(e){let c=e.parent;const p=e.proxy,v=`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const b=c.ec;if(b){for(let g=0;g<b.length;g++)if(b[g](t,p,v)===!1)return}c=c.parent}if(l){Sa(),Bl(l,null,10,[t,p,v]),Ea();return}}C5(t,n,o,r,h)}function C5(t,e,n,r=!0,o=!1){if(o)throw t;console.error(t)}const yr=[];let Hi=-1;const ts=[];let $a=null,Xo=0;const z4=Promise.resolve();let G0=null;function ja(t){const e=G0||z4;return t?e.then(this?t.bind(this):t):e}function L5(t){let e=Hi+1,n=yr.length;for(;e<n;){const r=e+n>>>1,o=yr[r],l=Nl(o);l<t||l===t&&o.flags&2?e=r+1:n=r}return e}function zp(t){if(!(t.flags&1)){const e=Nl(t),n=yr[yr.length-1];!n||!(t.flags&2)&&e>=Nl(n)?yr.push(t):yr.splice(L5(e),0,t),t.flags|=1,B4()}}function B4(){G0||(G0=z4.then(q4))}function _5(t){It(t)?ts.push(...t):$a&&t.id===-1?$a.splice(Xo+1,0,t):t.flags&1||(ts.push(t),t.flags|=1),B4()}function M1(t,e,n=Hi+1){for(;n<yr.length;n++){const r=yr[n];if(r&&r.flags&2){if(t&&r.id!==t.uid)continue;yr.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function F4(t){if(ts.length){const e=[...new Set(ts)].sort((n,r)=>Nl(n)-Nl(r));if(ts.length=0,$a){$a.push(...e);return}for($a=e,Xo=0;Xo<$a.length;Xo++){const n=$a[Xo];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}$a=null,Xo=0}}const Nl=t=>t.id==null?t.flags&2?-1:1/0:t.id;function q4(t){const e=xi;try{for(Hi=0;Hi<yr.length;Hi++){const n=yr[Hi];n&&!(n.flags&8)&&(n.flags&4&&(n.flags&=-2),Bl(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2))}}finally{for(;Hi<yr.length;Hi++){const n=yr[Hi];n&&(n.flags&=-2)}Hi=-1,yr.length=0,F4(),G0=null,(yr.length||ts.length)&&q4()}}let Qr=null,j4=null;function K0(t){const e=Qr;return Qr=t,j4=t&&t.type.__scopeId||null,e}function N5(t,e=Qr,n){if(!e||t._n)return t;const r=(...o)=>{r._d&&O1(-1);const l=K0(e);let h;try{h=t(...o)}finally{K0(l),r._d&&O1(1)}return h};return r._n=!0,r._c=!0,r._d=!0,r}function X0(t,e){if(Qr===null)return t;const n=Hc(Qr),r=t.dirs||(t.dirs=[]);for(let o=0;o<e.length;o++){let[l,h,c,p=gn]=e[o];l&&(Bt(l)&&(l={mounted:l,updated:l}),l.deep&&ha(h),r.push({dir:l,instance:n,value:h,oldValue:void 0,arg:c,modifiers:p}))}return t}function ko(t,e,n,r){const o=t.dirs,l=e&&e.dirs;for(let h=0;h<o.length;h++){const c=o[h];l&&(c.oldValue=l[h].value);let p=c.dir[r];p&&(Sa(),Ui(p,n,8,[t.el,c,t,e]),Ea())}}const D5=Symbol("_vte"),R5=t=>t.__isTeleport,I5=Symbol("_leaveCb");function Bp(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Bp(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function $4(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function yl(t,e,n,r,o=!1){if(It(t)){t.forEach((w,S)=>yl(w,e&&(It(e)?e[S]:e),n,r,o));return}if(wl(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&yl(t,e,n,r.component.subTree);return}const l=r.shapeFlag&4?Hc(r.component):r.el,h=o?null:l,{i:c,r:p}=t,v=e&&e.r,b=c.refs===gn?c.refs={}:c.refs,g=c.setupState,m=nn(g),x=g===gn?h4:w=>rn(m,w);if(v!=null&&v!==p){if(Vn(v))b[v]=null,x(v)&&(g[v]=null);else if(fr(v)){v.value=null;const w=e;w.k&&(b[w.k]=null)}}if(Bt(p))Bl(p,c,12,[h,b]);else{const w=Vn(p),S=fr(p);if(w||S){const k=()=>{if(t.f){const C=w?x(p)?g[p]:b[p]:p.value;if(o)It(C)&&Cp(C,l);else if(It(C))C.includes(l)||C.push(l);else if(w)b[p]=[l],x(p)&&(g[p]=b[p]);else{const T=[l];p.value=T,t.k&&(b[t.k]=T)}}else w?(b[p]=h,x(p)&&(g[p]=h)):S&&(p.value=h,t.k&&(b[t.k]=h))};h?(k.id=-1,qr(k,n)):k()}}}Lc().requestIdleCallback;Lc().cancelIdleCallback;const wl=t=>!!t.type.__asyncLoader,U4=t=>t.type.__isKeepAlive;function O5(t,e){V4(t,"a",e)}function H5(t,e){V4(t,"da",e)}function V4(t,e,n=wr){const r=t.__wdc||(t.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.p
|
|||
|
|
* @vue/runtime-dom v3.5.20
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**/let zh;const F1=typeof window<"u"&&window.trustedTypes;if(F1)try{zh=F1.createPolicy("vue",{createHTML:t=>t})}catch{}const mv=zh?t=>zh.createHTML(t):t=>t,Pb="http://www.w3.org/2000/svg",zb="http://www.w3.org/1998/Math/MathML",la=typeof document<"u"?document:null,q1=la&&la.createElement("template"),Bb={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,r)=>{const o=e==="svg"?la.createElementNS(Pb,t):e==="mathml"?la.createElementNS(zb,t):n?la.createElement(t,{is:n}):la.createElement(t);return t==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:t=>la.createTextNode(t),createComment:t=>la.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>la.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,r,o,l){const h=n?n.previousSibling:e.lastChild;if(o&&(o===l||o.nextSibling))for(;e.insertBefore(o.cloneNode(!0),n),!(o===l||!(o=o.nextSibling)););else{q1.innerHTML=mv(r==="svg"?`<svg>${t}</svg>`:r==="mathml"?`<math>${t}</math>`:t);const c=q1.content;if(r==="svg"||r==="mathml"){const p=c.firstChild;for(;p.firstChild;)c.appendChild(p.firstChild);c.removeChild(p)}e.insertBefore(c,n)}return[h?h.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},Fb=Symbol("_vtc");function qb(t,e,n){const r=t[Fb];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const J0=Symbol("_vod"),gv=Symbol("_vsh"),jb={name:"show",beforeMount(t,{value:e},{transition:n}){t[J0]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):tl(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:r}){!e!=!n&&(r?e?(r.beforeEnter(t),tl(t,!0),r.enter(t)):r.leave(t,()=>{tl(t,!1)}):tl(t,e))},beforeUnmount(t,{value:e}){tl(t,e)}};function tl(t,e){t.style.display=e?t[J0]:"none",t[gv]=!e}const $b=Symbol(""),Ub=/(^|;)\s*display\s*:/;function Vb(t,e,n){const r=t.style,o=Vn(n);let l=!1;if(n&&!o){if(e)if(Vn(e))for(const h of e.split(";")){const c=h.slice(0,h.indexOf(":")).trim();n[c]==null&&R0(r,c,"")}else for(const h in e)n[h]==null&&R0(r,h,"");for(const h in n)h==="display"&&(l=!0),R0(r,h,n[h])}else if(o){if(e!==n){const h=r[$b];h&&(n+=";"+h),r.cssText=n,l=Ub.test(n)}}else e&&t.removeAttribute("style");J0 in t&&(t[J0]=l?r.display:"",t[gv]&&(r.display="none"))}const j1=/\s*!important$/;function R0(t,e,n){if(It(n))n.forEach(r=>R0(t,e,r));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const r=Wb(t,e);j1.test(n)?t.setProperty(ao(r),n.replace(j1,""),"important"):t[r]=n}}const $1=["Webkit","Moz","ms"],Fd={};function Wb(t,e){const n=Fd[e];if(n)return n;let r=Xa(e);if(r!=="filter"&&r in t)return Fd[e]=r;r=v4(r);for(let o=0;o<$1.length;o++){const l=$1[o]+r;if(l in t)return Fd[e]=l}return e}const U1="http://www.w3.org/1999/xlink";function V1(t,e,n,r,o,l=Y2(e)){r&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(U1,e.slice(6,e.length)):t.setAttributeNS(U1,e,n):n==null||l&&!y4(n)?t.removeAttribute(e):t.setAttribute(e,l?"":io(n)?String(n):n)}function W1(t,e,n,r,o){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?mv(n):n);return}const l=t.tagName;if(e==="value"&&l!=="PROGRESS"&&!l.includes("-")){const c=l==="OPTION"?t.getAttribute("value")||"":t.value,p=n==null?t.type==="checkbox"?"on":"":String(n);(c!==p||!("_value"in t))&&(t.value=p),n==null&&t.removeAttribute(e),t._value=n;return}let h=!1;if(n===""||n==null){const c=typeof t[e];c==="boolean"?n=y4(n):n==null&&c==="string"?(n="",h=!0):c==="number"&&(n=0,h=!0)}try{t[e]=n}catch{}h&&t.removeAttribute(o||e)}function Zo(t,e,n,r){t.addEventListener(e,n,r)}function Gb(t,e,n,r){t.removeEventListener(e,n,r)}const G1=Symbol("_vei");function Kb(t,e,n,r,o=null){const l=t[G1]||(t[G1]={}),h=l[e];if(r&&h)h.value=r;else{const[c,p]=Xb(e);if(r){const v=l[e]=Jb(r,o);Zo(t,c,v,p)}else h&&(Gb(t,c,h,p),l[e]=void 0)}}const K1=/(?:Once|Passive|Capture)$/;function Xb(t
|
|||
|
|
* Vditor v3.11.2 - A markdown editor written in TypeScript.
|
|||
|
|
*
|
|||
|
|
* MIT License
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2018-present B3log 开源, b3log.org
|
|||
|
|
*
|
|||
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|||
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|||
|
|
* in the Software without restriction, including without limitation the rights
|
|||
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|||
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|||
|
|
* furnished to do so, subject to the following conditions:
|
|||
|
|
*
|
|||
|
|
* The above copyright notice and this permission notice shall be included in all
|
|||
|
|
* copies or substantial portions of the Software.
|
|||
|
|
*
|
|||
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|||
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|||
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||
|
|
* SOFTWARE.
|
|||
|
|
*
|
|||
|
|
*/(function(t,e){(function(r,o){t.exports=o()})(Bh,function(){return(()=>{var n={173:h=>{var c=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},p=-1,v=1,b=0;c.Diff=function(g,m){return[g,m]},c.prototype.diff_main=function(g,m,x,w){typeof w>"u"&&(this.Diff_Timeout<=0?w=Number.MAX_VALUE:w=new Date().getTime()+this.Diff_Timeout*1e3);var S=w;if(g==null||m==null)throw new Error("Null input. (diff_main)");if(g==m)return g?[new c.Diff(b,g)]:[];typeof x>"u"&&(x=!0);var k=x,C=this.diff_commonPrefix(g,m),T=g.substring(0,C);g=g.substring(C),m=m.substring(C),C=this.diff_commonSuffix(g,m);var A=g.substring(g.length-C);g=g.substring(0,g.length-C),m=m.substring(0,m.length-C);var M=this.diff_compute_(g,m,k,S);return T&&M.unshift(new c.Diff(b,T)),A&&M.push(new c.Diff(b,A)),this.diff_cleanupMerge(M),M},c.prototype.diff_compute_=function(g,m,x,w){var S;if(!g)return[new c.Diff(v,m)];if(!m)return[new c.Diff(p,g)];var k=g.length>m.length?g:m,C=g.length>m.length?m:g,T=k.indexOf(C);if(T!=-1)return S=[new c.Diff(v,k.substring(0,T)),new c.Diff(b,C),new c.Diff(v,k.substring(T+C.length))],g.length>m.length&&(S[0][0]=S[2][0]=p),S;if(C.length==1)return[new c.Diff(p,g),new c.Diff(v,m)];var A=this.diff_halfMatch_(g,m);if(A){var M=A[0],y=A[1],N=A[2],z=A[3],F=A[4],P=this.diff_main(M,N,x,w),Y=this.diff_main(y,z,x,w);return P.concat([new c.Diff(b,F)],Y)}return x&&g.length>100&&m.length>100?this.diff_lineMode_(g,m,w):this.diff_bisect_(g,m,w)},c.prototype.diff_lineMode_=function(g,m,x){var w=this.diff_linesToChars_(g,m);g=w.chars1,m=w.chars2;var S=w.lineArray,k=this.diff_main(g,m,!1,x);this.diff_charsToLines_(k,S),this.diff_cleanupSemantic(k),k.push(new c.Diff(b,""));for(var C=0,T=0,A=0,M="",y="";C<k.length;){switch(k[C][0]){case v:A++,y+=k[C][1];break;case p:T++,M+=k[C][1];break;case b:if(T>=1&&A>=1){k.splice(C-T-A,T+A),C=C-T-A;for(var N=this.diff_main(M,y,!1,x),z=N.length-1;z>=0;z--)k.splice(C,0,N[z]);C=C+N.length}A=0,T=0,M="",y="";break}C++}return k.pop(),k},c.prototype.diff_bisect_=function(g,m,x){for(var w=g.length,S=m.length,k=Math.ceil((w+S)/2),C=k,T=2*k,A=new Array(T),M=new Array(T),y=0;y<T;y++)A[y]=-1,M[y]=-1;A[C+1]=0,M[C+1]=0;for(var N=w-S,z=N%2!=0,F=0,P=0,Y=0,te=0,ce=0;ce<k&&!(new Date().getTime()>x);ce++){for(var Me=-ce+F;Me<=ce-P;Me+=2){var Fe=C+Me,We;Me==-ce||Me!=ce&&A[Fe-1]<A[Fe+1]?We=A[Fe+1]:We=A[Fe-1]+1;for(var rt=We-Me;We<w&&rt<S&&g.charAt(We)==m.charAt(rt);)We++,rt++;if(A[Fe]=We,We>w)P+=2;else if(rt>S)F+=2;else if(z){var je=C+N-Me;if(je>=0&&je<T&&M[je]!=-1){var Ne=w-M[je];if(We>=Ne)return this.diff_bisectSplit_(g,m,We,rt,x)}}}for(var nt=-ce+Y;nt<=ce-te;nt+=2){var je=C+nt,Ne;nt==-ce||nt!=ce&&M[je-1]<M[je+1]?Ne=M[je+1]:Ne=M[je-1]+1;for(var ct=Ne-nt;Ne<w&&ct<S&&g.charAt(w-Ne-1)==m.charAt(S-ct-1);)Ne++,ct++;if(M[je]=Ne,Ne>w)te+=2;else if(ct>S)Y+=2;else if(!z){var Fe=C+N-nt;if(Fe>=0&&Fe<T&&A[Fe]!=-1){var We=A[Fe],rt=C+We-Fe;if(Ne=w-Ne,We>=Ne)return this.diff_bisectSplit_(g,m,We,rt,x)}}}}return[new c.Diff(p,g),new c.Diff(v,m)]},c.prototype.diff_bisectSplit_=function(g,m,x,w,S){var k=g.substring(0,x),C=m.substring(0,w),T=g.substring(x),A=m.substring(w),M=this.diff_main(k,C,!1,S),y=this.diff_main(T,A,!1,S);return M.concat(y)},c.prototype.diff_linesToChars_=function(g,m){var x=[],w={};x[0]="";function S(A){for(var M="",y=0,N=-1,z=x.length;N<A.length-1;){N=A.indexOf(`
|
|||
|
|
`,y),N==-1&&(N=A.length-1);var F=A.substring(y,N+1);(w.hasOwnProperty?w.hasOwnProperty(F):w[F]!==void 0)?M+=String.fromCharCode(w[F]):(z==k&&(F=A.substring(y),N=A.length),M+=String.fromCharCode(z),w[F]=z,x[z++]=F),y=N+1}return M}var k=4e4,C=S(g);k=65535;var T=S(m);return{chars1:C,chars2:T,lineArray:x}},c.prototype.diff_charsToLines_=function(g,m){for(var x=0;x<g.length;x++){for(var w=g[x][1],S=[],k=0;k<w.length;k++)S[k]=m[w.charCodeAt(k)];g[x][1]=S.join("")}},c.prototype.diff_commonPrefix=function(g,m){if(!g||!m||g.charAt(0)!=m.charAt(0))return 0;for(var x=0,w=Math.min(g.length,m.length),S=w,k=0;x<S;)g.substring(k,S)==m.substring(k,S)?(x=S,k=x):w=S,S=Math.floor((w-x)/2+x);return S},c.prototype.diff_commonSuffix=function(g,m){if(!g||!m||g.charAt(g.length-1)!=m.charAt(m.length-1))return 0;for(var x=0,w=Math.min(g.length,m.length),S=w,k=0;x<S;)g.substring(g.length-S,g.length-k)==m.substring(m.length-S,m.length-k)?(x=S,k=x):w=S,S=Math.floor((w-x)/2+x);return S},c.prototype.diff_commonOverlap_=function(g,m){var x=g.length,w=m.length;if(x==0||w==0)return 0;x>w?g=g.substring(x-w):x<w&&(m=m.substring(0,x));var S=Math.min(x,w);if(g==m)return S;for(var k=0,C=1;;){var T=g.substring(S-C),A=m.indexOf(T);if(A==-1)return k;C+=A,(A==0||g.substring(S-C)==m.substring(0,C))&&(k=C,C++)}},c.prototype.diff_halfMatch_=function(g,m){if(this.Diff_Timeout<=0)return null;var x=g.length>m.length?g:m,w=g.length>m.length?m:g;if(x.length<4||w.length*2<x.length)return null;var S=this;function k(P,Y,te){for(var ce=P.substring(te,te+Math.floor(P.length/4)),Me=-1,Fe="",We,rt,je,Ne;(Me=Y.indexOf(ce,Me+1))!=-1;){var nt=S.diff_commonPrefix(P.substring(te),Y.substring(Me)),ct=S.diff_commonSuffix(P.substring(0,te),Y.substring(0,Me));Fe.length<ct+nt&&(Fe=Y.substring(Me-ct,Me)+Y.substring(Me,Me+nt),We=P.substring(0,te-ct),rt=P.substring(te+nt),je=Y.substring(0,Me-ct),Ne=Y.substring(Me+nt))}return Fe.length*2>=P.length?[We,rt,je,Ne,Fe]:null}var C=k(x,w,Math.ceil(x.length/4)),T=k(x,w,Math.ceil(x.length/2)),A;if(!C&&!T)return null;T?C?A=C[4].length>T[4].length?C:T:A=T:A=C;var M,y,N,z;g.length>m.length?(M=A[0],y=A[1],N=A[2],z=A[3]):(N=A[0],z=A[1],M=A[2],y=A[3]);var F=A[4];return[M,y,N,z,F]},c.prototype.diff_cleanupSemantic=function(g){for(var m=!1,x=[],w=0,S=null,k=0,C=0,T=0,A=0,M=0;k<g.length;)g[k][0]==b?(x[w++]=k,C=A,T=M,A=0,M=0,S=g[k][1]):(g[k][0]==v?A+=g[k][1].length:M+=g[k][1].length,S&&S.length<=Math.max(C,T)&&S.length<=Math.max(A,M)&&(g.splice(x[w-1],0,new c.Diff(p,S)),g[x[w-1]+1][0]=v,w--,w--,k=w>0?x[w-1]:-1,C=0,T=0,A=0,M=0,S=null,m=!0)),k++;for(m&&this.diff_cleanupMerge(g),this.diff_cleanupSemanticLossless(g),k=1;k<g.length;){if(g[k-1][0]==p&&g[k][0]==v){var y=g[k-1][1],N=g[k][1],z=this.diff_commonOverlap_(y,N),F=this.diff_commonOverlap_(N,y);z>=F?(z>=y.length/2||z>=N.length/2)&&(g.splice(k,0,new c.Diff(b,N.substring(0,z))),g[k-1][1]=y.substring(0,y.length-z),g[k+1][1]=N.substring(z),k++):(F>=y.length/2||F>=N.length/2)&&(g.splice(k,0,new c.Diff(b,y.substring(0,F))),g[k-1][0]=v,g[k-1][1]=N.substring(0,N.length-F),g[k+1][0]=p,g[k+1][1]=y.substring(F),k++),k++}k++}},c.prototype.diff_cleanupSemanticLossless=function(g){function m(F,P){if(!F||!P)return 6;var Y=F.charAt(F.length-1),te=P.charAt(0),ce=Y.match(c.nonAlphaNumericRegex_),Me=te.match(c.nonAlphaNumericRegex_),Fe=ce&&Y.match(c.whitespaceRegex_),We=Me&&te.match(c.whitespaceRegex_),rt=Fe&&Y.match(c.linebreakRegex_),je=We&&te.match(c.linebreakRegex_),Ne=rt&&F.match(c.blanklineEndRegex_),nt=je&&P.match(c.blanklineStartRegex_);return Ne||nt?5:rt||je?4:ce&&!Fe&&We?3:Fe||We?2:ce||Me?1:0}for(var x=1;x<g.length-1;){if(g[x-1][0]==b&&g[x+1][0]==b){var w=g[x-1][1],S=g[x][1],k=g[x+1][1],C=this.diff_commonSuffix(w,S);if(C){var T=S.substring(S.length-C);w=w.substring(0,w.length-C),S=T+S.substring(0,S.length-C),k=T+k}for(var A=w,M=S,y=k,N=m(w,S)+m(S,k);S.charAt(0)===k.charAt(0);){w+=S.charAt(0),S=S.substring(1)+k.charAt(0),k=k.substring(1);var z=m(w,S)+m(S,k);z>=N&&(N=z,A=w,M=S,y=k)}g[x-1][1]!=A&&(A?g[x-1][1]=A:(g.splice(x-1,1),x--),g[x][1]=M,y?g[x+1][1]=y:(g.splice(x+1,1),x--))}x++}},c.nonAlphaNumericRegex_=/[^a-zA-Z0-
|
|||
|
|
`),w=0,S=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;w<x.length;){var k=x[w].match(S);if(!k)throw new Error("Invalid patch string: "+x[w]);var C=new c.patch_obj;for(m.push(C),C.start1=parseInt(k[1],10),k[2]===""?(C.start1--,C.length1=1):k[2]=="0"?C.length1=0:(C.start1--,C.length1=parseInt(k[2],10)),C.start2=parseInt(k[3],10),k[4]===""?(C.start2--,C.length2=1):k[4]=="0"?C.length2=0:(C.start2--,C.length2=parseInt(k[4],10)),w++;w<x.length;){var T=x[w].charAt(0);try{var A=decodeURI(x[w].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+A)}if(T=="-")C.diffs.push(new c.Diff(p,A));else if(T=="+")C.diffs.push(new c.Diff(v,A));else if(T==" ")C.diffs.push(new c.Diff(b,A));else{if(T=="@")break;if(T!=="")throw new Error('Invalid patch mode "'+T+'" in: '+A)}w++}}return m},c.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},c.patch_obj.prototype.toString=function(){var g,m;this.length1===0?g=this.start1+",0":this.length1==1?g=this.start1+1:g=this.start1+1+","+this.length1,this.length2===0?m=this.start2+",0":this.length2==1?m=this.start2+1:m=this.start2+1+","+this.length2;for(var x=["@@ -"+g+" +"+m+` @@
|
|||
|
|
`],w,S=0;S<this.diffs.length;S++){switch(this.diffs[S][0]){case v:w="+";break;case p:w="-";break;case b:w=" ";break}x[S+1]=w+encodeURI(this.diffs[S][1])+`
|
|||
|
|
`}return x.join("").replace(/%20/g," ")},h.exports=c,h.exports.diff_match_patch=c,h.exports.DIFF_DELETE=p,h.exports.DIFF_INSERT=v,h.exports.DIFF_EQUAL=b},408:(h,c,p)=>{p.d(c,{default:()=>Nt});var v=p(135),b=p(840),g=p(775),m=p(428),x=p(325),w=p(483),S=p(999),k=function(oe){oe===void 0&&(oe=document);var he=function(J){var ee=document.createElement("img");ee.src=J.getAttribute("data-src"),ee.addEventListener("load",function(){!J.getAttribute("style")&&!J.getAttribute("class")&&!J.getAttribute("width")&&!J.getAttribute("height")&&ee.naturalHeight>ee.naturalWidth&&ee.naturalWidth/ee.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&ee.naturalHeight>window.innerHeight-40&&(J.style.height=window.innerHeight-40+"px"),J.src=ee.src}),J.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return oe.querySelectorAll("img").forEach(function(J){J.getAttribute("data-src")&&he(J)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),oe.querySelectorAll("img").forEach(function(J){window.vditorImageIntersectionObserver.observe(J)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(J){J.forEach(function(ee){(typeof ee.isIntersecting>"u"?ee.intersectionRatio!==0:ee.isIntersecting)&&ee.target.getAttribute("data-src")&&he(ee.target)})}),oe.querySelectorAll("img").forEach(function(J){window.vditorImageIntersectionObserver.observe(J)}))},C=p(472),T=p(280),A=p(637),M=p(825),y=p(11),N=p(194),z=p(436),F=p(229),P=p(145),Y=p(538),te=p(413),ce=p(106),Me=p(673),Fe=function(oe){document.querySelectorAll(".vditor-anchor").forEach(function(he){oe===1&&he.classList.add("vditor-anchor--left"),he.onclick=function(){var J=he.getAttribute("href").substr(1),ee=document.getElementById("vditorAnchor-"+J).offsetTop;document.querySelector("html").scrollTop=ee}}),window.onhashchange=function(){var he=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));he&&(document.querySelector("html").scrollTop=he.offsetTop)}},We=p(214),rt=p(810),je=function(oe,he){if(he===void 0&&(he="zh_CN"),!(typeof speechSynthesis>"u"||typeof SpeechSynthesisUtterance>"u")){var J=function(){var be=speechSynthesis.getVoices(),le,ye;return be.forEach(function(Ae){Ae.lang===he.replace("_","-")&&(le=Ae),Ae.default&&(ye=Ae)}),le||(le=ye),le},ee='<svg><use xlink:href="#vditor-icon-play"></use></svg>',Ce='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(ee='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',Ce='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var se=document.querySelector(".vditor-speech");se||(se=document.createElement("button"),se.className="vditor-speech",oe.insertAdjacentElement("beforeend",se),speechSynthesis.onvoiceschanged!==void 0&&(speechSynthesis.onvoiceschanged=J));var G=J(),X=new SpeechSynthesisUtterance;X.voice=G,X.onend=X.onerror=function(){se.style.display="none",speechSynthesis.cancel(),se.classList.remove("vditor-speech--current"),se.innerHTML=ee},oe.addEventListener(window.ontouchstart!==void 0?"touchend":"click",function(be){var le=be.target;if(le.classList.contains("vditor-speech")||le.parentElement.classList.contains("vditor-speech")){se.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),se.innerHTML=Ce):(speechSynthesis.pause(),se.innerHTML=ee)):(X.text=se.getAttribute("data-text"),speechSynthesis.speak(X),se.classList.add("vditor-speech--current"),se.innerHTML=Ce),(0,rt.Hc)(window.vditorSpeechRange),oe.focus();return}if(se.style.display="none",speechSynthesis.cancel(),se.classList.remove("vditor-speech--current"),se.innerHTML=ee,getSelection().rangeCount!==0){var ye=getSelection().getRangeAt(0),Ae=ye.toString().trim();if(Ae){window.vditorSpeechRange=ye.cloneRange();var ze=ye.getBoundingClientRect();se.innerHTML=ee,se.style.display="block",se.style.top=ze.top+ze.height+document.queryS
|
|||
|
|
`)&&(T=T.substr(0,T.length-1));var M='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(M='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var y=document.createElement("div");y.className="vditor-copy",y.innerHTML='<span aria-label="'.concat(((S=window.VditorI18n)===null||S===void 0?void 0:S.copy)||"复制",`"
|
|||
|
|
onmouseover="this.setAttribute('aria-label', '`).concat(((k=window.VditorI18n)===null||k===void 0?void 0:k.copy)||"复制",`')"
|
|||
|
|
class="vditor-tooltipped vditor-tooltipped__w"
|
|||
|
|
onclick="event.stopPropagation();this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`).concat(((C=window.VditorI18n)===null||C===void 0?void 0:C.copied)||"已复制",`');this.previousElementSibling.blur()">`).concat(M,"</span>");var N=document.createElement("textarea");N.value=(0,v.X)(T),y.insertAdjacentElement("afterbegin",N),x&&x.renderMenu&&x.renderMenu(w,y),w.before(y),w.style.maxHeight=window.outerHeight-40+"px",w.insertAdjacentHTML("afterend",'<span style="position: absolute">'.concat(b.g.ZWSP,"</span>"))})}},325:(h,c,p)=>{p.d(c,{P:()=>m});var v=p(145),b=p(413),g=p(840),m=function(x,w){w===void 0&&(w=v.g.CDN);var S=g.flowchartRenderAdapter.getElements(x);S.length!==0&&(0,b.G)("".concat(w,"/dist/js/flowchart.js/flowchart.min.js"),"vditorFlowchartScript").then(function(){S.forEach(function(k){if(k.getAttribute("data-processed")!=="true"){var C=flowchart.parse(g.flowchartRenderAdapter.getCode(k));k.innerHTML="",C.drawSVG(k),k.setAttribute("data-processed","true")}})})}},483:(h,c,p)=>{p.d(c,{v:()=>m});var v=p(145),b=p(413),g=p(840),m=function(x,w){w===void 0&&(w=v.g.CDN);var S=g.graphvizRenderAdapter.getElements(x);S.length!==0&&(0,b.G)("".concat(w,"/dist/js/graphviz/viz.js"),"vditorGraphVizScript").then(function(){S.forEach(function(k){var C=g.graphvizRenderAdapter.getCode(k);if(!(k.parentElement.classList.contains("vditor-wysiwyg__pre")||k.parentElement.classList.contains("vditor-ir__marker--pre"))&&!(k.getAttribute("data-processed")==="true"||C.trim()==="")){try{var T=new Blob(["importScripts('".concat(document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js"),"');")],{type:"application/javascript"}),A=window.URL||window.webkitURL,M=A.createObjectURL(T),y=new Worker(M);new Viz({worker:y}).renderSVGElement(C).then(function(N){k.innerHTML=N.outerHTML}).catch(function(N){k.innerHTML="graphviz render error: <br>".concat(N),k.className="vditor-reset--error"})}catch(N){console.error("graphviz error",N)}k.setAttribute("data-processed","true")}})})}},999:(h,c,p)=>{p.d(c,{s:()=>m});var v=p(145),b=p(413),g=p(290),m=function(x,w,S){w===void 0&&(w=document),S===void 0&&(S=v.g.CDN);var k=x.style;v.g.CODE_THEME.includes(k)||(k="github");var C=document.getElementById("vditorHljsStyle"),T="".concat(S,"/dist/js/highlight.js/styles/").concat(k,".min.css");if(C&&C.getAttribute("href")!==T&&C.remove(),(0,g.c)("".concat(S,"/dist/js/highlight.js/styles/").concat(k,".min.css"),"vditorHljsStyle"),x.enable!==!1){var A=w.querySelectorAll("pre > code");A.length!==0&&(0,b.G)("".concat(S,"/dist/js/highlight.js/highlight.min.js?v=11.7.0"),"vditorHljsScript").then(function(){(0,b.G)("".concat(S,"/dist/js/highlight.js/third-languages.js?v=1.0.1"),"vditorHljsThirdScript").then(function(){w.querySelectorAll("pre > code").forEach(function(M){if(!(M.parentElement.classList.contains("vditor-ir__marker--pre")||M.parentElement.classList.contains("vditor-wysiwyg__pre"))&&!(M.classList.contains("language-mermaid")||M.classList.contains("language-flowchart")||M.classList.contains("language-echarts")||M.classList.contains("language-mindmap")||M.classList.contains("language-plantuml")||M.classList.contains("language-smiles")||M.classList.contains("language-abc")||M.classList.contains("language-graphviz")||M.classList.contains("language-math"))){x.defaultLang!==""&&M.className.indexOf("language-")===-1&&M.classList.add("language-"+x.defaultLang);var y=M.className.replace("language-","");if(window.hljs.getLanguage(y)||(y="plaintext"),M.innerHTML=window.hljs.highlight(M.textContent,{language:y,ignoreIllegals:!0}).value,M.classList.add("hljs"),!!x.lineNumber){M.classList.add("vditor-linenumber");var N=M.querySelector(".vditor-linenumber__temp");N||(N=document.createElement("div"),N.className="vditor-linenumber__temp",M.insertAdjacentElement("beforeend",N));var z=getComputedStyle(M).whiteSpace,F=!1;(z==="pre-wrap"||z==="pre-line")&&(F=!0);var P="",Y=M.textContent.split(/\r\n|\r|\n/g);Y.pop(),Y.map(function(te){var ce="";F&&(N.textContent=te||`
|
|||
|
|
`,ce=' style="height:'.concat(N.getBoundingClientRect().height,'px"')),P+="<span".concat(ce,"></span>")}),N.style.display="none",P='<span class="vditor-linenumber__rows">'.concat(P,"</span>"),M.insertAdjacentHTML("beforeend",P)}}})})})}}},11:(h,c,p)=>{p.d(c,{K:()=>S});var v=p(145),b=p(413),g=p(840),m={},x=function(k,C){var T=k.transform(C),A=Object.keys(T.features).filter(function(F){return!m[F]});A.forEach(function(F){m[F]=!0});var M=k.getAssets(A),y=M.styles,N=M.scripts,z=window.markmap;return y&&z.loadCSS(y),N&&z.loadJS(N),T},w=function(k,C){var T=window.markmap,A=T.Transformer,M=T.Markmap,y=T.deriveOptions;T.globalCSS;var N=new A;k.innerHTML='<svg style="width:100%"></svg>';var z=k.firstChild,F=M.create(z,null),P=x(N,C),Y=P.root,te=P.frontmatter,ce=te==null?void 0:te.markmap,Me=y(ce);F.setData(Y,Me),F.fit()},S=function(k,C){k===void 0&&(k=document),C===void 0&&(C=v.g.CDN);var T=g.markmapRenderAdapter.getElements(k);T.length!==0&&(0,b.G)("".concat(C,"/dist/js/markmap/markmap.min.js"),"vditorMarkerScript").then(function(){T.forEach(function(A){var M=g.markmapRenderAdapter.getCode(A);if(!(A.getAttribute("data-processed")==="true"||M.trim()==="")){var y=document.createElement("div");y.className="language-markmap",A.parentNode.appendChild(y),w(y,M),A.parentNode.childNodes[0].nodeName=="CODE"&&A.parentNode.removeChild(A.parentNode.childNodes[0])}})})}},472:(h,c,p)=>{p.d(c,{H:()=>w});var v=p(145),b=p(413),g=p(290),m=p(105),x=p(840),w=function(S,k){S===void 0&&(S=document);var C=x.mathRenderAdapter.getElements(S);if(C.length!==0){var T={cdn:v.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(k&&k.math&&(k.math=Object.assign({},T.math,k.math)),k=Object.assign({},T,k),k.math.engine==="KaTeX")(0,g.c)("".concat(k.cdn,"/dist/js/katex/katex.min.css?v=0.16.9"),"vditorKatexStyle"),(0,b.G)("".concat(k.cdn,"/dist/js/katex/katex.min.js?v=0.16.9"),"vditorKatexScript").then(function(){(0,b.G)("".concat(k.cdn,"/dist/js/katex/mhchem.min.js?v=0.16.9"),"vditorKatexChemScript").then(function(){C.forEach(function(y){if(!(y.parentElement.classList.contains("vditor-wysiwyg__pre")||y.parentElement.classList.contains("vditor-ir__marker--pre"))&&!y.getAttribute("data-math")){var N=(0,m.X)(x.mathRenderAdapter.getCode(y));y.setAttribute("data-math",N);try{y.innerHTML=katex.renderToString(N,{displayMode:y.tagName==="DIV",output:"html",macros:k.math.macros})}catch(z){y.innerHTML=z.message,y.className="language-math vditor-reset--error"}y.addEventListener("copy",function(z){z.stopPropagation(),z.preventDefault();var F=z.currentTarget.closest(".language-math");z.clipboardData.setData("text/html",F.innerHTML),z.clipboardData.setData("text/plain",F.getAttribute("data-math"))})}})})});else if(k.math.engine==="MathJax"){var A=function(y){if(y.length!==0){var N=0,z=y[y.length-1],F=function(){var P=y[N++];P===z?P():P(F)};F()}};window.MathJax||(window.MathJax={loader:{paths:{mathjax:"".concat(k.cdn,"/dist/js/mathjax")}},startup:{typeset:!1},tex:{macros:k.math.macros}},Object.assign(window.MathJax,k.math.mathJaxOptions)),(0,b.J)("".concat(k.cdn,"/dist/js/mathjax/tex-svg-full.js"),"protyleMathJaxScript");var M=function(y,N){var z=(0,m.X)(y.textContent).trim(),F=window.MathJax.getMetricsFor(y);F.display=y.tagName==="DIV",window.MathJax.tex2svgPromise(z,F).then(function(P){y.innerHTML="",y.setAttribute("data-math",z),y.append(P),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var Y=P.querySelector('[data-mml-node="merror"]');Y&&Y.textContent.trim()!==""&&(y.innerHTML=Y.textContent.trim(),y.className="vditor-reset--error"),N&&N()})};window.MathJax.startup.promise.then(function(){for(var y=[],N=function(F){var P=C[F];!P.parentElement.classList.contains("vditor-wysiwyg__pre")&&!P.parentElement.classList.contains("vditor-ir__marker--pre")&&!P.getAttribute("data-math")&&(0,m.X)(P.textContent).trim()&&y.push(function(Y){F===C.length-1?M(P):M(P,Y)})},z=0;z<C.length;z++)N(z);A(y)})}}}},280:(h,c,p)=>{p.d(c,{Y:()=>x});var v=p(494),b=function(w,S){w.insertAdjacentHTML("afterend",'<video controls="controls" src="'.concat(S,'"></
|
|||
|
|
src="//coub.com/embed/`.concat(A[1],'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>')),w.remove();else if(M&&M[0])w.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
|
|||
|
|
src="https://www.facebook.com/plugins/video.php?href=`.concat(encodeURIComponent(M[0]),'"></iframe>')),w.remove();else if(y&&y[2])w.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
|
|||
|
|
src="https://www.dailymotion.com/embed/video/`.concat(y[2],'"></iframe>')),w.remove();else if(S.indexOf("bilibili.com")>-1&&(S.indexOf("bvid=")>-1||N&&N[1])){var F={bvid:(0,v.on)("bvid",S)||N&&N[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(S.startsWith("http")?S:"https:"+S).search.split("&").forEach(function(te,ce){if(te){ce===0&&(te=te.substr(1));var Me=te.split("=");F[Me[0]]=Me[1]}});var P="https://player.bilibili.com/player.html?",Y=Object.keys(F);Y.forEach(function(te,ce){P+="".concat(te,"=").concat(F[te]),ce<Y.length-1&&(P+="&")}),w.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'.concat(P,'"></iframe>')),w.remove()}else z&&z[1]&&(w.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'.concat(z[1],'"></iframe>')),w.remove())},x=function(w){w&&w.querySelectorAll("a").forEach(function(S){var k=S.getAttribute("href");k&&(k.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?b(S,k):k.match(/^.+.(mp3|wav|flac)$/)?g(S,k):m(S,k))})}},637:(h,c,p)=>{p.d(c,{i:()=>S});var v=p(145),b=p(413),g=p(840),m=p(494),x=function(k,C,T,A){function M(y){return y instanceof T?y:new T(function(N){N(y)})}return new(T||(T=Promise))(function(y,N){function z(Y){try{P(A.next(Y))}catch(te){N(te)}}function F(Y){try{P(A.throw(Y))}catch(te){N(te)}}function P(Y){Y.done?y(Y.value):M(Y.value).then(z,F)}P((A=A.apply(k,C||[])).next())})},w=function(k,C){var T={label:0,sent:function(){if(y[0]&1)throw y[1];return y[1]},trys:[],ops:[]},A,M,y,N;return N={next:z(0),throw:z(1),return:z(2)},typeof Symbol=="function"&&(N[Symbol.iterator]=function(){return this}),N;function z(P){return function(Y){return F([P,Y])}}function F(P){if(A)throw new TypeError("Generator is already executing.");for(;N&&(N=0,P[0]&&(T=0)),T;)try{if(A=1,M&&(y=P[0]&2?M.return:P[0]?M.throw||((y=M.return)&&y.call(M),0):M.next)&&!(y=y.call(M,P[1])).done)return y;switch(M=0,y&&(P=[P[0]&2,y.value]),P[0]){case 0:case 1:y=P;break;case 4:return T.label++,{value:P[1],done:!1};case 5:T.label++,M=P[1],P=[0];continue;case 7:P=T.ops.pop(),T.trys.pop();continue;default:if(y=T.trys,!(y=y.length>0&&y[y.length-1])&&(P[0]===6||P[0]===2)){T=0;continue}if(P[0]===3&&(!y||P[1]>y[0]&&P[1]<y[3])){T.label=P[1];break}if(P[0]===6&&T.label<y[1]){T.label=y[1],y=P;break}if(y&&T.label<y[2]){T.label=y[2],T.ops.push(P);break}y[2]&&T.ops.pop(),T.trys.pop();continue}P=C.call(k,T)}catch(Y){P=[6,Y],M=0}finally{A=y=0}if(P[0]&5)throw P[1];return{value:P[0]?P[1]:void 0,done:!0}}},S=function(k,C,T){k===void 0&&(k=document),C===void 0&&(C=v.g.CDN);var A=g.mermaidRenderAdapter.getElements(k);A.length!==0&&(0,b.G)("".concat(C,"/dist/js/mermaid/mermaid.min.js?v=11.6.0"),"vditorMermaidScript").then(function(){var M={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};T==="dark"&&(M.theme="dark"),mermaid.initialize(M),A.forEach(function(y){return x(void 0,void 0,void 0,function(){var N,z,F,P,Y;return w(this,function(te){switch(te.label){case 0:if(N=g.mermaidRenderAdapter.getCode(y),y.getAttribute("data-processed")==="true"||N.trim()==="")return[2];z="mermaid"+(0,m.Wb)(),te.label=1;case 1:return te.trys.push([1,3,,4]),[4,mermaid.render(z,y.textContent)];case 2:return F=te.sent(),y.innerHTML=F.svg,[3,4];case 3:return P=te.sent(),Y=document.querySelector("#"+z),y.innerHTML="".concat(Y.outerHTML,`<br>
|
|||
|
|
<div style="text-align: left"><small>`).concat(P.message.replace(/\n/,"<br>"),"</small></div>"),Y.parentElement.remove(),[3,4];case 4:return y.setAttribute("data-processed","true"),[2]}})})})})}},194:(h,c,p)=>{p.d(c,{P:()=>m});var v=p(145),b=p(413),g=p(840),m=function(x,w,S){x===void 0&&(x=document),w===void 0&&(w=v.g.CDN);var k=g.mindmapRenderAdapter.getElements(x);k.length>0&&(0,b.G)("".concat(w,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){k.forEach(function(C){if(!(C.parentElement.classList.contains("vditor-wysiwyg__pre")||C.parentElement.classList.contains("vditor-ir__marker--pre"))){var T=g.mindmapRenderAdapter.getCode(C);if(T)try{if(C.getAttribute("data-processed")==="true")return;echarts.init(C,S==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(T))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(A,M){var y;return!((y=M==null?void 0:M.data)===null||y===void 0)&&y.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),C.setAttribute("data-processed","true")}catch(A){C.className="vditor-reset--error",C.innerHTML="mindmap render error: <br>".concat(A)}}})})}},436:(h,c,p)=>{p.d(c,{k:()=>g});var v=p(771),b=p(472),g=function(m,x,w){var S="",k=[];if(Array.from(m.children).forEach(function(M,y){if((0,v.W)(M)){if(w){var N=M.id.lastIndexOf("_");M.id=M.id.substring(0,N===-1?void 0:N)+"_"+y}k.push(M.id),S+=M.outerHTML.replace("<wbr>","")}}),S==="")return x.innerHTML="","";var C=document.createElement("div");if(w)w.lute.SetToC(!0),w.currentMode==="wysiwyg"&&!w.preview.element.contains(m)?C.innerHTML=w.lute.SpinVditorDOM("<p>[ToC]</p>"+S):w.currentMode==="ir"&&!w.preview.element.contains(m)?C.innerHTML=w.lute.SpinVditorIRDOM("<p>[ToC]</p>"+S):C.innerHTML=w.lute.HTML2VditorDOM("<p>[ToC]</p>"+S),w.lute.SetToC(w.options.preview.markdown.toc);else{x.classList.add("vditor-outline");var T=Lute.New();T.SetToC(!0),C.innerHTML=T.HTML2VditorDOM("<p>[ToC]</p>"+S)}var A=C.firstElementChild.querySelectorAll("li > span[data-target-id]");return A.forEach(function(M,y){if(M.nextElementSibling&&M.nextElementSibling.tagName==="UL"){var N="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(N='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),M.innerHTML="".concat(N,"<span>").concat(M.innerHTML,"</span>")}else M.innerHTML="<svg></svg><span>".concat(M.innerHTML,"</span>");M.setAttribute("data-target-id",k[y])}),S=C.firstElementChild.innerHTML,A.length===0?(x.innerHTML="",S):(x.innerHTML=S,w&&(0,b.H)(x,{cdn:w.options.cdn,math:w.options.preview.math}),x.firstElementChild.addEventListener("click",function(M){for(var y=M.target;y&&!y.isEqualNode(x);){if(y.classList.contains("vditor-outline__action")){y.classList.contains("vditor-outline__action--close")?(y.classList.remove("vditor-outline__action--close"),y.parentElement.nextElementSibling.setAttribute("style","display:block")):(y.classList.add("vditor-outline__action--close"),y.parentElement.nextElementSibling.setAttribute("style","display:none")),M.preventDefault(),M.stopPropagation();break}else if(y.getAttribute("data-target-id")){M.preventDefault(),M.stopPropagation();var N=document.getElementById(y.getAttribute("data-target-id"));if(!N)return;if(w)if(w.options.height==="auto"){var z=N.offsetTop+w.element.offsetTop;w.options.toolbarConfig.pin||(z+=w.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,z)}else w.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,w.element.offsetTop),w.preview.element.contains(m)?m.parentElement.scrollTop=N.offsetTop:m.scrollTop=N.offsetTop;else window.scrollTo(window.scrollX,N.offsetTop);break}y=y.parentElement}}),S)}},229:(
|
|||
|
|
<div class="vditor-img__bar">
|
|||
|
|
<span class="vditor-img__btn" data-deg="0">
|
|||
|
|
<svg><use xlink:href="#vditor-icon-redo"></use></svg>
|
|||
|
|
`).concat(window.VditorI18n.spin,`
|
|||
|
|
</span>
|
|||
|
|
<span class="vditor-img__btn" onclick="this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''">
|
|||
|
|
X `).concat(window.VditorI18n.close,`
|
|||
|
|
</span>
|
|||
|
|
</div>
|
|||
|
|
<div class="vditor-img__img" onclick="this.parentElement.outerHTML = '';document.body.style.overflow = ''">
|
|||
|
|
<img style="width: `).concat(b.width,"px;height:").concat(b.height,"px;transform: translate3d(").concat(x.left,"px, ").concat(x.top-w,'px, 0)" src="').concat(b.getAttribute("src"),`">
|
|||
|
|
</div>
|
|||
|
|
</div>`)),document.body.style.overflow="hidden";var S=document.querySelector(".vditor-img img"),k="translate3d(".concat(Math.max(0,window.innerWidth-b.naturalWidth)/2,"px, ").concat(Math.max(0,window.innerHeight-w-b.naturalHeight)/2,"px, 0)");setTimeout(function(){S.setAttribute("style","transition: transform .3s ease-in-out;transform: ".concat(k)),setTimeout(function(){S.parentElement.scrollTo((S.parentElement.scrollWidth-S.parentElement.clientWidth)/2,(S.parentElement.scrollHeight-S.parentElement.clientHeight)/2)},400)});var C=document.querySelector(".vditor-img__btn");C.addEventListener("click",function(){var T=parseInt(C.getAttribute("data-deg"),10)+90;T/90%2===1&&b.naturalWidth>S.parentElement.clientHeight?S.style.transform="translate3d(".concat(Math.max(0,window.innerWidth-b.naturalWidth)/2,"px, ").concat(b.naturalWidth/2-b.naturalHeight/2,"px, 0) rotateZ(").concat(T,"deg)"):S.style.transform="".concat(k," rotateZ(").concat(T,"deg)"),C.setAttribute("data-deg",T.toString()),setTimeout(function(){S.parentElement.scrollTo((S.parentElement.scrollWidth-S.parentElement.clientWidth)/2,(S.parentElement.scrollHeight-S.parentElement.clientHeight)/2)},400)})}},580:(h,c,p)=>{p.d(c,{Y:()=>g});var v=p(145),b=p(290),g=function(m,x){x===void 0&&(x=v.g.CDN),v.g.CODE_THEME.includes(m)||(m="github");var w=document.getElementById("vditorHljsStyle"),S="".concat(x,"/dist/js/highlight.js/styles/").concat(m,".min.css");w?w.getAttribute("href")!==S&&(w.remove(),(0,b.c)(S,"vditorHljsStyle")):(0,b.c)(S,"vditorHljsStyle")}},538:(h,c,p)=>{p.d(c,{Z:()=>b});var v=p(290),b=function(g,m){if(!(!g||!m)){var x=document.getElementById("vditorContentTheme"),w="".concat(m,"/").concat(g,".css");x?x.getAttribute("href")!==w&&(x.remove(),(0,v.c)(w,"vditorContentTheme")):(0,v.c)(w,"vditorContentTheme")}}},413:(h,c,p)=>{p.d(c,{J:()=>v,G:()=>b});var v=function(g,m){if(document.getElementById(m))return!1;var x=new XMLHttpRequest;x.open("GET",g,!1),x.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),x.send("");var w=document.createElement("script");w.type="text/javascript",w.text=x.responseText,w.id=m,document.head.appendChild(w)},b=function(g,m){return new Promise(function(x,w){if(document.getElementById(m))return x(!0),!1;var S=document.createElement("script");S.src=g,S.async=!0,document.head.appendChild(S),S.onerror=function(k){w(k)},S.onload=function(){if(document.getElementById(m))return S.remove(),x(!0),!1;S.id=m,x(!0)}})}},290:(h,c,p)=>{p.d(c,{c:()=>v});var v=function(b,g){if(!document.getElementById(g)){var m=document.createElement("link");m.id=g,m.rel="stylesheet",m.type="text/css",m.href=b,document.getElementsByTagName("head")[0].appendChild(m)}}},105:(h,c,p)=>{p.d(c,{X:()=>v});var v=function(b){return b.replace(/\u00a0/g," ")}},410:(h,c,p)=>{p.d(c,{G6:()=>v,vU:()=>b,pK:()=>g,Le:()=>m,yl:()=>x,ns:()=>w,i7:()=>S});var v=function(){return navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")===-1},b=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},g=function(){try{return typeof localStorage<"u"}catch{return!1}},m=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},x=function(k){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!!(k.metaKey&&!k.ctrlKey):!!(!k.metaKey&&k.ctrlKey)},w=function(k){return/Mac/.test(navigator.platform)||navigator.platform==="iPhone"?k.indexOf("⇧")>-1&&b()&&(k=k.replace(";",":").replace("=","+").replace("-","_")):(k.startsWith("⌘")?k=k.replace("⌘","⌘+"):k.startsWith("⌥")&&k.substr(1,1)!=="⌘"?k=k.replace("⌥","⌥+"):k=k.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+"),k=k.replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt"),k.indexOf("Shift")>-1&&(k=k.replace(";",":").replace("=","+").replace("-","_"))),k},S=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},494:(h,c,p)=>{p.d(c,{Wb:()=>v,on:()=>b,Qf:()=>g});var v=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g
|
|||
|
|
`).replace(/\n\n$/,`
|
|||
|
|
`)):i.currentMode==="wysiwyg"?i.lute.VditorDOM2Md(i.wysiwyg.element.innerHTML):i.currentMode==="ir"?i.lute.VditorIRDOM2Md(i.ir.element.innerHTML):""},b=o(413),g=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-devtools",this.element.innerHTML='<div class="vditor-reset--error"></div><div style="height: 100%;"></div>'}return i.prototype.renderEchart=function(a){var s=this;a.devtools.element.style.display==="block"&&(0,b.G)("".concat(a.options.cdn,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){s.ASTChart||(s.ASTChart=echarts.init(a.devtools.element.lastElementChild));try{s.element.lastElementChild.style.display="block",s.element.firstElementChild.innerHTML="",s.ASTChart.setOption({series:[{data:JSON.parse(a.lute.RenderEChartsJSON(v(a))),initialTreeDepth:-1,label:{align:"left",backgroundColor:"rgba(68, 77, 86, .68)",borderRadius:3,color:"#d1d5da",fontSize:12,lineHeight:12,offset:[9,12],padding:[2,4,2,4],position:"top",verticalAlign:"middle"},lineStyle:{color:"#4285f4",type:"curve",width:1},orient:"vertical",roam:!0,type:"tree"}],toolbox:{bottom:25,emphasis:{iconStyle:{color:"#4285f4"}},feature:{restore:{show:!0},saveAsImage:{show:!0}},right:15,show:!0}}),s.ASTChart.resize()}catch(u){s.element.lastElementChild.style.display="none",s.element.firstElementChild.innerHTML=u}})},i}(),m=o(410),x=function(i,a){a.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&u.classList.contains("vditor-menu--current")&&u.classList.remove("vditor-menu--current")}})},w=function(i,a){a.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&!u.classList.contains("vditor-menu--current")&&u.classList.add("vditor-menu--current")}})},S=function(i,a){a.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&u.classList.contains(c.g.CLASS_MENU_DISABLED)&&u.classList.remove(c.g.CLASS_MENU_DISABLED)}})},k=function(i,a){a.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&!u.classList.contains(c.g.CLASS_MENU_DISABLED)&&u.classList.add(c.g.CLASS_MENU_DISABLED)}})},C=function(i,a){a.forEach(function(s){i[s]&&i[s]&&(i[s].style.display="none")})},T=function(i,a){a.forEach(function(s){i[s]&&i[s]&&(i[s].style.display="block")})},A=function(i,a,s){a.includes("subToolbar")&&(i.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(u){s&&u.isEqualNode(s)||(u.style.display="none")}),i.toolbar.elements.emoji&&(i.toolbar.elements.emoji.lastElementChild.style.display="none")),a.includes("hint")&&(i.hint.element.style.display="none"),i.wysiwyg.popover&&a.includes("popover")&&(i.wysiwyg.popover.style.display="none")},M=function(i,a,s,u){s.addEventListener((0,m.Le)(),function(d){d.preventDefault(),d.stopPropagation(),!s.classList.contains(c.g.CLASS_MENU_DISABLED)&&(i.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(f){f.classList.remove("vditor-hint--current")}),a.style.display==="block"?a.style.display="none":(A(i,["subToolbar","hint","popover"],s.parentElement.parentElement),s.classList.contains("vditor-tooltipped")||s.classList.add("vditor-hint--current"),a.style.display="block",i.toolbar.element.getBoundingClientRect().right-s.getBoundingClientRect().right<250?a.classList.add("vditor-panel--left"):a.classList.remove("vditor-panel--left")))})},y=o(106),N=o(771),z=function(i,a,s,u){u&&console.log("".concat(i," - ").concat(s,": ").concat(a))},F=o(135),P=o(775),Y=o(428),te=o(325),ce=o(483),Me=o(999),Fe=o(472),We=o(637),rt=o(11),je=o(194),Ne=o(229),nt=o(825),ct=function(i,a,s){s===void 0&&(s="sv");var u=document.createElement("div");u.innerHTML=i;var d=!1;u.childElementCount===1&&u.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(d=!0);var f=u.querySelectorAll("pre");if(u.childElementCount===1&&f.length===1&&f[0].className!=="vditor-wysiwyg"&&f[0].className!=="vditor-sv"&&(d=!0),i.indexOf(`
|
|||
|
|
<p class="p1">`)===0&&(d=!0),u.childElementCount===1&&u.firstElementChild.tagName==="TABLE"&&u.querySelector(".line-number")&&u.querySelector(".line-content")&&(d=!0),d){var E=a||i;return/\n/.test(E)||f.length===1?s==="wysiwyg"?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'.concat(E.replace(/&/g,"&").replace(/</g,"<"),"<wbr></code></pre></div>"):"\n```\n"+E.replace(/&/g,"&").replace(/</g,"<")+"\n```":s==="wysiwyg"?"<code>".concat(E.replace(/&/g,"&").replace(/</g,"<"),"</code><wbr>"):"`".concat(E,"`")}return!1},tt=function(i,a){if(i){if(i.parentElement.getAttribute("data-type")==="html-block"){i.setAttribute("data-render","1");return}var s=i.firstElementChild.className.replace("language-","");if(s==="abc")(0,F.Q)(i,a.options.cdn);else if(s==="mermaid")(0,We.i)(i,a.options.cdn,a.options.theme);else if(s==="smiles")(0,nt.J)(i,a.options.cdn,a.options.theme);else if(s==="markmap")(0,rt.K)(i,a.options.cdn);else if(s==="flowchart")(0,te.P)(i,a.options.cdn);else if(s==="echarts")(0,P.p)(i,a.options.cdn,a.options.theme);else if(s==="mindmap")(0,je.P)(i,a.options.cdn,a.options.theme);else if(s==="plantuml")(0,Ne.B)(i,a.options.cdn);else if(s==="graphviz")(0,ce.v)(i,a.options.cdn);else if(s==="math")(0,Fe.H)(i,{cdn:a.options.cdn,math:a.options.preview.math});else{var u=a.options.customRenders.find(function(d){if(d.language===s)return d.render(i,a),!0});u||((0,Me.s)(Object.assign({},a.options.preview.hljs),i,a.options.cdn),(0,Y.O)(i,a.options.preview.hljs))}i.setAttribute("data-render","1")}},q=o(810),Ht=function(i){if(i.currentMode!=="sv"){var a=i[i.currentMode].element,s=i.outline.render(i);s===""&&(s="[ToC]"),a.querySelectorAll('[data-type="toc-block"]').forEach(function(u){u.innerHTML=s,(0,Fe.H)(u,{cdn:i.options.cdn,math:i.options.preview.math})})}},Rt=function(i,a){var s=(0,y.lG)(i.target,"SPAN");if(s&&(0,y.fb)(s,"vditor-toc")){var u=a[a.currentMode].element.querySelector("#"+s.getAttribute("data-target-id"));if(u)if(a.options.height==="auto"){var d=u.offsetTop+a.element.offsetTop;a.options.toolbarConfig.pin||(d+=a.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,d)}else a.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,a.element.offsetTop),a[a.currentMode].element.scrollTop=u.offsetTop;return}},$t=function(i,a,s,u){if(i.previousElementSibling&&i.previousElementSibling.classList.contains("vditor-toc")){if(s.key==="Backspace"&&(0,q.im)(i,a[a.currentMode].element,u).start===0)return i.previousElementSibling.remove(),lt(a),!0;if(Pr(a,s,u,i,i.previousElementSibling))return!0}if(i.nextElementSibling&&i.nextElementSibling.classList.contains("vditor-toc")){if(s.key==="Delete"&&(0,q.im)(i,a[a.currentMode].element,u).start>=i.textContent.trimRight().length)return i.nextElementSibling.remove(),lt(a),!0;if(pi(a,s,u,i,i.nextElementSibling))return!0}if(s.key==="Backspace"||s.key==="Delete"){var d=(0,y.fb)(u.startContainer,"vditor-toc");if(d)return d.remove(),lt(a),!0}},Nt=function(i,a,s,u){s===void 0&&(s=!1);var d=(0,y.F9)(a.startContainer);if(d&&!s&&d.getAttribute("data-type")!=="code-block"){if(fo(d.innerHTML)&&d.previousElementSibling||mo(d.innerHTML))return;for(var f=(0,q.im)(d,i.ir.element,a).start,E=!0,L=f-1;L>d.textContent.substr(0,f).lastIndexOf(`
|
|||
|
|
`);L--)if(d.textContent.charAt(L)!==" "&&d.textContent.charAt(L)!==" "){E=!1;break}f===0&&(E=!1);for(var D=!0,L=f-1;L<d.textContent.length;L++)if(d.textContent.charAt(L)!==" "&&d.textContent.charAt(L)!==`
|
|||
|
|
`){D=!1;break}if(E){typeof i.options.input=="function"&&i.options.input(v(i));return}if(D&&/^#{1,6} $/.test(d.textContent)&&(D=!1),D){var _=(0,y.fb)(a.startContainer,"vditor-ir__marker");if(!_){var B=a.startContainer.previousSibling;B&&B.nodeType!==3&&B.classList.contains("vditor-ir__node--expand")&&B.classList.remove("vditor-ir__node--expand"),typeof i.options.input=="function"&&i.options.input(v(i));return}}}if(i.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(it){it.classList.remove("vditor-ir__node--expand")}),d||(d=i.ir.element),!d.querySelector("wbr")){var K=(0,y.fb)(a.startContainer,"vditor-ir__preview");K?K.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):a.insertNode(document.createElement("wbr"))}d.querySelectorAll("[style]").forEach(function(it){it.removeAttribute("style")}),d.getAttribute("data-type")==="link-ref-defs-block"&&(d=i.ir.element);var fe=d.isEqualNode(i.ir.element),ve=(0,y.a1)(d,"data-type","footnotes-block"),ue="";if(fe)ue=d.innerHTML;else{var ke=(0,N.S)(a.startContainer,"BLOCKQUOTE"),we=(0,y.O9)(a.startContainer);if(we&&(d=we),ke&&(!we||we&&!ke.contains(we))&&(d=ke),ve&&(d=ve),ue=d.outerHTML,d.tagName==="UL"||d.tagName==="OL"){var de=d.previousElementSibling,Ie=d.nextElementSibling;de&&(de.tagName==="UL"||de.tagName==="OL")&&(ue=de.outerHTML+ue,de.remove()),Ie&&(Ie.tagName==="UL"||Ie.tagName==="OL")&&(ue=ue+Ie.outerHTML,Ie.remove()),ue=ue.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else d.previousElementSibling&&d.previousElementSibling.textContent.replace(c.g.ZWSP,"")!==""&&u&&u.inputType==="insertParagraph"&&(ue=d.previousElementSibling.outerHTML+ue,d.previousElementSibling.remove());d.innerText.startsWith("```")||(i.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(it){it&&!d.isEqualNode(it)&&(ue+=it.outerHTML,it.remove())}),i.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(it){it&&!d.isEqualNode(it)&&(ue+=it.outerHTML,it.remove())}))}if(z("SpinVditorIRDOM",ue,"argument",i.options.debugger),ue=i.lute.SpinVditorIRDOM(ue),z("SpinVditorIRDOM",ue,"result",i.options.debugger),fe)d.innerHTML=ue;else if(d.outerHTML=ue,ve){var Te=(0,y.a1)(i.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(Te){var $e=Te.textContent,bt=$e.substring(1,$e.indexOf("]:")),gt=i.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(bt,'"]'));gt&>.setAttribute("aria-label",$e.substr(bt.length+3).trim().substr(0,24))}}var kt,dn=i.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");dn.forEach(function(it,zt){zt===0?kt=it:(kt.insertAdjacentHTML("beforeend",it.innerHTML),it.remove())}),dn.length>0&&i.ir.element.insertAdjacentElement("beforeend",dn[0]);var Wt,hn=i.ir.element.querySelectorAll("[data-type='footnotes-block']");hn.forEach(function(it,zt){zt===0?Wt=it:(Wt.insertAdjacentHTML("beforeend",it.innerHTML),it.remove())}),hn.length>0&&i.ir.element.insertAdjacentElement("beforeend",hn[0]),(0,q.ib)(i.ir.element,a),i.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(it){tt(it,i)}),Ht(i),Xn(i,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},oe=function(i,a){if(i==="")return!1;if(i.indexOf("⇧")===-1&&i.indexOf("⌘")===-1&&i.indexOf("⌥")===-1)return!(0,m.yl)(a)&&!a.altKey&&!a.shiftKey&&a.code===i;if(i==="⇧Tab")return!!(!(0,m.yl)(a)&&!a.altKey&&a.shiftKey&&a.code==="Tab");var s=i.split("");if(i.startsWith("⌥")){var u=s.length===3?s[2]:s[1];return!!((s.length===3?(0,m.yl)(a):!(0,m.yl)(a))&&a.altKey&&!a.shiftKey&&a.code===(/^[0-9]$/.test(u)?"Digit":"Key")+u)}i==="⌘Enter"&&(s=["⌘","Enter"]);var d=s.length>2&&s[0]==="⇧",f=d?s[2]:s[1];return d&&((0,m.vU)()||!/Mac/.test(navigator.platform))&&(f==="-"?f="_":f==="="&&(f="+")),!!((0,m.yl)(a)&&a.key.toLowerCase()===f.toLowerCase()&&!a.altKey&&(!d&&!a.shiftKey||d&&a.shiftKey))},he=function(i){var a=i.startContainer;if(a.nodeType===3&&a.nodeValue.length!==i.startOffset)return!1;for(var s=a.nextSibling;s&&s.textContent==="";)s=s.nextSibling;if(s){if(s&&s.nodeType
|
|||
|
|
`);D--)if(f.textContent.charAt(D)!==" "&&f.textContent.charAt(D)!==" "){L=!1;break}if(E===0&&(L=!1),L){Ge(i);return}if(a.inputType==="deleteContentBackward"){var _=(0,y.a1)(d,"data-type","code-block-open-marker")||(0,y.a1)(d,"data-type","code-block-close-marker");if(_){if(_.getAttribute("data-type")==="code-block-close-marker"){var B=pe(d,"code-block-open-marker");if(B){B.textContent=_.textContent,Ge(i);return}}if(_.getAttribute("data-type")==="code-block-open-marker"){var B=pe(d,"code-block-close-marker",!1);if(B){B.textContent=_.textContent,Ge(i);return}}}var K=(0,y.a1)(d,"data-type","math-block-open-marker");if(K){var fe=K.nextElementSibling.nextElementSibling;fe&&fe.getAttribute("data-type")==="math-block-close-marker"&&(fe.remove(),Ge(i));return}f.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(de){de.textContent.length===1&&de.remove()}),f.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(de){de.textContent.length===1&&de.remove()});var ve=(0,y.a1)(d,"data-type","heading-marker");if(ve&&ve.textContent.indexOf("#")===-1){Ge(i);return}}if((a.data===" "||a.inputType==="deleteContentBackward")&&((0,y.a1)(d,"data-type","padding")||(0,y.a1)(d,"data-type","li-marker")||(0,y.a1)(d,"data-type","task-marker")||(0,y.a1)(d,"data-type","blockquote-marker"))){Ge(i);return}}if(f&&f.textContent.trimRight()==="$$"){Ge(i);return}f||(f=i.sv.element),((s=f.firstElementChild)===null||s===void 0?void 0:s.getAttribute("data-type"))==="link-ref-defs-block"&&(f=i.sv.element),(0,y.a1)(d,"data-type","footnotes-link")&&(f=i.sv.element),f.textContent.indexOf(Lute.Caret)===-1&&u.insertNode(document.createTextNode(Lute.Caret)),f.querySelectorAll("[style]").forEach(function(de){de.removeAttribute("style")}),f.querySelectorAll("font").forEach(function(de){de.outerHTML=de.innerHTML});var ue=f.textContent,ke=f.isEqualNode(i.sv.element);if(ke)ue=f.textContent;else{f.previousElementSibling&&(ue=f.previousElementSibling.textContent+ue,f.previousElementSibling.remove()),f.previousElementSibling&&ue.indexOf(`---
|
|||
|
|
`)===0&&(ue=f.previousElementSibling.textContent+ue,f.previousElementSibling.remove());var we="";i.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(de,Ie){de&&!f.isEqualNode(de.parentElement)&&(we+=de.parentElement.textContent+`
|
|||
|
|
`,de.parentElement.remove())}),i.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(de,Ie){de&&!f.isEqualNode(de.parentElement)&&(we+=de.parentElement.textContent+`
|
|||
|
|
`,de.parentElement.remove())}),ue=we+ue}ue=Oe(ue,i),ke?f.innerHTML=ue:f.outerHTML=ue,i.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(de){i.sv.element.insertAdjacentElement("beforeend",de.parentElement)}),G(i.sv.element,function(de){i.sv.element.insertAdjacentElement("beforeend",de)}),(0,q.ib)(i.sv.element,u),Z(i),Ge(i,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},be=function(i,a){var s,u,d,f,E;if(i.sv.composingLock=a.isComposing,a.isComposing||(a.key.indexOf("Arrow")===-1&&a.key!=="Meta"&&a.key!=="Control"&&a.key!=="Alt"&&a.key!=="Shift"&&a.key!=="CapsLock"&&a.key!=="Escape"&&!/^F\d{1,2}$/.test(a.key)&&i.undo.recordFirstPosition(i,a),a.key!=="Enter"&&a.key!=="Tab"&&a.key!=="Backspace"&&a.key.indexOf("Arrow")===-1&&!(0,m.yl)(a)&&a.key!=="Escape"))return!1;var L=(0,q.zh)(i),D=L.startContainer;L.startContainer.nodeType!==3&&L.startContainer.tagName==="DIV"&&(D=L.startContainer.childNodes[L.startOffset-1]);var _=(0,y.a1)(D,"data-type","text"),B=(0,y.a1)(D,"data-type","blockquote-marker");if(!B&&L.startOffset===0&&_&&_.previousElementSibling&&_.previousElementSibling.getAttribute("data-type")==="blockquote-marker"&&(B=_.previousElementSibling),B&&a.key==="Enter"&&!(0,m.yl)(a)&&!a.altKey&&B.nextElementSibling.textContent.trim()===""&&(0,q.im)(B,i.sv.element,L).start===B.textContent.length)return((s=B.previousElementSibling)===null||s===void 0?void 0:s.getAttribute("data-type"))==="padding"&&B.previousElementSibling.setAttribute("data-action","enter-remove"),B.remove(),Ge(i),a.preventDefault(),!0;var K=(0,y.a1)(D,"data-type","li-marker"),fe=(0,y.a1)(D,"data-type","task-marker"),ve=K;if(ve||fe&&fe.nextElementSibling.getAttribute("data-type")!=="task-marker"&&(ve=fe),!ve&&L.startOffset===0&&_&&_.previousElementSibling&&(_.previousElementSibling.getAttribute("data-type")==="li-marker"||_.previousElementSibling.getAttribute("data-type")==="task-marker")&&(ve=_.previousElementSibling),ve){var ue=(0,q.im)(ve,i.sv.element,L).start,ke=ve.getAttribute("data-type")==="task-marker",we=ve;if(ke&&(we=ve.previousElementSibling.previousElementSibling.previousElementSibling),ue===ve.textContent.length){if(a.key==="Enter"&&!(0,m.yl)(a)&&!a.altKey&&!a.shiftKey&&ve.nextElementSibling.textContent.trim()==="")return((u=we.previousElementSibling)===null||u===void 0?void 0:u.getAttribute("data-type"))==="padding"?(we.previousElementSibling.remove(),X(i)):(ke&&(we.remove(),ve.previousElementSibling.previousElementSibling.remove(),ve.previousElementSibling.remove()),ve.nextElementSibling.remove(),ve.remove(),Ge(i)),a.preventDefault(),!0;if(a.key==="Tab")return a.shiftKey?we.previousElementSibling.getAttribute("data-type")==="padding"&&we.previousElementSibling.remove():we.insertAdjacentHTML("beforebegin",'<span data-type="padding">'.concat(we.textContent.replace(/\S/g," "),"</span>")),/^\d/.test(we.textContent)&&(we.textContent=we.textContent.replace(/^\d{1,}/,"1"),L.selectNodeContents(ve.firstChild),L.collapse(!1)),X(i),a.preventDefault(),!0}}if(go(i,L,a))return!0;var de=(0,y.a1)(D,"data-block","0"),Ie=(0,N.S)(D,"SPAN");if(a.key==="Enter"&&!(0,m.yl)(a)&&!a.altKey&&!a.shiftKey&&de){var Te=!1,$e=de.textContent.match(/^\n+/);(0,q.im)(de,i.sv.element).start<=($e?$e[0].length:0)&&(Te=!0);var bt=`
|
|||
|
|
`;if(Ie){if(((d=Ie.previousElementSibling)===null||d===void 0?void 0:d.getAttribute("data-action"))==="enter-remove")return Ie.previousElementSibling.remove(),Ge(i),a.preventDefault(),!0;bt+=Je(Ie)}return L.insertNode(document.createTextNode(bt)),L.collapse(!1),de&&de.textContent.trim()!==""&&!Te?X(i):Ge(i),a.preventDefault(),!0}if(a.key==="Backspace"&&!(0,m.yl)(a)&&!a.altKey&&!a.shiftKey){if(Ie&&((f=Ie.previousElementSibling)===null||f===void 0?void 0:f.getAttribute("data-type"))==="newline"&&(0,q.im)(Ie,i.sv.element,L).start===1&&Ie.getAttribute("data-type").indexOf("code-block-")===-1)return L.setStart(Ie,0),L.extractContents(),Ie.textContent.trim()!==""?X(i):Ge(i),a.preventDefault(),!0;if(de&&(0,q.im)(de,i.sv.element,L).start===0&&de.previousElementSibling){L.extractContents();var gt=de.previousElementSibling.lastElementChild;return gt.getAttribute("data-type")==="newline"&&(gt.remove(),gt=de.previousElementSibling.lastElementChild),gt.getAttribute("data-type")!=="newline"&&(gt.insertAdjacentHTML("afterend",de.innerHTML),de.remove()),de.textContent.trim()!==""&&!(!((E=de.previousElementSibling)===null||E===void 0)&&E.querySelector('[data-type="code-block-open-marker"]'))?X(i):(gt.getAttribute("data-type")!=="newline"&&(L.selectNodeContents(gt.lastChild),L.collapse(!1)),Ge(i)),a.preventDefault(),!0}}return!1},le=o(538),ye=function(i){i.options.theme==="dark"?i.element.classList.add("vditor--dark"):i.element.classList.remove("vditor--dark")},Ae=function(i){i.element.innerHTML="",i.element.classList.add("vditor"),i.options.rtl&&i.element.setAttribute("dir","rtl"),ye(i),(0,le.Z)(i.options.preview.theme.current,i.options.preview.theme.path),typeof i.options.height=="number"?i.element.style.height=i.options.height+"px":i.element.style.height=i.options.height,typeof i.options.minHeight=="number"&&(i.element.style.minHeight=i.options.minHeight+"px"),typeof i.options.width=="number"?i.element.style.width=i.options.width+"px":i.element.style.width=i.options.width,i.element.appendChild(i.toolbar.element);var a=document.createElement("div");if(a.className="vditor-content",i.options.outline.position==="left"&&a.appendChild(i.outline.element),a.appendChild(i.wysiwyg.element.parentElement),a.appendChild(i.sv.element),a.appendChild(i.ir.element.parentElement),a.appendChild(i.preview.element),i.toolbar.elements.devtools&&a.appendChild(i.devtools.element),i.options.outline.position==="right"&&(i.outline.element.classList.add("vditor-outline--right"),a.appendChild(i.outline.element)),i.upload&&a.appendChild(i.upload.element),i.options.resize.enable&&a.appendChild(i.resize.element),a.appendChild(i.hint.element),a.appendChild(i.tip.element),i.element.appendChild(a),a.addEventListener("click",function(){A(i,["subToolbar"])}),i.toolbar.elements.export&&i.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),er(i,i.options.mode,st(i)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&typeof window.visualViewport<"u"){var s=!1,u=function(d){s||(s=!0,requestAnimationFrame(function(){s=!1;var f=i.toolbar.element;f.style.transform="none",f.getBoundingClientRect().top<0&&(f.style.transform="translate(0, ".concat(-f.getBoundingClientRect().top,"px)"))}))};window.visualViewport.addEventListener("scroll",u),window.visualViewport.addEventListener("resize",u)}},ze=function(i){var a=window.innerWidth<=c.g.MOBILE_WIDTH?10:35;if(i.wysiwyg.element.parentElement.style.display!=="none"){var s=(i.wysiwyg.element.parentElement.clientWidth-i.options.preview.maxWidth)/2;i.wysiwyg.element.style.padding="10px ".concat(Math.max(a,s),"px")}if(i.ir.element.parentElement.style.display!=="none"){var s=(i.ir.element.parentElement.clientWidth-i.options.preview.maxWidth)/2;i.ir.element.style.padding="10px ".concat(Math.max(a,s),"px")}i.preview.element.style.display!=="block"?i.toolbar.element.style.paddingLeft=Math.max(5,parseInt(i[i.currentMode].element.style.paddingLeft||"0",10)+(i.options.outline.position==="left"?i.outline.element.offsetWidth:0))+"
|
|||
|
|
`,s.insertNode(_),s.collapse(!0),(0,q.Hc)(s),Re(i),Z(i),a.preventDefault(),!0}var B=(0,N.W)(u);if(B){if(B.tagName==="H6"&&u.textContent.length===s.startOffset&&!(0,m.yl)(a)&&!a.shiftKey&&!a.altKey&&a.key==="Enter"){var K=document.createElement("p");return K.textContent=`
|
|||
|
|
`,K.setAttribute("data-block","0"),u.parentElement.insertAdjacentElement("afterend",K),s.setStart(K,0),(0,q.Hc)(s),Re(i),Z(i),a.preventDefault(),!0}if(oe("⌘=",a)){var fe=parseInt(B.tagName.substr(1),10)-1;return fe>0&&(kn(i,"h".concat(fe)),Re(i)),a.preventDefault(),!0}if(oe("⌘-",a)){var fe=parseInt(B.tagName.substr(1),10)+1;return fe<7&&(kn(i,"h".concat(fe)),Re(i)),a.preventDefault(),!0}a.key==="Backspace"&&!(0,m.yl)(a)&&!a.shiftKey&&!a.altKey&&B.textContent.length===1&&lr(i)}if(Ps(i,s,a))return!0;if(a.altKey&&a.key==="Enter"&&!(0,m.yl)(a)&&!a.shiftKey){var ve=(0,y.lG)(u,"A"),ue=(0,y.a1)(u,"data-type","link-ref"),ke=(0,y.a1)(u,"data-type","footnotes-ref");if(ve||ue||ke||B&&B.tagName.length===2){var we=i.wysiwyg.popover.querySelector("input");we.focus(),we.select()}}if(Ot(i,a))return!0;if(oe("⇧⌘U",a)){var de=i.wysiwyg.popover.querySelector('[data-type="up"]');if(de)return de.click(),a.preventDefault(),!0}if(oe("⇧⌘D",a)){var de=i.wysiwyg.popover.querySelector('[data-type="down"]');if(de)return de.click(),a.preventDefault(),!0}if(go(i,s,a))return!0;if(!(0,m.yl)(a)&&a.shiftKey&&!a.altKey&&a.key==="Enter"&&u.parentElement.tagName!=="LI"&&u.parentElement.tagName!=="P")return["STRONG","STRIKE","S","I","EM","B"].includes(u.parentElement.tagName)?s.insertNode(document.createTextNode(`
|
|||
|
|
`+c.g.ZWSP)):s.insertNode(document.createTextNode(`
|
|||
|
|
`)),s.collapse(!1),(0,q.Hc)(s),Re(i),Z(i),a.preventDefault(),!0;if(a.key==="Backspace"&&!(0,m.yl)(a)&&!a.shiftKey&&!a.altKey&&s.toString()===""){if(zs(i,s,a,f))return!0;if(d){if(d.previousElementSibling&&d.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&d.previousElementSibling.getAttribute("data-block")==="0"&&d.tagName!=="UL"&&d.tagName!=="OL"){var Ie=(0,q.im)(d,i.wysiwyg.element,s).start;if(Ie===0&&s.startOffset===0||Ie===1&&d.innerText.startsWith(c.g.ZWSP))return cr(d.previousElementSibling.lastElementChild,i,!1),d.innerHTML.trim().replace(c.g.ZWSP,"")===""&&(d.remove(),Re(i)),a.preventDefault(),!0}var Te=s.startOffset;if(s.toString()===""&&u.nodeType===3&&u.textContent.charAt(Te-2)===`
|
|||
|
|
`&&u.textContent.charAt(Te-1)!==c.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(u.parentElement.tagName))return u.textContent=u.textContent.substring(0,Te-1)+c.g.ZWSP,s.setStart(u,Te),s.collapse(!0),Re(i),a.preventDefault(),!0;u.textContent===c.g.ZWSP&&s.startOffset===1&&!u.previousSibling&&Dt(s)&&(u.textContent=""),d.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(bt){bt.firstElementChild.style.display="inline",bt.lastElementChild.style.display="none"}),d.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(bt){bt.firstElementChild.style.display="inline",bt.lastElementChild.style.display="none"})}}if((0,m.vU)()&&s.startOffset===1&&u.textContent.indexOf(c.g.ZWSP)>-1&&u.previousSibling&&u.previousSibling.nodeType!==3&&u.previousSibling.tagName==="CODE"&&(a.key==="Backspace"||a.key==="ArrowLeft"))return s.selectNodeContents(u.previousSibling),s.collapse(!1),a.preventDefault(),!0;if(Fs(a,d,s))return a.preventDefault(),!0;if(Ts(s,a.key),a.key==="ArrowDown"){var $e=u.nextSibling;$e&&$e.nodeType!==3&&$e.getAttribute("data-type")==="math-inline"&&s.setStartAfter($e)}return d&&$t(d,i,a,s)?(a.preventDefault(),!0):!1},Ot=function(i,a){if(oe("⇧⌘X",a)){var s=i.wysiwyg.popover.querySelector('[data-type="remove"]');return s&&s.click(),a.preventDefault(),!0}},jn=function(i){clearTimeout(i.wysiwyg.hlToolbarTimeoutId),i.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if(i.wysiwyg.element.getAttribute("contenteditable")!=="false"&&(0,q.Gb)(i.wysiwyg.element)){x(i.toolbar.elements,c.g.EDIT_TOOLBARS),S(i.toolbar.elements,c.g.EDIT_TOOLBARS);var a=getSelection().getRangeAt(0),s=a.startContainer;a.startContainer.nodeType===3?s=a.startContainer.parentElement:s=s.childNodes[a.startOffset>=s.childNodes.length?s.childNodes.length-1:a.startOffset];var u=(0,y.a1)(s,"data-type","footnotes-block");if(u){i.wysiwyg.popover.innerHTML="",pn(u,i),tn(i,"footnotes-block"),en(i,u);return}var d=(0,y.lG)(s,"LI");d?(d.classList.contains("vditor-task")?w(i.toolbar.elements,["check"]):d.parentElement.tagName==="OL"?w(i.toolbar.elements,["ordered-list"]):d.parentElement.tagName==="UL"&&w(i.toolbar.elements,["list"]),S(i.toolbar.elements,["outdent","indent"])):k(i.toolbar.elements,["outdent","indent"]),(0,y.lG)(s,"BLOCKQUOTE")&&w(i.toolbar.elements,["quote"]),((0,y.lG)(s,"B")||(0,y.lG)(s,"STRONG"))&&w(i.toolbar.elements,["bold"]),((0,y.lG)(s,"I")||(0,y.lG)(s,"EM"))&&w(i.toolbar.elements,["italic"]),((0,y.lG)(s,"STRIKE")||(0,y.lG)(s,"S"))&&w(i.toolbar.elements,["strike"]),i.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(Le){Le.classList.remove("vditor-comment--focus")});var f=(0,y.fb)(s,"vditor-comment");if(f){var E=f.getAttribute("data-cmtids").split(" ");if(E.length>1&&f.nextSibling.isSameNode(f.nextElementSibling)){var L=f.nextElementSibling.getAttribute("data-cmtids").split(" ");E.find(function(Le){if(L.includes(Le))return E=[Le],!0})}i.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(Le){Le.getAttribute("data-cmtids").indexOf(E[0])>-1&&Le.classList.add("vditor-comment--focus")})}var D=(0,y.lG)(s,"A");D&&w(i.toolbar.elements,["link"]);var _=(0,y.lG)(s,"TABLE"),B=(0,N.W)(s);(0,y.lG)(s,"CODE")?(0,y.lG)(s,"PRE")?(k(i.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),w(i.toolbar.elements,["code"])):(k(i.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),w(i.toolbar.elements,["inline-code"])):B?(k(i.toolbar.elements,["bold"]),w(i.toolbar.elements,["headings"])):_&&k(i.toolbar.elements,["table"]);var K=(0,y.fb)(s,"vditor-toc");if(K){i.wysiwyg.popover.innerHTML="",pn(K,i),tn(i,"vditor-toc"),en(i,K);return}var fe=(0,N.S)(s,"BLOCKQUOTE");if(fe&&(i.wysiwyg.popover.innerHTML="",ur(a,fe,i),nr(a,fe,i),pn(fe,i),tn(i,"blockquote"),en(i,fe)),d&&(i.wysiwyg.popover.innerHTML="",ur(a,d,i),nr(a,d,i),pn(d,i),tn(i,"li"),en(i,d)),_){i.options.lang,i.
|
|||
|
|
</code></pre>`:(K.innerHTML="<pre><code>".concat(f.toString(),"<wbr></code></pre>"),f.deleteContents()),f.insertNode(K),_&&(_.outerHTML=i.lute.SpinVditorDOM(_.outerHTML)),(0,q.ib)(i.wysiwyg.element,f),i.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(bt){tt(bt,i)}),a.classList.add("vditor-menu--disabled")}else if(E==="link"){if(f.toString()===""){var fe=document.createElement("a");fe.innerText=c.g.ZWSP,f.insertNode(fe),f.setStart(fe.firstChild,1),f.collapse(!0),Ti(i,fe,f);var ve=i.wysiwyg.popover.querySelector("input");ve.value="",ve.focus(),d=!1}else{var K=document.createElement("a");K.setAttribute("href",""),K.innerHTML=f.toString(),f.surroundContents(K),f.insertNode(K),(0,q.Hc)(f),Ti(i,K,f);var ue=i.wysiwyg.popover.querySelectorAll("input");ue[0].value=K.innerText,ue[1].focus()}u=!1,a.classList.add("vditor-menu--current")}else if(E==="table"){var ke='<table data-block="0"><thead><tr><th>col1<wbr></th><th>col2</th><th>col3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table>';if(f.toString().trim()==="")_&&_.innerHTML.trim().replace(c.g.ZWSP,"")===""?_.outerHTML=ke:document.execCommand("insertHTML",!1,ke),f.selectNode(i.wysiwyg.element.querySelector("wbr").previousSibling),i.wysiwyg.element.querySelector("wbr").remove(),(0,q.Hc)(f);else{ke='<table data-block="0"><thead><tr>';var we=f.toString().split(`
|
|||
|
|
`),de=we[0].split(",").length>we[0].split(" ").length?",":" ";we.forEach(function($e,bt){bt===0?($e.split(de).forEach(function(gt,kt){kt===0?ke+="<th>".concat(gt,"<wbr></th>"):ke+="<th>".concat(gt,"</th>")}),ke+="</tr></thead>"):(bt===1?ke+="<tbody><tr>":ke+="<tr>",$e.split(de).forEach(function(gt){ke+="<td>".concat(gt,"</td>")}),ke+="</tr>")}),ke+="</tbody></table>",document.execCommand("insertHTML",!1,ke),(0,q.ib)(i.wysiwyg.element,f)}u=!1,a.classList.add("vditor-menu--disabled")}else if(E==="line"){if(_){var Ie=`<hr data-block="0"><p data-block="0"><wbr>
|
|||
|
|
</p>`;_.innerHTML.trim()===""?_.outerHTML=Ie:_.insertAdjacentHTML("afterend",Ie),(0,q.ib)(i.wysiwyg.element,f)}}else if(u=!1,a.classList.add("vditor-menu--current"),E==="strike"&&(E="strikeThrough"),f.toString()===""&&(E==="bold"||E==="italic"||E==="strikeThrough")){var Te="strong";E==="italic"?Te="em":E==="strikeThrough"&&(Te="s");var K=document.createElement(Te);K.textContent=c.g.ZWSP,f.insertNode(K),K.previousSibling&&K.previousSibling.textContent===c.g.ZWSP&&(K.previousSibling.textContent=""),f.setStart(K.firstChild,1),f.collapse(!0),(0,q.Hc)(f)}else document.execCommand(E,!1,"")}u&&jn(i),d&&Re(i)}},Mt=function(){function i(a,s){var u,d=this;this.element=document.createElement("div"),s.className&&(u=this.element.classList).add.apply(u,s.className.split(" "));var f=s.hotkey?" <".concat((0,m.ns)(s.hotkey),">"):"";s.level===2&&(f=s.hotkey?" <".concat((0,m.ns)(s.hotkey),">"):"");var E=s.tip?s.tip+f:"".concat(window.VditorI18n[s.name]).concat(f),L=s.name==="upload"?"div":"button";if(s.level===2)this.element.innerHTML="<".concat(L,' data-type="').concat(s.name,'">').concat(E,"</").concat(L,">");else{this.element.classList.add("vditor-toolbar__item");var D=document.createElement(L);D.setAttribute("data-type",s.name),D.className="vditor-tooltipped vditor-tooltipped__".concat(s.tipPosition),D.setAttribute("aria-label",E),D.innerHTML=s.icon,this.element.appendChild(D)}s.prefix&&this.element.children[0].addEventListener((0,m.Le)(),function(_){_.preventDefault(),!d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)&&(a.currentMode==="wysiwyg"?bs(a,d.element.children[0],_):a.currentMode==="ir"?vu(a,d.element.children[0],s.prefix||"",s.suffix||""):Gt(a,d.element.children[0],s.prefix||"",s.suffix||""))})}return i}(),ys=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),er=function(i,a,s){var u;if(typeof s!="string"?(A(i,["subToolbar","hint"]),s.preventDefault(),u=v(i)):u=s,!(i.currentMode===a&&typeof s!="string")){if(i.devtools&&i.devtools.renderEchart(i),i.options.preview.mode==="both"&&a==="sv"?i.preview.element.style.display="block":i.preview.element.style.display="none",S(i.toolbar.elements,c.g.EDIT_TOOLBARS),x(i.toolbar.elements,c.g.EDIT_TOOLBARS),k(i.toolbar.elements,["outdent","indent"]),a==="ir")C(i.toolbar.elements,["both"]),T(i.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),i.sv.element.style.display="none",i.wysiwyg.element.parentElement.style.display="none",i.ir.element.parentElement.style.display="block",i.lute.SetVditorIR(!0),i.lute.SetVditorWYSIWYG(!1),i.lute.SetVditorSV(!1),i.currentMode="ir",i.ir.element.innerHTML=i.lute.Md2VditorIRDOM(u),Xn(i,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),ze(i),i.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(f){tt(f,i)}),i.ir.element.querySelectorAll(".vditor-toc").forEach(function(f){(0,Fe.H)(f,{cdn:i.options.cdn,math:i.options.preview.math})});else if(a==="wysiwyg")C(i.toolbar.elements,["both"]),T(i.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),i.sv.element.style.display="none",i.wysiwyg.element.parentElement.style.display="block",i.ir.element.parentElement.style.display="none",i.lute.SetVditorIR(!1),i.lute.SetVditorWYSIWYG(!0),i.lute.SetVditorSV(!1),i.currentMode="wysiwyg",ze(i),uo(i,u,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),i.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(f){(0,Fe.H)(f,{cdn:i.options.cdn,math:i.options.preview.math})}),i.wysiwyg.popover.style.display="none";else if(a==="sv"){T(i.toolbar.elements,["both"]),C(i.toolbar.elements,["outdent","indent","outline","insert-before","insert-
|
|||
|
|
<button data-mode="ir">`).concat(window.VditorI18n.instantRendering," <").concat((0,m.ns)("⌥⌘8"),`></button>
|
|||
|
|
<button data-mode="sv">`).concat(window.VditorI18n.splitView," <").concat((0,m.ns)("⌥⌘9"),"></button>"),d.element.appendChild(f),d._bindEvent(s,f,u),d}return a.prototype._bindEvent=function(s,u,d){var f=this.element.children[0];M(s,u,f,d.level),u.children.item(0).addEventListener((0,m.Le)(),function(E){er(s,"wysiwyg",E),E.preventDefault(),E.stopPropagation()}),u.children.item(1).addEventListener((0,m.Le)(),function(E){er(s,"ir",E),E.preventDefault(),E.stopPropagation()}),u.children.item(2).addEventListener((0,m.Le)(),function(E){er(s,"sv",E),E.preventDefault(),E.stopPropagation()})},a}(Mt),Or=function(i,a){return(0,q.Gb)(i,a)?getSelection().toString():""},Ai=function(i,a){a.addEventListener("focus",function(){i.options.focus&&i.options.focus(v(i)),A(i,["subToolbar","hint"])})},ho=function(i,a){a.addEventListener("dblclick",function(s){s.target.tagName==="IMG"&&(i.options.image.preview?i.options.image.preview(s.target):i.options.image.isPreview&&(0,se.E)(s.target,i.options.lang,i.options.theme))})},Mi=function(i,a){a.addEventListener("blur",function(s){if(i.currentMode==="ir"){var u=i.ir.element.querySelector(".vditor-ir__node--expand");u&&u.classList.remove("vditor-ir__node--expand")}else i.currentMode==="wysiwyg"&&!i.wysiwyg.selectPopover.contains(s.relatedTarget)&&i.wysiwyg.hideComment();i[i.currentMode].range=(0,q.zh)(i),i.options.blur&&i.options.blur(v(i))})},Ci=function(i,a){a.addEventListener("dragstart",function(s){s.dataTransfer.setData(c.g.DROP_EDITOR,c.g.DROP_EDITOR)}),a.addEventListener("drop",function(s){s.dataTransfer.getData(c.g.DROP_EDITOR)?lt(i):(s.dataTransfer.types.includes("Files")||s.dataTransfer.types.includes("text/html"))&&ta(i,s,{pasteCode:function(u){document.execCommand("insertHTML",!1,u)}})})},U=function(i,a,s){a.addEventListener("copy",function(u){return s(u,i)})},Q=function(i,a,s){a.addEventListener("cut",function(u){s(u,i),i.options.comment.enable&&i.currentMode==="wysiwyg"&&i.wysiwyg.getComments(i),document.execCommand("delete")})},Z=function(i){if(i.currentMode==="wysiwyg"&&i.options.comment.enable&&i.options.comment.adjustTop(i.wysiwyg.getComments(i,!0)),!!i.options.typewriterMode){var a=i[i.currentMode].element,s=(0,q.Ny)(a).top;i.options.height==="auto"&&!i.element.classList.contains("vditor--fullscreen")&&window.scrollTo(window.scrollX,s+i.element.offsetTop+i.toolbar.element.offsetHeight-window.innerHeight/2+10),(i.options.height!=="auto"||i.element.classList.contains("vditor--fullscreen"))&&(a.scrollTop=s+a.scrollTop-a.clientHeight/2+10)}},xe=function(i,a){a.addEventListener("keydown",function(s){if(!s.isComposing&&i.options.keydown&&i.options.keydown(s),!((i.options.hint.extend.length>1||i.toolbar.elements.emoji)&&i.hint.select(s,i))){if(i.options.comment.enable&&i.currentMode==="wysiwyg"&&(s.key==="Backspace"||oe("⌘X",s))&&i.wysiwyg.getComments(i),i.currentMode==="sv"){if(be(i,s))return}else if(i.currentMode==="wysiwyg"){if(zn(i,s))return}else if(i.currentMode==="ir"&&Ce(i,s))return;if(i.options.ctrlEnter&&oe("⌘Enter",s)){i.options.ctrlEnter(v(i)),s.preventDefault();return}if(oe("⌘Z",s)&&!i.toolbar.elements.undo){i.undo.undo(i),s.preventDefault();return}if(oe("⌘Y",s)&&!i.toolbar.elements.redo){i.undo.redo(i),s.preventDefault();return}if(s.key==="Escape"){i.hint.element.style.display==="block"?i.hint.element.style.display="none":i.options.esc&&!s.isComposing&&i.options.esc(v(i)),s.preventDefault();return}if((0,m.yl)(s)&&s.altKey&&!s.shiftKey&&/^Digit[1-6]$/.test(s.code)){if(i.currentMode==="wysiwyg"){var u=s.code.replace("Digit","H");(0,y.lG)(getSelection().getRangeAt(0).startContainer,u)?lr(i):kn(i,u),Re(i)}else i.currentMode==="sv"?Ct(i,"#".repeat(parseInt(s.code.replace("Digit",""),10))+" "):i.currentMode==="ir"&&fi(i,"#".repeat(parseInt(s.code.replace("Digit",""),10))+" ");return s.preventDefault(),!0}if((0,m.yl)(s)&&s.altKey&&!s.shiftKey&&/^Digit[7-9]$/.test(s.code))return s.code==="Digit7"?er(i,"wysiwyg",s):s.code==="Digit8"?er(i,"ir",s):s.code==="Digit9"&&er(i,"sv",s),!0;i.options.toolbar.find(function(d){if(!d.hotkey||d.toolbar){if(d.toolbar){var f=d.toolbar.f
|
|||
|
|
</span></span><span data-type="newline"><br /><span style="display: none">
|
|||
|
|
</span></span></div><div data-block="0"><`)+"</div>",u.isEqualNode(i.sv.element)?u.innerHTML=d:u.outerHTML=d,G(i.sv.element),(0,q.ib)(i.sv.element,s),Z(i)},pe=function(i,a,s){s===void 0&&(s=!0);var u=i;for(u.nodeType===3&&(u=u.parentElement);u;){if(u.getAttribute("data-type")===a)return u;s?u=u.previousElementSibling:u=u.nextElementSibling}return!1},Oe=function(i,a){z("SpinVditorSVDOM",i,"argument",a.options.debugger);var s=a.lute.SpinVditorSVDOM(i);return i="<div data-block='0'>"+s.replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,`<span data-type="newline"><br /><span style="display: none">
|
|||
|
|
</span></span><span data-type="newline"><br /><span style="display: none">
|
|||
|
|
</span></span></div><div data-block="0"><`)+"</div>",z("SpinVditorSVDOM",i,"result",a.options.debugger),i},Je=function(i){var a=i.getAttribute("data-type"),s=i.previousElementSibling,u=a&&a!=="text"&&a!=="table"&&a!=="heading-marker"&&a!=="newline"&&a!=="yaml-front-matter-open-marker"&&a!=="yaml-front-matter-close-marker"&&a!=="code-block-info"&&a!=="code-block-close-marker"&&a!=="code-block-open-marker"?i.textContent:"",d=!1;for(a==="newline"&&(d=!0);s&&!d;){var f=s.getAttribute("data-type");if(f==="li-marker"||f==="blockquote-marker"||f==="task-marker"||f==="padding"){var E=s.textContent;if(f==="li-marker"&&(a==="code-block-open-marker"||a==="code-block-info"))u=E.replace(/\S/g," ")+u;else if(a==="code-block-close-marker"&&s.nextElementSibling.isSameNode(i)){var L=pe(i,"code-block-open-marker");L&&L.previousElementSibling&&(s=L.previousElementSibling,u=E+u)}else u=E+u}else f==="newline"&&(d=!0);s=s.previousElementSibling}return u},Ge=function(i,a){a===void 0&&(a={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),a.enableHint&&i.hint.render(i),i.preview.render(i);var s=v(i);typeof i.options.input=="function"&&a.enableInput&&i.options.input(s),i.options.counter.enable&&i.counter.render(i,s),i.options.cache.enable&&(0,m.pK)()&&(localStorage.setItem(i.options.cache.id,s),i.options.cache.after&&i.options.cache.after(s)),i.devtools&&i.devtools.renderEchart(i),clearTimeout(i.sv.processTimeoutId),i.sv.processTimeoutId=window.setTimeout(function(){a.enableAddUndoStack&&!i.sv.composingLock&&i.undo.addToUndoStack(i)},i.options.undoDelay)},Ct=function(i,a){var s=(0,q.zh)(i),u=(0,N.S)(s.startContainer,"SPAN");u&&u.textContent.trim()!==""&&(a=`
|
|||
|
|
`+a),s.collapse(!0),document.execCommand("insertHTML",!1,a)},Gt=function(i,a,s,u){var d=(0,q.zh)(i),f=a.getAttribute("data-type");i.sv.element.childNodes.length===0&&(i.sv.element.innerHTML=`<span data-type="p" data-block="0"><span data-type="text"><wbr></span></span><span data-type="newline"><br><span style="display: none">
|
|||
|
|
</span></span>`,(0,q.ib)(i.sv.element,d));var E=(0,y.F9)(d.startContainer),L=(0,N.S)(d.startContainer,"SPAN");if(E){if(f==="link"){var D=void 0;d.toString()===""?D="".concat(s).concat(Lute.Caret).concat(u):D="".concat(s).concat(d.toString()).concat(u.replace(")",Lute.Caret+")")),document.execCommand("insertHTML",!1,D);return}else if(f==="italic"||f==="bold"||f==="strike"||f==="inline-code"||f==="code"||f==="table"||f==="line"){var D=void 0;d.toString()===""?D="".concat(s).concat(Lute.Caret).concat(f==="code"?"":u):D="".concat(s).concat(d.toString()).concat(Lute.Caret).concat(f==="code"?"":u),f==="table"||f==="code"&&L&&L.textContent!==""?D=`
|
|||
|
|
|
|||
|
|
`+D:f==="line"&&(D=`
|
|||
|
|
|
|||
|
|
`.concat(s,`
|
|||
|
|
`).concat(Lute.Caret)),document.execCommand("insertHTML",!1,D);return}else if((f==="check"||f==="list"||f==="ordered-list"||f==="quote")&&L){var _="* ";f==="check"?_="* [ ] ":f==="ordered-list"?_="1. ":f==="quote"&&(_="> ");var B=pe(L,"newline");B?B.insertAdjacentText("afterend",_):E.insertAdjacentText("afterbegin",_),X(i);return}(0,q.ib)(i.sv.element,d),Ge(i)}},un=function(i){switch(i.currentMode){case"ir":return i.ir.element;case"wysiwyg":return i.wysiwyg.element;case"sv":return i.sv.element}},$n=function(i,a){i.options.upload.setHeaders&&(i.options.upload.headers=i.options.upload.setHeaders()),i.options.upload.headers&&Object.keys(i.options.upload.headers).forEach(function(s){a.setRequestHeader(s,i.options.upload.headers[s])})},mr=function(i,a,s,u){function d(f){return f instanceof s?f:new s(function(E){E(f)})}return new(s||(s=Promise))(function(f,E){function L(B){try{_(u.next(B))}catch(K){E(K)}}function D(B){try{_(u.throw(B))}catch(K){E(K)}}function _(B){B.done?f(B.value):d(B.value).then(L,D)}_((u=u.apply(i,a||[])).next())})},Hr=function(i,a){var s={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},u,d,f,E;return E={next:L(0),throw:L(1),return:L(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function L(_){return function(B){return D([_,B])}}function D(_){if(u)throw new TypeError("Generator is already executing.");for(;E&&(E=0,_[0]&&(s=0)),s;)try{if(u=1,d&&(f=_[0]&2?d.return:_[0]?d.throw||((f=d.return)&&f.call(d),0):d.next)&&!(f=f.call(d,_[1])).done)return f;switch(d=0,f&&(_=[_[0]&2,f.value]),_[0]){case 0:case 1:f=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,d=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(f=s.trys,!(f=f.length>0&&f[f.length-1])&&(_[0]===6||_[0]===2)){s=0;continue}if(_[0]===3&&(!f||_[1]>f[0]&&_[1]<f[3])){s.label=_[1];break}if(_[0]===6&&s.label<f[1]){s.label=f[1],f=_;break}if(f&&s.label<f[2]){s.label=f[2],s.ops.push(_);break}f[2]&&s.ops.pop(),s.trys.pop();continue}_=a.call(i,s)}catch(B){_=[6,B],d=0}finally{u=f=0}if(_[0]&5)throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}},Ia=function(){function i(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"}return i}(),Li=function(i,a){i.tip.hide();var s=[],u="",d="";i.options.lang,i.options;for(var f=function(_,B){var K=a[B],fe=!0;K.name||(u+="<li>".concat(window.VditorI18n.nameEmpty,"</li>"),fe=!1),K.size>i.options.upload.max&&(u+="<li>".concat(K.name," ").concat(window.VditorI18n.over," ").concat(i.options.upload.max/1024/1024,"M</li>"),fe=!1);var ve=K.name.lastIndexOf("."),ue=K.name.substr(ve),ke=i.options.upload.filename(K.name.substr(0,ve))+ue;if(i.options.upload.accept){var we=i.options.upload.accept.split(",").some(function(de){var Ie=de.trim();if(Ie.indexOf(".")===0){if(ue.toLowerCase()===Ie.toLowerCase())return!0}else if(K.type.split("/")[0]===Ie.split("/")[0])return!0;return!1});we||(u+="<li>".concat(K.name," ").concat(window.VditorI18n.fileTypeError,"</li>"),fe=!1)}fe&&(s.push(K),d+="<li>".concat(ke," ").concat(window.VditorI18n.uploading,' <a class="vditorCancelUpload" href="javascript:void(0)">').concat(window.VditorI18n.cancelUpload,"</a></li>"))},E=a.length,L=0;L<E;L++)f(E,L);if(i.tip.show("<ul>".concat(u).concat(d,"</ul>")),i.options.upload.cancel){var D=i.tip.element.querySelector(".vditorCancelUpload");D&&D.addEventListener("click",function(){i.options.upload.cancel(s),i.tip.hide(),i.upload.isUploading=!1})}return s},Oa=function(i,a){var s=un(a);s.focus();var u=JSON.parse(i),d="";u.code===1&&(d="".concat(u.msg)),u.data.errFiles&&u.data.errFiles.length>0&&(d="<ul><li>".concat(d,"</li>"),u.data.errFiles.forEach(function(E){var L=E.lastIndexOf("."),D=a.options.upload.filename(E.substr(0,L))+E.substr(L);d+="<li>".concat(D," ").concat(window.VditorI18n.uploadError,"</li>")}),d+="</ul>"),d?a.tip.show(d):a.tip.hide();var f="";Object.keys(u.data.succMap).forEach(function(E){var L=u.data.succMap[E],D=E.lastIndexOf("."),_=E.substr(D),B=a.options.upload.filename(E.substr(0,D))+_;_=_.toLowerCase()
|
|||
|
|
data-block="0"><pre><code><audio controls="controls" src="`.concat(L,'"></audio></code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="').concat(L,`"></audio></pre></div>
|
|||
|
|
`):a.currentMode==="ir"?f+='<audio controls="controls" src="'.concat(L,`"></audio>
|
|||
|
|
`):f+="[".concat(B,"](").concat(L,`)
|
|||
|
|
`):_.indexOf(".apng")===0||_.indexOf(".bmp")===0||_.indexOf(".gif")===0||_.indexOf(".ico")===0||_.indexOf(".cur")===0||_.indexOf(".jpg")===0||_.indexOf(".jpeg")===0||_.indexOf(".jfif")===0||_.indexOf(".pjp")===0||_.indexOf(".pjpeg")===0||_.indexOf(".png")===0||_.indexOf(".svg")===0||_.indexOf(".webp")===0?a.currentMode==="wysiwyg"?f+='<img alt="'.concat(B,'" src="').concat(L,`">
|
|||
|
|
`):f+=".concat(L,`)
|
|||
|
|
`):a.currentMode==="wysiwyg"?f+='<a href="'.concat(L,'">').concat(B,`</a>
|
|||
|
|
`):f+="[".concat(B,"](").concat(L,`)
|
|||
|
|
`)}),(0,q.Hc)(a.upload.range),document.execCommand("insertHTML",!1,f),a.upload.range=getSelection().getRangeAt(0).cloneRange()},_i=function(i,a,s){return mr(void 0,void 0,void 0,function(){var u,d,ue,f,E,E,L,D,_,B,K,fe,ve,ue,ke,we;return Hr(this,function(de){switch(de.label){case 0:for(u=[],d=i.options.upload.multiple===!0?a.length:1,ue=0;ue<d;ue++)f=a[ue],f instanceof DataTransferItem&&(f=f.getAsFile()),u.push(f);return i.options.upload.handler?[4,i.options.upload.handler(u)]:[3,2];case 1:return E=de.sent(),s&&(s.value=""),typeof E=="string"?(i.tip.show(E),[2]):[2];case 2:return!i.options.upload.url||!i.upload?(s&&(s.value=""),i.tip.show("please config: options.upload.url"),[2]):i.options.upload.file?[4,i.options.upload.file(u)]:[3,4];case 3:u=de.sent(),de.label=4;case 4:if(i.options.upload.validate&&(E=i.options.upload.validate(u),typeof E=="string"))return i.tip.show(E),[2];if(L=un(i),i.upload.range=(0,q.zh)(i),D=Li(i,u),D.length===0)return s&&(s.value=""),[2];for(_=new FormData,B=i.options.upload.extraData,K=0,fe=Object.keys(B);K<fe.length;K++)ve=fe[K],_.append(ve,B[ve]);for(ue=0,ke=D.length;ue<ke;ue++)_.append(i.options.upload.fieldName,D[ue]);return we=new XMLHttpRequest,i.upload.xhr=we,we.open("POST",i.options.upload.url),i.options.upload.token&&we.setRequestHeader("X-Upload-Token",i.options.upload.token),i.options.upload.withCredentials&&(we.withCredentials=!0),$n(i,we),i.upload.isUploading=!0,L.setAttribute("contenteditable","false"),we.onreadystatechange=function(){if(we.readyState===XMLHttpRequest.DONE){if(i.upload.isUploading=!1,L.setAttribute("contenteditable","true"),we.status>=200&&we.status<300)if(i.options.upload.success)i.options.upload.success(L,we.responseText);else{var Ie=we.responseText;i.options.upload.format&&(Ie=i.options.upload.format(a,we.responseText)),Oa(Ie,i)}else i.options.upload.error?i.options.upload.error(we.responseText):i.tip.show(we.responseText);s&&(s.value=""),i.upload.element.style.display="none",i.upload.xhr=void 0}},we.upload.onprogress=function(Ie){if(Ie.lengthComputable){var Te=Ie.loaded/Ie.total*100;i.upload.element.style.display="block";var $e=i.upload.element;$e.style.width=Te+"%"}},we.send(_),[2]}})})},Zr=function(i,a,s){var u,d=(0,y.F9)(a.startContainer);if(d||(d=i.wysiwyg.element),s&&s.inputType!=="formatItalic"&&s.inputType!=="deleteByDrag"&&s.inputType!=="insertFromDrop"&&s.inputType!=="formatBold"&&s.inputType!=="formatRemove"&&s.inputType!=="formatStrikeThrough"&&s.inputType!=="insertUnorderedList"&&s.inputType!=="insertOrderedList"&&s.inputType!=="formatOutdent"&&s.inputType!=="formatIndent"&&s.inputType!==""||!s){var f=mt(a.startContainer);f&&f.remove(),i.wysiwyg.element.querySelectorAll("wbr").forEach(function(Te){Te.remove()}),a.insertNode(document.createElement("wbr")),d.querySelectorAll("[style]").forEach(function(Te){Te.removeAttribute("style")}),d.querySelectorAll(".vditor-comment").forEach(function(Te){Te.textContent.trim()===""&&(Te.classList.remove("vditor-comment","vditor-comment--focus"),Te.removeAttribute("data-cmtids"))}),(u=d.previousElementSibling)===null||u===void 0||u.querySelectorAll(".vditor-comment").forEach(function(Te){Te.textContent.trim()===""&&(Te.classList.remove("vditor-comment","vditor-comment--focus"),Te.removeAttribute("data-cmtids"))});var E="";d.getAttribute("data-type")==="link-ref-defs-block"&&(d=i.wysiwyg.element);var L=d.isEqualNode(i.wysiwyg.element),D=(0,y.a1)(d,"data-type","footnotes-block");if(L)E=d.innerHTML;else{var _=(0,y.O9)(a.startContainer);if(_&&!D){var B=(0,N.S)(a.startContainer,"BLOCKQUOTE");B?d=(0,y.F9)(a.startContainer)||d:d=_}if(D&&(d=D),E=d.outerHTML,d.tagName==="UL"||d.tagName==="OL"){var K=d.previousElementSibling,fe=d.nextElementSibling;K&&(K.tagName==="UL"||K.tagName==="OL")&&(E=K.outerHTML+E,K.remove()),fe&&(fe.tagName==="UL"||fe.tagName==="OL")&&(E=E+fe.outerHTML,fe.remove()),E=E.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}d.innerText.startsWith("```")||(i.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(Te){Te&&!d.isEqualNode(Te)&&(E+=Te.outerHTML,Te.re
|
|||
|
|
</p>`)),(0,q.ib)(i[i.currentMode].element,s),dr(i),lt(i))},fu=function(i){var a=(0,y.lG)(i,"TABLE");return a&&a.rows[0].cells[0].isSameNode(i)?a:!1},mu=function(i){var a=(0,y.lG)(i,"TABLE");return a&&a.lastElementChild.lastElementChild.lastElementChild.isSameNode(i)?a:!1},As=function(i,a,s){s===void 0&&(s=!0);var u=i.previousElementSibling;return u||(i.parentElement.previousElementSibling?u=i.parentElement.previousElementSibling.lastElementChild:i.parentElement.parentElement.tagName==="TBODY"&&i.parentElement.parentElement.previousElementSibling?u=i.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:u=null),u&&(a.selectNodeContents(u),s||a.collapse(!1),(0,q.Hc)(a)),u},pi=function(i,a,s,u,d){var f=(0,q.im)(u,i[i.currentMode].element,s);if(a.key==="ArrowDown"&&u.textContent.trimRight().substr(f.start).indexOf(`
|
|||
|
|
`)===-1||a.key==="ArrowRight"&&f.start>=u.textContent.trimRight().length){var E=d.nextElementSibling;return!E||E&&(E.tagName==="TABLE"||E.getAttribute("data-type"))?(d.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,q.ib)(i[i.currentMode].element,s)):(s.selectNodeContents(E),s.collapse(!0),(0,q.Hc)(s)),a.preventDefault(),!0}return!1},Pr=function(i,a,s,u,d){var f=(0,q.im)(u,i[i.currentMode].element,s);if(a.key==="ArrowUp"&&u.textContent.substr(0,f.start).indexOf(`
|
|||
|
|
`)===-1||(a.key==="ArrowLeft"||a.key==="Backspace"&&s.toString()==="")&&f.start===0){var E=d.previousElementSibling;return!E||E&&(E.tagName==="TABLE"||E.getAttribute("data-type"))?(d.insertAdjacentHTML("beforebegin",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,q.ib)(i[i.currentMode].element,s)):(s.selectNodeContents(E),s.collapse(!1),(0,q.Hc)(s)),a.preventDefault(),!0}return!1},Ji=function(i,a,s,u){u===void 0&&(u=!0);var d=(0,y.lG)(a.startContainer,"LI");if(i[i.currentMode].element.querySelectorAll("wbr").forEach(function(B){B.remove()}),a.insertNode(document.createElement("wbr")),u&&d){for(var f="",E=0;E<d.parentElement.childElementCount;E++){var L=d.parentElement.children[E].querySelector("input");L&&L.remove(),f+='<p data-block="0">'.concat(d.parentElement.children[E].innerHTML.trimLeft(),"</p>")}d.parentElement.insertAdjacentHTML("beforebegin",f),d.parentElement.remove()}else if(d)if(s==="check")d.parentElement.querySelectorAll("li").forEach(function(B){B.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'.concat(B.textContent.indexOf(" ")===0?"":" ")),B.classList.add("vditor-task")});else{d.querySelector("input")&&d.parentElement.querySelectorAll("li").forEach(function(B){B.querySelector("input").remove(),B.classList.remove("vditor-task")});var _=void 0;s==="list"?(_=document.createElement("ul"),_.setAttribute("data-marker","*")):(_=document.createElement("ol"),_.setAttribute("data-marker","1.")),_.setAttribute("data-block","0"),_.setAttribute("data-tight",d.parentElement.getAttribute("data-tight")),_.innerHTML=d.parentElement.innerHTML,d.parentElement.parentNode.replaceChild(_,d.parentElement)}else{var D=(0,y.a1)(a.startContainer,"data-block","0");D||(i[i.currentMode].element.querySelector("wbr").remove(),D=i[i.currentMode].element.querySelector("p"),D.innerHTML="<wbr>"),s==="check"?(D.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '.concat(D.innerHTML,"</li></ul>")),D.remove()):s==="list"?(D.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'.concat(D.innerHTML,"</li></ul>")),D.remove()):s==="ordered-list"&&(D.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'.concat(D.innerHTML,"</li></ol>")),D.remove())}},Ms=function(i,a,s){var u=a.previousElementSibling;if(a&&u){var d=[a];Array.from(s.cloneContents().children).forEach(function(D,_){D.nodeType!==3&&a&&D.textContent.trim()!==""&&a.getAttribute("data-node-id")===D.getAttribute("data-node-id")&&(_!==0&&d.push(a),a=a.nextElementSibling)}),i[i.currentMode].element.querySelectorAll("wbr").forEach(function(D){D.remove()}),s.insertNode(document.createElement("wbr"));var f=u.parentElement,E="";d.forEach(function(D){var _=D.getAttribute("data-marker");_.length!==1&&(_="1".concat(_.slice(-1))),E+='<li data-node-id="'.concat(D.getAttribute("data-node-id"),'" data-marker="').concat(_,'">').concat(D.innerHTML,"</li>"),D.remove()}),u.insertAdjacentHTML("beforeend","<".concat(f.tagName,' data-block="0">').concat(E,"</").concat(f.tagName,">")),i.currentMode==="wysiwyg"?f.outerHTML=i.lute.SpinVditorDOM(f.outerHTML):f.outerHTML=i.lute.SpinVditorIRDOM(f.outerHTML),(0,q.ib)(i[i.currentMode].element,s);var L=(0,y.O9)(s.startContainer);L&&L.querySelectorAll(".vditor-".concat(i.currentMode,"__preview[data-render='2']")).forEach(function(D){tt(D,i),i.currentMode==="wysiwyg"&&D.previousElementSibling.setAttribute("style","display:none")}),lt(i),dr(i)}else i[i.currentMode].element.focus()},po=function(i,a,s,u){var d=(0,y.lG)(a.parentElement,"LI");if(d){i[i.currentMode].element.querySelectorAll("wbr").forEach(function(K){K.remove()}),s.insertNode(document.createElement("wbr"));var f=a.parentElement,E=f.cloneNode(),L=[a];Array.from(s.cloneContents().children).forEach(function(K,fe){K.nodeType!==3&&a&&K.textContent.trim()!==""&&a.getAttribute("data-node-id")===K.getAttribute("data-node-id")&&(fe!==0&&L.push(a),a=a.nextElementSibling)});var D=!1,_="";f.querySelectorAll("li").forEach(function(K){D&&(_+=K.outerHTML,!K.nextElementSibling&&!K.previousElementSibling?K.parentElement.remove():K.remove()),K.isSam
|
|||
|
|
`).pop();return a===""?!1:(a.replace(/ |-/g,"")===""||a.replace(/ |_/g,"")===""||a.replace(/ |\*/g,"")==="")&&a.replace(/ /g,"").length>2?!(a.indexOf("-")>-1&&a.trimLeft().indexOf(" ")===-1&&i.trimRight().split(`
|
|||
|
|
`).length>1||a.indexOf(" ")===0||a.indexOf(" ")===0):!1},mo=function(i){var a=i.trimRight().split(`
|
|||
|
|
`);return i=a.pop(),i.indexOf(" ")===0||i.indexOf(" ")===0||(i=i.trimLeft(),i===""||a.length===0)?!1:i.replace(/-/g,"")===""||i.replace(/=/g,"")===""},lt=function(i,a){a===void 0&&(a={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),i.currentMode==="wysiwyg"?Re(i,a):i.currentMode==="ir"?Xn(i,a):i.currentMode==="sv"&&Ge(i,a)},Cs=function(i,a,s,u){var d,f=i.startContainer,E=(0,y.lG)(f,"LI");if(E){if(!(0,m.yl)(u)&&!u.altKey&&u.key==="Enter"&&!u.shiftKey&&s&&E.contains(s)&&s.nextElementSibling)return E&&!E.textContent.endsWith(`
|
|||
|
|
`)&&E.insertAdjacentText("beforeend",`
|
|||
|
|
`),i.insertNode(document.createTextNode(`
|
|||
|
|
|
|||
|
|
`)),i.collapse(!1),lt(a),u.preventDefault(),!0;if(!(0,m.yl)(u)&&!u.shiftKey&&!u.altKey&&u.key==="Backspace"&&!E.previousElementSibling&&i.toString()===""&&(0,q.im)(E,a[a.currentMode].element,i).start===0)return E.nextElementSibling?(E.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(E.innerHTML,"</p>")),E.remove()):E.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(E.innerHTML,"</p>"),(0,q.ib)(a[a.currentMode].element,i),lt(a),u.preventDefault(),!0;if(!(0,m.yl)(u)&&!u.shiftKey&&!u.altKey&&u.key==="Backspace"&&E.textContent.trim().replace(c.g.ZWSP,"")===""&&i.toString()===""&&((d=E.previousElementSibling)===null||d===void 0?void 0:d.tagName)==="LI")return E.previousElementSibling.insertAdjacentText("beforeend",`
|
|||
|
|
|
|||
|
|
`),i.selectNodeContents(E.previousElementSibling),i.collapse(!1),E.remove(),(0,q.ib)(a[a.currentMode].element,i),lt(a),u.preventDefault(),!0;if(!(0,m.yl)(u)&&!u.altKey&&u.key==="Tab"){var L=!1;if((i.startOffset===0&&(f.nodeType===3&&!f.previousSibling||f.nodeType!==3&&f.nodeName==="LI")||E.classList.contains("vditor-task")&&i.startOffset===1&&f.previousSibling.nodeType!==3&&f.previousSibling.tagName==="INPUT")&&(L=!0),L||i.toString()!=="")return u.shiftKey?po(a,E,i,E.parentElement):Ms(a,E,i),u.preventDefault(),!0}}return!1},go=function(i,a,s){if(i.options.tab&&s.key==="Tab")return s.shiftKey||(a.toString()===""?(a.insertNode(document.createTextNode(i.options.tab)),a.collapse(!1)):(a.extractContents(),a.insertNode(document.createTextNode(i.options.tab)),a.collapse(!1))),(0,q.Hc)(a),lt(i),s.preventDefault(),!0},Ls=function(i,a,s,u){if(s){if(!(0,m.yl)(i)&&!i.altKey&&i.key==="Enter"){var d=String.raw(qs||(qs=pu(["",""],["",""])),s.textContent).replace(/\\\|/g,"").trim(),f=d.split("|");if(d.startsWith("|")&&d.endsWith("|")&&f.length>3){var E=f.map(function(){return"---"}).join("|");return E=s.textContent+`
|
|||
|
|
`+E.substring(3,E.length-3)+`
|
|||
|
|
|<wbr>`,s.outerHTML=a.lute.SpinVditorDOM(E),(0,q.ib)(a[a.currentMode].element,u),lt(a),Z(a),i.preventDefault(),!0}if(fo(s.innerHTML)&&s.previousElementSibling){var L="",D=s.innerHTML.trimRight().split(`
|
|||
|
|
`);return D.length>1&&(D.pop(),L='<p data-block="0">'.concat(D.join(`
|
|||
|
|
`),"</p>")),s.insertAdjacentHTML("afterend","".concat(L,`<hr data-block="0"><p data-block="0"><wbr>
|
|||
|
|
</p>`)),s.remove(),(0,q.ib)(a[a.currentMode].element,u),lt(a),Z(a),i.preventDefault(),!0}if(mo(s.innerHTML))return a.currentMode==="wysiwyg"?s.outerHTML=a.lute.SpinVditorDOM(s.innerHTML+`<p data-block="0"><wbr>
|
|||
|
|
</p>`):s.outerHTML=a.lute.SpinVditorIRDOM(s.innerHTML+`<p data-block="0"><wbr>
|
|||
|
|
</p>`),(0,q.ib)(a[a.currentMode].element,u),lt(a),Z(a),i.preventDefault(),!0}if(u.collapsed&&s.previousElementSibling&&i.key==="Backspace"&&!(0,m.yl)(i)&&!i.altKey&&!i.shiftKey&&s.textContent.trimRight().split(`
|
|||
|
|
`).length>1&&(0,q.im)(s,a[a.currentMode].element,u).start===0){var _=(0,y.DX)(s.previousElementSibling);return _.textContent.endsWith(`
|
|||
|
|
`)||(_.textContent=_.textContent+`
|
|||
|
|
`),_.parentElement.insertAdjacentHTML("beforeend","<wbr>".concat(s.innerHTML)),s.remove(),(0,q.ib)(a[a.currentMode].element,u),!1}return!1}},_s=function(i,a,s){for(var u="",d=0;d<s.parentElement.childElementCount;d++)u+='<td align="'.concat(s.parentElement.children[d].getAttribute("align"),'"> </td>');s.tagName==="TH"?s.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>".concat(u,"</tr></tbody>")):s.parentElement.insertAdjacentHTML("afterend","<tr>".concat(u,"</tr>")),lt(i)},Ns=function(i,a,s){for(var u="",d=0;d<s.parentElement.childElementCount;d++)s.tagName==="TH"?u+='<th align="'.concat(s.parentElement.children[d].getAttribute("align"),'"> </th>'):u+='<td align="'.concat(s.parentElement.children[d].getAttribute("align"),'"> </td>');if(s.tagName==="TH"){s.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>".concat(u,"</tr></thead>")),a.insertNode(document.createElement("wbr"));var f=s.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");s.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",f),s.parentElement.parentElement.remove(),(0,q.ib)(i.ir.element,a)}else s.parentElement.insertAdjacentHTML("beforebegin","<tr>".concat(u,"</tr>"));lt(i)},ea=function(i,a,s,u){u===void 0&&(u="afterend");for(var d=0,f=s.previousElementSibling;f;)d++,f=f.previousElementSibling;for(var E=0;E<a.rows.length;E++)E===0?a.rows[E].cells[d].insertAdjacentHTML(u,"<th> </th>"):a.rows[E].cells[d].insertAdjacentHTML(u,"<td> </td>");lt(i)},Ds=function(i,a,s){if(s.tagName==="TD"){var u=s.parentElement.parentElement;s.parentElement.previousElementSibling?a.selectNodeContents(s.parentElement.previousElementSibling.lastElementChild):a.selectNodeContents(u.previousElementSibling.lastElementChild.lastElementChild),u.childElementCount===1?u.remove():s.parentElement.remove(),a.collapse(!1),(0,q.Hc)(a),lt(i)}},Rs=function(i,a,s,u){for(var d=0,f=u.previousElementSibling;f;)d++,f=f.previousElementSibling;(u.previousElementSibling||u.nextElementSibling)&&(a.selectNodeContents(u.previousElementSibling||u.nextElementSibling),a.collapse(!0));for(var E=0;E<s.rows.length;E++){var L=s.rows[E].cells;if(L.length===1){s.remove(),dr(i);break}L[d].remove()}(0,q.Hc)(a),lt(i)},Is=function(i,a,s){var u=s.startContainer,d=(0,y.lG)(u,"TD")||(0,y.lG)(u,"TH");if(d){if(!(0,m.yl)(a)&&!a.altKey&&a.key==="Enter"){(!d.lastElementChild||d.lastElementChild&&(!d.lastElementChild.isSameNode(d.lastChild)||d.lastElementChild.tagName!=="BR"))&&d.insertAdjacentHTML("beforeend","<br>");var f=document.createElement("br");return s.insertNode(f),s.setStartAfter(f),lt(i),Z(i),a.preventDefault(),!0}if(a.key==="Tab"){if(a.shiftKey)return As(d,s),a.preventDefault(),!0;var E=d.nextElementSibling;return E||(d.parentElement.nextElementSibling?E=d.parentElement.nextElementSibling.firstElementChild:d.parentElement.parentElement.tagName==="THEAD"&&d.parentElement.parentElement.nextElementSibling?E=d.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:E=null),E&&(s.selectNodeContents(E),(0,q.Hc)(s)),a.preventDefault(),!0}var L=d.parentElement.parentElement.parentElement;if(a.key==="ArrowUp"){if(a.preventDefault(),d.tagName==="TH")return L.previousElementSibling?(s.selectNodeContents(L.previousElementSibling),s.collapse(!1),(0,q.Hc)(s)):hi(i,"beforebegin"),!0;for(var D=0,_=d.parentElement;D<_.cells.length&&!_.cells[D].isSameNode(d);D++);var B=_.previousElementSibling;return B||(B=_.parentElement.previousElementSibling.firstChild),s.selectNodeContents(B.cells[D]),s.collapse(!1),(0,q.Hc)(s),!0}if(a.key==="ArrowDown"){a.preventDefault();var _=d.parentElement;if(!_.nextElementSibling&&d.tagName==="TD")return L.nextElementSibling?(s.selectNodeContents(L.nextElementSibling),s.collapse(!0),(0,q.Hc)(s)):hi(i,"afterend"),!0;for(var D=0;D<_.cells.length&&!_.cells[D].isSameNode(d);D++);var E=_.nextElementSibling;return E||(E=_.parentElement.nextElementSibling.firstChild),s.selectNodeContents(E.cells[D]),s.collapse(!0),(0,q.Hc)(s),!0}if(i.currentMode==="wysiwyg"&&!(0,m.yl)(a)&&a.key==="Enter"&&!a.s
|
|||
|
|
</p>`,(0,q.ib)(i[i.currentMode].element,s)):(s.setStartBefore(L),s.collapse(!0)),lt(i)),a.preventDefault(),!0}if(oe("⇧⌘F",a))return Ns(i,s,d),a.preventDefault(),!0;if(oe("⌘=",a))return _s(i,s,d),a.preventDefault(),!0;if(oe("⇧⌘G",a))return ea(i,L,d,"beforebegin"),a.preventDefault(),!0;if(oe("⇧⌘=",a))return ea(i,L,d),a.preventDefault(),!0;if(oe("⌘-",a))return Ds(i,s,d),a.preventDefault(),!0;if(oe("⇧⌘-",a))return Rs(i,s,L,d),a.preventDefault(),!0;if(oe("⇧⌘L",a)){if(i.currentMode==="ir")return Qi(L,"left"),lt(i),a.preventDefault(),!0;var ve=i.wysiwyg.popover.querySelector('[data-type="left"]');if(ve)return ve.click(),a.preventDefault(),!0}if(oe("⇧⌘C",a)){if(i.currentMode==="ir")return Qi(L,"center"),lt(i),a.preventDefault(),!0;var ve=i.wysiwyg.popover.querySelector('[data-type="center"]');if(ve)return ve.click(),a.preventDefault(),!0}if(oe("⇧⌘R",a)){if(i.currentMode==="ir")return Qi(L,"right"),lt(i),a.preventDefault(),!0;var ve=i.wysiwyg.popover.querySelector('[data-type="right"]');if(ve)return ve.click(),a.preventDefault(),!0}}return!1},Os=function(i,a,s,u){if(s.tagName==="PRE"&&oe("⌘A",a))return u.selectNodeContents(s.firstElementChild),a.preventDefault(),!0;if(i.options.tab&&a.key==="Tab"&&!a.shiftKey&&u.toString()==="")return u.insertNode(document.createTextNode(i.options.tab)),u.collapse(!1),lt(i),a.preventDefault(),!0;if(a.key==="Backspace"&&!(0,m.yl)(a)&&!a.shiftKey&&!a.altKey){var d=(0,q.im)(s,i[i.currentMode].element,u);if((d.start===0||d.start===1&&s.innerText===`
|
|||
|
|
`)&&u.toString()==="")return s.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(s.firstElementChild.innerHTML,"</p>"),(0,q.ib)(i[i.currentMode].element,u),lt(i),a.preventDefault(),!0}return!(0,m.yl)(a)&&!a.altKey&&a.key==="Enter"?(s.firstElementChild.textContent.endsWith(`
|
|||
|
|
`)||s.firstElementChild.insertAdjacentText("beforeend",`
|
|||
|
|
`),u.extractContents(),u.insertNode(document.createTextNode(`
|
|||
|
|
`)),u.collapse(!1),(0,q.Hc)(u),(0,m.vU)()||(i.currentMode==="wysiwyg"?Zr(i,u):Nt(i,u)),Z(i),a.preventDefault(),!0):!1},Hs=function(i,a,s,u){var d=a.startContainer,f=(0,y.lG)(d,"BLOCKQUOTE");if(f&&a.toString()===""){if(s.key==="Backspace"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey&&(0,q.im)(f,i[i.currentMode].element,a).start===0)return a.insertNode(document.createElement("wbr")),f.outerHTML=f.innerHTML,(0,q.ib)(i[i.currentMode].element,a),lt(i),s.preventDefault(),!0;if(u&&s.key==="Enter"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey&&u.parentElement.tagName==="BLOCKQUOTE"){var E=!1;if(u.innerHTML.replace(c.g.ZWSP,"")===`
|
|||
|
|
`||u.innerHTML.replace(c.g.ZWSP,"")===""?(E=!0,u.remove()):u.innerHTML.endsWith(`
|
|||
|
|
|
|||
|
|
`)&&(0,q.im)(u,i[i.currentMode].element,a).start===u.textContent.length-1&&(u.innerHTML=u.innerHTML.substr(0,u.innerHTML.length-2),E=!0),E)return f.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(c.g.ZWSP,`<wbr>
|
|||
|
|
</p>`)),(0,q.ib)(i[i.currentMode].element,a),lt(i),s.preventDefault(),!0}var L=(0,y.F9)(d);if(i.currentMode==="wysiwyg"&&L&&oe("⇧⌘;",s))return a.insertNode(document.createElement("wbr")),L.outerHTML='<blockquote data-block="0">'.concat(L.outerHTML,"</blockquote>"),(0,q.ib)(i.wysiwyg.element,a),Re(i),s.preventDefault(),!0;if(pi(i,s,a,f,f)||Pr(i,s,a,f,f))return!0}return!1},Ps=function(i,a,s){var u=a.startContainer,d=(0,y.lG)(u,"LI");if(d&&d.classList.contains("vditor-task")){if(oe("⇧⌘J",s)){var f=d.firstElementChild;return f.checked?f.removeAttribute("checked"):f.setAttribute("checked","checked"),lt(i),s.preventDefault(),!0}if(s.key==="Backspace"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey&&a.toString()===""&&a.startOffset===1&&(u.nodeType===3&&u.previousSibling&&u.previousSibling.tagName==="INPUT"||u.nodeType!==3)){var E=d.previousElementSibling;if(d.querySelector("input").remove(),E){var L=(0,y.DX)(E);L.parentElement.insertAdjacentHTML("beforeend","<wbr>"+d.innerHTML.trim()),d.remove()}else d.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(d.innerHTML.trim()||`
|
|||
|
|
`,"</p>")),d.nextElementSibling?d.remove():d.parentElement.remove();return(0,q.ib)(i[i.currentMode].element,a),lt(i),s.preventDefault(),!0}if(s.key==="Enter"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey){if(d.textContent.trim()==="")if((0,y.fb)(d.parentElement,"vditor-task")){var D=(0,y.O9)(u);D&&po(i,d,a,D)}else if(d.nextElementSibling){var _="",B="",K=!1;Array.from(d.parentElement.children).forEach(function(ke){d.isSameNode(ke)?K=!0:K?_+=ke.outerHTML:B+=ke.outerHTML});var fe=d.parentElement.tagName,ve=d.parentElement.tagName==="OL"?"":' data-marker="'.concat(d.parentElement.getAttribute("data-marker"),'"'),ue="";B&&(ue=d.parentElement.tagName==="UL"?"":' start="1"',B="<".concat(fe,' data-tight="true"').concat(ve,' data-block="0">').concat(B,"</").concat(fe,">")),d.parentElement.outerHTML="".concat(B,`<p data-block="0"><wbr>
|
|||
|
|
</p><`).concat(fe,`
|
|||
|
|
data-tight="true"`).concat(ve,' data-block="0"').concat(ue,">").concat(_,"</").concat(fe,">")}else d.parentElement.insertAdjacentHTML("afterend",`<p data-block="0"><wbr>
|
|||
|
|
</p>`),d.parentElement.querySelectorAll("li").length===1?d.parentElement.remove():d.remove();else u.nodeType!==3&&a.startOffset===0&&u.firstChild.tagName==="INPUT"?a.setStart(u.childNodes[1],1):(a.setEndAfter(d.lastChild),d.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'.concat(d.getAttribute("data-marker"),'"><input type="checkbox"> <wbr></li>')),document.querySelector("wbr").after(a.extractContents()));return(0,q.ib)(i[i.currentMode].element,a),lt(i),Z(i),s.preventDefault(),!0}}return!1},zs=function(i,a,s,u){if(a.startContainer.nodeType!==3){var d=a.startContainer.children[a.startOffset];if(d&&d.tagName==="HR")return a.selectNodeContents(d.previousElementSibling),a.collapse(!1),s.preventDefault(),!0}if(u){var f=u.previousElementSibling;if(f&&(0,q.im)(u,i[i.currentMode].element,a).start===0&&((0,m.vU)()&&f.tagName==="HR"||f.tagName==="TABLE")){if(f.tagName==="TABLE"){var E=f.lastElementChild.lastElementChild.lastElementChild;E.innerHTML=E.innerHTML.trimLeft()+"<wbr>"+u.textContent.trim(),u.remove()}else f.remove();return(0,q.ib)(i[i.currentMode].element,a),lt(i),s.preventDefault(),!0}}return!1},Bs=function(i){(0,m.vU)()&&i.startContainer.nodeType!==3&&i.startContainer.tagName==="HR"&&i.setStartBefore(i.startContainer)},Fs=function(i,a,s){var u,d;if(!(0,m.vU)())return!1;if(i.key==="ArrowUp"&&a&&((u=a.previousElementSibling)===null||u===void 0?void 0:u.tagName)==="TABLE"){var f=a.previousElementSibling;return s.selectNodeContents(f.rows[f.rows.length-1].lastElementChild),s.collapse(!1),i.preventDefault(),!0}return i.key==="ArrowDown"&&a&&((d=a.nextElementSibling)===null||d===void 0?void 0:d.tagName)==="TABLE"?(s.selectNodeContents(a.nextElementSibling.rows[0].cells[0]),s.collapse(!0),i.preventDefault(),!0):!1},ta=function(i,a,s){return xs(void 0,void 0,void 0,function(){var u,d,f,E,L,D,_,B,K,fe,ve,ue,ke,de,we,de,Ie;return ks(this,function(Te){switch(Te.label){case 0:return i[i.currentMode].element.getAttribute("contenteditable")!=="true"?[2]:(a.stopPropagation(),a.preventDefault(),"clipboardData"in a?(u=a.clipboardData.getData("text/html"),d=a.clipboardData.getData("text/plain"),f=a.clipboardData.files):(u=a.dataTransfer.getData("text/html"),d=a.dataTransfer.getData("text/plain"),a.dataTransfer.types.includes("Files")&&(f=a.dataTransfer.items)),E={},L=function($e,bt){if(!bt)return["",Lute.WalkContinue];if(i.options.upload.renderLinkDest)return i.options.upload.renderLinkDest(i,$e,bt);var gt=$e.TokensStr();if($e.__internal_object__.Parent.Type===34&>&>.indexOf("file://")===-1&&i.options.upload.linkToImgUrl){var kt=new XMLHttpRequest;kt.open("POST",i.options.upload.linkToImgUrl),i.options.upload.token&&kt.setRequestHeader("X-Upload-Token",i.options.upload.token),i.options.upload.withCredentials&&(kt.withCredentials=!0),$n(i,kt),kt.setRequestHeader("Content-Type","application/json; charset=utf-8"),kt.onreadystatechange=function(){if(kt.readyState===XMLHttpRequest.DONE){if(kt.status===200){var dn=kt.responseText;i.options.upload.linkToImgFormat&&(dn=i.options.upload.linkToImgFormat(kt.responseText));var Wt=JSON.parse(dn);if(Wt.code!==0){i.tip.show(Wt.msg);return}var hn=Wt.data.originalURL;if(i.currentMode==="sv")i.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(zt){zt.textContent===hn&&(zt.textContent=Wt.data.url)});else{var it=i[i.currentMode].element.querySelector('img[src="'.concat(hn,'"]'));it.src=Wt.data.url,i.currentMode==="ir"&&(it.previousElementSibling.previousElementSibling.innerHTML=Wt.data.url)}lt(i)}else i.tip.show(kt.responseText);i.options.upload.linkToImgCallback&&i.options.upload.linkToImgCallback(kt.responseText)}},kt.send(JSON.stringify({url:gt}))}return i.currentMode==="ir"?['<span class="vditor-ir__marker vditor-ir__marker--link">'.concat(Lute.EscapeHTMLStr(gt),"</span>"),Lute.WalkContinue]:i.currentMode==="wysiwyg"?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'.concat(Lute.EscapeHTMLStr(gt),"</span>"),Lute.WalkContinue]},(u.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/ig,"").trim()==='<a href="'.concat(d,'">').concat(d,
|
|||
|
|
`):$e+=".concat(ue.result.toString(),`)
|
|||
|
|
`),document.execCommand("insertHTML",!1,$e)}),Te.label=8;case 8:return[3,10];case 9:d.trim()!==""&&f.length===0&&(de=(0,q.zh)(i),de.toString()!==""&&i.lute.IsValidLinkDest(d)&&(d="[".concat(de.toString(),"](").concat(d,")")),i.currentMode==="ir"?(E.Md2VditorIRDOM={renderLinkDest:L},i.lute.SetJSRenderers({renderers:E}),(0,q.oC)(Lute.Sanitize(i.lute.Md2VditorIRDOM(d)),i)):i.currentMode==="wysiwyg"?(E.Md2VditorDOM={renderLinkDest:L},i.lute.SetJSRenderers({renderers:E}),(0,q.oC)(Lute.Sanitize(i.lute.Md2VditorDOM(d)),i)):(E.Md2VditorSVDOM={renderLinkDest:L},i.lute.SetJSRenderers({renderers:E}),Pe(i,d)),i.outline.render(i)),Te.label=10;case 10:return i.currentMode!=="sv"&&(we=(0,y.F9)((0,q.zh)(i).startContainer),we&&(de=(0,q.zh)(i),i[i.currentMode].element.querySelectorAll("wbr").forEach(function($e){$e.remove()}),de.insertNode(document.createElement("wbr")),i.currentMode==="wysiwyg"?we.outerHTML=i.lute.SpinVditorDOM(we.outerHTML):we.outerHTML=i.lute.SpinVditorIRDOM(we.outerHTML),(0,q.ib)(i[i.currentMode].element,de)),i[i.currentMode].element.querySelectorAll(".vditor-".concat(i.currentMode,"__preview[data-render='2']")).forEach(function($e){tt($e,i)})),i.wysiwyg.triggerRemoveComment(i),lt(i),i[i.currentMode].element.scrollHeight-_>Math.min(i[i.currentMode].element.clientHeight,window.innerHeight)/2&&Z(i),[2]}})})},gu=function(i,a,s){return xs(void 0,void 0,void 0,function(){var u,d,f,E,L,D,_,B,K,ke,fe,ve,ue,ke,we,de;return ks(this,function(Ie){switch(Ie.label){case 0:if(!s)return[2];if(u=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,d=new RegExp("(?:("+u.source+"))([\\da-fA-F\\s]+)\\}","g"),f=s.match(d),E=[],f)for(L=0,D=f;L<D.length;L++)_=D[L],B=void 0,_.includes("\\pngblip")?B="image/png":_.includes("\\jpegblip")&&(B="image/jpeg"),B&&E.push({hex:_.replace(u,"").replace(/[^\da-fA-F]/g,""),type:B});for(K=[],vo(a,function(Te){if(Te.tagName==="V:SHAPE")return vo(Te,function($e){$e.tagName==="V:IMAGEDATA"&&K.push({shape:Te,img:$e})}),!1}),ke=0;ke<K.length;ke++)fe=document.createElement("img"),ve="data:"+E[ke].type+";base64,"+btoa((E[ke].hex.match(/\w{2}/g)||[]).map(function(Te){return String.fromCharCode(parseInt(Te,16))}).join("")),fe.src=ve,fe.title=K[ke].img.getAttribute("title"),K[ke].shape.parentNode.replaceChild(fe,K[ke].shape);ue=a.querySelectorAll("img"),ke=0,Ie.label=1;case 1:return ke<ue.length?(we=ue[ke].src||"",we?(de=ue[ke],[4,i.options.upload.base64ToLink(we)]):[3,3]):[3,4];case 2:de.src=Ie.sent(),Ie.label=3;case 3:return ke++,[3,1];case 4:return[2]}})})},vo=function(i,a){var s=a(i);if(s!==!1)for(var u=0;u<i.children.length;u++)vo(i.children[u],a)},qs,js=function(i){var a,s;i.hint.render(i);var u=(0,q.zh)(i).startContainer,d=(0,y.a1)(u,"data-type","code-block-info");if(d)if(d.textContent.replace(c.g.ZWSP,"")===""&&i.hint.recentLanguage){d.textContent=c.g.ZWSP+i.hint.recentLanguage;var f=(0,q.zh)(i);f.selectNodeContents(d)}else{var E=[],L=d.textContent.substring(0,(0,q.im)(d,i.ir.element).start).replace(c.g.ZWSP,"");(i.options.preview.hljs.langs||c.g.ALIAS_CODE_LANGUAGES.concat(((s=(a=window.hljs)===null||a===void 0?void 0:a.listLanguages())!==null&&s!==void 0?s:[]).sort())).forEach(function(D){D.indexOf(L.toLowerCase())>-1&&E.push({html:D,value:D})}),i.hint.genHTML(E,L,i)}},Xn=function(i,a){a===void 0&&(a={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),a.enableHint&&js(i),clearTimeout(i.ir.processTimeoutId),i.ir.processTimeoutId=window.setTimeout(function(){if(!i.ir.composingLock){var s=v(i);typeof i.options.input=="function"&&a.enableInput&&i.options.input(s),i.options.counter.enable&&i.counter.render(i,s),i.options.cache.enable&&(0,m.pK)()&&(localStorage.setItem(i.options.cache.id,s),i.options.cache.after&&i.options.cache.after(s)),i.devtools&&i.devtools.renderEchart(i),a.enableAddUndoStack&&i.undo.addToUndoStack(i)}},i.options.undoDelay)},fi=function(i,a){var s=(0,q.zh)(i),u=(0,y.F9)(s.startContainer)||s.startContainer;if(u){var d=u.querySelector(".vditor-ir__marker--heading");d?d.innerHTML=a:(u.insertAdjacentText("afterbegin",a),s.selectNodeContents(u),s.collapse(!
|
|||
|
|
</p>`;K.innerHTML.trim()===""?K.outerHTML=fe:K.insertAdjacentHTML("afterend",fe)}}else if(f==="quote")K&&(d.insertNode(document.createElement("wbr")),K.outerHTML='<blockquote data-block="0">'.concat(K.outerHTML,"</blockquote>"),L=!1,a.classList.add("vditor-menu--current"));else if(f==="link"){var ve=void 0;d.toString()===""?ve="".concat(s,"<wbr>").concat(u):ve="".concat(s).concat(d.toString()).concat(u.replace(")","<wbr>)")),document.execCommand("insertHTML",!1,ve),L=!1,a.classList.add("vditor-menu--current")}else if(f==="italic"||f==="bold"||f==="strike"||f==="inline-code"||f==="code"||f==="table"){var ve=void 0;d.toString()===""?ve="".concat(s,"<wbr>").concat(u):(f==="code"?ve="".concat(s,`
|
|||
|
|
`).concat(d.toString(),"<wbr>").concat(u):f==="table"?ve="".concat(s).concat(d.toString(),"<wbr>").concat(u):ve="".concat(s).concat(d.toString()).concat(u,"<wbr>"),d.deleteContents()),(f==="table"||f==="code")&&(ve=`
|
|||
|
|
`+ve+`
|
|||
|
|
|
|||
|
|
`);var ue=document.createElement("span");ue.innerHTML=ve,d.insertNode(ue),Nt(i,d),f==="table"&&(d.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,q.Hc)(d))}else(f==="check"||f==="list"||f==="ordered-list")&&(Ji(i,d,f,!1),L=!1,x(i.toolbar.elements,["check","list","ordered-list"]),a.classList.add("vditor-menu--current"))}(0,q.ib)(i.ir.element,d),Xn(i),L&&qe(i)},bu=function(i,a,s,u){function d(f){return f instanceof s?f:new s(function(E){E(f)})}return new(s||(s=Promise))(function(f,E){function L(B){try{_(u.next(B))}catch(K){E(K)}}function D(B){try{_(u.throw(B))}catch(K){E(K)}}function _(B){B.done?f(B.value):d(B.value).then(L,D)}_((u=u.apply(i,a||[])).next())})},yu=function(i,a){var s={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},u,d,f,E;return E={next:L(0),throw:L(1),return:L(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function L(_){return function(B){return D([_,B])}}function D(_){if(u)throw new TypeError("Generator is already executing.");for(;E&&(E=0,_[0]&&(s=0)),s;)try{if(u=1,d&&(f=_[0]&2?d.return:_[0]?d.throw||((f=d.return)&&f.call(d),0):d.next)&&!(f=f.call(d,_[1])).done)return f;switch(d=0,f&&(_=[_[0]&2,f.value]),_[0]){case 0:case 1:f=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,d=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(f=s.trys,!(f=f.length>0&&f[f.length-1])&&(_[0]===6||_[0]===2)){s=0;continue}if(_[0]===3&&(!f||_[1]>f[0]&&_[1]<f[3])){s.label=_[1];break}if(_[0]===6&&s.label<f[1]){s.label=f[1],f=_;break}if(f&&s.label<f[2]){s.label=f[2],s.ops.push(_);break}f[2]&&s.ops.pop(),s.trys.pop();continue}_=a.call(i,s)}catch(B){_=[6,B],d=0}finally{u=f=0}if(_[0]&5)throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}},wu=function(){function i(a){var s=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(u,d){s.element.style.display="none";var f=decodeURIComponent(u.getAttribute("data-value")),E=window.getSelection().getRangeAt(0);if(d.currentMode==="ir"){var L=(0,y.a1)(E.startContainer,"data-type","code-block-info");if(L){L.textContent=c.g.ZWSP+f.trimRight(),E.selectNodeContents(L),E.collapse(!1),Xn(d),L.parentElement.querySelectorAll("code").forEach(function(K){K.className="language-"+f.trimRight()}),tt(L.parentElement.querySelector(".vditor-ir__preview"),d),s.recentLanguage=f.trimRight();return}}if(d.currentMode==="wysiwyg"&&E.startContainer.nodeType!==3){var D=E.startContainer,_=void 0;if(D.classList.contains("vditor-input")?_=D:_=D.firstElementChild,_&&_.classList.contains("vditor-input")){_.value=f.trimRight(),E.selectNodeContents(_),E.collapse(!1),_.dispatchEvent(new CustomEvent("input",{detail:1})),s.recentLanguage=f.trimRight();return}}if(E.setStart(E.startContainer,s.lastIndex),E.deleteContents(),d.options.hint.parse?d.currentMode==="sv"?(0,q.oC)(d.lute.SpinVditorSVDOM(f),d):d.currentMode==="wysiwyg"?(0,q.oC)(d.lute.SpinVditorDOM(f),d):(0,q.oC)(d.lute.SpinVditorIRDOM(f),d):(0,q.oC)(f,d),s.splitChar===":"&&f.indexOf(":")>-1&&d.currentMode!=="sv"&&E.insertNode(document.createTextNode(" ")),E.collapse(!1),(0,q.Hc)(E),d.currentMode==="wysiwyg"){var B=(0,y.fb)(E.startContainer,"vditor-wysiwyg__block");B&&B.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(B.lastElementChild.innerHTML=B.firstElementChild.innerHTML,tt(B.lastElementChild,d))}else if(d.currentMode==="ir"){var B=(0,y.fb)(E.startContainer,"vditor-ir__marker--pre");B&&B.nextElementSibling.classList.contains("vditor-ir__preview")&&(B.nextElementSibling.innerHTML=B.innerHTML,tt(B.nextElementSibling,d))}lt(d)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",a.push({key:":"})}return i.prototype.render=function(a){var s=this;if(window.getSelection().focusNode){var u,d=getSelection().getRangeAt(0);u=d.startContainer.textContent.substring(0,d.startOffset)||"";var f=this.getKey(u,a.options.hint.extend);if(typeof f>"u")this.element.style.display="none",clearTimeout(this.timeId);else if(this.splitChar===":"){var E=f===""?a.options.
|
|||
|
|
`).concat(fe===0?"class='vditor-hint--current'":"","> ").concat(ve,"</button>")}}),this.element.innerHTML=_;var B=parseInt(document.defaultView.getComputedStyle(f,null).getPropertyValue("line-height"),10);this.element.style.top="".concat(D+(B||22),"px"),this.element.style.left="".concat(L,"px"),this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(K){K.addEventListener("click",function(fe){d.fillEmoji(K,u),fe.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top="".concat(D-this.element.offsetHeight,"px")),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")},i.prototype.select=function(a,s){if(this.element.querySelectorAll("button").length===0||this.element.style.display==="none")return!1;var u=this.element.querySelector(".vditor-hint--current");if(a.key==="ArrowDown")return a.preventDefault(),a.stopPropagation(),u.removeAttribute("class"),u.nextElementSibling?u.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if(a.key==="ArrowUp"){if(a.preventDefault(),a.stopPropagation(),u.removeAttribute("class"),u.previousElementSibling)u.previousElementSibling.className="vditor-hint--current";else{var d=this.element.children.length;this.element.children[d-1].className="vditor-hint--current"}return!0}else if(!(0,m.yl)(a)&&!a.shiftKey&&!a.altKey&&a.key==="Enter"&&!a.isComposing)return a.preventDefault(),a.stopPropagation(),this.fillEmoji(u,s),!0;return!1},i.prototype.getKey=function(a,s){var u=this;this.lastIndex=-1,this.splitChar="",s.forEach(function(_){var B=a.lastIndexOf(_.key);u.lastIndex<B&&(u.splitChar=_.key,u.lastIndex=B)});var d;if(this.lastIndex===-1)return d;var f=a.split(this.splitChar),E=f[f.length-1],L=32;if(f.length>1&&E.trim()===E)if(f.length===2&&f[0]===""&&f[1].length<L)d=f[1];else{var D=f[f.length-2].slice(-1);(0,p.X)(D)===" "&&E.length<L&&(d=E)}return d},i}(),xu=function(){function i(a){this.composingLock=!1;var s=document.createElement("div");s.className="vditor-ir",s.innerHTML='<pre class="vditor-reset" placeholder="'.concat(a.options.placeholder,`"
|
|||
|
|
contenteditable="true" spellcheck="false"></pre>`),this.element=s.firstElementChild,this.bindEvent(a),Ai(a,this.element),ho(a,this.element),Mi(a,this.element),xe(a,this.element),He(a,this.element),Ci(a,this.element),U(a,this.element,this.copy),Q(a,this.element,this.copy)}return i.prototype.copy=function(a,s){var u=getSelection().getRangeAt(0);if(u.toString()!==""){a.stopPropagation(),a.preventDefault();var d=document.createElement("div");d.appendChild(u.cloneContents()),a.clipboardData.setData("text/plain",s.lute.VditorIRDOM2Md(d.innerHTML).trim()),a.clipboardData.setData("text/html","")}},i.prototype.bindEvent=function(a){var s=this;this.element.addEventListener("paste",function(u){ta(a,u,{pasteCode:function(d){document.execCommand("insertHTML",!1,d)}})}),this.element.addEventListener("scroll",function(){A(a,["hint"])}),this.element.addEventListener("compositionstart",function(u){s.composingLock=!0}),this.element.addEventListener("compositionend",function(u){(0,m.vU)()||Nt(a,getSelection().getRangeAt(0).cloneRange()),s.composingLock=!1}),this.element.addEventListener("input",function(u){if(!(u.inputType==="deleteByDrag"||u.inputType==="insertFromDrop")){if(s.preventInput){s.preventInput=!1,Xn(a,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0});return}s.composingLock||u.data==="‘"||u.data==="“"||u.data==="《"||Nt(a,getSelection().getRangeAt(0).cloneRange(),!1,u)}}),this.element.addEventListener("click",function(u){if(u.target.tagName==="INPUT"){u.target.checked?u.target.setAttribute("checked","checked"):u.target.removeAttribute("checked"),s.preventInput=!0,Xn(a);return}var d=(0,q.zh)(a),f=(0,y.fb)(u.target,"vditor-ir__preview");if(f||(f=(0,y.fb)(d.startContainer,"vditor-ir__preview")),f&&(f.previousElementSibling.firstElementChild?d.selectNodeContents(f.previousElementSibling.firstElementChild):d.selectNodeContents(f.previousElementSibling),d.collapse(!0),(0,q.Hc)(d),Z(a)),u.target.tagName==="IMG"){var E=u.target.parentElement.querySelector(".vditor-ir__marker--link");E&&(d.selectNode(E),(0,q.Hc)(d))}var L=(0,y.a1)(u.target,"data-type","a");if(L&&!L.classList.contains("vditor-ir__node--expand")){a.options.link.click?a.options.link.click(L.querySelector(":scope > .vditor-ir__marker--link")):a.options.link.isOpen&&window.open(L.querySelector(":scope > .vditor-ir__marker--link").textContent);return}if(u.target.isEqualNode(s.element)&&s.element.lastElementChild&&d.collapsed){var D=s.element.lastElementChild.getBoundingClientRect();u.y>D.top+D.height&&(s.element.lastElementChild.tagName==="P"&&s.element.lastElementChild.textContent.trim().replace(c.g.ZWSP,"")===""?(d.selectNodeContents(s.element.lastElementChild),d.collapse(!1)):(s.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,q.ib)(s.element,d)))}d.toString()===""?ee(d,a):setTimeout(function(){ee((0,q.zh)(a),a)}),Rt(u,a),qe(a)}),this.element.addEventListener("keyup",function(u){if(!(u.isComposing||(0,m.yl)(u))){if(u.key==="Enter"&&Z(a),qe(a),(u.key==="Backspace"||u.key==="Delete")&&a.ir.element.innerHTML!==""&&a.ir.element.childNodes.length===1&&a.ir.element.firstElementChild&&a.ir.element.firstElementChild.tagName==="P"&&a.ir.element.firstElementChild.childElementCount===0&&(a.ir.element.textContent===""||a.ir.element.textContent===`
|
|||
|
|
`)){a.ir.element.innerHTML="";return}var d=(0,q.zh)(a);u.key==="Backspace"?((0,m.vU)()&&d.startContainer.textContent===`
|
|||
|
|
`&&d.startOffset===1&&(d.startContainer.textContent="",ee(d,a)),s.element.querySelectorAll(".language-math").forEach(function(E){var L=E.querySelector("br");L&&L.remove()})):u.key.indexOf("Arrow")>-1?((u.key==="ArrowLeft"||u.key==="ArrowRight")&&js(a),ee(d,a)):u.keyCode===229&&u.code===""&&u.key==="Unidentified"&&ee(d,a);var f=(0,y.fb)(d.startContainer,"vditor-ir__preview");if(f){if(u.key==="ArrowUp"||u.key==="ArrowLeft")return f.previousElementSibling.firstElementChild?d.selectNodeContents(f.previousElementSibling.firstElementChild):d.selectNodeContents(f.previousElementSibling),d.collapse(!1),u.preventDefault(),!0;if(f.tagName==="SPAN"&&(u.key==="ArrowDown"||u.key==="ArrowRight"))return f.parentElement.getAttribute("data-type")==="html-entity"?(f.parentElement.insertAdjacentText("afterend",c.g.ZWSP),d.setStart(f.parentElement.nextSibling,1)):d.selectNodeContents(f.parentElement.lastElementChild),d.collapse(!1),u.preventDefault(),!0}}})},i}(),$s=function(i){if(i.currentMode==="sv")return i.lute.Md2HTML(v(i));if(i.currentMode==="wysiwyg")return i.lute.VditorDOM2HTML(i.wysiwyg.element.innerHTML);if(i.currentMode==="ir")return i.lute.VditorIRDOM2HTML(i.ir.element.innerHTML)},ku=o(214),Us=o(436),Su=function(){function i(a){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'.concat(a,`</div>
|
|||
|
|
<div class="vditor-outline__content"></div>`)}return i.prototype.render=function(a){var s="";return a.preview.element.style.display==="block"?s=(0,Us.k)(a.preview.previewElement,this.element.lastElementChild,a):s=(0,Us.k)(a[a.currentMode].element,this.element.lastElementChild,a),s},i.prototype.toggle=function(a,s,u){var d;s===void 0&&(s=!0),u===void 0&&(u=!0);var f=(d=a.toolbar.elements.outline)===null||d===void 0?void 0:d.firstElementChild;if(s&&window.innerWidth>=c.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(a),f==null||f.classList.add("vditor-menu--current")):(this.element.style.display="none",f==null||f.classList.remove("vditor-menu--current")),u&&getSelection().rangeCount>0){var E=getSelection().getRangeAt(0);a[a.currentMode].element.contains(E.startContainer)&&(0,q.Hc)(E)}ze(a)},i}(),Eu=o(280),Tu=function(){function i(a){var s=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",a.options.classes.preview&&this.previewElement.classList.add(a.options.classes.preview),this.previewElement.style.maxWidth=a.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(D){if(D.target.tagName!=="TEXTAREA"){var _=document.createElement("div");_.className="vditor-reset",_.appendChild(getSelection().getRangeAt(0).cloneContents()),s.copyToX(a,_,"default"),D.preventDefault()}}),this.previewElement.addEventListener("click",function(D){var _=(0,y.lG)(D.target,"SPAN");if(_&&(0,y.fb)(_,"vditor-toc")){var B=s.previewElement.querySelector("#"+_.getAttribute("data-target-id"));B&&(s.element.scrollTop=B.offsetTop);return}if(D.target.tagName==="A"){a.options.link.click?a.options.link.click(D.target):a.options.link.isOpen&&window.open(D.target.getAttribute("href")),D.preventDefault();return}D.target.tagName==="IMG"&&(a.options.image.preview?a.options.image.preview(D.target):a.options.image.isPreview&&(0,se.E)(D.target,a.options.lang,a.options.theme))}),this.element.appendChild(this.previewElement);var u=a.options.preview.actions;if(u.length!==0){var d=document.createElement("div");d.className="vditor-preview__action";for(var f=[],E=0;E<u.length;E++){var L=u[E];if(typeof L=="object"){f.push('<button type="button" data-type="'.concat(L.key,'" class="').concat(L.className,'"').concat(L.tooltip?' aria-label="'.concat(L.tooltip,'"'):"",'">').concat(L.text,"</button>"));continue}switch(L){case"desktop":f.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":f.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":f.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":f.push('<button type="button" data-type="mp-wechat" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到公众号"><svg><use xlink:href="#vditor-icon-mp-wechat"></use></svg></button>');break;case"zhihu":f.push('<button type="button" data-type="zhihu" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到知乎"><svg><use xlink:href="#vditor-icon-zhihu"></use></svg></button>');break}}d.innerHTML=f.join(""),d.addEventListener((0,m.Le)(),function(D){var _=(0,N.S)(D.target,"BUTTON");if(_){var B=_.getAttribute("data-type"),K=u.find(function(fe){return(fe==null?void 0:fe.key)===B});if(K){K.click(B);return}if(B==="mp-wechat"||B==="zhihu"){s.copyToX(a,s.previewElement.cloneNode(!0),B);return}B==="desktop"?s.previewElement.style.width="auto":B==="tablet"?s.previewElement.style.width="780px":s.previewElement.style.width="360px",s.previewElement.scrollWidth>s.previewElement.parentElement.clientWidth&&(s.previewElement.style.width="auto"),s.render(a),d.querySelectorAll("button").forEach(function(fe){fe.classList.remove("vditor-preview__action--current")}),_.classList.add("vditor-preview__action--current")}}),this.element.insertBefore(d,this.previewElement)}}return i.prototype.render=function(a,s){var u=this;if(clearTimeout(this.mdTimeoutId),this.element.st
|
|||
|
|
`)){a.sv.element.innerHTML="";return}u.key==="Enter"&&Z(a)}})},i}(),Vs=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return i.prototype.show=function(a,s){var u=this;s===void 0&&(s=6e3),this.element.className="vditor-tip vditor-tip--show",s===0?(this.element.innerHTML='<div class="vditor-tip__content">'.concat(a,`
|
|||
|
|
<div class="vditor-tip__close">X</div></div>`),this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){u.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'.concat(a,"</div>"),setTimeout(function(){u.hide()},s)),this.element.removeAttribute("style"),setTimeout(function(){var d=u.element.getBoundingClientRect();d.top<46&&(u.element.style.position="fixed",u.element.style.top="46px")},150)},i.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},i}(),bo=function(i,a){if(a.options.preview.mode!==i){switch(a.options.preview.mode=i,i){case"both":a.sv.element.style.display="block",a.preview.element.style.display="block",a.preview.render(a),w(a.toolbar.elements,["both"]);break;case"editor":a.sv.element.style.display="block",a.preview.element.style.display="none",x(a.toolbar.elements,["both"]);break}a.devtools&&a.devtools.renderEchart(a)}},Cu=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Lu=function(i){Cu(a,i);function a(s,u){var d=i.call(this,s,u)||this;return s.options.preview.mode==="both"&&d.element.children[0].classList.add("vditor-menu--current"),d.element.children[0].addEventListener((0,m.Le)(),function(f){var E=d.element.firstElementChild;E.classList.contains(c.g.CLASS_MENU_DISABLED)||(f.preventDefault(),s.currentMode==="sv"&&(s.options.preview.mode==="both"?bo("editor",s):bo("both",s)))}),d}return a}(Mt),_u=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"}return i}(),Ws=o(580),Nu=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Du=function(i){Nu(a,i);function a(s,u){var d=i.call(this,s,u)||this,f=d.element.children[0],E=document.createElement("div");E.className="vditor-hint".concat(u.level===2?"":" vditor-panel--arrow");var L="";return c.g.CODE_THEME.forEach(function(D){L+="<button>".concat(D,"</button>")}),E.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(L,"</div>"),E.addEventListener((0,m.Le)(),function(D){D.target.tagName==="BUTTON"&&(A(s,["subToolbar"]),s.options.preview.hljs.style=D.target.textContent,(0,Ws.Y)(D.target.textContent,s.options.cdn),D.preventDefault(),D.stopPropagation())}),d.element.appendChild(E),M(s,E,f,u.level),d}return a}(Mt),Ru=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Iu=function(i){Ru(a,i);function a(s,u){var d=i.call(this,s,u)||this,f=d.element.children[0],E=document.createElement("div");E.className="vditor-hint".concat(u.level===2?"":" vditor-panel--arrow");var L="";return Object.keys(s.options.preview.theme.list).forEach(function(D){L+='<button data-type="'.concat(D,'">').concat(s.options.preview.theme.list[D],"</button>")}),E.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(L,"</div>"),E.add
|
|||
|
|
`)?s.length-1:s.length;if(a.options.counter.type==="text"&&a[a.currentMode]){var d=a[a.currentMode].element.cloneNode(!0);d.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(f){f.remove()}),u=d.textContent.length}typeof a.options.counter.max=="number"?(u>a.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML="".concat(u,"/").concat(a.options.counter.max)):this.element.innerHTML="".concat(u),this.element.setAttribute("aria-label",a.options.counter.type),a.options.counter.after&&a.options.counter.after(u,{enable:a.options.counter.enable,max:a.options.counter.max,type:a.options.counter.type})},i}(),Hu=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Pu=function(i){Hu(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].innerHTML=u.icon,d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),!f.currentTarget.classList.contains(c.g.CLASS_MENU_DISABLED)&&u.click(f,s)}),d}return a}(Mt),zu=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Bu=function(i){zu(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.firstElementChild.addEventListener((0,m.Le)(),function(f){var E=d.element.firstElementChild;E.classList.contains(c.g.CLASS_MENU_DISABLED)||(f.preventDefault(),E.classList.contains("vditor-menu--current")?(E.classList.remove("vditor-menu--current"),s.devtools.element.style.display="none",ze(s)):(E.classList.add("vditor-menu--current"),s.devtools.element.style.display="block",ze(s),s.devtools.renderEchart(s)))}),d}return a}(Mt),Fu=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"}return i}(),qu=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),ju=function(i){qu(a,i);function a(s,u){var d=i.call(this,s,u)||this,f=document.createElement("div");f.className="vditor-panel vditor-panel--arrow";var E="";return Object.keys(s.options.hint.emoji).forEach(function(L){var D=s.options.hint.emoji[L];D.indexOf(".")>-1?E+='<button data-value=":'.concat(L,': " data-key=":').concat(L,`:"><img
|
|||
|
|
data-value=":`).concat(L,': " data-key=":').concat(L,':" class="vditor-emojis__icon" src="').concat(D,'"/></button>'):E+='<button data-value="'.concat(D,` "
|
|||
|
|
data-key="`).concat(L,'"><span class="vditor-emojis__icon">').concat(D,"</span></button>")}),f.innerHTML='<div class="vditor-emojis" style="max-height: '.concat(s.options.height==="auto"?"auto":s.options.height-80,'px">').concat(E,`</div><div class="vditor-emojis__tail">
|
|||
|
|
<span class="vditor-emojis__tip"></span><span>`).concat(s.options.hint.emojiTail||"",`</span>
|
|||
|
|
</div>`),d.element.appendChild(f),M(s,f,d.element.firstElementChild,u.level),d.bindEvent(s),d}return a.prototype.bindEvent=function(s){var u=this;this.element.lastElementChild.addEventListener((0,m.Le)(),function(d){var f=(0,N.S)(d.target,"BUTTON");if(f){d.preventDefault();var E=f.getAttribute("data-value"),L=(0,q.zh)(s),D=E;if(s.currentMode==="wysiwyg"?D=s.lute.SpinVditorDOM(E):s.currentMode==="ir"&&(D=s.lute.SpinVditorIRDOM(E)),E.indexOf(":")>-1&&s.currentMode!=="sv"){var _=document.createElement("div");_.innerHTML=D,D=_.firstElementChild.firstElementChild.outerHTML+" ",(0,q.oC)(D,s)}else L.extractContents(),L.insertNode(document.createTextNode(E)),(0,y.F9)(L.startContainer)||Pn(s,L);L.collapse(!1),(0,q.Hc)(L),u.element.lastElementChild.style.display="none",lt(s)}}),this.element.lastElementChild.addEventListener("mouseover",function(d){var f=(0,N.S)(d.target,"BUTTON");f&&(u.element.querySelector(".vditor-emojis__tip").innerHTML=f.getAttribute("data-key"))})},a}(Mt),Gs=function(i,a,s){var u=document.createElement("a");"download"in u?(u.download=s,u.style.display="none",u.href=URL.createObjectURL(new Blob([a])),document.body.appendChild(u),u.click(),u.remove()):i.tip.show(window.VditorI18n.downloadTip,0)},$u=function(i){var a=v(i);Gs(i,a,a.substr(0,10)+".md")},Uu=function(i){i.tip.show(window.VditorI18n.generate,3800);var a=document.querySelector("#vditorExportIframe");a.contentDocument.open(),a.contentDocument.write('<link rel="stylesheet" href="'.concat(i.options.cdn,`/dist/index.css"/>
|
|||
|
|
<script src="`).concat(i.options.cdn,`/dist/method.min.js"><\/script>
|
|||
|
|
<div id="preview" style="width: 800px"></div>
|
|||
|
|
<script>
|
|||
|
|
window.addEventListener("message", (e) => {
|
|||
|
|
if(!e.data) {
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
Vditor.preview(document.getElementById('preview'), e.data, {
|
|||
|
|
cdn: "`).concat(i.options.cdn,`",
|
|||
|
|
markdown: {
|
|||
|
|
theme: `).concat(JSON.stringify(i.options.preview.theme),`
|
|||
|
|
},
|
|||
|
|
hljs: {
|
|||
|
|
style: "`).concat(i.options.preview.hljs.style,`"
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
setTimeout(() => {
|
|||
|
|
window.print();
|
|||
|
|
}, 3600);
|
|||
|
|
}, false);
|
|||
|
|
<\/script>`)),a.contentDocument.close(),setTimeout(function(){a.contentWindow.postMessage(v(i),"*")},200)},Vu=function(i){var a=$s(i),s='<html><head><link rel="stylesheet" type="text/css" href="'.concat(i.options.cdn,`/dist/index.css"/>
|
|||
|
|
<script src="`).concat(i.options.cdn,"/dist/js/i18n/").concat(i.options.lang,`.js"><\/script>
|
|||
|
|
<script src="`).concat(i.options.cdn,`/dist/method.min.js"><\/script></head>
|
|||
|
|
<body><div class="vditor-reset" id="preview">`).concat(a,`</div>
|
|||
|
|
<script>
|
|||
|
|
const previewElement = document.getElementById('preview')
|
|||
|
|
Vditor.setContentTheme('`).concat(i.options.preview.theme.current,"', '").concat(i.options.preview.theme.path,`');
|
|||
|
|
Vditor.codeRender(previewElement);
|
|||
|
|
Vditor.highlightRender(`).concat(JSON.stringify(i.options.preview.hljs),", previewElement, '").concat(i.options.cdn,`');
|
|||
|
|
Vditor.mathRender(previewElement, {
|
|||
|
|
cdn: '`).concat(i.options.cdn,`',
|
|||
|
|
math: `).concat(JSON.stringify(i.options.preview.math),`,
|
|||
|
|
});
|
|||
|
|
Vditor.mermaidRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.SMILESRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.markmapRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
Vditor.flowchartRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
Vditor.graphvizRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
Vditor.chartRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.mindmapRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.abcRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
`).concat(i.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"",`
|
|||
|
|
Vditor.speechRender(previewElement);
|
|||
|
|
<\/script>
|
|||
|
|
<script src="`).concat(i.options.cdn,"/dist/js/icons/").concat(i.options.icon,'.js"><\/script></body></html>');Gs(i,s,a.substr(0,10)+".html")},Wu=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Gu=function(i){Wu(a,i);function a(s,u){var d=i.call(this,s,u)||this,f=d.element.children[0],E=document.createElement("div");return E.className="vditor-hint".concat(u.level===2?"":" vditor-panel--arrow"),E.innerHTML=`<button data-type="markdown">Markdown</button>
|
|||
|
|
<button data-type="pdf">PDF</button>
|
|||
|
|
<button data-type="html">HTML</button>`,E.addEventListener((0,m.Le)(),function(L){var D=L.target;if(D.tagName==="BUTTON"){switch(D.getAttribute("data-type")){case"markdown":$u(s);break;case"pdf":Uu(s);break;case"html":Vu(s);break}A(s,["subToolbar"]),L.preventDefault(),L.stopPropagation()}}),d.element.appendChild(E),M(s,E,f,u.level),d}return a}(Mt),Ku=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Xu=function(i){Ku(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d._bindEvent(s,u),d}return a.prototype._bindEvent=function(s,u){this.element.children[0].addEventListener((0,m.Le)(),function(d){d.preventDefault(),s.element.className.includes("vditor--fullscreen")?(u.level||(this.innerHTML=u.icon),s.element.style.zIndex="",document.body.style.overflow="",s.element.classList.remove("vditor--fullscreen"),Object.keys(s.toolbar.elements).forEach(function(f){var E=s.toolbar.elements[f].firstChild;E&&(E.className=E.className.replace("__s","__n"),s.options.toolbar.forEach(function(L){typeof L!="string"&&L.tipPosition&&L.name===E.dataset.type&&(E.className="vditor-tooltipped vditor-tooltipped__".concat(L.tipPosition))}))}),s.counter&&(s.counter.element.className=s.counter.element.className.replace("__s","__n"))):(u.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),s.element.style.zIndex=s.options.fullscreen.index.toString(),document.body.style.overflow="hidden",s.element.classList.add("vditor--fullscreen"),Object.keys(s.toolbar.elements).forEach(function(f){var E=s.toolbar.elements[f].firstChild;E&&(E.className=E.className.replace("__n","__s"))}),s.counter&&(s.counter.element.className=s.counter.element.className.replace("__n","__s"))),s.devtools&&s.devtools.renderEchart(s),u.click&&u.click(d,s),ze(s),Xe(s)})},a}(Mt),Zu=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Yu=function(i){Zu(a,i);function a(s,u){var d=i.call(this,s,u)||this,f=document.createElement("div");return f.className="vditor-hint vditor-panel--arrow",f.innerHTML='<button data-tag="h1" data-value="# ">'.concat(window.VditorI18n.heading1," ").concat((0,m.ns)("<⌥⌘1>"),`</button>
|
|||
|
|
<button data-tag="h2" data-value="## ">`).concat(window.VditorI18n.heading2," <").concat((0,m.ns)("⌥⌘2"),`></button>
|
|||
|
|
<button data-tag="h3" data-value="### ">`).concat(window.VditorI18n.heading3," <").concat((0,m.ns)("⌥⌘3"),`></button>
|
|||
|
|
<button data-tag="h4" data-value="#### ">`).concat(window.VditorI18n.heading4," <").concat((0,m.ns)("⌥⌘4"),`></button>
|
|||
|
|
<button data-tag="h5" data-value="##### ">`).concat(window.VditorI18n.heading5," <").concat((0,m.ns)("⌥⌘5"),`></button>
|
|||
|
|
<button data-tag="h6" data-value="###### ">`).concat(window.VditorI18n.heading6," <").concat((0,m.ns)("⌥⌘6"),"></button>"),d.element.appendChild(f),d._bindEvent(s,f),d}return a.prototype._bindEvent=function(s,u){var d=this.element.children[0];d.addEventListener((0,m.Le)(),function(E){E.preventDefault(),clearTimeout(s.wysiwyg.afterRenderTimeoutId),clearTimeout(s.ir.processTimeoutId),clearTimeout(s.sv.processTimeoutId),!d.classList.contains(c.g.CLASS_MENU_DISABLED)&&(d.blur(),d.classList.contains("vditor-menu--current")?(s.currentMode==="wysiwyg"?(lr(s),Re(s)):s.currentMode==="ir"&&fi(s,""),d.classList.remove("vditor-menu--current")):(A(s,["subToolbar"]),u.style.display="block"))});for(var f=0;f<6;f++)u.children.item(f).addEventListener((0,m.Le)(),function(E){E.preventDefault(),s.currentMode==="wysiwyg"?(kn(s,E.target.getAttribute("data-tag")),Re(s),d.classList.add("vditor-menu--current")):s.currentMode==="ir"?(fi(s,E.target.getAttribute("data-value")),d.classList.add("vditor-menu--current")):Ct(s,E.target.getAttribute("data-value")),u.style.display="none"})},a}(Mt),Ju=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Qu=function(i){Ju(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),s.tip.show(`<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">
|
|||
|
|
<div style="margin-top: 14px;flex: 1">
|
|||
|
|
<div>Markdown 使用指南</div>
|
|||
|
|
<ul style="list-style: none">
|
|||
|
|
<li><a href="https://ld246.com/article/1583308420519" target="_blank">语法速查手册</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1583129520165" target="_blank">基础语法</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1583305480675" target="_blank">扩展语法</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1582778815353" target="_blank">键盘快捷键</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
<div style="margin-top: 14px;flex: 1">
|
|||
|
|
<div>Vditor 支持</div>
|
|||
|
|
<ul style="list-style: none">
|
|||
|
|
<li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>
|
|||
|
|
<li><a href="https://ld246.com/tag/vditor" target="_blank">官方讨论区</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1549638745630" target="_blank">开发手册</a></li>
|
|||
|
|
<li><a href="https://ld246.com/guide/markdown" target="_blank">演示地址</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</div></div>`,0)}),d}return a}(Mt),ed=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),td=function(i){ed(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){if(f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")){var E=(0,q.zh)(s),L=(0,y.lG)(E.startContainer,"LI");L&&Ms(s,L,E)}}),d}return a}(Mt),nd=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),rd=function(i){nd(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),s.tip.show(`<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">
|
|||
|
|
<p style="text-align: center;margin: 14px 0">
|
|||
|
|
<em>下一代的 Markdown 编辑器,为未来而构建</em>
|
|||
|
|
</p>
|
|||
|
|
<div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">
|
|||
|
|
<img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>
|
|||
|
|
<div> </div>
|
|||
|
|
<div style="flex: 1;min-width: 250px">
|
|||
|
|
Vditor 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。
|
|||
|
|
它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div style="display: flex;flex-wrap: wrap;">
|
|||
|
|
<ul style="list-style: none;flex: 1;min-width:148px">
|
|||
|
|
<li>
|
|||
|
|
项目地址:<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>
|
|||
|
|
</li>
|
|||
|
|
<li>
|
|||
|
|
开源协议:MIT
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
<ul style="list-style: none;margin-right: 18px">
|
|||
|
|
<li>
|
|||
|
|
组件版本:Vditor v`.concat(c.H," / Lute v").concat(Lute.Version,`
|
|||
|
|
</li>
|
|||
|
|
<li>
|
|||
|
|
赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
</div>`),0)}),d}return a}(Mt),id=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),ad=function(i){id(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")&&hi(s,"afterend")}),d}return a}(Mt),od=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),sd=function(i){od(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")&&hi(s,"beforebegin")}),d}return a}(Mt),ld=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),cd=function(i){ld(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){if(f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")){var E=(0,q.zh)(s),L=(0,y.lG)(E.startContainer,"LI");L&&po(s,L,E,L.parentElement)}}),d}return a}(Mt),ud=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),dd=function(i){ud(a,i);function a(s,u){var d=i.call(this,s,u)||this;return s.options.outline&&d.element.firstElementChild.classList.add("vditor-menu--current"),d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault();var E=s.toolbar.elements.outline.firstElementChild;E.classList.contains(c.g.CLASS_MENU_DISABLED)||(s.options.outline.enable=!d.element.firstElementChild.classList.contains("vditor-menu--current"),s.outline.toggle(s,s.options.outline.enable))}),d}return a}(Mt),hd=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),pd=function(i){hd(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d._bindEvent(s),d}return a.prototype._bindEvent=function(s){var u=this;this.element.children[0].addEventListener((0,m.Le)(),function(d){d.preventDefault();var f=u.element.first
|
|||
|
|
| --- | --- | --- |
|
|||
|
|
| | | |
|
|||
|
|
| | | |`,tipPosition:"n"},{name:"|"},{hotkey:"⌘Z",icon:'<svg><use xlink:href="#vditor-icon-undo"></use></svg>',name:"undo",tipPosition:"nw"},{hotkey:"⌘Y",icon:'<svg><use xlink:href="#vditor-icon-redo"></use></svg>',name:"redo",tipPosition:"nw"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-more"></use></svg>',name:"more",tipPosition:"e"},{hotkey:"⌘'",icon:'<svg><use xlink:href="#vditor-icon-fullscreen"></use></svg>',name:"fullscreen",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-edit"></use></svg>',name:"edit-mode",tipPosition:"nw"},{hotkey:"⌘P",icon:'<svg><use xlink:href="#vditor-icon-both"></use></svg>',name:"both",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-preview"></use></svg>',name:"preview",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',name:"outline",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-theme"></use></svg>',name:"content-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-code-theme"></use></svg>',name:"code-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-bug"></use></svg>',name:"devtools",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-info"></use></svg>',name:"info",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-help"></use></svg>',name:"help",tipPosition:"nw"},{name:"br"}],d=[];return a.forEach(function(f){var E=f;u.forEach(function(L){typeof f=="string"&&L.name===f&&(E=L),typeof f=="object"&&L.name===f.name&&(E=Object.assign({},L,f))}),f.toolbar&&(E.toolbar=s.mergeToolbar(f.toolbar)),d.push(E)}),d},i}(),Cd=function(){function i(a){var s=this;this.composingLock=!1,this.commentIds=[];var u=document.createElement("div");u.className="vditor-wysiwyg",u.innerHTML='<pre class="vditor-reset" placeholder="'.concat(a.options.placeholder,`"
|
|||
|
|
contenteditable="true" spellcheck="false"></pre>
|
|||
|
|
<div class="vditor-panel vditor-panel--none"></div>
|
|||
|
|
<div class="vditor-panel vditor-panel--none">
|
|||
|
|
<button type="button" aria-label="`).concat(window.VditorI18n.comment,`" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">
|
|||
|
|
<svg><use xlink:href="#vditor-icon-comment"></use></svg>
|
|||
|
|
</button>
|
|||
|
|
</div>`),this.element=u.firstElementChild,this.popover=u.firstElementChild.nextElementSibling,this.selectPopover=u.lastElementChild,this.bindEvent(a),Ai(a,this.element),ho(a,this.element),Mi(a,this.element),xe(a,this.element),He(a,this.element),Ci(a,this.element),U(a,this.element,this.copy),Q(a,this.element,this.copy),a.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var d=Lute.NewNodeID(),f=getSelection().getRangeAt(0),E=f.cloneRange(),L=f.extractContents(),D,_,B=!1,K=!1;L.childNodes.forEach(function(ue,ke){var we=!1;if(ue.nodeType===3?we=!0:ue.classList.contains("vditor-comment")?ue.classList.contains("vditor-comment")&&ue.setAttribute("data-cmtids",ue.getAttribute("data-cmtids")+" "+d):we=!0,we)if(ue.nodeType!==3&&ue.getAttribute("data-block")==="0"&&ke===0&&E.startOffset>0)ue.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(d,'">').concat(ue.innerHTML,"</span>"),D=ue;else if(ue.nodeType!==3&&ue.getAttribute("data-block")==="0"&&ke===L.childNodes.length-1&&E.endOffset<E.endContainer.textContent.length)ue.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(d,'">').concat(ue.innerHTML,"</span>"),_=ue;else if(ue.nodeType!==3&&ue.getAttribute("data-block")==="0")ke===0?B=!0:ke===L.childNodes.length-1&&(K=!0),ue.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(d,'">').concat(ue.innerHTML,"</span>");else{var de=document.createElement("span");de.classList.add("vditor-comment"),de.setAttribute("data-cmtids",d),ue.parentNode.insertBefore(de,ue),de.appendChild(ue)}});var fe=(0,y.F9)(E.startContainer);fe&&(D?(fe.insertAdjacentHTML("beforeend",D.innerHTML),D.remove()):fe.textContent.trim().replace(c.g.ZWSP,"")===""&&B&&fe.remove());var ve=(0,y.F9)(E.endContainer);ve&&(_?(ve.insertAdjacentHTML("afterbegin",_.innerHTML),_.remove()):ve.textContent.trim().replace(c.g.ZWSP,"")===""&&K&&ve.remove()),f.insertNode(L),a.options.comment.add(d,f.toString(),s.getComments(a,!0)),Re(a,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),s.hideComment()})}return i.prototype.getComments=function(a,s){var u=this;if(s===void 0&&(s=!1),a.currentMode==="wysiwyg"&&a.options.comment.enable){this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(f){u.commentIds=u.commentIds.concat(f.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var d=[];if(s)return this.commentIds.forEach(function(f){d.push({id:f,top:u.element.querySelector('.vditor-comment[data-cmtids="'.concat(f,'"]')).offsetTop})}),d}else return[]},i.prototype.triggerRemoveComment=function(a){var s=function(f,E){var L=new Set(E);return f.filter(function(D){return!L.has(D)})};if(a.currentMode==="wysiwyg"&&a.options.comment.enable&&a.wysiwyg.commentIds.length>0){var u=JSON.parse(JSON.stringify(this.commentIds));this.getComments(a);var d=s(u,this.commentIds);d.length>0&&a.options.comment.remove(d)}},i.prototype.showComment=function(){var a=(0,q.Ny)(this.element);this.selectPopover.setAttribute("style","left:".concat(a.left,"px;display:block;top:").concat(Math.max(-8,a.top-21),"px"))},i.prototype.hideComment=function(){this.selectPopover.setAttribute("style","display:none")},i.prototype.unbindListener=function(){window.removeEventListener("scroll",this.scrollListener)},i.prototype.copy=function(a,s){var u=getSelection().getRangeAt(0);if(u.toString()!==""){a.stopPropagation(),a.preventDefault();var d=(0,y.lG)(u.startContainer,"CODE"),f=(0,y.lG)(u.endContainer,"CODE");if(d&&f&&f.isSameNode(d)){var E="";d.parentElement.tagName==="PRE"?E=u.toString():E="`"+u.toString()+"`",a.clipboardData.setData("text/plain",E),a.clipboardData.setData("text/html","");return}var L=(0,y.lG)(u.startContainer,"A"),D=(0,y.lG)(u.endContainer,"A");if(L&&D&&D.isSameNode(L)){var _=L.getAttribute("title")||"";_&&(_=' "'.concat(_,'"')),a.clipboardData.setData("text/plain","[".concat(u.toString(),"](").concat(L.getAttribute("href")).concat(_,")")),a.clipboardData.setData("text/html","");return}var B=document.createElement("div");B.appendChild(u.cloneContents()),a.clipboardData.setD
|
|||
|
|
`);D--)if(f.textContent.charAt(D)!==" "&&f.textContent.charAt(D)!==" "){L=!1;break}E===0&&(L=!1);for(var _=!0,D=E-1;D<f.textContent.length;D++)if(f.textContent.charAt(D)!==" "&&f.textContent.charAt(D)!==`
|
|||
|
|
`){_=!1;break}_&&/^#{1,6} $/.test(f.textContent)&&(_=!1);var B=(0,N.W)(getSelection().getRangeAt(0).startContainer);if(B&&B.textContent===""&&(Ht(a),B.remove()),L&&f.getAttribute("data-type")!=="code-block"||_||mo(f.innerHTML)||fo(f.innerHTML)&&f.previousElementSibling){typeof a.options.input=="function"&&a.options.input(v(a));return}u.inputType==="insertParagraph"&&s.element.innerHTML==="<p><br></p><p><br></p>"&&f.previousElementSibling.remove(),Zr(a,d,u)}}}),this.element.addEventListener("click",function(u){if(u.target.tagName==="INPUT"){var d=u.target;d.checked?d.setAttribute("checked","checked"):d.removeAttribute("checked"),s.preventInput=!0,getSelection().rangeCount>0&&(0,q.Hc)(getSelection().getRangeAt(0)),Re(a);return}if(u.target.tagName==="IMG"&&!u.target.parentElement.classList.contains("vditor-wysiwyg__preview")){u.target.getAttribute("data-type")==="link-ref"?co(a,u.target):di(u,a);return}var f=(0,y.lG)(u.target,"A");if(f){a.options.link.click?a.options.link.click(f):a.options.link.isOpen&&window.open(f.getAttribute("href")),u.preventDefault();return}var E=(0,q.zh)(a);if(u.target.isEqualNode(s.element)&&s.element.lastElementChild&&E.collapsed){var L=s.element.lastElementChild.getBoundingClientRect();u.y>L.top+L.height&&(s.element.lastElementChild.tagName==="P"&&s.element.lastElementChild.textContent.trim().replace(c.g.ZWSP,"")===""?(E.selectNodeContents(s.element.lastElementChild),E.collapse(!1)):(s.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,q.ib)(s.element,E)))}jn(a);var D=(0,y.fb)(u.target,"vditor-wysiwyg__preview");D||(D=(0,y.fb)((0,q.zh)(a).startContainer,"vditor-wysiwyg__preview")),D&&cr(D,a),Rt(u,a)}),this.element.addEventListener("keyup",function(u){if(!(u.isComposing||(0,m.yl)(u))){u.key==="Enter"&&Z(a),(u.key==="Backspace"||u.key==="Delete")&&a.wysiwyg.element.innerHTML!==""&&a.wysiwyg.element.childNodes.length===1&&a.wysiwyg.element.firstElementChild&&a.wysiwyg.element.firstElementChild.tagName==="P"&&a.wysiwyg.element.firstElementChild.childElementCount===0&&(a.wysiwyg.element.textContent===""||a.wysiwyg.element.textContent===`
|
|||
|
|
`)&&(a.wysiwyg.element.innerHTML="");var d=(0,q.zh)(a);if(u.key==="Backspace"&&(0,m.vU)()&&d.startContainer.textContent===`
|
|||
|
|
`&&d.startOffset===1&&(d.startContainer.textContent=""),Pn(a,d),jn(a),!(u.key!=="ArrowDown"&&u.key!=="ArrowRight"&&u.key!=="Backspace"&&u.key!=="ArrowLeft"&&u.key!=="ArrowUp")){(u.key==="ArrowLeft"||u.key==="ArrowRight")&&a.hint.render(a);var f=(0,y.fb)(d.startContainer,"vditor-wysiwyg__preview");if(!f&&d.startContainer.nodeType!==3&&d.startOffset>0){var E=d.startContainer;E.classList.contains("vditor-wysiwyg__block")&&(f=E.lastElementChild)}if(f){var L=f.previousElementSibling;if(L.style.display==="none"){u.key==="ArrowDown"||u.key==="ArrowRight"?cr(f,a):cr(f,a,!1);return}var D=f.previousElementSibling;if(D.tagName==="PRE"&&(D=D.firstElementChild),u.key==="ArrowDown"||u.key==="ArrowRight"){var E=f.parentElement,_=Hn(E);if(_&&_.nodeType!==3){var B=_.querySelector(".vditor-wysiwyg__preview");if(B){cr(B,a);return}}if(_.nodeType===3){for(;_.textContent.length===0&&_.nextSibling;)_=_.nextSibling;d.setStart(_,1)}else d.setStart(_.firstChild,0)}else d.selectNodeContents(D),d.collapse(!1)}}}})},i}(),Ld=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),_d=function(i){Ld(a,i);function a(s,u){var d=i.call(this)||this;if(d.isDestroyed=!1,d.version=c.H,typeof s=="string"){if(u?u.cache?u.cache.id||(u.cache.id="vditor".concat(s)):u.cache={id:"vditor".concat(s)}:u={cache:{id:"vditor".concat(s)}},!document.getElementById(s))return d.showErrorTip("Failed to get element by id: ".concat(s)),d;s=document.getElementById(s)}var f=new Md(u),E=f.merge();if(E.i18n)window.VditorI18n=E.i18n,d.init(s,E);else if(["de_DE","en_US","es_ES","fr_FR","ja_JP","ko_KR","pt_BR","ru_RU","sv_SE","vi_VN","zh_CN","zh_TW"].includes(E.lang)){var L="vditorI18nScript",D=L+E.lang;document.querySelectorAll('head script[id^="'.concat(L,'"]')).forEach(function(_){_.id!==D&&document.head.removeChild(_)}),(0,b.G)("".concat(E.cdn,"/dist/js/i18n/").concat(E.lang,".js"),D).then(function(){d.init(s,E)}).catch(function(_){d.showErrorTip("GET ".concat(E.cdn,"/dist/js/i18n/").concat(E.lang,".js net::ERR_ABORTED 404 (Not Found)"))})}else throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");return d}return a.prototype.showErrorTip=function(s){var u=new Vs;document.body.appendChild(u.element),u.show(s,0)},a.prototype.updateToolbarConfig=function(s){this.vditor.toolbar.updateConfig(this.vditor,s)},a.prototype.setTheme=function(s,u,d,f){this.vditor.options.theme=s,ye(this.vditor),u&&(this.vditor.options.preview.theme.current=u,(0,le.Z)(u,f||this.vditor.options.preview.theme.path)),d&&(this.vditor.options.preview.hljs.style=d,(0,Ws.Y)(d,this.vditor.options.cdn))},a.prototype.getValue=function(){return v(this.vditor)},a.prototype.getCurrentMode=function(){return this.vditor.currentMode},a.prototype.focus=function(){this.vditor.currentMode==="sv"?this.vditor.sv.element.focus():this.vditor.currentMode==="wysiwyg"?this.vditor.wysiwyg.element.focus():this.vditor.currentMode==="ir"&&this.vditor.ir.element.focus()},a.prototype.blur=function(){this.vditor.currentMode==="sv"?this.vditor.sv.element.blur():this.vditor.currentMode==="wysiwyg"?this.vditor.wysiwyg.element.blur():this.vditor.currentMode==="ir"&&this.vditor.ir.element.blur()},a.prototype.disabled=function(){A(this.vditor,["subToolbar","hint","popover"]),k(this.vditor.toolbar.elements,c.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},a.prototype.enable=function(){S(this.vditor.toolbar.elements,c.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor.undo.resetIcon(this.vditor),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","true")
|
|||
|
|
]`).replace("lheading",kv).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},By=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Fy=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ev=/^( {2,}|\\)\n(?!\s*$)/,qy=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Bc=/[\p{P}\p{S}]/u,sf=/[\s\p{P}\p{S}]/u,Tv=/[^\s\p{P}\p{S}]/u,jy=on(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,sf).getRegex(),Av=/(?!~)[\p{P}\p{S}]/u,$y=/(?!~)[\s\p{P}\p{S}]/u,Uy=/(?:[^\s\p{P}\p{S}]|~)/u,Vy=/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,Mv=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Wy=on(Mv,"u").replace(/punct/g,Bc).getRegex(),Gy=on(Mv,"u").replace(/punct/g,Av).getRegex(),Cv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ky=on(Cv,"gu").replace(/notPunctSpace/g,Tv).replace(/punctSpace/g,sf).replace(/punct/g,Bc).getRegex(),Xy=on(Cv,"gu").replace(/notPunctSpace/g,Uy).replace(/punctSpace/g,$y).replace(/punct/g,Av).getRegex(),Zy=on("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Tv).replace(/punctSpace/g,sf).replace(/punct/g,Bc).getRegex(),Yy=on(/\\(punct)/,"gu").replace(/punct/g,Bc).getRegex(),Jy=on(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Qy=on(af).replace("(?:-->|$)","-->").getRegex(),e7=on("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Qy).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),rc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,t7=on(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",rc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Lv=on(/^!?\[(label)\]\[(ref)\]/).replace("label",rc).replace("ref",rf).getRegex(),_v=on(/^!?\[(ref)\](?:\[\])?/).replace("ref",rf).getRegex(),n7=on("reflink|nolink(?!\\()","g").replace("reflink",Lv).replace("nolink",_v).getRegex(),lf={_backpedal:El,anyPunctuation:Yy,autolink:Jy,blockSkip:Vy,br:Ev,code:Fy,del:El,emStrongLDelim:Wy,emStrongRDelimAst:Ky,emStrongRDelimUnd:Zy,escape:By,link:t7,nolink:_v,punctuation:jy,reflink:Lv,reflinkSearch:n7,tag:e7,text:qy,url:El},r7={...lf,link:on(/^!?\[(label)\]\((.*?)\)/).replace("label",rc).getRegex(),reflink:on(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",rc).getRegex()},jh={...lf,emStrongRDelimAst:Xy,emStrongLDelim:Gy,url:on(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},i7={...jh,br:on(Ev).replace("{2,}","*").getRegex(),text:on(jh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},i0={normal:of,gfm:Py,pedantic:zy},rl={normal:lf,gfm:jh,breaks:i7,pedantic:r7},a7={"&":"&","<":"<",">":">",'"':"
|
|||
|
|
`).map(l=>{let h=l.match(n.other.beginningSpace);if(h===null)return l;let[c]=h;return c.length>=o.length?l.slice(o.length):l}).join(`
|
|||
|
|
`)}var ic=class{constructor(t){vt(this,"options"),vt(this,"rules"),vt(this,"lexer"),this.options=t||zo}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:il(n,`
|
|||
|
|
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=s7(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=il(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:il(e[0],`
|
|||
|
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=il(e[0],`
|
|||
|
|
`).split(`
|
|||
|
|
`),r="",o="",l=[];for(;n.length>0;){let h=!1,c=[],p;for(p=0;p<n.length;p++)if(this.rules.other.blockquoteStart.test(n[p]))c.push(n[p]),h=!0;else if(!h)c.push(n[p]);else break;n=n.slice(p);let v=c.join(`
|
|||
|
|
`),b=v.replace(this.rules.other.blockquoteSetextReplace,`
|
|||
|
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|||
|
|
${v}`:v,o=o?`${o}
|
|||
|
|
${b}`:b;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,l,!0),this.lexer.state.top=g,n.length===0)break;let m=l.at(-1);if((m==null?void 0:m.type)==="code")break;if((m==null?void 0:m.type)==="blockquote"){let x=m,w=x.raw+`
|
|||
|
|
`+n.join(`
|
|||
|
|
`),S=this.blockquote(w);l[l.length-1]=S,r=r.substring(0,r.length-x.raw.length)+S.raw,o=o.substring(0,o.length-x.text.length)+S.text;break}else if((m==null?void 0:m.type)==="list"){let x=m,w=x.raw+`
|
|||
|
|
`+n.join(`
|
|||
|
|
`),S=this.list(w);l[l.length-1]=S,r=r.substring(0,r.length-m.raw.length)+S.raw,o=o.substring(0,o.length-x.raw.length)+S.raw,n=w.substring(l.at(-1).raw.length).split(`
|
|||
|
|
`);continue}}return{type:"blockquote",raw:r,tokens:l,text:o}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let l=this.rules.other.listItemRegex(n),h=!1;for(;t;){let p=!1,v="",b="";if(!(e=l.exec(t))||this.rules.block.hr.test(t))break;v=e[0],t=t.substring(v.length);let g=e[2].split(`
|
|||
|
|
`,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),m=t.split(`
|
|||
|
|
`,1)[0],x=!g.trim(),w=0;if(this.options.pedantic?(w=2,b=g.trimStart()):x?w=e[1].length+1:(w=e[2].search(this.rules.other.nonSpaceChar),w=w>4?1:w,b=g.slice(w),w+=e[1].length),x&&this.rules.other.blankLine.test(m)&&(v+=m+`
|
|||
|
|
`,t=t.substring(m.length+1),p=!0),!p){let C=this.rules.other.nextBulletRegex(w),T=this.rules.other.hrRegex(w),A=this.rules.other.fencesBeginRegex(w),M=this.rules.other.headingBeginRegex(w),y=this.rules.other.htmlBeginRegex(w);for(;t;){let N=t.split(`
|
|||
|
|
`,1)[0],z;if(m=N,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),z=m):z=m.replace(this.rules.other.tabCharGlobal," "),A.test(m)||M.test(m)||y.test(m)||C.test(m)||T.test(m))break;if(z.search(this.rules.other.nonSpaceChar)>=w||!m.trim())b+=`
|
|||
|
|
`+z.slice(w);else{if(x||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(g)||M.test(g)||T.test(g))break;b+=`
|
|||
|
|
`+m}!x&&!m.trim()&&(x=!0),v+=N+`
|
|||
|
|
`,t=t.substring(N.length+1),g=z.slice(w)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(v)&&(h=!0));let S=null,k;this.options.gfm&&(S=this.rules.other.listIsTask.exec(b),S&&(k=S[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:v,task:!!S,checked:k,loose:!1,text:b,tokens:[]}),o.raw+=v}let c=o.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let p=0;p<o.items.length;p++)if(this.lexer.state.top=!1,o.items[p].tokens=this.lexer.blockTokens(o.items[p].text,[]),!o.loose){let v=o.items[p].tokens.filter(g=>g.type==="space"),b=v.length>0&&v.some(g=>this.rules.other.anyLine.test(g.raw));o.loose=b}if(o.loose)for(let p=0;p<o.items.length;p++)o.items[p].loose=!0;return o}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:o}}}table(t){var e;let n=this.rules.block.table.exec(t);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=im(n[1]),o=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=(e=n[3])!=null&&e.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|||
|
|
`):[],h={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===o.length){for(let c of o)this.rules.other.tableAlignRight.test(c)?h.align.push("right"):this.rules.other.tableAlignCenter.test(c)?h.align.push("center"):this.rules.other.tableAlignLeft.test(c)?h.align.push("left"):h.align.push(null);for(let c=0;c<r.length;c++)h.header.push({text:r[c],tokens:this.lexer.inline(r[c]),header:!0,align:h.align[c]});for(let c of l)h.rows.push(im(c,h.header.length).map((p,v)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:h.align[v]})));return h}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|||
|
|
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let l=il(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=o7(e[2],"()");if(l===-2)return;if(l>-1){let h=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,h).trim(),e[3]=""}}let r=e[2],o="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(r);l&&(r=l[1],o=l[3])}else o=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),am(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=e[r.toLowerCase()];if(!o){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return am(n,o,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let o=[...r[0]].length-1,l,h,c=o,p=0,v=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,e=e.slice(-1*t.length+o);(r=v.exec(e))!=null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(h=[...l].length,r[3]||r[4]){c+=h;continue}else if((r[5]||r[6])&&o%3&&!((o+h)%3)){p+=h;continue}if(c-=h,c>0)continue;h=Math.min(h,h+c+p);let b=[...r[0]][0].length,g=t.slice(0,o+r.index+b+h);if(Math.min(o,h)%2){let x=g.slice(1,-1);return{type:"em",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}let m=g.slice(2,-2);return{type:"strong",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var e;let n;if(n=this.rules.inline.url.exec(t)){let r,o;if(n[2]==="@")r=n[0],o="mailto:"+r;else{let l;do l=n[0],n[0]=((e=this.rules.inline._backpedal.exec(n[0]))==null?void 0:e[0])??"";while(l!==n[0]);r=n[0],n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},pa=class $h{constructor(e){vt(this,"tokens"),vt(this,"
|
|||
|
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){var o,l,h;for(this.options.pedantic&&(e=e.replace(xr.tabCharGlobal," ").replace(xr.spaceLine,""));e;){let c;if((l=(o=this.options.extensions)==null?void 0:o.block)!=null&&l.some(v=>(c=v.call({lexer:this},e,n))?(e=e.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.space(e)){e=e.substring(c.raw.length);let v=n.at(-1);c.raw.length===1&&v!==void 0?v.raw+=`
|
|||
|
|
`:n.push(c);continue}if(c=this.tokenizer.code(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.at(-1).src=v.text):n.push(c);continue}if(c=this.tokenizer.fences(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.heading(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.hr(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.blockquote(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.list(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.html(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.def(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.raw,this.inlineQueue.at(-1).src=v.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title},n.push(c));continue}if(c=this.tokenizer.table(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.lheading(e)){e=e.substring(c.raw.length),n.push(c);continue}let p=e;if((h=this.options.extensions)!=null&&h.startBlock){let v=1/0,b=e.slice(1),g;this.options.extensions.startBlock.forEach(m=>{g=m.call({lexer:this},b),typeof g=="number"&&g>=0&&(v=Math.min(v,g))}),v<1/0&&v>=0&&(p=e.substring(0,v+1))}if(this.state.top&&(c=this.tokenizer.paragraph(p))){let v=n.at(-1);r&&(v==null?void 0:v.type)==="paragraph"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):n.push(c),r=p.length!==e.length,e=e.substring(c.raw.length);continue}if(c=this.tokenizer.text(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):n.push(c);continue}if(e){let v="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(v)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){var r,o,l;let h=e,c=null;if(this.tokens.links){let b=Object.keys(this.tokens.links);if(b.length>0)for(;(c=this.tokenizer.rules.inline.reflinkSearch.exec(h))!=null;)b.includes(c[0].slice(c[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(c=this.tokenizer.rules.inline.anyPunctuation.exec(h))!=null;)h=h.slice(0,c.index)+"++"+h.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(c=this.tokenizer.rules.inline.blockSkip.exec(h))!=null;)h=h.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let p=!1,v="";for(;e;){p||(v=""),p=!1;let b;if((o=(r=this.options.extensions)==null?void 0:r.inline)!=null&&o.some(m=>(b=m.call({lexer:this},e,n))?(e=e.substring(b.raw.length),n.push(b),!0):!1))continue;if(b=this.tokenizer.escape(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.tag(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.link(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(b.raw.length);let m=n.at(-1);b.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=b.raw,m.text+=b.text):n.push(b);continue}if(b=this.tokenizer.emStrong(e,h,v)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.codespan(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.br(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.del(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.autolink(e)){e=e.substring(b.raw.length),n.push(b);continue}if(!this.state.inLink&&(b=this.tokenizer.url(e))){e=e.substring(b.raw.length),n.push(b);continue}let g=e;if((l=this.options.extensions)!=null&&l.startInline){let m=1/0,x=e.slice(1),w;this.options.extensions.startInline.forEach(S=>{w=S.call({lexer:this},x),typeof w=="number"&&w>=0&&(m=Math.min(m,w))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(b=this.tokenizer.inlineText(g)){e=e.substring(b.raw.length),b.raw.slice(-1)!=="_"&&(v=b.raw.slice(-1)),p=!0;let m=n.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=b.raw,m.text+=b.text):n.push(b);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(m)}}return n}},ac=class{constructor(t){vt(this,"options"),vt(this,"parser"),this.options=t||zo}space(t){return""}code({text:t,lang:e,escaped:n}){var r;let o=(r=(e||"").match(xr.notSpaceStart))==null?void 0:r[0],l=t.replace(xr.endingNewline,"")+`
|
|||
|
|
`;return o?'<pre><code class="language-'+Ri(o)+'">'+(n?l:Ri(l,!0))+`</code></pre>
|
|||
|
|
`:"<pre><code>"+(n?l:Ri(l,!0))+`</code></pre>
|
|||
|
|
`}blockquote({tokens:t}){return`<blockquote>
|
|||
|
|
${this.parser.parse(t)}</blockquote>
|
|||
|
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|||
|
|
`}hr(t){return`<hr>
|
|||
|
|
`}list(t){let e=t.ordered,n=t.start,r="";for(let h=0;h<t.items.length;h++){let c=t.items[h];r+=this.listitem(c)}let o=e?"ol":"ul",l=e&&n!==1?' start="'+n+'"':"";return"<"+o+l+`>
|
|||
|
|
`+r+"</"+o+`>
|
|||
|
|
`}listitem(t){var e;let n="";if(t.task){let r=this.checkbox({checked:!!t.checked});t.loose?((e=t.tokens[0])==null?void 0:e.type)==="paragraph"?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=r+" "+Ri(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):n+=r+" "}return n+=this.parser.parse(t.tokens,!!t.loose),`<li>${n}</li>
|
|||
|
|
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|||
|
|
`}table(t){let e="",n="";for(let o=0;o<t.header.length;o++)n+=this.tablecell(t.header[o]);e+=this.tablerow({text:n});let r="";for(let o=0;o<t.rows.length;o++){let l=t.rows[o];n="";for(let h=0;h<l.length;h++)n+=this.tablecell(l[h]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|||
|
|
<thead>
|
|||
|
|
`+e+`</thead>
|
|||
|
|
`+r+`</table>
|
|||
|
|
`}tablerow({text:t}){return`<tr>
|
|||
|
|
${t}</tr>
|
|||
|
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|||
|
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ri(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),o=rm(t);if(o===null)return r;t=o;let l='<a href="'+t+'"';return e&&(l+=' title="'+Ri(e)+'"'),l+=">"+r+"</a>",l}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let o=rm(t);if(o===null)return Ri(n);t=o;let l=`<img src="${t}" alt="${n}"`;return e&&(l+=` title="${Ri(e)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ri(t.text)}},cf=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},fa=class Uh{constructor(e){vt(this,"options"),vt(this,"renderer"),vt(this,"textRenderer"),this.options=e||zo,this.options.renderer=this.options.renderer||new ac,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new cf}static parse(e,n){return new Uh(n).parse(e)}static parseInline(e,n){return new Uh(n).parseInline(e)}parse(e,n=!0){var r,o;let l="";for(let h=0;h<e.length;h++){let c=e[h];if((o=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&o[c.type]){let v=c,b=this.options.extensions.renderers[v.type].call({parser:this},v);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(v.type)){l+=b||"";continue}}let p=c;switch(p.type){case"space":{l+=this.renderer.space(p);continue}case"hr":{l+=this.renderer.hr(p);continue}case"heading":{l+=this.renderer.heading(p);continue}case"code":{l+=this.renderer.code(p);continue}case"table":{l+=this.renderer.table(p);continue}case"blockquote":{l+=this.renderer.blockquote(p);continue}case"list":{l+=this.renderer.list(p);continue}case"html":{l+=this.renderer.html(p);continue}case"def":{l+=this.renderer.def(p);continue}case"paragraph":{l+=this.renderer.paragraph(p);continue}case"text":{let v=p,b=this.renderer.text(v);for(;h+1<e.length&&e[h+1].type==="text";)v=e[++h],b+=`
|
|||
|
|
`+this.renderer.text(v);n?l+=this.renderer.paragraph({type:"paragraph",raw:b,text:b,tokens:[{type:"text",raw:b,text:b,escaped:!0}]}):l+=b;continue}default:{let v='Token with "'+p.type+'" type was not found.';if(this.options.silent)return"";throw new Error(v)}}}return l}parseInline(e,n=this.renderer){var r,o;let l="";for(let h=0;h<e.length;h++){let c=e[h];if((o=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&o[c.type]){let v=this.options.extensions.renderers[c.type].call({parser:this},c);if(v!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){l+=v||"";continue}}let p=c;switch(p.type){case"escape":{l+=n.text(p);break}case"html":{l+=n.html(p);break}case"link":{l+=n.link(p);break}case"image":{l+=n.image(p);break}case"strong":{l+=n.strong(p);break}case"em":{l+=n.em(p);break}case"codespan":{l+=n.codespan(p);break}case"br":{l+=n.br(p);break}case"del":{l+=n.del(p);break}case"text":{l+=n.text(p);break}default:{let v='Token with "'+p.type+'" type was not found.';if(this.options.silent)return"";throw new Error(v)}}}return l}},Ud,I0=(Ud=class{constructor(t){vt(this,"options"),vt(this,"block"),this.options=t||zo}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?pa.lex:pa.lexInline}provideParser(){return this.block?fa.parse:fa.parseInline}},vt(Ud,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Ud),l7=class{constructor(...t){vt(this,"defaults",ef()),vt(this,"options",this.setOptions),vt(this,"parse",this.parseMarkdown(!0)),vt(this,"parseInline",this.parseMarkdown(!1)),vt(this,"Parser",fa),vt(this,"Renderer",ac),vt(this,"TextRenderer",cf),vt(this,"Lexer",pa),vt(this,"Tokenizer",ic),vt(this,"Hooks",I0),this.use(...t)}walkTokens(t,e){var n,r;let o=[];for(let l of t)switch(o=o.concat(e.call(this,l)),l.type){case"table":{let h=l;for(let c of h.header)o=o.concat(this.walkTokens(c.tokens,e));for(let c of h.rows)for(let p of c)o=o.concat(this.walkTokens(p.tokens,e));break}case"list":{let h=l;o=o.concat(this.walkTokens(h.items,e));break}default:{let h=l;(r=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&r[h.type]?this.defaults.extensions.childTokens[h.type].forEach(c=>{let p=h[c].flat(1/0);o=o.concat(this.walkTokens(p,e))}):h.tokens&&(o=o.concat(this.walkTokens(h.tokens,e)))}}return o}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let l=e.renderers[o.name];l?e.renderers[o.name]=function(...h){let c=o.renderer.apply(this,h);return c===!1&&(c=l.apply(this,h)),c}:e.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[o.level];l?l.unshift(o.tokenizer):e[o.level]=[o.tokenizer],o.start&&(o.level==="block"?e.startBlock?e.startBlock.push(o.start):e.startBlock=[o.start]:o.level==="inline"&&(e.startInline?e.startInline.push(o.start):e.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(e.childTokens[o.name]=o.childTokens)}),r.extensions=e),n.renderer){let o=this.defaults.renderer||new ac(this.defaults);for(let l in n.renderer){if(!(l in o))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let h=l,c=n.renderer[h],p=o[h];o[h]=(...v)=>{let b=c.apply(o,v);return b===!1&&(b=p.apply(o,v)),b||""}}r.renderer=o}if(n.tokenizer){let o=this.defaults.tokenizer||new ic(this.defaults);for(let l in n.tokenizer){if(!(l in o))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let h=l,c=n.tokenizer[h],p=o[h];o[h]=(...v)=>{let b=c.apply(o,v);return b===!1&&(b=p.apply(o,v)),b}}r.tokenizer=o}if(n.hooks){let o=this.defaults.hooks||new I0;for(let l in n.hooks){if(!(l in o))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let h=l,c=n.hooks[h],p
|
|||
|
|
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Ri(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},Ro=new l7;function an(t,e){return Ro.parse(t,e)}an.options=an.setOptions=function(t){return Ro.setOptions(t),an.defaults=Ro.defaults,wv(an.defaults),an};an.getDefaults=ef;an.defaults=zo;an.use=function(...t){return Ro.use(...t),an.defaults=Ro.defaults,wv(an.defaults),an};an.walkTokens=function(t,e){return Ro.walkTokens(t,e)};an.parseInline=Ro.parseInline;an.Parser=fa;an.parser=fa.parse;an.Renderer=ac;an.TextRenderer=cf;an.Lexer=pa;an.lexer=pa.lex;an.Tokenizer=ic;an.Hooks=I0;an.parse=an;an.options;an.setOptions;an.use;an.walkTokens;an.parseInline;fa.parse;pa.lex;const Sn=document,Nv=function(t,e){const n=(this!=null&&this.el?this.el:e||document).querySelector(`[data-nodeid="me${t}"]`);if(!n)throw new Error(`FindEle: Node ${t} not found, maybe it's collapsed.`);return n},Fc=function(t,e){if(t.innerHTML="",e.style){const r=e.style;for(const o in r)t.style[o]=r[o]}if(e.dangerouslySetInnerHTML){const r=e.dangerouslySetInnerHTML;if(r.includes("|")&&r.includes("-")||r.includes("![")||r.includes("#")||r.includes("**")||r.includes("`")){t.innerHTML='<div class="node-loading"><div class="loading-spinner"></div><span>渲染中...</span></div>',t.classList.add("mindmap-node-rendering");try{Promise.resolve().then(()=>sk).then(({default:o})=>{o.preview(t,r,{mode:"dark",hljs:{style:"github"},after:()=>{t.classList.remove("mindmap-node-rendering"),t.classList.add("mindmap-node-completed")}})}).catch(o=>{n(t,r)})}catch{n(t,r)}return}n(t,r);return}function n(r,o){let l=o;l.includes("<table")||l.includes("<td>")||l.includes("<th>")?(l=l.replace(/•\s*【/g,"【"),l=l.replace(/•\s*\[/g,"["),l=l.replace(/•\s*(/g,"("),l=l.replace(/•\s*\(/g,"(")):(l=l.replace(/•\s*【/g,"【"),l=l.replace(/•\s*\[/g,"["),l=l.replace(/•\s*(/g,"("),l=l.replace(/•\s*\(/g,"("),l=l.replace(/^(\s*)•\s*(.+)$/gm,"<li>$2</li>").replace(/(<li>.*<\/li>)/gs,h=>l.includes("<ul>")?h:`<ul>${h}</ul>`).replace(/\n/g,"<br>")),r.innerHTML=l,l.includes("<img"),e.image,r.classList.add("no-image"),r.classList.remove("has-image")}if(e.image){const r=e.image;if(r.url&&r.width&&r.height){const o=Sn.createElement("img");o.src=this.imageProxy?this.imageProxy(r.url):r.url,o.style.width=r.width+"px",o.style.height=r.height+"px",r.fit&&(o.style.objectFit=r.fit),t.appendChild(o),t.image=o}}else t.image&&(t.image=void 0);{const r=Sn.createElement("span");r.className="text";let o="";this.markdown?o=this.markdown(e.topic,e):o=e.topic||"",o=o.replace(/•\s*【/g,"【"),o=o.replace(/•\s*\[/g,"["),o=o.replace(/•\s*(/g,"("),o=o.replace(/•\s*\(/g,"("),r.innerHTML=o,t.appendChild(r),t.text=r,e.image,o.includes("<img"),t.classList.add("no-image"),t.classList.remove("has-image")}if(e.hyperLink){const r=Sn.createElement("a");r.className="hyper-link",r.target="_blank",r.innerText="🔗",r.href=e.hyperLink,t.appendChild(r),t.link=r}else t.link&&(t.link=void 0);if(e.icons&&e.icons.length){const r=Sn.createElement("span");r.className="icons",r.innerHTML=e.icons.map(o=>`<span>${Fh(o)}</span>`).join(""),t.appendChild(r),t.icons=r}else t.icons&&(t.icons=void 0);if(e.tags&&e.tags.length){const r=Sn.createElement("div");r.className="tags",e.tags.forEach(o=>{const l=Sn.createElement("span");typeof o=="string"?l.textContent=o:(l.textContent=o.text,o.className&&(l.className=o.className),o.style&&Object.assign(l.style,o.style)),r.appendChild(l)}),t.appendChild(r),t.tags=r}else t.tags&&(t.tags=void 0)},c7=function(t,e){const n=Sn.createElement("me-wrapper"),{p:r,tpc:o}=this.createParent(t);if(n.appendChild(r),!e&&t.children&&t.children.length>0){const l=uf(t.expanded);if(r.appendChild(l),t.expanded!==!1){const h=Ay(this,t.children);n.appendChild(h)}}return{grp:n,top:r,tpc:o}},u7=function(t){const e=Sn.createElement("me-parent"),n=this.createTopic(t);return Fc.call(this,n,t),e.appendChild(n),{p:e,tpc:n}},d7=function(t){const e=Sn.createElement("me-children");return e.append(...t),e},h
|
|||
|
|
color:${o.color};
|
|||
|
|
padding:${o.padding};
|
|||
|
|
margin:${o.margin};
|
|||
|
|
font:${o.font};
|
|||
|
|
background-color:${o.backgroundColor!=="rgba(0, 0, 0, 0)"&&o.backgroundColor};
|
|||
|
|
border-radius:${o.borderRadius};`,this.direction===0&&(e.style.right="0"),Dv(e),this.bus.fire("operation",{name:"beginEdit",obj:t.nodeObj}),e.addEventListener("keydown",l=>{l.stopPropagation();const h=l.key;if(h==="Enter"||h==="Tab"){if(l.shiftKey)return;l.preventDefault(),e.blur(),this.container.focus()}}),e.addEventListener("blur",()=>{var l;if(!e)return;const h=((l=e.textContent)==null?void 0:l.trim())||"";h===""?n.topic=r:(n.topic=h,this.markdown?t.text.innerHTML=this.markdown(n.topic,n):t.text.textContent=h),e.remove(),Fc.call(this,t,n),h!==r&&(this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:n,origin:r}))})},uf=function(t){const e=Sn.createElement("me-epd");return e.expanded=t!==!1,e.className=t!==!1?"minus":"",e},f7=function(t){if(!t)return;const e=t.nodeObj,n=e.dangerouslySetInnerHTML||"",r=Sn.createElement("div");r.id="table-edit-overlay",r.style.cssText=`
|
|||
|
|
position: fixed;
|
|||
|
|
top: 0;
|
|||
|
|
left: 0;
|
|||
|
|
right: 0;
|
|||
|
|
bottom: 0;
|
|||
|
|
background: rgba(0, 0, 0, 0.5);
|
|||
|
|
z-index: 9999;
|
|||
|
|
`;const o=Sn.createElement("div");o.id="table-edit-container",o.style.cssText=`
|
|||
|
|
position: fixed;
|
|||
|
|
top: 50%;
|
|||
|
|
left: 50%;
|
|||
|
|
transform: translate(-50%, -50%);
|
|||
|
|
width: 600px;
|
|||
|
|
min-height: 400px;
|
|||
|
|
max-height: 80vh;
|
|||
|
|
background: white;
|
|||
|
|
border: 2px solid #660874;
|
|||
|
|
border-radius: 8px;
|
|||
|
|
padding: 15px;
|
|||
|
|
z-index: 10000;
|
|||
|
|
box-shadow: 0 8px 24px rgba(0,0,0,0.3);
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
`;const l=Sn.createElement("div");l.textContent="编辑表格(Markdown格式)",l.style.cssText=`
|
|||
|
|
font-size: 14px;
|
|||
|
|
font-weight: 600;
|
|||
|
|
color: #333;
|
|||
|
|
margin-bottom: 10px;
|
|||
|
|
padding-bottom: 8px;
|
|||
|
|
border-bottom: 1px solid #e0e0e0;
|
|||
|
|
`;const h=Sn.createElement("textarea");h.value=this.convertTableHTMLToMarkdown(n),h.style.cssText=`
|
|||
|
|
flex: 1;
|
|||
|
|
min-height: 300px;
|
|||
|
|
border: 1px solid #ddd;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
padding: 12px;
|
|||
|
|
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
|
|||
|
|
font-size: 13px;
|
|||
|
|
line-height: 1.5;
|
|||
|
|
resize: vertical;
|
|||
|
|
outline: none;
|
|||
|
|
background: #fafafa;
|
|||
|
|
color: #333;
|
|||
|
|
caret-color: #660874;
|
|||
|
|
`,h.setAttribute("spellcheck","false"),h.setAttribute("autocomplete","off"),h.setAttribute("autocorrect","off"),h.setAttribute("autocapitalize","off");const c=Sn.createElement("div");c.style.cssText=`
|
|||
|
|
display: flex;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 8px;
|
|||
|
|
margin-top: 12px;
|
|||
|
|
padding-top: 12px;
|
|||
|
|
border-top: 1px solid #e0e0e0;
|
|||
|
|
`;const p=Sn.createElement("span");p.textContent="提示: Ctrl+Enter保存, Esc取消",p.style.cssText=`
|
|||
|
|
font-size: 11px;
|
|||
|
|
color: #999;
|
|||
|
|
`;const v=Sn.createElement("div");v.style.cssText=`
|
|||
|
|
display: flex;
|
|||
|
|
gap: 8px;
|
|||
|
|
`;const b=Sn.createElement("button");b.textContent="取消",b.style.cssText=`
|
|||
|
|
padding: 8px 20px;
|
|||
|
|
background: #6c757d;
|
|||
|
|
color: white;
|
|||
|
|
border: none;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
font-size: 13px;
|
|||
|
|
transition: background 0.2s;
|
|||
|
|
`,b.addEventListener("mouseenter",()=>{b.style.background="#5a6268"}),b.addEventListener("mouseleave",()=>{b.style.background="#6c757d"});const g=Sn.createElement("button");g.textContent="保存",g.style.cssText=`
|
|||
|
|
padding: 8px 20px;
|
|||
|
|
background: #660874;
|
|||
|
|
color: white;
|
|||
|
|
border: none;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
font-size: 13px;
|
|||
|
|
font-weight: 500;
|
|||
|
|
transition: background 0.2s;
|
|||
|
|
`,g.addEventListener("mouseenter",()=>{g.style.background="#4d0655"}),g.addEventListener("mouseleave",()=>{g.style.background="#660874"}),v.appendChild(b),v.appendChild(g),c.appendChild(p),c.appendChild(v),o.appendChild(l),o.appendChild(h),o.appendChild(c),Sn.body.appendChild(r),Sn.body.appendChild(o),r.addEventListener("click",()=>{r.remove(),o.remove()}),setTimeout(()=>{h.focus(),h.setSelectionRange(0,0)},50);const m=()=>{const w=h.value.trim();if(w===this.convertTableHTMLToMarkdown(n)){r.remove(),o.remove();return}an.setOptions({breaks:!1,gfm:!0});const S=an.parse(w).replace(/<table>/g,'<table class="markdown-table">');r.remove(),o.remove(),e.dangerouslySetInnerHTML=S,e.topic=w,t.innerHTML=S,this.bus.fire("operation",{name:"finishEditTable",obj:e,origin:n}),t.classList.add("no-image"),t.classList.remove("has-image"),this.bus.fire("operation",{name:"finishEditTable",obj:e,origin:n}),this.linkDiv()},x=()=>{r.remove(),o.remove()};g.addEventListener("click",m),b.addEventListener("click",x),h.addEventListener("keydown",w=>{w.stopPropagation(),w.key==="Escape"?(w.preventDefault(),x()):w.key==="Enter"&&w.ctrlKey&&(w.preventDefault(),m())})},m7=function(t){const e=Sn.createElement("div");e.innerHTML=t;const n=e.querySelector("table");if(!n)return t;let r="";const o=n.querySelector("thead");if(o){const h=o.querySelector("tr");if(h){const c=Array.from(h.querySelectorAll("th")).map(p=>{var v;return((v=p.textContent)==null?void 0:v.trim())||""});r+="| "+c.join(" | ")+` |
|
|||
|
|
`,r+="| "+c.map(()=>"---").join(" | ")+` |
|
|||
|
|
`}}const l=n.querySelector("tbody");return l&&l.querySelectorAll("tr").forEach(h=>{const c=Array.from(h.querySelectorAll("td")).map(p=>{var v;return((v=p.textContent)==null?void 0:v.trim())||""});r+="| "+c.join(" | ")+` |
|
|||
|
|
`}),r.trim()},Do=document,ri="http://www.w3.org/2000/svg",Vh=function(t,e,n,r={}){const{anchor:o="middle",color:l,dataType:h}=r,c=document.createElementNS(ri,"text");return En(c,{"text-anchor":o,x:e+"",y:n+"",fill:l||(o==="middle"?"rgb(235, 95, 82)":"#666")}),h&&(c.dataset.type=h),c.innerHTML=t,c},Rv=function(t,e,n){const r=Do.createElementNS(ri,"path");return En(r,{d:t,stroke:e||"#666",fill:"none","stroke-width":n}),r},pl=function(t){const e=Do.createElementNS(ri,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},om=function(){const t=Do.createElementNS(ri,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},g7=function(t,e,n,r){const o=Do.createElementNS(ri,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:n}].forEach((l,h)=>{const c=l.d,p=Do.createElementNS(ri,"path"),v={d:c,stroke:(r==null?void 0:r.stroke)||"rgb(235, 95, 82)",fill:"none","stroke-linecap":(r==null?void 0:r.strokeLinecap)||"cap","stroke-width":String((r==null?void 0:r.strokeWidth)||"2")};(r==null?void 0:r.opacity)!==void 0&&(v.opacity=String(r.opacity)),En(p,v),h===0&&p.setAttribute("stroke-dasharray",(r==null?void 0:r.strokeDasharray)||"8,2");const b=Do.createElementNS(ri,"path");En(b,{d:c,stroke:"transparent",fill:"none","stroke-width":"15"}),o.appendChild(b),o.appendChild(p),o[l.name]=p}),o},Iv=function(t,e,n){if(!e)return;const r=Do.createElement("div");t.nodes.appendChild(r);const o=e.innerHTML;r.id="input-box",r.textContent=o,r.contentEditable="plaintext-only",r.spellcheck=!1;const l=e.getBBox();r.style.cssText=`
|
|||
|
|
min-width:${Math.max(88,l.width)}px;
|
|||
|
|
position:absolute;
|
|||
|
|
left:${l.x}px;
|
|||
|
|
top:${l.y}px;
|
|||
|
|
padding: 2px 4px;
|
|||
|
|
margin: -2px -4px;
|
|||
|
|
`,Dv(r),t.scrollIntoView(r),r.addEventListener("keydown",h=>{h.stopPropagation();const c=h.key;if(c==="Enter"||c==="Tab"){if(h.shiftKey)return;h.preventDefault(),r.blur(),t.container.focus()}}),r.addEventListener("blur",()=>{var h;if(!r)return;const c=((h=r.textContent)==null?void 0:h.trim())||"";c===""?n.label=o:n.label=c,r.remove(),c!==o&&(e.innerHTML=n.label,"parent"in n?t.bus.fire("operation",{name:"finishEditSummary",obj:n}):t.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},v7=function(t){const e=this.map.querySelector("me-root"),n=e.offsetTop,r=e.offsetLeft,o=e.offsetWidth,l=e.offsetHeight,h=this.map.querySelectorAll("me-main > me-wrapper");this.lines.innerHTML="";for(let c=0;c<h.length;c++){const p=h[c],v=p.querySelector("me-tpc"),{offsetLeft:b,offsetTop:g}=ql(this.nodes,v),m=v.offsetWidth,x=v.offsetHeight,w=p.parentNode.className,S=this.generateMainBranch({pT:n,pL:r,pW:o,pH:l,cT:g,cL:b,cW:m,cH:x,direction:w,containerHeight:this.nodes.offsetHeight}),k=this.theme.palette,C=v.nodeObj.branchColor||k[c%k.length];if(v.style.borderColor=C,this.lines.appendChild(Rv(S,C,"3")),t&&t!==p)continue;const T=pl("subLines"),A=p.lastChild;A.tagName==="svg"&&A.remove(),p.appendChild(T),Ov(this,T,C,p,w,!0)}this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},Ov=function(t,e,n,r,o,l){const h=r.firstChild,c=r.children[1].children;if(c.length===0)return;const p=h.offsetTop,v=h.offsetLeft,b=h.offsetWidth,g=h.offsetHeight;for(let m=0;m<c.length;m++){const x=c[m],w=x.firstChild,S=w.offsetTop,k=w.offsetLeft,C=w.offsetWidth,T=w.offsetHeight,A=w.firstChild.nodeObj.branchColor||n,M=t.generateSubBranch({pT:p,pL:v,pW:b,pH:g,cT:S,cL:k,cW:C,cH:T,direction:o,isFirst:l});e.appendChild(Rv(M,A,"2"));const y=w.children[1];if(y){if(!y.expanded)continue}else continue;Ov(t,e,A,x,o)}},sm={addChild:"插入子节点",addParent:"插入父节点",addSibling:"插入同级节点",removeNode:"删除节点",focus:"专注",cancelFocus:"取消专注",moveUp:"上移",moveDown:"下移",link:"连接",linkBidirectional:"双向连接",clickTips:"请点击目标节点",summary:"摘要"},lm={cn:sm,zh_CN:sm,zh_TW:{addChild:"插入子節點",addParent:"插入父節點",addSibling:"插入同級節點",removeNode:"刪除節點",focus:"專注",cancelFocus:"取消專注",moveUp:"上移",moveDown:"下移",link:"連接",linkBidirectional:"雙向連接",clickTips:"請點擊目標節點",summary:"摘要"},en:{addChild:"Add child",addParent:"Add parent",addSibling:"Add sibling",removeNode:"Remove node",focus:"Focus Mode",cancelFocus:"Cancel Focus Mode",moveUp:"Move up",moveDown:"Move down",link:"Link",linkBidirectional:"Bidirectional Link",clickTips:"Please click the target node",summary:"Summary"},ru:{addChild:"Добавить дочерний элемент",addParent:"Добавить родительский элемент",addSibling:"Добавить на этом уровне",removeNode:"Удалить узел",focus:"Режим фокусировки",cancelFocus:"Отменить режим фокусировки",moveUp:"Поднять выше",moveDown:"Опустить ниже",link:"Ссылка",linkBidirectional:"Двунаправленная ссылка",clickTips:"Пожалуйста, нажмите на целевой узел",summary:"Описание"},ja:{addChild:"子ノードを追加する",addParent:"親ノードを追加します",addSibling:"兄弟ノードを追加する",removeNode:"ノードを削除",focus:"集中",cancelFocus:"集中解除",moveUp:"上へ移動",moveDown:"下へ移動",link:"コネクト",linkBidirectional:"双方向リンク",clickTips:"ターゲットノードをクリックしてください",summary:"概要"},pt:{addChild:"Adicionar item filho",addParent:"Adicionar item pai",addSibling:"Adicionar item irmao",removeNode:"Remover item",focus:"Modo Foco",cancelFocus:"Cancelar Modo Foco",moveUp:"Mover para cima",moveDown:"Mover para baixo",link:"Link",linkBidirectional:"Link bidirecional",clickTips:"Favor clicar no item alvo",summary:"Resumo"},it:{addChild:"Aggiungi figlio",addParent:"Aggiungi ge
|
|||
|
|
.topic { font-family: Arial, sans-serif; font-size: 14px; color: #333; }
|
|||
|
|
.markdown-content { font-size: 12px; line-height: 1.3; }
|
|||
|
|
|
|||
|
|
/* 表格样式 */
|
|||
|
|
.markdown-table {
|
|||
|
|
border-collapse: collapse;
|
|||
|
|
width: 100%;
|
|||
|
|
margin: 4px 0;
|
|||
|
|
font-size: 11px;
|
|||
|
|
border: 1px solid #e0e0e0;
|
|||
|
|
border-radius: 6px;
|
|||
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
|
|||
|
|
background-color: #fafafa;
|
|||
|
|
overflow: hidden;
|
|||
|
|
white-space: normal;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.markdown-table th,
|
|||
|
|
.markdown-table td {
|
|||
|
|
border: 1px solid #e0e0e0;
|
|||
|
|
padding: 8px 12px;
|
|||
|
|
text-align: left;
|
|||
|
|
vertical-align: top;
|
|||
|
|
position: relative;
|
|||
|
|
white-space: normal;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.markdown-table th {
|
|||
|
|
background-color: #f5f5f5;
|
|||
|
|
font-weight: 600;
|
|||
|
|
color: #333;
|
|||
|
|
text-align: center;
|
|||
|
|
border-bottom: 1px solid #d0d0d0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.markdown-table td {
|
|||
|
|
background-color: #fff;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.markdown-table tr:nth-child(even) td {
|
|||
|
|
background-color: #f8f8f8;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.markdown-table tr:hover td {
|
|||
|
|
background-color: #f0f8ff;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* 移除多余的边框,保持简洁 */
|
|||
|
|
.markdown-table th:not(:last-child),
|
|||
|
|
.markdown-table td:not(:last-child) {
|
|||
|
|
border-right: 1px solid #e0e0e0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.markdown-table tr:not(:last-child) td {
|
|||
|
|
border-bottom: 1px solid #e0e0e0;
|
|||
|
|
}
|
|||
|
|
`,l=await e.exportSvg(!0,o);if(!l)return;const h=URL.createObjectURL(l),c=document.createElement("a");c.href=h,c.download=`${r}.${t}`,c.click(),URL.revokeObjectURL(h)}catch{alert(`导出${t.toUpperCase()}失败,请重试`)}},I7={side:T7,left:A7,right:M7,full:C7,living:L7,zoomin:_7,zoomout:N7,exportSvg:D7},Va=(t,e)=>{const n=document.createElement("span");return n.id=t,n.innerHTML=I7[e],n};function O7(t){try{const e=document.createElement("div"),n=Va("fullscreen","full"),r=Va("toCenter","living"),o=Va("zoomout","zoomout"),l=Va("zoomin","zoomin"),h=Va("exportSvg","exportSvg");h.title="导出SVG矢量图";const c=document.createElement("span");return c.innerText="100%",e.appendChild(n),e.appendChild(r),e.appendChild(o),e.appendChild(l),e.appendChild(h),e.className="mind-elixir-toolbar rb",n.onclick=()=>{document.fullscreenElement===t.el?(document.exitFullscreen(),setTimeout(()=>{t.el.focus()},100)):(t.el.requestFullscreen(),setTimeout(()=>{},100))},r.onclick=()=>{t.toCenter()},o.onclick=()=>{t.scale(t.scaleVal-t.scaleSensitivity)},l.onclick=()=>{t.scale(t.scaleVal+t.scaleSensitivity)},h.onclick=()=>{R7("svg")(t)},setTimeout(()=>{const p=document.getElementById("exportSvg")},1e3),e}catch{const e=document.createElement("div");return e.className="mind-elixir-toolbar rb",e}}function H7(t){const e=document.createElement("div"),n=Va("tbltl","left"),r=Va("tbltr","right"),o=Va("tblts","side");return e.appendChild(n),e.appendChild(r),e.appendChild(o),e.className="mind-elixir-toolbar lt",n.onclick=()=>{t.initLeft()},r.onclick=()=>{t.initRight()},o.onclick=()=>{t.initSide()},e}function P7(t){try{if(!t.container)return;const e=O7(t),n=H7(t);t.container.append(e),t.container.append(n)}catch{}}/*! @viselect/vanilla v3.9.0 MIT | https://github.com/Simonwep/selection/tree/master/packages/vanilla */let z7=class{constructor(){this._listeners=new Map,this.on=this.addEventListener,this.off=this.removeEventListener,this.emit=this.dispatchEvent}addEventListener(t,e){const n=this._listeners.get(t)??new Set;return this._listeners.set(t,n),n.add(e),this}removeEventListener(t,e){var n;return(n=this._listeners.get(t))==null||n.delete(e),this}dispatchEvent(t,...e){let n=!0;for(const r of this._listeners.get(t)??[])n=r(...e)!==!1&&n;return n}unbindAllListeners(){this._listeners.clear()}};const um=(t,e="px")=>typeof t=="number"?t+e:t,Ha=({style:t},e,n)=>{if(typeof e=="object")for(const[r,o]of Object.entries(e))o!==void 0&&(t[r]=um(o));else n!==void 0&&(t[e]=um(n))},dm=(t=0,e=0,n=0,r=0)=>{const o={x:t,y:e,width:n,height:r,top:e,left:t,right:t+n,bottom:e+r};return{...o,toJSON:()=>JSON.stringify(o)}},B7=t=>{let e,n=-1,r=!1;return{next:(...o)=>{e=o,r||(r=!0,n=requestAnimationFrame(()=>{t(...e),r=!1}))},cancel:()=>{cancelAnimationFrame(n),r=!1}}},hm=(t,e,n="touch")=>{switch(n){case"center":{const r=e.left+e.width/2,o=e.top+e.height/2;return r>=t.left&&r<=t.right&&o>=t.top&&o<=t.bottom}case"cover":return e.left>=t.left&&e.top>=t.top&&e.right<=t.right&&e.bottom<=t.bottom;case"touch":return t.right>=e.left&&t.left<=e.right&&t.bottom>=e.top&&t.top<=e.bottom}},F7=()=>matchMedia("(hover: none), (pointer: coarse)").matches,q7=()=>"safari"in window,Kh=t=>Array.isArray(t)?t:[t],Hv=t=>(e,n,r,o={})=>{(e instanceof HTMLCollection||e instanceof NodeList)&&(e=Array.from(e)),n=Kh(n),e=Kh(e);for(const l of e)if(l)for(const h of n)l[t](h,r,{capture:!1,...o})},Pa=Hv("addEventListener"),vi=Hv("removeEventListener"),a0=t=>{var e;const{clientX:n,clientY:r,target:o}=((e=t.touches)==null?void 0:e[0])??t;return{x:n,y:r,target:o}},Vo=(t,e=document)=>Kh(t).map(n=>typeof n=="string"?Array.from(e.querySelectorAll(n)):n instanceof Element?n:null).flat().filter(Boolean),j7=(t,e)=>e.some(n=>typeof n=="number"?t.button===n:typeof n=="object"?n.button!==t.button?!1:n.modifiers.every(r=>{switch(r){case"alt":return t.altKey;case"ctrl":return t.ctrlKey||t.metaKey;case"shift":return t.shiftKey}}):!1),{abs:Eo,max:pm,min:fm,ceil:mm}=Math,gm=(t=[])=>({stored:t,selected:[],touched:[],changed:{added:[],removed:[]}}),Pv=class extends z7{constructor(t){var e,n,r,o,l;super(),this._selection=gm
|
|||
|
|
`),c=parseFloat(e.lineHeight)||parseFloat(e.fontSize)*1.2,p=parseFloat(e.fontSize),v=parseInt(e.paddingTop)||8,b=parseInt(e.paddingLeft)||8,g=t.offsetWidth||200,m=n+b,x=(h.length-1)*c+p+v+(parseInt(e.paddingBottom)||8),w=t.offsetHeight||100,S=Math.min(x,w),k=document.createElementNS(Yn,"rect");return En(k,{x:n+"",y:r+"",rx:e.borderRadius||"8",ry:e.borderRadius||"8",width:g+"px",height:S+"px",fill:e.backgroundColor||"white",stroke:e.borderColor||"#ccc","stroke-width":e.borderWidth||"1"}),o.appendChild(k),h.forEach((C,T)=>{const A=document.createElementNS(Yn,"text");En(A,{x:m+"",y:r+v+p+c*T+"","text-anchor":"start","font-family":e.fontFamily,"font-size":`${e.fontSize}`,"font-weight":`${e.fontWeight}`,fill:`${e.color}`}),A.innerHTML=C,o.appendChild(A)}),o}function wm(t){if(!t)return t;let e=t.replace(/<td[^>]*>([^<]*)<br\s*\/?>([^<]*)<\/td>/gi,(n,r,o)=>`<td>${r} ${o}</td>`);return e=e.replace(/<th[^>]*>([^<]*)<br\s*\/?>([^<]*)<\/th>/gi,(n,r,o)=>`<th>${r} ${o}</th>`),e=e.replace(/<br\s*\/?>/gi," "),e=e.replace(/•\s*【/g,"【"),e=e.replace(/•\s*\[/g,"["),e=e.replace(/•\s*(/g,"("),e=e.replace(/•\s*\(/g,"("),e=e.replace(/<([^>]+)>/g,(n,r)=>{const o=["br","hr","img","input","meta","link"],l=r.split(" ")[0].toLowerCase();return o.includes(l)?`<${r} />`:n}),e}function Wd(t,e,n,r,o=!1){const l=document.createElementNS(Yn,"g");o||l.setAttribute("transform",`translate(${n}, ${r})`);const h=t;let c="";h.nodeObj&&h.nodeObj.dangerouslySetInnerHTML?c=h.nodeObj.dangerouslySetInnerHTML:h.text&&h.text.innerHTML&&(c=h.text.innerHTML);const p=c&&c!==t.textContent,v=c&&c.includes("<table");if(v){const b=t.offsetWidth||400,g=t.offsetHeight||200,m=document.createElementNS(Yn,"rect");En(m,{x:n+"",y:r+"",width:b+"",height:g+"",fill:"white",stroke:"#ccc","stroke-width":"1"}),l.appendChild(m);const x=document.createElementNS(Yn,"foreignObject");En(x,{x:o?n+"":"0",y:o?r+"":"0",width:b+"",height:g+""});const w=`
|
|||
|
|
<div xmlns="http://www.w3.org/1999/xhtml" style="
|
|||
|
|
width: 100%;
|
|||
|
|
height: 100%;
|
|||
|
|
padding: 8px;
|
|||
|
|
box-sizing: border-box;
|
|||
|
|
overflow: hidden;
|
|||
|
|
font-family: '${(e.fontFamily||"Arial, sans-serif").replace(/"/g,""")}';
|
|||
|
|
font-size: ${e.fontSize||"14px"};
|
|||
|
|
line-height: 1.4;
|
|||
|
|
">
|
|||
|
|
${wm(c)}
|
|||
|
|
</div>
|
|||
|
|
`;return x.innerHTML=w,l.appendChild(x),l}if(p&&!v){const b=wm(c),g=t.getBoundingClientRect(),m=g.width,x=g.height;b.includes("<img"),h.nodeObj&&h.nodeObj.image;try{const N=document.createElement("div");N.innerHTML=b,N.style.cssText=`
|
|||
|
|
position: absolute;
|
|||
|
|
top: -9999px;
|
|||
|
|
left: -9999px;
|
|||
|
|
width: ${m}px;
|
|||
|
|
font-family: '${(e.fontFamily||"Arial").replace(/"/g,""")}';
|
|||
|
|
font-size: ${e.fontSize};
|
|||
|
|
color: ${e.color};
|
|||
|
|
`,document.body.appendChild(N);const z=(N.textContent||N.innerText||"").split(`
|
|||
|
|
`).filter(F=>F.trim());if(z.length>0){const F=parseFloat(e.fontSize)||14,P=F*1.4,Y=parseInt(e.paddingTop)||8,te=parseInt(e.paddingBottom)||8,ce=parseInt(e.paddingLeft)||8,Me=(z.length-1)*P+F+Y+te,Fe=Math.min(Me,x),We=b.includes("<img"),rt=We?n+m/2:n+ce,je=r+F+Y;z.forEach((nt,ct)=>{const tt=document.createElementNS(Yn,"text");En(tt,{x:rt+"",y:je+P*ct+"","text-anchor":We?"middle":"start","font-family":e.fontFamily,"font-size":e.fontSize,"font-weight":e.fontWeight,fill:e.color}),tt.innerHTML=nt.trim(),l.appendChild(tt)});const Ne=document.createElementNS(Yn,"rect");return En(Ne,{x:n+"",y:r+"",rx:e.borderRadius||"8",ry:e.borderRadius||"8",width:m+"px",height:Fe+"px",fill:e.backgroundColor||"white",stroke:e.borderColor||"#ccc","stroke-width":e.borderWidth||"1"}),l.insertBefore(Ne,l.firstChild),document.body.removeChild(N),l}document.body.removeChild(N)}catch{}const w=document.createElementNS(Yn,"foreignObject");En(w,{x:n+"",y:r+"",width:m+"px",height:x+"px"});const S=document.createElement("div");S.innerHTML=b;const k=15,C=15,T=parseInt(e.paddingLeft)||8,A=parseInt(e.paddingRight)||8;S.style.cssText=`
|
|||
|
|
width: 100%;
|
|||
|
|
height: 100%;
|
|||
|
|
font-family: '${(e.fontFamily||"Arial").replace(/"/g,""")}';
|
|||
|
|
font-size: ${e.fontSize};
|
|||
|
|
color: ${e.color};
|
|||
|
|
background: transparent;
|
|||
|
|
padding: ${k}px ${A}px ${C}px ${T}px;
|
|||
|
|
box-sizing: border-box;
|
|||
|
|
overflow: visible;
|
|||
|
|
text-align: center !important;
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
justify-content: center;
|
|||
|
|
align-items: center;
|
|||
|
|
position: relative;
|
|||
|
|
`,S.querySelectorAll("table").forEach(N=>{const z=N;z.style.cssText=`
|
|||
|
|
width: 100%;
|
|||
|
|
border-collapse: collapse;
|
|||
|
|
font-size: ${e.fontSize};
|
|||
|
|
font-family: '${(e.fontFamily||"Arial").replace(/"/g,""")}';
|
|||
|
|
margin: 0 auto 0px auto;
|
|||
|
|
border: 1px solid #ccc;
|
|||
|
|
`,N.querySelectorAll("td, th").forEach(F=>{const P=F;P.style.cssText=`
|
|||
|
|
border: 1px solid #ccc;
|
|||
|
|
padding: 4px 8px;
|
|||
|
|
text-align: center;
|
|||
|
|
vertical-align: top;
|
|||
|
|
font-size: ${parseFloat(e.fontSize)*.9}px;
|
|||
|
|
background: white;
|
|||
|
|
`})}),S.querySelectorAll("ul, ol").forEach(N=>{const z=N;z.style.cssText=`
|
|||
|
|
margin: 2px 0 4px 0 !important;
|
|||
|
|
padding-left: 0 !important;
|
|||
|
|
text-align: center !important;
|
|||
|
|
list-style-position: inside !important;
|
|||
|
|
`}),S.querySelectorAll("li").forEach(N=>{const z=N;z.style.cssText=`
|
|||
|
|
margin: 1px 0 !important;
|
|||
|
|
line-height: 1.2 !important;
|
|||
|
|
padding: 0 !important;
|
|||
|
|
text-align: center !important;
|
|||
|
|
list-style-position: inside !important;
|
|||
|
|
`}),S.querySelectorAll("p").forEach(N=>{const z=N;z.style.cssText=`
|
|||
|
|
margin: 2px 0 !important;
|
|||
|
|
line-height: 1.4 !important;
|
|||
|
|
padding: 0 !important;
|
|||
|
|
text-align: center !important;
|
|||
|
|
`}),S.querySelectorAll("span, div, strong, em").forEach(N=>{const z=N;z.style.cssText=`
|
|||
|
|
text-align: center !important;
|
|||
|
|
display: block !important;
|
|||
|
|
margin-left: auto !important;
|
|||
|
|
margin-right: auto !important;
|
|||
|
|
`});const M=document.createElement("style");M.textContent=`
|
|||
|
|
* {
|
|||
|
|
text-align: center !important;
|
|||
|
|
margin-left: auto !important;
|
|||
|
|
margin-right: auto !important;
|
|||
|
|
}
|
|||
|
|
`,S.appendChild(M),S.querySelectorAll("img").forEach((N,z)=>{const F=N,P=m-T-A-5,Y=Math.floor(x*.7);F.style.cssText=`
|
|||
|
|
max-width: ${P}px !important;
|
|||
|
|
max-height: ${Y}px !important;
|
|||
|
|
width: auto !important;
|
|||
|
|
height: auto !important;
|
|||
|
|
display: block !important;
|
|||
|
|
margin: 8px auto 0px auto !important;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
object-fit: contain !important;
|
|||
|
|
flex-shrink: 0 !important;
|
|||
|
|
box-sizing: border-box !important;
|
|||
|
|
position: relative !important;
|
|||
|
|
top: 0 !important;
|
|||
|
|
left: 0 !important;
|
|||
|
|
right: 0 !important;
|
|||
|
|
bottom: 0 !important;
|
|||
|
|
`}),w.appendChild(S);const y=document.createElementNS(Yn,"rect");En(y,{x:n+"",y:r+"",rx:e.borderRadius||"8",ry:e.borderRadius||"8",width:m+"px",height:x+"px",fill:e.backgroundColor||"white",stroke:e.borderColor||"#ccc","stroke-width":e.borderWidth||"1"}),l.insertBefore(y,l.firstChild),l.appendChild(w)}else return Gv(t,e,n,r);return l}function s0(t,e,n=!1,r){var o;const l=getComputedStyle(e);let h,c;if(r)h=r.x,c=r.y;else{const{offsetLeft:x,offsetTop:w}=Qp(t.nodes,e);h=x,c=w}my(e);const p=e;p.nodeObj&&p.nodeObj.dangerouslySetInnerHTML&&((o=p.nodeObj.dangerouslySetInnerHTML)==null||o.includes("<img")),p.nodeObj&&p.nodeObj.image;const v=document.createElementNS(Yn,"g");r||v.setAttribute("transform",`translate(${h}, ${c})`);let b=null;const g=e,m=g.nodeObj&&g.nodeObj.dangerouslySetInnerHTML&&g.nodeObj.dangerouslySetInnerHTML.includes("<table");if(g.nodeObj&&g.nodeObj.dangerouslySetInnerHTML){if(m)return Wd(e,l,h,c);b=Wd(e,l,h,c)}else n?b=Wd(e,l,h,c):b=Gv(e,l,h,c);return b&&v.appendChild(b),v}function dw(t,e){const n=getComputedStyle(e),{offsetLeft:r,offsetTop:o}=ql(t.nodes,e),l=document.createElementNS(Yn,"a"),h=document.createElementNS(Yn,"text");return En(h,{x:r+"",y:o+parseInt(n.fontSize)+"","text-anchor":"start","font-family":n.fontFamily,"font-size":`${n.fontSize}`,"font-weight":`${n.fontWeight}`,fill:`${n.color}`}),h.innerHTML=e.textContent,l.appendChild(h),l.setAttribute("href",e.href),l}async function hw(t,e){const n=getComputedStyle(e),{offsetLeft:r,offsetTop:o}=Qp(t.nodes,e);if(!e.nodeObj.image)return null;const l=e.nodeObj.image,h=document.createElementNS(Yn,"image"),c=parseInt(n.width),p=parseInt(n.height),v=Math.min(c-10,300),b=Math.min(p*.6,150),g=Math.min(l.width||200,v),m=Math.min(l.height||150,b);let x=0;if(e.text&&e.text.textContent){const k=e.text.textContent.trim();if(k){const C=k.split(`
|
|||
|
|
`).length,T=parseFloat(n.lineHeight)||parseFloat(n.fontSize)*1.2;parseFloat(n.fontSize);const A=parseInt(n.paddingTop)||8,M=parseInt(n.paddingBottom)||8;x=C*T+A+M}}const w=r+(c-g)/2,S=o+x+0;try{const k=await Kv(l.url);En(h,{x:w+"",y:S+"",width:g+"",height:m+"",href:k})}catch{En(h,{x:w+"",y:S+"",width:g+"",height:m+"",href:l.url})}return h}async function pw(t,e){const n=getComputedStyle(e),{offsetLeft:r,offsetTop:o}=Qp(t.nodes,e),l=document.createElementNS(Yn,"image"),h=t.imageProxy?t.imageProxy(e.src):e.src,c=Math.min(parseInt(n.width)||300,300),p=Math.min(parseInt(n.height)||200,200);try{const v=await Kv(h);En(l,{x:r+"",y:o+"",width:c+"",height:p+"",href:v})}catch{En(l,{x:r+"",y:o+"",width:c+"",height:p+"",href:h})}return l}function Kv(t){return new Promise((e,n)=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{try{const o=document.createElement("canvas");o.width=r.width,o.height=r.height;const l=o.getContext("2d");if(!l){n(new Error("Failed to get canvas context"));return}l.drawImage(r,0,0);const h=o.toDataURL("image/png");e(h)}catch(o){n(o)}},r.onerror=()=>{n(new Error("Failed to load image"))},r.src=t})}const l0=100,fw='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',xm=(t,e)=>{const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return window.getComputedStyle(e).transform,{x:n.left-r.left,y:n.top-r.top,width:n.width,height:n.height}},mw=async()=>{await new Promise(t=>setTimeout(t,0)),await document.fonts.ready,await new Promise(t=>requestAnimationFrame(t)),await new Promise(t=>setTimeout(t,100))},gw=async(t,e=!1)=>{var n,r,o;await mw();const l=t.nodes;l.getBoundingClientRect();const h=l.offsetHeight+l0*2,c=l.offsetWidth+l0*2,p=uw(h+"px",c+"px"),v=document.createElementNS(Yn,"svg"),b=document.createElementNS(Yn,"rect");En(b,{x:"0",y:"0",width:`${c}`,height:`${h}`,fill:t.theme.cssVar["--bgcolor"]}),p.appendChild(b),l.querySelectorAll(".subLines").forEach(k=>{const C=k.cloneNode(!0),T=k.parentElement,A=xm(T,l);C.setAttribute("x",`${A.x}`),C.setAttribute("y",`${A.y}`),v.appendChild(C)});const g=(n=l.querySelector(".lines"))==null?void 0:n.cloneNode(!0);g&&v.appendChild(g);const m=(r=l.querySelector(".topiclinks"))==null?void 0:r.cloneNode(!0);m&&v.appendChild(m);const x=(o=l.querySelector(".summary"))==null?void 0:o.cloneNode(!0);x&&v.appendChild(x);const w=Array.from(l.querySelectorAll("me-tpc")).map(async k=>{const C=xm(k,l),T=k.nodeObj.dangerouslySetInnerHTML,A=!!(k.text&&k.text.innerHTML&&k.text.innerHTML!==k.text.textContent),M=k.nodeObj.image;if(T||A){const y=s0(t,k,!e,C);v.appendChild(y)}else v.appendChild(s0(t,k,!1,C));if(M)try{const y=await hw(t,k);y&&v.appendChild(y)}catch{}});await Promise.all(w),l.querySelectorAll(".tags > span").forEach(k=>{v.appendChild(s0(t,k))}),l.querySelectorAll(".icons > span").forEach(k=>{v.appendChild(s0(t,k))}),l.querySelectorAll(".hyper-link").forEach(k=>{v.appendChild(dw(t,k))});const S=Array.from(l.querySelectorAll("img")).map(async(k,C)=>{const T=k.closest("me-tpc"),A=k.closest("foreignObject");return T||A?null:await pw(t,k)});return(await Promise.all(S)).filter(k=>k!==null).forEach(k=>{k&&v.appendChild(k)}),En(v,{x:l0+"",y:l0+"",overflow:"visible"}),p.appendChild(v),p},vw=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),fw+t.outerHTML);function bw(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=o=>{e(o.target.result)},r.onerror=o=>{n(o)},r.readAsDataURL(t)})}const yw=async function(t=!1,e){const n=await gw(this,t),r=vw(n,e);return new Blob([r],{type:"image/svg+xml"})},ww=async function(t=!1,e){const n=await this.exportSvg(t,e),r=await bw(n);return new Promise((o,l)=>{const h=new Image;h.setAttribute("crossOrigin","anonymous");const c=setTimeout(()=>{l(new Error("Image loading timeout"))},1e4);h.onload=()=>{clearTimeout(c);try{const p=document.createElement("canvas");p.width=h.width,p.height=h.height;const v=p.getContext("2d");v.fillStyle="#ffffff",v.fillRect(0,0,p.width,p.height),v.drawImage(h,0,0),p.toBlob(o,"image/png",1)}catch(p){l(
|
|||
|
|
]`).replace("lheading",Yv).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Iw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ow=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Qv=/^( {2,}|\\)\n(?!\s*$)/,Hw=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,$c=/[\p{P}\p{S}]/u,wf=/[\s\p{P}\p{S}]/u,e6=/[^\s\p{P}\p{S}]/u,Pw=sn(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,wf).getRegex(),t6=/(?!~)[\p{P}\p{S}]/u,zw=/(?!~)[\s\p{P}\p{S}]/u,Bw=/(?:[^\s\p{P}\p{S}]|~)/u,Fw=/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,n6=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,qw=sn(n6,"u").replace(/punct/g,$c).getRegex(),jw=sn(n6,"u").replace(/punct/g,t6).getRegex(),r6="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$w=sn(r6,"gu").replace(/notPunctSpace/g,e6).replace(/punctSpace/g,wf).replace(/punct/g,$c).getRegex(),Uw=sn(r6,"gu").replace(/notPunctSpace/g,Bw).replace(/punctSpace/g,zw).replace(/punct/g,t6).getRegex(),Vw=sn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,e6).replace(/punctSpace/g,wf).replace(/punct/g,$c).getRegex(),Ww=sn(/\\(punct)/,"gu").replace(/punct/g,$c).getRegex(),Gw=sn(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Kw=sn(bf).replace("(?:-->|$)","-->").getRegex(),Xw=sn("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Kw).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),sc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,Zw=sn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",sc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),i6=sn(/^!?\[(label)\]\[(ref)\]/).replace("label",sc).replace("ref",vf).getRegex(),a6=sn(/^!?\[(ref)\](?:\[\])?/).replace("ref",vf).getRegex(),Yw=sn("reflink|nolink(?!\\()","g").replace("reflink",i6).replace("nolink",a6).getRegex(),xf={_backpedal:Tl,anyPunctuation:Ww,autolink:Gw,blockSkip:Fw,br:Qv,code:Ow,del:Tl,emStrongLDelim:qw,emStrongRDelimAst:$w,emStrongRDelimUnd:Vw,escape:Iw,link:Zw,nolink:a6,punctuation:Pw,reflink:i6,reflinkSearch:Yw,tag:Xw,text:Hw,url:Tl},Jw={...xf,link:sn(/^!?\[(label)\]\((.*?)\)/).replace("label",sc).getRegex(),reflink:sn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",sc).getRegex()},Xh={...xf,emStrongRDelimAst:Uw,emStrongLDelim:jw,url:sn(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Qw={...Xh,br:sn(Qv).replace("{2,}","*").getRegex(),text:sn(Xh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},c0={normal:yf,gfm:Dw,pedantic:Rw},al={normal:xf,gfm:Xh,breaks:Qw,pedantic:Jw},e9={"&":"&","<":"<",">":">",'"':"
|
|||
|
|
`).map(l=>{let h=l.match(n.other.beginningSpace);if(h===null)return l;let[c]=h;return c.length>=o.length?l.slice(o.length):l}).join(`
|
|||
|
|
`)}var lc=class{constructor(t){vt(this,"options"),vt(this,"rules"),vt(this,"lexer"),this.options=t||Bo}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ol(n,`
|
|||
|
|
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=n9(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=ol(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:ol(e[0],`
|
|||
|
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=ol(e[0],`
|
|||
|
|
`).split(`
|
|||
|
|
`),r="",o="",l=[];for(;n.length>0;){let h=!1,c=[],p;for(p=0;p<n.length;p++)if(this.rules.other.blockquoteStart.test(n[p]))c.push(n[p]),h=!0;else if(!h)c.push(n[p]);else break;n=n.slice(p);let v=c.join(`
|
|||
|
|
`),b=v.replace(this.rules.other.blockquoteSetextReplace,`
|
|||
|
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|||
|
|
${v}`:v,o=o?`${o}
|
|||
|
|
${b}`:b;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,l,!0),this.lexer.state.top=g,n.length===0)break;let m=l.at(-1);if((m==null?void 0:m.type)==="code")break;if((m==null?void 0:m.type)==="blockquote"){let x=m,w=x.raw+`
|
|||
|
|
`+n.join(`
|
|||
|
|
`),S=this.blockquote(w);l[l.length-1]=S,r=r.substring(0,r.length-x.raw.length)+S.raw,o=o.substring(0,o.length-x.text.length)+S.text;break}else if((m==null?void 0:m.type)==="list"){let x=m,w=x.raw+`
|
|||
|
|
`+n.join(`
|
|||
|
|
`),S=this.list(w);l[l.length-1]=S,r=r.substring(0,r.length-m.raw.length)+S.raw,o=o.substring(0,o.length-x.raw.length)+S.raw,n=w.substring(l.at(-1).raw.length).split(`
|
|||
|
|
`);continue}}return{type:"blockquote",raw:r,tokens:l,text:o}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let l=this.rules.other.listItemRegex(n),h=!1;for(;t;){let p=!1,v="",b="";if(!(e=l.exec(t))||this.rules.block.hr.test(t))break;v=e[0],t=t.substring(v.length);let g=e[2].split(`
|
|||
|
|
`,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),m=t.split(`
|
|||
|
|
`,1)[0],x=!g.trim(),w=0;if(this.options.pedantic?(w=2,b=g.trimStart()):x?w=e[1].length+1:(w=e[2].search(this.rules.other.nonSpaceChar),w=w>4?1:w,b=g.slice(w),w+=e[1].length),x&&this.rules.other.blankLine.test(m)&&(v+=m+`
|
|||
|
|
`,t=t.substring(m.length+1),p=!0),!p){let C=this.rules.other.nextBulletRegex(w),T=this.rules.other.hrRegex(w),A=this.rules.other.fencesBeginRegex(w),M=this.rules.other.headingBeginRegex(w),y=this.rules.other.htmlBeginRegex(w);for(;t;){let N=t.split(`
|
|||
|
|
`,1)[0],z;if(m=N,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),z=m):z=m.replace(this.rules.other.tabCharGlobal," "),A.test(m)||M.test(m)||y.test(m)||C.test(m)||T.test(m))break;if(z.search(this.rules.other.nonSpaceChar)>=w||!m.trim())b+=`
|
|||
|
|
`+z.slice(w);else{if(x||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(g)||M.test(g)||T.test(g))break;b+=`
|
|||
|
|
`+m}!x&&!m.trim()&&(x=!0),v+=N+`
|
|||
|
|
`,t=t.substring(N.length+1),g=z.slice(w)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(v)&&(h=!0));let S=null,k;this.options.gfm&&(S=this.rules.other.listIsTask.exec(b),S&&(k=S[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:v,task:!!S,checked:k,loose:!1,text:b,tokens:[]}),o.raw+=v}let c=o.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let p=0;p<o.items.length;p++)if(this.lexer.state.top=!1,o.items[p].tokens=this.lexer.blockTokens(o.items[p].text,[]),!o.loose){let v=o.items[p].tokens.filter(g=>g.type==="space"),b=v.length>0&&v.some(g=>this.rules.other.anyLine.test(g.raw));o.loose=b}if(o.loose)for(let p=0;p<o.items.length;p++)o.items[p].loose=!0;return o}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:o}}}table(t){var e;let n=this.rules.block.table.exec(t);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=Tm(n[1]),o=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=(e=n[3])!=null&&e.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|||
|
|
`):[],h={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===o.length){for(let c of o)this.rules.other.tableAlignRight.test(c)?h.align.push("right"):this.rules.other.tableAlignCenter.test(c)?h.align.push("center"):this.rules.other.tableAlignLeft.test(c)?h.align.push("left"):h.align.push(null);for(let c=0;c<r.length;c++)h.header.push({text:r[c],tokens:this.lexer.inline(r[c]),header:!0,align:h.align[c]});for(let c of l)h.rows.push(Tm(c,h.header.length).map((p,v)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:h.align[v]})));return h}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|||
|
|
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let l=ol(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=t9(e[2],"()");if(l===-2)return;if(l>-1){let h=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,h).trim(),e[3]=""}}let r=e[2],o="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(r);l&&(r=l[1],o=l[3])}else o=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Am(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=e[r.toLowerCase()];if(!o){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return Am(n,o,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let o=[...r[0]].length-1,l,h,c=o,p=0,v=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,e=e.slice(-1*t.length+o);(r=v.exec(e))!=null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(h=[...l].length,r[3]||r[4]){c+=h;continue}else if((r[5]||r[6])&&o%3&&!((o+h)%3)){p+=h;continue}if(c-=h,c>0)continue;h=Math.min(h,h+c+p);let b=[...r[0]][0].length,g=t.slice(0,o+r.index+b+h);if(Math.min(o,h)%2){let x=g.slice(1,-1);return{type:"em",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}let m=g.slice(2,-2);return{type:"strong",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var e;let n;if(n=this.rules.inline.url.exec(t)){let r,o;if(n[2]==="@")r=n[0],o="mailto:"+r;else{let l;do l=n[0],n[0]=((e=this.rules.inline._backpedal.exec(n[0]))==null?void 0:e[0])??"";while(l!==n[0]);r=n[0],n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},ma=class Zh{constructor(e){vt(this,"tokens"),vt(this,"
|
|||
|
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){var o,l,h;for(this.options.pedantic&&(e=e.replace(kr.tabCharGlobal," ").replace(kr.spaceLine,""));e;){let c;if((l=(o=this.options.extensions)==null?void 0:o.block)!=null&&l.some(v=>(c=v.call({lexer:this},e,n))?(e=e.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.space(e)){e=e.substring(c.raw.length);let v=n.at(-1);c.raw.length===1&&v!==void 0?v.raw+=`
|
|||
|
|
`:n.push(c);continue}if(c=this.tokenizer.code(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.at(-1).src=v.text):n.push(c);continue}if(c=this.tokenizer.fences(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.heading(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.hr(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.blockquote(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.list(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.html(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.def(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.raw,this.inlineQueue.at(-1).src=v.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title},n.push(c));continue}if(c=this.tokenizer.table(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.lheading(e)){e=e.substring(c.raw.length),n.push(c);continue}let p=e;if((h=this.options.extensions)!=null&&h.startBlock){let v=1/0,b=e.slice(1),g;this.options.extensions.startBlock.forEach(m=>{g=m.call({lexer:this},b),typeof g=="number"&&g>=0&&(v=Math.min(v,g))}),v<1/0&&v>=0&&(p=e.substring(0,v+1))}if(this.state.top&&(c=this.tokenizer.paragraph(p))){let v=n.at(-1);r&&(v==null?void 0:v.type)==="paragraph"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):n.push(c),r=p.length!==e.length,e=e.substring(c.raw.length);continue}if(c=this.tokenizer.text(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):n.push(c);continue}if(e){let v="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(v)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){var r,o,l;let h=e,c=null;if(this.tokens.links){let b=Object.keys(this.tokens.links);if(b.length>0)for(;(c=this.tokenizer.rules.inline.reflinkSearch.exec(h))!=null;)b.includes(c[0].slice(c[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(c=this.tokenizer.rules.inline.anyPunctuation.exec(h))!=null;)h=h.slice(0,c.index)+"++"+h.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(c=this.tokenizer.rules.inline.blockSkip.exec(h))!=null;)h=h.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let p=!1,v="";for(;e;){p||(v=""),p=!1;let b;if((o=(r=this.options.extensions)==null?void 0:r.inline)!=null&&o.some(m=>(b=m.call({lexer:this},e,n))?(e=e.substring(b.raw.length),n.push(b),!0):!1))continue;if(b=this.tokenizer.escape(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.tag(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.link(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(b.raw.length);let m=n.at(-1);b.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=b.raw,m.text+=b.text):n.push(b);continue}if(b=this.tokenizer.emStrong(e,h,v)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.codespan(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.br(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.del(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.autolink(e)){e=e.substring(b.raw.length),n.push(b);continue}if(!this.state.inLink&&(b=this.tokenizer.url(e))){e=e.substring(b.raw.length),n.push(b);continue}let g=e;if((l=this.options.extensions)!=null&&l.startInline){let m=1/0,x=e.slice(1),w;this.options.extensions.startInline.forEach(S=>{w=S.call({lexer:this},x),typeof w=="number"&&w>=0&&(m=Math.min(m,w))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(b=this.tokenizer.inlineText(g)){e=e.substring(b.raw.length),b.raw.slice(-1)!=="_"&&(v=b.raw.slice(-1)),p=!0;let m=n.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=b.raw,m.text+=b.text):n.push(b);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(m)}}return n}},cc=class{constructor(t){vt(this,"options"),vt(this,"parser"),this.options=t||Bo}space(t){return""}code({text:t,lang:e,escaped:n}){var r;let o=(r=(e||"").match(kr.notSpaceStart))==null?void 0:r[0],l=t.replace(kr.endingNewline,"")+`
|
|||
|
|
`;return o?'<pre><code class="language-'+Ii(o)+'">'+(n?l:Ii(l,!0))+`</code></pre>
|
|||
|
|
`:"<pre><code>"+(n?l:Ii(l,!0))+`</code></pre>
|
|||
|
|
`}blockquote({tokens:t}){return`<blockquote>
|
|||
|
|
${this.parser.parse(t)}</blockquote>
|
|||
|
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|||
|
|
`}hr(t){return`<hr>
|
|||
|
|
`}list(t){let e=t.ordered,n=t.start,r="";for(let h=0;h<t.items.length;h++){let c=t.items[h];r+=this.listitem(c)}let o=e?"ol":"ul",l=e&&n!==1?' start="'+n+'"':"";return"<"+o+l+`>
|
|||
|
|
`+r+"</"+o+`>
|
|||
|
|
`}listitem(t){var e;let n="";if(t.task){let r=this.checkbox({checked:!!t.checked});t.loose?((e=t.tokens[0])==null?void 0:e.type)==="paragraph"?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=r+" "+Ii(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):n+=r+" "}return n+=this.parser.parse(t.tokens,!!t.loose),`<li>${n}</li>
|
|||
|
|
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|||
|
|
`}table(t){let e="",n="";for(let o=0;o<t.header.length;o++)n+=this.tablecell(t.header[o]);e+=this.tablerow({text:n});let r="";for(let o=0;o<t.rows.length;o++){let l=t.rows[o];n="";for(let h=0;h<l.length;h++)n+=this.tablecell(l[h]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|||
|
|
<thead>
|
|||
|
|
`+e+`</thead>
|
|||
|
|
`+r+`</table>
|
|||
|
|
`}tablerow({text:t}){return`<tr>
|
|||
|
|
${t}</tr>
|
|||
|
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|||
|
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ii(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),o=Em(t);if(o===null)return r;t=o;let l='<a href="'+t+'"';return e&&(l+=' title="'+Ii(e)+'"'),l+=">"+r+"</a>",l}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let o=Em(t);if(o===null)return Ii(n);t=o;let l=`<img src="${t}" alt="${n}"`;return e&&(l+=` title="${Ii(e)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ii(t.text)}},kf=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},ga=class Yh{constructor(e){vt(this,"options"),vt(this,"renderer"),vt(this,"textRenderer"),this.options=e||Bo,this.options.renderer=this.options.renderer||new cc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new kf}static parse(e,n){return new Yh(n).parse(e)}static parseInline(e,n){return new Yh(n).parseInline(e)}parse(e,n=!0){var r,o;let l="";for(let h=0;h<e.length;h++){let c=e[h];if((o=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&o[c.type]){let v=c,b=this.options.extensions.renderers[v.type].call({parser:this},v);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(v.type)){l+=b||"";continue}}let p=c;switch(p.type){case"space":{l+=this.renderer.space(p);continue}case"hr":{l+=this.renderer.hr(p);continue}case"heading":{l+=this.renderer.heading(p);continue}case"code":{l+=this.renderer.code(p);continue}case"table":{l+=this.renderer.table(p);continue}case"blockquote":{l+=this.renderer.blockquote(p);continue}case"list":{l+=this.renderer.list(p);continue}case"html":{l+=this.renderer.html(p);continue}case"def":{l+=this.renderer.def(p);continue}case"paragraph":{l+=this.renderer.paragraph(p);continue}case"text":{let v=p,b=this.renderer.text(v);for(;h+1<e.length&&e[h+1].type==="text";)v=e[++h],b+=`
|
|||
|
|
`+this.renderer.text(v);n?l+=this.renderer.paragraph({type:"paragraph",raw:b,text:b,tokens:[{type:"text",raw:b,text:b,escaped:!0}]}):l+=b;continue}default:{let v='Token with "'+p.type+'" type was not found.';if(this.options.silent)return"";throw new Error(v)}}}return l}parseInline(e,n=this.renderer){var r,o;let l="";for(let h=0;h<e.length;h++){let c=e[h];if((o=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&o[c.type]){let v=this.options.extensions.renderers[c.type].call({parser:this},c);if(v!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){l+=v||"";continue}}let p=c;switch(p.type){case"escape":{l+=n.text(p);break}case"html":{l+=n.html(p);break}case"link":{l+=n.link(p);break}case"image":{l+=n.image(p);break}case"strong":{l+=n.strong(p);break}case"em":{l+=n.em(p);break}case"codespan":{l+=n.codespan(p);break}case"br":{l+=n.br(p);break}case"del":{l+=n.del(p);break}case"text":{l+=n.text(p);break}default:{let v='Token with "'+p.type+'" type was not found.';if(this.options.silent)return"";throw new Error(v)}}}return l}},Gd,O0=(Gd=class{constructor(t){vt(this,"options"),vt(this,"block"),this.options=t||Bo}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?ma.lex:ma.lexInline}provideParser(){return this.block?ga.parse:ga.parseInline}},vt(Gd,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Gd),r9=class{constructor(...t){vt(this,"defaults",ff()),vt(this,"options",this.setOptions),vt(this,"parse",this.parseMarkdown(!0)),vt(this,"parseInline",this.parseMarkdown(!1)),vt(this,"Parser",ga),vt(this,"Renderer",cc),vt(this,"TextRenderer",kf),vt(this,"Lexer",ma),vt(this,"Tokenizer",lc),vt(this,"Hooks",O0),this.use(...t)}walkTokens(t,e){var n,r;let o=[];for(let l of t)switch(o=o.concat(e.call(this,l)),l.type){case"table":{let h=l;for(let c of h.header)o=o.concat(this.walkTokens(c.tokens,e));for(let c of h.rows)for(let p of c)o=o.concat(this.walkTokens(p.tokens,e));break}case"list":{let h=l;o=o.concat(this.walkTokens(h.items,e));break}default:{let h=l;(r=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&r[h.type]?this.defaults.extensions.childTokens[h.type].forEach(c=>{let p=h[c].flat(1/0);o=o.concat(this.walkTokens(p,e))}):h.tokens&&(o=o.concat(this.walkTokens(h.tokens,e)))}}return o}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let l=e.renderers[o.name];l?e.renderers[o.name]=function(...h){let c=o.renderer.apply(this,h);return c===!1&&(c=l.apply(this,h)),c}:e.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[o.level];l?l.unshift(o.tokenizer):e[o.level]=[o.tokenizer],o.start&&(o.level==="block"?e.startBlock?e.startBlock.push(o.start):e.startBlock=[o.start]:o.level==="inline"&&(e.startInline?e.startInline.push(o.start):e.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(e.childTokens[o.name]=o.childTokens)}),r.extensions=e),n.renderer){let o=this.defaults.renderer||new cc(this.defaults);for(let l in n.renderer){if(!(l in o))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let h=l,c=n.renderer[h],p=o[h];o[h]=(...v)=>{let b=c.apply(o,v);return b===!1&&(b=p.apply(o,v)),b||""}}r.renderer=o}if(n.tokenizer){let o=this.defaults.tokenizer||new lc(this.defaults);for(let l in n.tokenizer){if(!(l in o))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let h=l,c=n.tokenizer[h],p=o[h];o[h]=(...v)=>{let b=c.apply(o,v);return b===!1&&(b=p.apply(o,v)),b}}r.tokenizer=o}if(n.hooks){let o=this.defaults.hooks||new O0;for(let l in n.hooks){if(!(l in o))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let h=l,c=n.hooks[h],p
|
|||
|
|
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Ii(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},Io=new r9;function Jt(t,e){return Io.parse(t,e)}Jt.options=Jt.setOptions=function(t){return Io.setOptions(t),Jt.defaults=Io.defaults,Xv(Jt.defaults),Jt};Jt.getDefaults=ff;Jt.defaults=Bo;Jt.use=function(...t){return Io.use(...t),Jt.defaults=Io.defaults,Xv(Jt.defaults),Jt};Jt.walkTokens=function(t,e){return Io.walkTokens(t,e)};Jt.parseInline=Io.parseInline;Jt.Parser=ga;Jt.parser=ga.parse;Jt.Renderer=cc;Jt.TextRenderer=kf;Jt.Lexer=ma;Jt.lexer=ma.lex;Jt.Tokenizer=lc;Jt.Hooks=O0;Jt.parse=Jt;Jt.options;Jt.setOptions;Jt.use;Jt.walkTokens;Jt.parseInline;ga.parse;ma.lex;var Jh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function o6(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var s6={exports:{}};(function(t){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|||
|
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|||
|
|
*
|
|||
|
|
* @license MIT <https://opensource.org/licenses/MIT>
|
|||
|
|
* @author Lea Verou <https://lea.verou.me>
|
|||
|
|
* @namespace
|
|||
|
|
* @public
|
|||
|
|
*/var n=function(r){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,h={},c={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function T(A){return A instanceof p?new p(A.type,T(A.content),A.alias):Array.isArray(A)?A.map(T):A.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(T){return Object.prototype.toString.call(T).slice(8,-1)},objId:function(T){return T.__id||Object.defineProperty(T,"__id",{value:++l}),T.__id},clone:function T(A,M){M=M||{};var y,N;switch(c.util.type(A)){case"Object":if(N=c.util.objId(A),M[N])return M[N];y={},M[N]=y;for(var z in A)A.hasOwnProperty(z)&&(y[z]=T(A[z],M));return y;case"Array":return N=c.util.objId(A),M[N]?M[N]:(y=[],M[N]=y,A.forEach(function(F,P){y[P]=T(F,M)}),y);default:return A}},getLanguage:function(T){for(;T;){var A=o.exec(T.className);if(A)return A[1].toLowerCase();T=T.parentElement}return"none"},setLanguage:function(T,A){T.className=T.className.replace(RegExp(o,"gi"),""),T.classList.add("language-"+A)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT"&&1<2)return document.currentScript;try{throw new Error}catch(y){var T=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(y.stack)||[])[1];if(T){var A=document.getElementsByTagName("script");for(var M in A)if(A[M].src==T)return A[M]}return null}},isActive:function(T,A,M){for(var y="no-"+A;T;){var N=T.classList;if(N.contains(A))return!0;if(N.contains(y))return!1;T=T.parentElement}return!!M}},languages:{plain:h,plaintext:h,text:h,txt:h,extend:function(T,A){var M=c.util.clone(c.languages[T]);for(var y in A)M[y]=A[y];return M},insertBefore:function(T,A,M,y){y=y||c.languages;var N=y[T],z={};for(var F in N)if(N.hasOwnProperty(F)){if(F==A)for(var P in M)M.hasOwnProperty(P)&&(z[P]=M[P]);M.hasOwnProperty(F)||(z[F]=N[F])}var Y=y[T];return y[T]=z,c.languages.DFS(c.languages,function(te,ce){ce===Y&&te!=T&&(this[te]=z)}),z},DFS:function T(A,M,y,N){N=N||{};var z=c.util.objId;for(var F in A)if(A.hasOwnProperty(F)){M.call(A,F,A[F],y||F);var P=A[F],Y=c.util.type(P);Y==="Object"&&!N[z(P)]?(N[z(P)]=!0,T(P,M,null,N)):Y==="Array"&&!N[z(P)]&&(N[z(P)]=!0,T(P,M,F,N))}}},plugins:{},highlightAll:function(T,A){c.highlightAllUnder(document,T,A)},highlightAllUnder:function(T,A,M){var y={callback:M,container:T,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};c.hooks.run("before-highlightall",y),y.elements=Array.prototype.slice.apply(y.container.querySelectorAll(y.selector)),c.hooks.run("before-all-elements-highlight",y);for(var N=0,z;z=y.elements[N++];)c.highlightElement(z,A===!0,y.callback)},highlightElement:function(T,A,M){var y=c.util.getLanguage(T),N=c.languages[y];c.util.setLanguage(T,y);var z=T.parentElement;z&&z.nodeName.toLowerCase()==="pre"&&c.util.setLanguage(z,y);var F=T.textContent,P={element:T,language:y,grammar:N,code:F};function Y(ce){P.highlightedCode=ce,c.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,c.hooks.run("after-highlight",P),c.hooks.run("complete",P),M&&M.call(P.element)}if(c.hooks.run("before-sanity-check",P),z=P.element.parentElement,z&&z.nodeName.toLowerCase()==="pre"&&!z.hasAttribute("tabindex")&&z.setAttribute("tabindex","0"),!P.code){c.hooks.run("complete",P),M&&M.call(P.element);return}if(c.hooks.run("before-highlight",P),!P.grammar){Y(c.util.encode(P.code));return}if(A&&r.Worker){var te=new Worker(c.filename);te.onmessage=function(ce){Y(ce.data)},te.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else Y(c.highlight(P.code,P.grammar,P.language))},highlight:function(T,A,M){var y={code:T,grammar:A,language:M};if(c.hooks.run("before-tokenize",y),!y.grammar)throw new Error('The language "'+y.language+'" has no grammar.');return y.tokens=c.tokenize(y.code,y.grammar),c.hooks.run("after-tokenize",y),p.stringify(c.util.encode(y.tokens),y.language)},tokenize:function(T,A){var M=A.rest;if(M){for(var y in M)A[y]=M[y];delete A.rest}var N=new g;return m(N,N.head,T)
|
|||
|
|
`),S.hasAttribute("data-start")||S.setAttribute("data-start",String(F+1))}k.textContent=y,n.highlightElement(k)},function(y){S.setAttribute(c,b),k.textContent=y})}}),n.plugins.fileHighlight={highlight:function(w){for(var S=(w||document).querySelectorAll(g),k=0,C;C=S[k++];)n.highlightElement(C)}},n.fileHighlight=function(){n.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(s6);var i9=s6.exports;const Mm=o6(i9);class jr{constructor(e,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=r}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new jr(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class ii{constructor(e,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=n}range(e,n){return new ii(n,jr.range(this,e))}}let et=class l6{constructor(e,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r="KaTeX parse error: "+e,o,l,h=n&&n.loc;if(h&&h.start<=h.end){var c=h.lexer.input;o=h.start,l=h.end,o===c.length?r+=" at end of input: ":r+=" at position "+(o+1)+": ";var p=c.slice(o,l).replace(/[^]/g,"$&̲"),v;o>15?v="…"+c.slice(o-15,o):v=c.slice(0,o);var b;l+15<c.length?b=c.slice(l,l+15)+"…":b=c.slice(l),r+=v+p+b}var g=new Error(r);return g.name="ParseError",g.__proto__=l6.prototype,g.position=o,o!=null&&l!=null&&(g.length=l-o),g.rawMessage=e,g}};et.prototype.__proto__=Error.prototype;var a9=function(t,e){return t.indexOf(e)!==-1},o9=function(t,e){return t===void 0?e:t},s9=/([A-Z])/g,l9=function(t){return t.replace(s9,"-$1").toLowerCase()},c9={"&":"&",">":">","<":"<",'"':""","'":"'"},u9=/[&><"']/g;function d9(t){return String(t).replace(u9,e=>c9[e])}var c6=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},h9=function(t){var e=c6(t);return e.type==="mathord"||e.type==="textord"||e.type==="atom"},p9=function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t},f9=function(t){var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},wt={contains:a9,deflt:o9,escape:d9,hyphenate:l9,getBaseElem:c6,isCharacterBox:h9,protocolFromUrl:f9},H0={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:
|
|||
|
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|||
|
|
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|||
|
|
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|||
|
|
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|||
|
|
c69,-144,104.5,-217.7,106.5,-221
|
|||
|
|
l`+t/2.075+" -"+t+`
|
|||
|
|
c5.3,-9.3,12,-14,20,-14
|
|||
|
|
H400000v`+(40+t)+`H845.2724
|
|||
|
|
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|||
|
|
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|||
|
|
M`+(834+t)+" "+e+"h400000v"+(40+t)+"h-400000z"},E9=function(t,e){return"M263,"+(601+t+e)+`c0.7,0,18,39.7,52,119
|
|||
|
|
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|||
|
|
c340,-704.7,510.7,-1060.3,512,-1067
|
|||
|
|
l`+t/2.084+" -"+t+`
|
|||
|
|
c4.7,-7.3,11,-11,19,-11
|
|||
|
|
H40000v`+(40+t)+`H1012.3
|
|||
|
|
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|||
|
|
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|||
|
|
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|||
|
|
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|||
|
|
M`+(1001+t)+" "+e+"h400000v"+(40+t)+"h-400000z"},T9=function(t,e){return"M983 "+(10+t+e)+`
|
|||
|
|
l`+t/3.13+" -"+t+`
|
|||
|
|
c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
|
|||
|
|
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|||
|
|
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
|||
|
|
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|||
|
|
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|||
|
|
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|||
|
|
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|||
|
|
M`+(1001+t)+" "+e+"h400000v"+(40+t)+"h-400000z"},A9=function(t,e){return"M424,"+(2398+t+e)+`
|
|||
|
|
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|||
|
|
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|||
|
|
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|||
|
|
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|||
|
|
l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
|
|||
|
|
v`+(40+t)+`H1014.6
|
|||
|
|
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|||
|
|
c-2,6,-10,9,-24,9
|
|||
|
|
c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+e+`
|
|||
|
|
h400000v`+(40+t)+"h-400000z"},M9=function(t,e){return"M473,"+(2713+t+e)+`
|
|||
|
|
c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
|
|||
|
|
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
|
|||
|
|
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|||
|
|
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|||
|
|
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|||
|
|
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|||
|
|
606zM`+(1001+t)+" "+e+"h400000v"+(40+t)+"H1017.7z"},C9=function(t){var e=t/2;return"M400000 "+t+" H0 L"+e+" 0 l65 45 L145 "+(t-80)+" H400000z"},L9=function(t,e,n){var r=n-54-e-t;return"M702 "+(t+e)+"H400000"+(40+t)+`
|
|||
|
|
H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|||
|
|
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|||
|
|
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|||
|
|
219 661 l218 661zM702 `+e+"H400000v"+(40+t)+"H742z"},_9=function(t,e,n){e=1e3*e;var r="";switch(t){case"sqrtMain":r=S9(e,Wo);break;case"sqrtSize1":r=E9(e,Wo);break;case"sqrtSize2":r=T9(e,Wo);break;case"sqrtSize3":r=A9(e,Wo);break;case"sqrtSize4":r=M9(e,Wo);break;case"sqrtTall":r=L9(e,Wo,n)}return r},N9=function(t,e){switch(t){case"⎜":return"M291 0 H417 V"+e+" H291z M291 0 H417 V"+e+" H291z";case"∣":return"M145 0 H188 V"+e+" H145z M145 0 H188 V"+e+" H145z";case"∥":return"M145 0 H188 V"+e+" H145z M145 0 H188 V"+e+" H145z"+("M367 0 H410 V"+e+" H367z M367 0 H410 V"+e+" H367z");case"⎟":return"M457 0 H583 V"+e+" H457z M457 0 H583 V"+e+" H457z";case"⎢":return"M319 0 H403 V"+e+" H319z M319 0 H403 V"+e+" H319z";case"⎥":return"M263 0 H347 V"+e+" H263z M263 0 H347 V"+e+" H263z";case"⎪":return"M384 0 H504 V"+e+" H384z M384 0 H504 V"+e+" H384z";case"⏐":return"M312 0 H355 V"+e+" H312z M312 0 H355 V"+e+" H312z";case"‖":return"M257 0 H300 V"+e+" H257z M257 0 H300 V"+e+" H257z"+("M478 0 H521 V"+e+" H478z M478 0 H521 V"+e+" H478z");default:return""}},Cm={doubleleftarrow:`M262 157
|
|||
|
|
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|||
|
|
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|||
|
|
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|||
|
|
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|||
|
|
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|||
|
|
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|||
|
|
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|||
|
|
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|||
|
|
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|||
|
|
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|||
|
|
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|||
|
|
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|||
|
|
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|||
|
|
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|||
|
|
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|||
|
|
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|||
|
|
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|||
|
|
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|||
|
|
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|||
|
|
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|||
|
|
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|||
|
|
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|||
|
|
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|||
|
|
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|||
|
|
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|||
|
|
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|||
|
|
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|||
|
|
435 0h399565z`,leftgroupunder:`M400000 262
|
|||
|
|
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|||
|
|
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|||
|
|
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|||
|
|
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|||
|
|
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|||
|
|
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|||
|
|
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|||
|
|
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|||
|
|
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|||
|
|
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|||
|
|
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|||
|
|
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|||
|
|
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|||
|
|
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|||
|
|
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|||
|
|
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|||
|
|
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|||
|
|
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
|
|||
|
|
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
|
|||
|
|
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|||
|
|
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|||
|
|
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|||
|
|
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
|
|||
|
|
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
|
|||
|
|
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|||
|
|
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|||
|
|
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|||
|
|
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|||
|
|
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|||
|
|
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|||
|
|
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|||
|
|
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|||
|
|
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|||
|
|
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|||
|
|
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|||
|
|
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|||
|
|
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|||
|
|
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|||
|
|
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|||
|
|
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|||
|
|
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|||
|
|
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|||
|
|
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|||
|
|
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|||
|
|
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|||
|
|
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|||
|
|
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|||
|
|
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|||
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|||
|
|
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|||
|
|
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|||
|
|
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|||
|
|
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|||
|
|
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|||
|
|
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|||
|
|
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|||
|
|
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|||
|
|
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|||
|
|
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|||
|
|
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|||
|
|
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|||
|
|
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|||
|
|
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|||
|
|
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|||
|
|
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|||
|
|
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|||
|
|
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|||
|
|
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|||
|
|
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|||
|
|
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|||
|
|
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|||
|
|
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|||
|
|
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
|
|||
|
|
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|||
|
|
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|||
|
|
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|||
|
|
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|||
|
|
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|||
|
|
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|||
|
|
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|||
|
|
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|||
|
|
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|||
|
|
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|||
|
|
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|||
|
|
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|||
|
|
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|||
|
|
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|||
|
|
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|||
|
|
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|||
|
|
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|||
|
|
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|||
|
|
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|||
|
|
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|||
|
|
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|||
|
|
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|||
|
|
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|||
|
|
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|||
|
|
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|||
|
|
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|||
|
|
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|||
|
|
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|||
|
|
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|||
|
|
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|||
|
|
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|||
|
|
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|||
|
|
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|||
|
|
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|||
|
|
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|||
|
|
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|||
|
|
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|||
|
|
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|||
|
|
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|||
|
|
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|||
|
|
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|||
|
|
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|||
|
|
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|||
|
|
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|||
|
|
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|||
|
|
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|||
|
|
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|||
|
|
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|||
|
|
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|||
|
|
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|||
|
|
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|||
|
|
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|||
|
|
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|||
|
|
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|||
|
|
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|||
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|||
|
|
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|||
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|||
|
|
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|||
|
|
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|||
|
|
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|||
|
|
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|||
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|||
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|||
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|||
|
|
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|||
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|||
|
|
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|||
|
|
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|||
|
|
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|||
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|||
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|||
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|||
|
|
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},D9=function(t,e){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+e+` v1759 h347 v-84
|
|||
|
|
H403z M403 1759 V0 H319 V1759 v`+e+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+e+` v1759 H0 v84 H347z
|
|||
|
|
M347 1759 V0 H263 V1759 v`+e+" v1759 h84z";case"vert":return"M145 15 v585 v"+e+` v585 c2.667,10,9.667,15,21,15
|
|||
|
|
c10,0,16.667,-5,20,-15 v-585 v`+-e+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|||
|
|
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+e+" v585 h43z";case"doublevert":return"M145 15 v585 v"+e+` v585 c2.667,10,9.667,15,21,15
|
|||
|
|
c10,0,16.667,-5,20,-15 v-585 v`+-e+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|||
|
|
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+e+` v585 h43z
|
|||
|
|
M367 15 v585 v`+e+` v585 c2.667,10,9.667,15,21,15
|
|||
|
|
c10,0,16.667,-5,20,-15 v-585 v`+-e+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|||
|
|
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+e+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+e+` v1715 h263 v84 H319z
|
|||
|
|
MM319 602 V0 H403 V602 v`+e+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+e+` v1799 H0 v-84 H319z
|
|||
|
|
MM319 602 V0 H403 V602 v`+e+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+e+` v602 h84z
|
|||
|
|
M403 1759 V0 H319 V1759 v`+e+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+e+` v602 h84z
|
|||
|
|
M347 1759 V0 h-84 V1759 v`+e+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
|||
|
|
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
|||
|
|
-36,557 l0,`+(e+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|||
|
|
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
|||
|
|
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
|||
|
|
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|||
|
|
l0,-`+(e+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|||
|
|
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
|||
|
|
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|||
|
|
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(e+9)+`
|
|||
|
|
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
|||
|
|
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
|||
|
|
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
|||
|
|
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|||
|
|
l0,-`+(e+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|||
|
|
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Vl{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return wt.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){for(var e="",n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e}toText(){var e=n=>n.toText();return this.children.map(e).join("")}}var Fi={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.755
|
|||
|
|
`+N+" children.");for(var Y=0;Y<N;Y++){var te=new Qa(T[Y]),ce=new Ta([te],{width:"400em",height:at(y),viewBox:"0 0 "+h+" "+M,preserveAspectRatio:F[Y]+" slice"}),Me=Se.makeSvgSpan([z[Y]],[ce],e);if(N===1)return{span:Me,minWidth:A,height:y};Me.style.height=at(y),k.push(Me)}return{span:Se.makeSpan(["stretchy"],k,e),minWidth:A,height:y}}}var{span:r,minWidth:o,height:l}=n();return r.height=l,r.style.height=at(l),o>0&&(r.style.minWidth=at(o)),r},vx=function(t,e,n,r,o){var l,h=t.height+t.depth+n+r;if(/fbox|color|angl/.test(e)){if(l=Se.makeSpan(["stretchy",e],[],o),e==="fbox"){var c=o.color&&o.getColor();c&&(l.style.borderColor=c)}}else{var p=[];/^[bx]cancel$/.test(e)&&p.push(new tp({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(e)&&p.push(new tp({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var v=new Ta(p,{width:"100%",height:at(h)});l=Se.makeSvgSpan([],[v],o)}return l.height=h,l.style.height=at(h),l},Ma={encloseSpan:vx,mathMLnode:px,svgSpan:gx};function Ft(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function _f(t){var e=Wc(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function Wc(t){return t&&(t.type==="atom"||j9.hasOwnProperty(t.type))?t:null}var Nf=(t,e)=>{var n,r,o;t&&t.type==="supsub"?(r=Ft(t.base,"accent"),n=r.base,t.base=n,o=F9(Zt(t,e)),t.base=r):(r=Ft(t,"accent"),n=r.base);var l=Zt(n,e.havingCrampedStyle()),h=r.isShifty&&wt.isCharacterBox(n),c=0;if(h){var p=wt.getBaseElem(n),v=Zt(p,e.havingCrampedStyle());c=Dm(v).skew}var b=r.label==="\\c",g=b?l.height+l.depth:Math.min(l.height,e.fontMetrics().xHeight),m;if(r.isStretchy)m=Ma.svgSpan(r,e),m=Se.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"elem",elem:m,wrapperClasses:["svg-align"],wrapperStyle:c>0?{width:"calc(100% - "+at(2*c)+")",marginLeft:at(2*c)}:void 0}]},e);else{var x,w;r.label==="\\vec"?(x=Se.staticSvg("vec",e),w=Se.svgData.vec[1]):(x=Se.makeOrd({mode:r.mode,text:r.label},e,"textord"),x=Dm(x),x.italic=0,w=x.width,b&&(g+=x.depth)),m=Se.makeSpan(["accent-body"],[x]);var S=r.label==="\\textcircled";S&&(m.classes.push("accent-full"),g=l.height);var k=c;S||(k-=w/2),m.style.left=at(k),r.label==="\\textcircled"&&(m.style.top=".2em"),m=Se.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:-g},{type:"elem",elem:m}]},e)}var C=Se.makeSpan(["mord","accent"],[m],e);return o?(o.children[0]=C,o.height=Math.max(C.height,o.height),o.classes[0]="mord",o):C},T6=(t,e)=>{var n=t.isStretchy?Ma.mathMLnode(t.label):new Ze.MathNode("mo",[li(t.label,t.mode)]),r=new Ze.MathNode("mover",[vn(t.base,e),n]);return r.setAttribute("accent","true"),r},bx=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));dt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var n=fc(e[0]),r=!bx.test(t.funcName),o=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:o,base:n}},htmlBuilder:Nf,mathmlBuilder:T6});dt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Nf,mathmlBuilder:T6});dt({type:"accentUnder",names:["\\underleftarro
|
|||
|
|
]`,Vx="\\\\[a-zA-Z@]+",Wx="\\\\[^\uD800-\uDFFF]",Gx="("+Vx+")"+J6+"*",Kx=`\\\\(
|
|||
|
|
|[ \r ]+
|
|||
|
|
?)[ \r ]*`,sp="[̀-ͯ]",Xx=new RegExp(sp+"+$"),Zx="("+J6+"+)|"+(Kx+"|")+"([!-\\[\\]-‧-豈-]"+(sp+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(sp+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Gx)+("|"+Wx+")");class rg{constructor(e,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=n,this.tokenRegex=new RegExp(Zx,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,n){this.catcodes[e]=n}lex(){var e=this.input,n=this.tokenRegex.lastIndex;if(n===e.length)return new ii("EOF",new jr(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new et("Unexpected character: '"+e[n]+"'",new ii(e[n],new jr(this,n,n+1)));var o=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[o]===14){var l=e.indexOf(`
|
|||
|
|
`,this.tokenRegex.lastIndex);return l===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=l+1,this.lex()}return new ii(o,new jr(this,n,this.tokenRegex.lastIndex))}}class Yx{constructor(e,n){e===void 0&&(e={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new et("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var n in e)e.hasOwnProperty(n)&&(e[n]==null?delete this.current[n]:this.current[n]=e[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,n,r){if(r===void 0&&(r=!1),r){for(var o=0;o<this.undefStack.length;o++)delete this.undefStack[o][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=n)}else{var l=this.undefStack[this.undefStack.length-1];l&&!l.hasOwnProperty(e)&&(l[e]=this.current[e])}n==null?delete this.current[e]:this.current[e]=n}}var Jx=q6;V("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});V("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});V("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});V("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});V("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return e[0].length===1&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});V("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");V("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var ig={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};V("\\char",function(t){var e=t.popToken(),n,r="";if(e.text==="'")n=8,e=t.popToken();else if(e.text==='"')n=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new et("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=ig[e.text],r==null||r>=n)throw new et("Invalid base-"+n+" digit "+e.text);for(var o;(o=ig[t.future().text])!=null&&o<n;)r*=n,r+=o,t.popToken()}return"\\@char{"+r+"}"});var Bf=(t,e,n,r)=>{var o=t.consumeArg().tokens;if(o.length!==1)throw new et("\\newcommand's first argument must be a macro name");var l=o[0].text,h=t.isDefined(l);if(h&&!e)throw new et("\\newcommand{"+l+"} attempting to redefine "+(l+"; use \\renewcommand"));if(!h&&!n)throw new et("\\renewcommand{"+l+"} when command "+l+" does not yet exist; use \\newcommand");var c=0;if(o=t.consumeArg().tokens,o.length===1&&o[0].text==="["){for(var p="",v=t.expandNextToken();v.text!=="]"&&v.text!=="EOF";)p+=v.text,v=t.expandNextToken();if(!p.match(/^\s*[0-9]+\s*$/))throw new et("Invalid number of arguments: "+p);c=parseInt(p),o=t.consumeArg().tokens}return h&&r||t.macros.set(l,{tokens:o,numArgs:c}),""};V("\\newcommand",t=>Bf(t,!1,!0,!1));V("\\renewcommand",t=>Bf(t,!0,!1,!1));V("\\providecommand",t=>Bf(t,!0,!0,!0));V("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});V("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});V("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),Wa[n],wn.math[n],wn.text[n]),""});V("\\bgroup","{");V("\\egroup","}");V("~","\\nobreakspace");V("\\lq","`");V("\\rq","'");V("\\aa","\\r a");V("\\AA","\\r A");V("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");V("\\copyright","\\TextOrMath{
|
|||
|
|
please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:o}}sg.hasOwnProperty(n[0])&&!wn[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',e),n=sg[n[0]]+n.slice(1));var l=Xx.exec(n);l&&(n=n.substring(0,l.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var h;if(wn[this.mode][n]){this.settings.strict&&this.mode==="math"&&np.indexOf(n)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var c=wn[this.mode][n].group,p=jr.range(e),v;if(q9.hasOwnProperty(c)){var b=c;v={type:"atom",mode:this.mode,family:b,loc:p,text:n}}else v={type:c,mode:this.mode,loc:p,text:n};h=v}else if(n.charCodeAt(0)>=128)this.settings.strict&&(u6(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),e)),h={type:"textord",mode:"text",loc:jr.range(e),text:n};else return null;if(this.consume(),l)for(var g=0;g<l[0].length;g++){var m=l[0][g];if(!lh[m])throw new et("Unknown accent ' "+m+"'",e);var x=lh[m][this.mode]||lh[m].text;if(!x)throw new et("Accent "+m+" unsupported in "+this.mode+" mode",e);h={type:"accent",mode:this.mode,loc:jr.range(e),label:x,isStretchy:!1,isShifty:!0,base:h}}return h}}Zc.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var qf=function(t,e){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Zc(t,e);delete n.gullet.macros.current["\\df@tag"];var r=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!e.displayMode)throw new et("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new ii("\\df@tag")])}]}return r},n3=function(t,e,n){e.textContent="";var r=jf(t,n).toNode();e.appendChild(r)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),n3=function(){throw new et("KaTeX doesn't work in quirks mode.")});var ek=function(t,e){var n=jf(t,e).toMarkup();return n},tk=function(t,e){var n=new Sf(e);return qf(t,n)},r3=function(t,e,n){if(n.throwOnError||!(t instanceof et))throw t;var r=Se.makeSpan(["katex-error"],[new si(e)]);return r.setAttribute("title",t.toString()),r.setAttribute("style","color:"+n.errorColor),r},jf=function(t,e){var n=new Sf(e);try{var r=qf(t,n);return ux(r,t,n)}catch(o){return r3(o,t,n)}},nk=function(t,e){var n=new Sf(e);try{var r=qf(t,n);return dx(r,t,n)}catch(o){return r3(o,t,n)}},rk="0.16.22",ik={Span:Wl,Anchor:Af,SymbolNode:si,SvgNode:Ta,PathNode:Qa,LineNode:tp},lg={version:rk,render:n3,renderToString:ek,ParseError:et,SETTINGS_SCHEMA:H0,__parse:tk,__renderToDomTree:jf,__renderToHTMLTree:nk,__setFontMetrics:R9,__defineSymbol:R,__defineFunction:dt,__defineMacro:V,__domTree:ik},i3={exports:{}};/*!
|
|||
|
|
* Vditor v3.11.2 - A markdown editor written in TypeScript.
|
|||
|
|
*
|
|||
|
|
* MIT License
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2018-present B3log 开源, b3log.org
|
|||
|
|
*
|
|||
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|||
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|||
|
|
* in the Software without restriction, including without limitation the rights
|
|||
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|||
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|||
|
|
* furnished to do so, subject to the following conditions:
|
|||
|
|
*
|
|||
|
|
* The above copyright notice and this permission notice shall be included in all
|
|||
|
|
* copies or substantial portions of the Software.
|
|||
|
|
*
|
|||
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|||
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|||
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||
|
|
* SOFTWARE.
|
|||
|
|
*
|
|||
|
|
*/(function(t,e){(function(n,r){t.exports=r()})(Jh,function(){return(()=>{var n={173:h=>{var c=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},p=-1,v=1,b=0;c.Diff=function(g,m){return[g,m]},c.prototype.diff_main=function(g,m,x,w){typeof w>"u"&&(this.Diff_Timeout<=0?w=Number.MAX_VALUE:w=new Date().getTime()+this.Diff_Timeout*1e3);var S=w;if(g==null||m==null)throw new Error("Null input. (diff_main)");if(g==m)return g?[new c.Diff(b,g)]:[];typeof x>"u"&&(x=!0);var k=x,C=this.diff_commonPrefix(g,m),T=g.substring(0,C);g=g.substring(C),m=m.substring(C),C=this.diff_commonSuffix(g,m);var A=g.substring(g.length-C);g=g.substring(0,g.length-C),m=m.substring(0,m.length-C);var M=this.diff_compute_(g,m,k,S);return T&&M.unshift(new c.Diff(b,T)),A&&M.push(new c.Diff(b,A)),this.diff_cleanupMerge(M),M},c.prototype.diff_compute_=function(g,m,x,w){var S;if(!g)return[new c.Diff(v,m)];if(!m)return[new c.Diff(p,g)];var k=g.length>m.length?g:m,C=g.length>m.length?m:g,T=k.indexOf(C);if(T!=-1)return S=[new c.Diff(v,k.substring(0,T)),new c.Diff(b,C),new c.Diff(v,k.substring(T+C.length))],g.length>m.length&&(S[0][0]=S[2][0]=p),S;if(C.length==1)return[new c.Diff(p,g),new c.Diff(v,m)];var A=this.diff_halfMatch_(g,m);if(A){var M=A[0],y=A[1],N=A[2],z=A[3],F=A[4],P=this.diff_main(M,N,x,w),Y=this.diff_main(y,z,x,w);return P.concat([new c.Diff(b,F)],Y)}return x&&g.length>100&&m.length>100?this.diff_lineMode_(g,m,w):this.diff_bisect_(g,m,w)},c.prototype.diff_lineMode_=function(g,m,x){var w=this.diff_linesToChars_(g,m);g=w.chars1,m=w.chars2;var S=w.lineArray,k=this.diff_main(g,m,!1,x);this.diff_charsToLines_(k,S),this.diff_cleanupSemantic(k),k.push(new c.Diff(b,""));for(var C=0,T=0,A=0,M="",y="";C<k.length;){switch(k[C][0]){case v:A++,y+=k[C][1];break;case p:T++,M+=k[C][1];break;case b:if(T>=1&&A>=1){k.splice(C-T-A,T+A),C=C-T-A;for(var N=this.diff_main(M,y,!1,x),z=N.length-1;z>=0;z--)k.splice(C,0,N[z]);C=C+N.length}A=0,T=0,M="",y="";break}C++}return k.pop(),k},c.prototype.diff_bisect_=function(g,m,x){for(var w=g.length,S=m.length,k=Math.ceil((w+S)/2),C=k,T=2*k,A=new Array(T),M=new Array(T),y=0;y<T;y++)A[y]=-1,M[y]=-1;A[C+1]=0,M[C+1]=0;for(var N=w-S,z=N%2!=0,F=0,P=0,Y=0,te=0,ce=0;ce<k&&!(new Date().getTime()>x);ce++){for(var Me=-ce+F;Me<=ce-P;Me+=2){var Fe=C+Me,We;Me==-ce||Me!=ce&&A[Fe-1]<A[Fe+1]?We=A[Fe+1]:We=A[Fe-1]+1;for(var rt=We-Me;We<w&&rt<S&&g.charAt(We)==m.charAt(rt);)We++,rt++;if(A[Fe]=We,We>w)P+=2;else if(rt>S)F+=2;else if(z){var je=C+N-Me;if(je>=0&&je<T&&M[je]!=-1){var Ne=w-M[je];if(We>=Ne)return this.diff_bisectSplit_(g,m,We,rt,x)}}}for(var nt=-ce+Y;nt<=ce-te;nt+=2){var je=C+nt,Ne;nt==-ce||nt!=ce&&M[je-1]<M[je+1]?Ne=M[je+1]:Ne=M[je-1]+1;for(var ct=Ne-nt;Ne<w&&ct<S&&g.charAt(w-Ne-1)==m.charAt(S-ct-1);)Ne++,ct++;if(M[je]=Ne,Ne>w)te+=2;else if(ct>S)Y+=2;else if(!z){var Fe=C+N-nt;if(Fe>=0&&Fe<T&&A[Fe]!=-1){var We=A[Fe],rt=C+We-Fe;if(Ne=w-Ne,We>=Ne)return this.diff_bisectSplit_(g,m,We,rt,x)}}}}return[new c.Diff(p,g),new c.Diff(v,m)]},c.prototype.diff_bisectSplit_=function(g,m,x,w,S){var k=g.substring(0,x),C=m.substring(0,w),T=g.substring(x),A=m.substring(w),M=this.diff_main(k,C,!1,S),y=this.diff_main(T,A,!1,S);return M.concat(y)},c.prototype.diff_linesToChars_=function(g,m){var x=[],w={};x[0]="";function S(A){for(var M="",y=0,N=-1,z=x.length;N<A.length-1;){N=A.indexOf(`
|
|||
|
|
`,y),N==-1&&(N=A.length-1);var F=A.substring(y,N+1);(w.hasOwnProperty?w.hasOwnProperty(F):w[F]!==void 0)?M+=String.fromCharCode(w[F]):(z==k&&(F=A.substring(y),N=A.length),M+=String.fromCharCode(z),w[F]=z,x[z++]=F),y=N+1}return M}var k=4e4,C=S(g);k=65535;var T=S(m);return{chars1:C,chars2:T,lineArray:x}},c.prototype.diff_charsToLines_=function(g,m){for(var x=0;x<g.length;x++){for(var w=g[x][1],S=[],k=0;k<w.length;k++)S[k]=m[w.charCodeAt(k)];g[x][1]=S.join("")}},c.prototype.diff_commonPrefix=function(g,m){if(!g||!m||g.charAt(0)!=m.charAt(0))return 0;for(var x=0,w=Math.min(g.length,m.length),S=w,k=0;x<S;)g.substring(k,S)==m.substring(k,S)?(x=S,k=x):w=S,S=Math.floor((w-x)/2+x);return S},c.prototype.diff_commonSuffix=function(g,m){if(!g||!m||g.charAt(g.length-1)!=m.charAt(m.length-1))return 0;for(var x=0,w=Math.min(g.length,m.length),S=w,k=0;x<S;)g.substring(g.length-S,g.length-k)==m.substring(m.length-S,m.length-k)?(x=S,k=x):w=S,S=Math.floor((w-x)/2+x);return S},c.prototype.diff_commonOverlap_=function(g,m){var x=g.length,w=m.length;if(x==0||w==0)return 0;x>w?g=g.substring(x-w):x<w&&(m=m.substring(0,x));var S=Math.min(x,w);if(g==m)return S;for(var k=0,C=1;;){var T=g.substring(S-C),A=m.indexOf(T);if(A==-1)return k;C+=A,(A==0||g.substring(S-C)==m.substring(0,C))&&(k=C,C++)}},c.prototype.diff_halfMatch_=function(g,m){if(this.Diff_Timeout<=0)return null;var x=g.length>m.length?g:m,w=g.length>m.length?m:g;if(x.length<4||w.length*2<x.length)return null;var S=this;function k(P,Y,te){for(var ce=P.substring(te,te+Math.floor(P.length/4)),Me=-1,Fe="",We,rt,je,Ne;(Me=Y.indexOf(ce,Me+1))!=-1;){var nt=S.diff_commonPrefix(P.substring(te),Y.substring(Me)),ct=S.diff_commonSuffix(P.substring(0,te),Y.substring(0,Me));Fe.length<ct+nt&&(Fe=Y.substring(Me-ct,Me)+Y.substring(Me,Me+nt),We=P.substring(0,te-ct),rt=P.substring(te+nt),je=Y.substring(0,Me-ct),Ne=Y.substring(Me+nt))}return Fe.length*2>=P.length?[We,rt,je,Ne,Fe]:null}var C=k(x,w,Math.ceil(x.length/4)),T=k(x,w,Math.ceil(x.length/2)),A;if(!C&&!T)return null;T?C?A=C[4].length>T[4].length?C:T:A=T:A=C;var M,y,N,z;g.length>m.length?(M=A[0],y=A[1],N=A[2],z=A[3]):(N=A[0],z=A[1],M=A[2],y=A[3]);var F=A[4];return[M,y,N,z,F]},c.prototype.diff_cleanupSemantic=function(g){for(var m=!1,x=[],w=0,S=null,k=0,C=0,T=0,A=0,M=0;k<g.length;)g[k][0]==b?(x[w++]=k,C=A,T=M,A=0,M=0,S=g[k][1]):(g[k][0]==v?A+=g[k][1].length:M+=g[k][1].length,S&&S.length<=Math.max(C,T)&&S.length<=Math.max(A,M)&&(g.splice(x[w-1],0,new c.Diff(p,S)),g[x[w-1]+1][0]=v,w--,w--,k=w>0?x[w-1]:-1,C=0,T=0,A=0,M=0,S=null,m=!0)),k++;for(m&&this.diff_cleanupMerge(g),this.diff_cleanupSemanticLossless(g),k=1;k<g.length;){if(g[k-1][0]==p&&g[k][0]==v){var y=g[k-1][1],N=g[k][1],z=this.diff_commonOverlap_(y,N),F=this.diff_commonOverlap_(N,y);z>=F?(z>=y.length/2||z>=N.length/2)&&(g.splice(k,0,new c.Diff(b,N.substring(0,z))),g[k-1][1]=y.substring(0,y.length-z),g[k+1][1]=N.substring(z),k++):(F>=y.length/2||F>=N.length/2)&&(g.splice(k,0,new c.Diff(b,y.substring(0,F))),g[k-1][0]=v,g[k-1][1]=N.substring(0,N.length-F),g[k+1][0]=p,g[k+1][1]=y.substring(F),k++),k++}k++}},c.prototype.diff_cleanupSemanticLossless=function(g){function m(F,P){if(!F||!P)return 6;var Y=F.charAt(F.length-1),te=P.charAt(0),ce=Y.match(c.nonAlphaNumericRegex_),Me=te.match(c.nonAlphaNumericRegex_),Fe=ce&&Y.match(c.whitespaceRegex_),We=Me&&te.match(c.whitespaceRegex_),rt=Fe&&Y.match(c.linebreakRegex_),je=We&&te.match(c.linebreakRegex_),Ne=rt&&F.match(c.blanklineEndRegex_),nt=je&&P.match(c.blanklineStartRegex_);return Ne||nt?5:rt||je?4:ce&&!Fe&&We?3:Fe||We?2:ce||Me?1:0}for(var x=1;x<g.length-1;){if(g[x-1][0]==b&&g[x+1][0]==b){var w=g[x-1][1],S=g[x][1],k=g[x+1][1],C=this.diff_commonSuffix(w,S);if(C){var T=S.substring(S.length-C);w=w.substring(0,w.length-C),S=T+S.substring(0,S.length-C),k=T+k}for(var A=w,M=S,y=k,N=m(w,S)+m(S,k);S.charAt(0)===k.charAt(0);){w+=S.charAt(0),S=S.substring(1)+k.charAt(0),k=k.substring(1);var z=m(w,S)+m(S,k);z>=N&&(N=z,A=w,M=S,y=k)}g[x-1][1]!=A&&(A?g[x-1][1]=A:(g.splice(x-1,1),x--),g[x][1]=M,y?g[x+1][1]=y:(g.splice(x+1,1),x--))}x++}},c.nonAlphaNumericRegex_=/[^a-zA-Z0-
|
|||
|
|
`),w=0,S=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;w<x.length;){var k=x[w].match(S);if(!k)throw new Error("Invalid patch string: "+x[w]);var C=new c.patch_obj;for(m.push(C),C.start1=parseInt(k[1],10),k[2]===""?(C.start1--,C.length1=1):k[2]=="0"?C.length1=0:(C.start1--,C.length1=parseInt(k[2],10)),C.start2=parseInt(k[3],10),k[4]===""?(C.start2--,C.length2=1):k[4]=="0"?C.length2=0:(C.start2--,C.length2=parseInt(k[4],10)),w++;w<x.length;){var T=x[w].charAt(0);try{var A=decodeURI(x[w].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+A)}if(T=="-")C.diffs.push(new c.Diff(p,A));else if(T=="+")C.diffs.push(new c.Diff(v,A));else if(T==" ")C.diffs.push(new c.Diff(b,A));else{if(T=="@")break;if(T!=="")throw new Error('Invalid patch mode "'+T+'" in: '+A)}w++}}return m},c.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},c.patch_obj.prototype.toString=function(){var g,m;this.length1===0?g=this.start1+",0":this.length1==1?g=this.start1+1:g=this.start1+1+","+this.length1,this.length2===0?m=this.start2+",0":this.length2==1?m=this.start2+1:m=this.start2+1+","+this.length2;for(var x=["@@ -"+g+" +"+m+` @@
|
|||
|
|
`],w,S=0;S<this.diffs.length;S++){switch(this.diffs[S][0]){case v:w="+";break;case p:w="-";break;case b:w=" ";break}x[S+1]=w+encodeURI(this.diffs[S][1])+`
|
|||
|
|
`}return x.join("").replace(/%20/g," ")},h.exports=c,h.exports.diff_match_patch=c,h.exports.DIFF_DELETE=p,h.exports.DIFF_INSERT=v,h.exports.DIFF_EQUAL=b},408:(h,c,p)=>{p.d(c,{default:()=>Nt});var v=p(135),b=p(840),g=p(775),m=p(428),x=p(325),w=p(483),S=p(999),k=function(oe){oe===void 0&&(oe=document);var he=function(J){var ee=document.createElement("img");ee.src=J.getAttribute("data-src"),ee.addEventListener("load",function(){!J.getAttribute("style")&&!J.getAttribute("class")&&!J.getAttribute("width")&&!J.getAttribute("height")&&ee.naturalHeight>ee.naturalWidth&&ee.naturalWidth/ee.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&ee.naturalHeight>window.innerHeight-40&&(J.style.height=window.innerHeight-40+"px"),J.src=ee.src}),J.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return oe.querySelectorAll("img").forEach(function(J){J.getAttribute("data-src")&&he(J)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),oe.querySelectorAll("img").forEach(function(J){window.vditorImageIntersectionObserver.observe(J)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(J){J.forEach(function(ee){(typeof ee.isIntersecting>"u"?ee.intersectionRatio!==0:ee.isIntersecting)&&ee.target.getAttribute("data-src")&&he(ee.target)})}),oe.querySelectorAll("img").forEach(function(J){window.vditorImageIntersectionObserver.observe(J)}))},C=p(472),T=p(280),A=p(637),M=p(825),y=p(11),N=p(194),z=p(436),F=p(229),P=p(145),Y=p(538),te=p(413),ce=p(106),Me=p(673),Fe=function(oe){document.querySelectorAll(".vditor-anchor").forEach(function(he){oe===1&&he.classList.add("vditor-anchor--left"),he.onclick=function(){var J=he.getAttribute("href").substr(1),ee=document.getElementById("vditorAnchor-"+J).offsetTop;document.querySelector("html").scrollTop=ee}}),window.onhashchange=function(){var he=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));he&&(document.querySelector("html").scrollTop=he.offsetTop)}},We=p(214),rt=p(810),je=function(oe,he){if(he===void 0&&(he="zh_CN"),!(typeof speechSynthesis>"u"||typeof SpeechSynthesisUtterance>"u")){var J=function(){var be=speechSynthesis.getVoices(),le,ye;return be.forEach(function(Ae){Ae.lang===he.replace("_","-")&&(le=Ae),Ae.default&&(ye=Ae)}),le||(le=ye),le},ee='<svg><use xlink:href="#vditor-icon-play"></use></svg>',Ce='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(ee='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',Ce='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var se=document.querySelector(".vditor-speech");se||(se=document.createElement("button"),se.className="vditor-speech",oe.insertAdjacentElement("beforeend",se),speechSynthesis.onvoiceschanged!==void 0&&(speechSynthesis.onvoiceschanged=J));var G=J(),X=new SpeechSynthesisUtterance;X.voice=G,X.onend=X.onerror=function(){se.style.display="none",speechSynthesis.cancel(),se.classList.remove("vditor-speech--current"),se.innerHTML=ee},oe.addEventListener(window.ontouchstart!==void 0?"touchend":"click",function(be){var le=be.target;if(le.classList.contains("vditor-speech")||le.parentElement.classList.contains("vditor-speech")){se.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),se.innerHTML=Ce):(speechSynthesis.pause(),se.innerHTML=ee)):(X.text=se.getAttribute("data-text"),speechSynthesis.speak(X),se.classList.add("vditor-speech--current"),se.innerHTML=Ce),(0,rt.Hc)(window.vditorSpeechRange),oe.focus();return}if(se.style.display="none",speechSynthesis.cancel(),se.classList.remove("vditor-speech--current"),se.innerHTML=ee,getSelection().rangeCount!==0){var ye=getSelection().getRangeAt(0),Ae=ye.toString().trim();if(Ae){window.vditorSpeechRange=ye.cloneRange();var ze=ye.getBoundingClientRect();se.innerHTML=ee,se.style.display="block",se.style.top=ze.top+ze.height+document.queryS
|
|||
|
|
`)&&(T=T.substr(0,T.length-1));var M='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(M='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var y=document.createElement("div");y.className="vditor-copy",y.innerHTML='<span aria-label="'.concat(((S=window.VditorI18n)===null||S===void 0?void 0:S.copy)||"复制",`"
|
|||
|
|
onmouseover="this.setAttribute('aria-label', '`).concat(((k=window.VditorI18n)===null||k===void 0?void 0:k.copy)||"复制",`')"
|
|||
|
|
class="vditor-tooltipped vditor-tooltipped__w"
|
|||
|
|
onclick="event.stopPropagation();this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`).concat(((C=window.VditorI18n)===null||C===void 0?void 0:C.copied)||"已复制",`');this.previousElementSibling.blur()">`).concat(M,"</span>");var N=document.createElement("textarea");N.value=(0,v.X)(T),y.insertAdjacentElement("afterbegin",N),x&&x.renderMenu&&x.renderMenu(w,y),w.before(y),w.style.maxHeight=window.outerHeight-40+"px",w.insertAdjacentHTML("afterend",'<span style="position: absolute">'.concat(b.g.ZWSP,"</span>"))})}},325:(h,c,p)=>{p.d(c,{P:()=>m});var v=p(145),b=p(413),g=p(840),m=function(x,w){w===void 0&&(w=v.g.CDN);var S=g.flowchartRenderAdapter.getElements(x);S.length!==0&&(0,b.G)("".concat(w,"/dist/js/flowchart.js/flowchart.min.js"),"vditorFlowchartScript").then(function(){S.forEach(function(k){if(k.getAttribute("data-processed")!=="true"){var C=flowchart.parse(g.flowchartRenderAdapter.getCode(k));k.innerHTML="",C.drawSVG(k),k.setAttribute("data-processed","true")}})})}},483:(h,c,p)=>{p.d(c,{v:()=>m});var v=p(145),b=p(413),g=p(840),m=function(x,w){w===void 0&&(w=v.g.CDN);var S=g.graphvizRenderAdapter.getElements(x);S.length!==0&&(0,b.G)("".concat(w,"/dist/js/graphviz/viz.js"),"vditorGraphVizScript").then(function(){S.forEach(function(k){var C=g.graphvizRenderAdapter.getCode(k);if(!(k.parentElement.classList.contains("vditor-wysiwyg__pre")||k.parentElement.classList.contains("vditor-ir__marker--pre"))&&!(k.getAttribute("data-processed")==="true"||C.trim()==="")){try{var T=new Blob(["importScripts('".concat(document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js"),"');")],{type:"application/javascript"}),A=window.URL||window.webkitURL,M=A.createObjectURL(T),y=new Worker(M);new Viz({worker:y}).renderSVGElement(C).then(function(N){k.innerHTML=N.outerHTML}).catch(function(N){k.innerHTML="graphviz render error: <br>".concat(N),k.className="vditor-reset--error"})}catch{}k.setAttribute("data-processed","true")}})})}},999:(h,c,p)=>{p.d(c,{s:()=>m});var v=p(145),b=p(413),g=p(290),m=function(x,w,S){w===void 0&&(w=document),S===void 0&&(S=v.g.CDN);var k=x.style;v.g.CODE_THEME.includes(k)||(k="github");var C=document.getElementById("vditorHljsStyle"),T="".concat(S,"/dist/js/highlight.js/styles/").concat(k,".min.css");if(C&&C.getAttribute("href")!==T&&C.remove(),(0,g.c)("".concat(S,"/dist/js/highlight.js/styles/").concat(k,".min.css"),"vditorHljsStyle"),x.enable!==!1){var A=w.querySelectorAll("pre > code");A.length!==0&&(0,b.G)("".concat(S,"/dist/js/highlight.js/highlight.min.js?v=11.7.0"),"vditorHljsScript").then(function(){(0,b.G)("".concat(S,"/dist/js/highlight.js/third-languages.js?v=1.0.1"),"vditorHljsThirdScript").then(function(){w.querySelectorAll("pre > code").forEach(function(M){if(!(M.parentElement.classList.contains("vditor-ir__marker--pre")||M.parentElement.classList.contains("vditor-wysiwyg__pre"))&&!(M.classList.contains("language-mermaid")||M.classList.contains("language-flowchart")||M.classList.contains("language-echarts")||M.classList.contains("language-mindmap")||M.classList.contains("language-plantuml")||M.classList.contains("language-smiles")||M.classList.contains("language-abc")||M.classList.contains("language-graphviz")||M.classList.contains("language-math"))){x.defaultLang!==""&&M.className.indexOf("language-")===-1&&M.classList.add("language-"+x.defaultLang);var y=M.className.replace("language-","");if(window.hljs.getLanguage(y)||(y="plaintext"),M.innerHTML=window.hljs.highlight(M.textContent,{language:y,ignoreIllegals:!0}).value,M.classList.add("hljs"),!!x.lineNumber){M.classList.add("vditor-linenumber");var N=M.querySelector(".vditor-linenumber__temp");N||(N=document.createElement("div"),N.className="vditor-linenumber__temp",M.insertAdjacentElement("beforeend",N));var z=getComputedStyle(M).whiteSpace,F=!1;(z==="pre-wrap"||z==="pre-line")&&(F=!0);var P="",Y=M.textContent.split(/\r\n|\r|\n/g);Y.pop(),Y.map(function(te){var ce="";F&&(N.textContent=te||`
|
|||
|
|
`,ce=' style="height:'.concat(N.getBoundingClientRect().height,'px"')),P+="<span".concat(ce,"></span>")}),N.style.display="none",P='<span class="vditor-linenumber__rows">'.concat(P,"</span>"),M.insertAdjacentHTML("beforeend",P)}}})})})}}},11:(h,c,p)=>{p.d(c,{K:()=>S});var v=p(145),b=p(413),g=p(840),m={},x=function(k,C){var T=k.transform(C),A=Object.keys(T.features).filter(function(F){return!m[F]});A.forEach(function(F){m[F]=!0});var M=k.getAssets(A),y=M.styles,N=M.scripts,z=window.markmap;return y&&z.loadCSS(y),N&&z.loadJS(N),T},w=function(k,C){var T=window.markmap,A=T.Transformer,M=T.Markmap,y=T.deriveOptions;T.globalCSS;var N=new A;k.innerHTML='<svg style="width:100%"></svg>';var z=k.firstChild,F=M.create(z,null),P=x(N,C),Y=P.root,te=P.frontmatter,ce=te==null?void 0:te.markmap,Me=y(ce);F.setData(Y,Me),F.fit()},S=function(k,C){k===void 0&&(k=document),C===void 0&&(C=v.g.CDN);var T=g.markmapRenderAdapter.getElements(k);T.length!==0&&(0,b.G)("".concat(C,"/dist/js/markmap/markmap.min.js"),"vditorMarkerScript").then(function(){T.forEach(function(A){var M=g.markmapRenderAdapter.getCode(A);if(!(A.getAttribute("data-processed")==="true"||M.trim()==="")){var y=document.createElement("div");y.className="language-markmap",A.parentNode.appendChild(y),w(y,M),A.parentNode.childNodes[0].nodeName=="CODE"&&A.parentNode.removeChild(A.parentNode.childNodes[0])}})})}},472:(h,c,p)=>{p.d(c,{H:()=>w});var v=p(145),b=p(413),g=p(290),m=p(105),x=p(840),w=function(S,k){S===void 0&&(S=document);var C=x.mathRenderAdapter.getElements(S);if(C.length!==0){var T={cdn:v.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(k&&k.math&&(k.math=Object.assign({},T.math,k.math)),k=Object.assign({},T,k),k.math.engine==="KaTeX")(0,g.c)("".concat(k.cdn,"/dist/js/katex/katex.min.css?v=0.16.9"),"vditorKatexStyle"),(0,b.G)("".concat(k.cdn,"/dist/js/katex/katex.min.js?v=0.16.9"),"vditorKatexScript").then(function(){(0,b.G)("".concat(k.cdn,"/dist/js/katex/mhchem.min.js?v=0.16.9"),"vditorKatexChemScript").then(function(){C.forEach(function(y){if(!(y.parentElement.classList.contains("vditor-wysiwyg__pre")||y.parentElement.classList.contains("vditor-ir__marker--pre"))&&!y.getAttribute("data-math")){var N=(0,m.X)(x.mathRenderAdapter.getCode(y));y.setAttribute("data-math",N);try{y.innerHTML=katex.renderToString(N,{displayMode:y.tagName==="DIV",output:"html",macros:k.math.macros})}catch(z){y.innerHTML=z.message,y.className="language-math vditor-reset--error"}y.addEventListener("copy",function(z){z.stopPropagation(),z.preventDefault();var F=z.currentTarget.closest(".language-math");z.clipboardData.setData("text/html",F.innerHTML),z.clipboardData.setData("text/plain",F.getAttribute("data-math"))})}})})});else if(k.math.engine==="MathJax"){var A=function(y){if(y.length!==0){var N=0,z=y[y.length-1],F=function(){var P=y[N++];P===z?P():P(F)};F()}};window.MathJax||(window.MathJax={loader:{paths:{mathjax:"".concat(k.cdn,"/dist/js/mathjax")}},startup:{typeset:!1},tex:{macros:k.math.macros}},Object.assign(window.MathJax,k.math.mathJaxOptions)),(0,b.J)("".concat(k.cdn,"/dist/js/mathjax/tex-svg-full.js"),"protyleMathJaxScript");var M=function(y,N){var z=(0,m.X)(y.textContent).trim(),F=window.MathJax.getMetricsFor(y);F.display=y.tagName==="DIV",window.MathJax.tex2svgPromise(z,F).then(function(P){y.innerHTML="",y.setAttribute("data-math",z),y.append(P),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var Y=P.querySelector('[data-mml-node="merror"]');Y&&Y.textContent.trim()!==""&&(y.innerHTML=Y.textContent.trim(),y.className="vditor-reset--error"),N&&N()})};window.MathJax.startup.promise.then(function(){for(var y=[],N=function(F){var P=C[F];!P.parentElement.classList.contains("vditor-wysiwyg__pre")&&!P.parentElement.classList.contains("vditor-ir__marker--pre")&&!P.getAttribute("data-math")&&(0,m.X)(P.textContent).trim()&&y.push(function(Y){F===C.length-1?M(P):M(P,Y)})},z=0;z<C.length;z++)N(z);A(y)})}}}},280:(h,c,p)=>{p.d(c,{Y:()=>x});var v=p(494),b=function(w,S){w.insertAdjacentHTML("afterend",'<video controls="controls" src="'.concat(S,'"></
|
|||
|
|
src="//coub.com/embed/`.concat(A[1],'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>')),w.remove();else if(M&&M[0])w.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
|
|||
|
|
src="https://www.facebook.com/plugins/video.php?href=`.concat(encodeURIComponent(M[0]),'"></iframe>')),w.remove();else if(y&&y[2])w.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
|
|||
|
|
src="https://www.dailymotion.com/embed/video/`.concat(y[2],'"></iframe>')),w.remove();else if(S.indexOf("bilibili.com")>-1&&(S.indexOf("bvid=")>-1||N&&N[1])){var F={bvid:(0,v.on)("bvid",S)||N&&N[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(S.startsWith("http")?S:"https:"+S).search.split("&").forEach(function(te,ce){if(te){ce===0&&(te=te.substr(1));var Me=te.split("=");F[Me[0]]=Me[1]}});var P="https://player.bilibili.com/player.html?",Y=Object.keys(F);Y.forEach(function(te,ce){P+="".concat(te,"=").concat(F[te]),ce<Y.length-1&&(P+="&")}),w.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'.concat(P,'"></iframe>')),w.remove()}else z&&z[1]&&(w.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'.concat(z[1],'"></iframe>')),w.remove())},x=function(w){w&&w.querySelectorAll("a").forEach(function(S){var k=S.getAttribute("href");k&&(k.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?b(S,k):k.match(/^.+.(mp3|wav|flac)$/)?g(S,k):m(S,k))})}},637:(h,c,p)=>{p.d(c,{i:()=>S});var v=p(145),b=p(413),g=p(840),m=p(494),x=function(k,C,T,A){function M(y){return y instanceof T?y:new T(function(N){N(y)})}return new(T||(T=Promise))(function(y,N){function z(Y){try{P(A.next(Y))}catch(te){N(te)}}function F(Y){try{P(A.throw(Y))}catch(te){N(te)}}function P(Y){Y.done?y(Y.value):M(Y.value).then(z,F)}P((A=A.apply(k,C||[])).next())})},w=function(k,C){var T={label:0,sent:function(){if(y[0]&1)throw y[1];return y[1]},trys:[],ops:[]},A,M,y,N;return N={next:z(0),throw:z(1),return:z(2)},typeof Symbol=="function"&&(N[Symbol.iterator]=function(){return this}),N;function z(P){return function(Y){return F([P,Y])}}function F(P){if(A)throw new TypeError("Generator is already executing.");for(;N&&(N=0,P[0]&&(T=0)),T;)try{if(A=1,M&&(y=P[0]&2?M.return:P[0]?M.throw||((y=M.return)&&y.call(M),0):M.next)&&!(y=y.call(M,P[1])).done)return y;switch(M=0,y&&(P=[P[0]&2,y.value]),P[0]){case 0:case 1:y=P;break;case 4:return T.label++,{value:P[1],done:!1};case 5:T.label++,M=P[1],P=[0];continue;case 7:P=T.ops.pop(),T.trys.pop();continue;default:if(y=T.trys,!(y=y.length>0&&y[y.length-1])&&(P[0]===6||P[0]===2)){T=0;continue}if(P[0]===3&&(!y||P[1]>y[0]&&P[1]<y[3])){T.label=P[1];break}if(P[0]===6&&T.label<y[1]){T.label=y[1],y=P;break}if(y&&T.label<y[2]){T.label=y[2],T.ops.push(P);break}y[2]&&T.ops.pop(),T.trys.pop();continue}P=C.call(k,T)}catch(Y){P=[6,Y],M=0}finally{A=y=0}if(P[0]&5)throw P[1];return{value:P[0]?P[1]:void 0,done:!0}}},S=function(k,C,T){k===void 0&&(k=document),C===void 0&&(C=v.g.CDN);var A=g.mermaidRenderAdapter.getElements(k);A.length!==0&&(0,b.G)("".concat(C,"/dist/js/mermaid/mermaid.min.js?v=11.6.0"),"vditorMermaidScript").then(function(){var M={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};T==="dark"&&(M.theme="dark"),mermaid.initialize(M),A.forEach(function(y){return x(void 0,void 0,void 0,function(){var N,z,F,P,Y;return w(this,function(te){switch(te.label){case 0:if(N=g.mermaidRenderAdapter.getCode(y),y.getAttribute("data-processed")==="true"||N.trim()==="")return[2];z="mermaid"+(0,m.Wb)(),te.label=1;case 1:return te.trys.push([1,3,,4]),[4,mermaid.render(z,y.textContent)];case 2:return F=te.sent(),y.innerHTML=F.svg,[3,4];case 3:return P=te.sent(),Y=document.querySelector("#"+z),y.innerHTML="".concat(Y.outerHTML,`<br>
|
|||
|
|
<div style="text-align: left"><small>`).concat(P.message.replace(/\n/,"<br>"),"</small></div>"),Y.parentElement.remove(),[3,4];case 4:return y.setAttribute("data-processed","true"),[2]}})})})})}},194:(h,c,p)=>{p.d(c,{P:()=>m});var v=p(145),b=p(413),g=p(840),m=function(x,w,S){x===void 0&&(x=document),w===void 0&&(w=v.g.CDN);var k=g.mindmapRenderAdapter.getElements(x);k.length>0&&(0,b.G)("".concat(w,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){k.forEach(function(C){if(!(C.parentElement.classList.contains("vditor-wysiwyg__pre")||C.parentElement.classList.contains("vditor-ir__marker--pre"))){var T=g.mindmapRenderAdapter.getCode(C);if(T)try{if(C.getAttribute("data-processed")==="true")return;echarts.init(C,S==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(T))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(A,M){var y;return!((y=M==null?void 0:M.data)===null||y===void 0)&&y.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),C.setAttribute("data-processed","true")}catch(A){C.className="vditor-reset--error",C.innerHTML="mindmap render error: <br>".concat(A)}}})})}},436:(h,c,p)=>{p.d(c,{k:()=>g});var v=p(771),b=p(472),g=function(m,x,w){var S="",k=[];if(Array.from(m.children).forEach(function(M,y){if((0,v.W)(M)){if(w){var N=M.id.lastIndexOf("_");M.id=M.id.substring(0,N===-1?void 0:N)+"_"+y}k.push(M.id),S+=M.outerHTML.replace("<wbr>","")}}),S==="")return x.innerHTML="","";var C=document.createElement("div");if(w)w.lute.SetToC(!0),w.currentMode==="wysiwyg"&&!w.preview.element.contains(m)?C.innerHTML=w.lute.SpinVditorDOM("<p>[ToC]</p>"+S):w.currentMode==="ir"&&!w.preview.element.contains(m)?C.innerHTML=w.lute.SpinVditorIRDOM("<p>[ToC]</p>"+S):C.innerHTML=w.lute.HTML2VditorDOM("<p>[ToC]</p>"+S),w.lute.SetToC(w.options.preview.markdown.toc);else{x.classList.add("vditor-outline");var T=Lute.New();T.SetToC(!0),C.innerHTML=T.HTML2VditorDOM("<p>[ToC]</p>"+S)}var A=C.firstElementChild.querySelectorAll("li > span[data-target-id]");return A.forEach(function(M,y){if(M.nextElementSibling&&M.nextElementSibling.tagName==="UL"){var N="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(N='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),M.innerHTML="".concat(N,"<span>").concat(M.innerHTML,"</span>")}else M.innerHTML="<svg></svg><span>".concat(M.innerHTML,"</span>");M.setAttribute("data-target-id",k[y])}),S=C.firstElementChild.innerHTML,A.length===0?(x.innerHTML="",S):(x.innerHTML=S,w&&(0,b.H)(x,{cdn:w.options.cdn,math:w.options.preview.math}),x.firstElementChild.addEventListener("click",function(M){for(var y=M.target;y&&!y.isEqualNode(x);){if(y.classList.contains("vditor-outline__action")){y.classList.contains("vditor-outline__action--close")?(y.classList.remove("vditor-outline__action--close"),y.parentElement.nextElementSibling.setAttribute("style","display:block")):(y.classList.add("vditor-outline__action--close"),y.parentElement.nextElementSibling.setAttribute("style","display:none")),M.preventDefault(),M.stopPropagation();break}else if(y.getAttribute("data-target-id")){M.preventDefault(),M.stopPropagation();var N=document.getElementById(y.getAttribute("data-target-id"));if(!N)return;if(w)if(w.options.height==="auto"){var z=N.offsetTop+w.element.offsetTop;w.options.toolbarConfig.pin||(z+=w.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,z)}else w.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,w.element.offsetTop),w.preview.element.contains(m)?m.parentElement.scrollTop=N.offsetTop:m.scrollTop=N.offsetTop;else window.scrollTo(window.scrollX,N.offsetTop);break}y=y.parentElement}}),S)}},229:(
|
|||
|
|
<div class="vditor-img__bar">
|
|||
|
|
<span class="vditor-img__btn" data-deg="0">
|
|||
|
|
<svg><use xlink:href="#vditor-icon-redo"></use></svg>
|
|||
|
|
`).concat(window.VditorI18n.spin,`
|
|||
|
|
</span>
|
|||
|
|
<span class="vditor-img__btn" onclick="this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''">
|
|||
|
|
X `).concat(window.VditorI18n.close,`
|
|||
|
|
</span>
|
|||
|
|
</div>
|
|||
|
|
<div class="vditor-img__img" onclick="this.parentElement.outerHTML = '';document.body.style.overflow = ''">
|
|||
|
|
<img style="width: `).concat(b.width,"px;height:").concat(b.height,"px;transform: translate3d(").concat(x.left,"px, ").concat(x.top-w,'px, 0)" src="').concat(b.getAttribute("src"),`">
|
|||
|
|
</div>
|
|||
|
|
</div>`)),document.body.style.overflow="hidden";var S=document.querySelector(".vditor-img img"),k="translate3d(".concat(Math.max(0,window.innerWidth-b.naturalWidth)/2,"px, ").concat(Math.max(0,window.innerHeight-w-b.naturalHeight)/2,"px, 0)");setTimeout(function(){S.setAttribute("style","transition: transform .3s ease-in-out;transform: ".concat(k)),setTimeout(function(){S.parentElement.scrollTo((S.parentElement.scrollWidth-S.parentElement.clientWidth)/2,(S.parentElement.scrollHeight-S.parentElement.clientHeight)/2)},400)});var C=document.querySelector(".vditor-img__btn");C.addEventListener("click",function(){var T=parseInt(C.getAttribute("data-deg"),10)+90;T/90%2===1&&b.naturalWidth>S.parentElement.clientHeight?S.style.transform="translate3d(".concat(Math.max(0,window.innerWidth-b.naturalWidth)/2,"px, ").concat(b.naturalWidth/2-b.naturalHeight/2,"px, 0) rotateZ(").concat(T,"deg)"):S.style.transform="".concat(k," rotateZ(").concat(T,"deg)"),C.setAttribute("data-deg",T.toString()),setTimeout(function(){S.parentElement.scrollTo((S.parentElement.scrollWidth-S.parentElement.clientWidth)/2,(S.parentElement.scrollHeight-S.parentElement.clientHeight)/2)},400)})}},580:(h,c,p)=>{p.d(c,{Y:()=>g});var v=p(145),b=p(290),g=function(m,x){x===void 0&&(x=v.g.CDN),v.g.CODE_THEME.includes(m)||(m="github");var w=document.getElementById("vditorHljsStyle"),S="".concat(x,"/dist/js/highlight.js/styles/").concat(m,".min.css");w?w.getAttribute("href")!==S&&(w.remove(),(0,b.c)(S,"vditorHljsStyle")):(0,b.c)(S,"vditorHljsStyle")}},538:(h,c,p)=>{p.d(c,{Z:()=>b});var v=p(290),b=function(g,m){if(!(!g||!m)){var x=document.getElementById("vditorContentTheme"),w="".concat(m,"/").concat(g,".css");x?x.getAttribute("href")!==w&&(x.remove(),(0,v.c)(w,"vditorContentTheme")):(0,v.c)(w,"vditorContentTheme")}}},413:(h,c,p)=>{p.d(c,{J:()=>v,G:()=>b});var v=function(g,m){if(document.getElementById(m))return!1;var x=new XMLHttpRequest;x.open("GET",g,!1),x.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),x.send("");var w=document.createElement("script");w.type="text/javascript",w.text=x.responseText,w.id=m,document.head.appendChild(w)},b=function(g,m){return new Promise(function(x,w){if(document.getElementById(m))return x(!0),!1;var S=document.createElement("script");S.src=g,S.async=!0,document.head.appendChild(S),S.onerror=function(k){w(k)},S.onload=function(){if(document.getElementById(m))return S.remove(),x(!0),!1;S.id=m,x(!0)}})}},290:(h,c,p)=>{p.d(c,{c:()=>v});var v=function(b,g){if(!document.getElementById(g)){var m=document.createElement("link");m.id=g,m.rel="stylesheet",m.type="text/css",m.href=b,document.getElementsByTagName("head")[0].appendChild(m)}}},105:(h,c,p)=>{p.d(c,{X:()=>v});var v=function(b){return b.replace(/\u00a0/g," ")}},410:(h,c,p)=>{p.d(c,{G6:()=>v,vU:()=>b,pK:()=>g,Le:()=>m,yl:()=>x,ns:()=>w,i7:()=>S});var v=function(){return navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")===-1},b=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},g=function(){try{return typeof localStorage<"u"}catch{return!1}},m=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},x=function(k){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!!(k.metaKey&&!k.ctrlKey):!!(!k.metaKey&&k.ctrlKey)},w=function(k){return/Mac/.test(navigator.platform)||navigator.platform==="iPhone"?k.indexOf("⇧")>-1&&b()&&(k=k.replace(";",":").replace("=","+").replace("-","_")):(k.startsWith("⌘")?k=k.replace("⌘","⌘+"):k.startsWith("⌥")&&k.substr(1,1)!=="⌘"?k=k.replace("⌥","⌥+"):k=k.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+"),k=k.replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt"),k.indexOf("Shift")>-1&&(k=k.replace(";",":").replace("=","+").replace("-","_"))),k},S=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},494:(h,c,p)=>{p.d(c,{Wb:()=>v,on:()=>b,Qf:()=>g});var v=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g
|
|||
|
|
`).replace(/\n\n$/,`
|
|||
|
|
`)):i.currentMode==="wysiwyg"?i.lute.VditorDOM2Md(i.wysiwyg.element.innerHTML):i.currentMode==="ir"?i.lute.VditorIRDOM2Md(i.ir.element.innerHTML):""},b=o(413),g=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-devtools",this.element.innerHTML='<div class="vditor-reset--error"></div><div style="height: 100%;"></div>'}return i.prototype.renderEchart=function(a){var s=this;a.devtools.element.style.display==="block"&&(0,b.G)("".concat(a.options.cdn,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){s.ASTChart||(s.ASTChart=echarts.init(a.devtools.element.lastElementChild));try{s.element.lastElementChild.style.display="block",s.element.firstElementChild.innerHTML="",s.ASTChart.setOption({series:[{data:JSON.parse(a.lute.RenderEChartsJSON(v(a))),initialTreeDepth:-1,label:{align:"left",backgroundColor:"rgba(68, 77, 86, .68)",borderRadius:3,color:"#d1d5da",fontSize:12,lineHeight:12,offset:[9,12],padding:[2,4,2,4],position:"top",verticalAlign:"middle"},lineStyle:{color:"#4285f4",type:"curve",width:1},orient:"vertical",roam:!0,type:"tree"}],toolbox:{bottom:25,emphasis:{iconStyle:{color:"#4285f4"}},feature:{restore:{show:!0},saveAsImage:{show:!0}},right:15,show:!0}}),s.ASTChart.resize()}catch(u){s.element.lastElementChild.style.display="none",s.element.firstElementChild.innerHTML=u}})},i}(),m=o(410),x=function(i,a){a.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&u.classList.contains("vditor-menu--current")&&u.classList.remove("vditor-menu--current")}})},w=function(i,a){a.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&!u.classList.contains("vditor-menu--current")&&u.classList.add("vditor-menu--current")}})},S=function(i,a){a.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&u.classList.contains(c.g.CLASS_MENU_DISABLED)&&u.classList.remove(c.g.CLASS_MENU_DISABLED)}})},k=function(i,a){a.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&!u.classList.contains(c.g.CLASS_MENU_DISABLED)&&u.classList.add(c.g.CLASS_MENU_DISABLED)}})},C=function(i,a){a.forEach(function(s){i[s]&&i[s]&&(i[s].style.display="none")})},T=function(i,a){a.forEach(function(s){i[s]&&i[s]&&(i[s].style.display="block")})},A=function(i,a,s){a.includes("subToolbar")&&(i.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(u){s&&u.isEqualNode(s)||(u.style.display="none")}),i.toolbar.elements.emoji&&(i.toolbar.elements.emoji.lastElementChild.style.display="none")),a.includes("hint")&&(i.hint.element.style.display="none"),i.wysiwyg.popover&&a.includes("popover")&&(i.wysiwyg.popover.style.display="none")},M=function(i,a,s,u){s.addEventListener((0,m.Le)(),function(d){d.preventDefault(),d.stopPropagation(),!s.classList.contains(c.g.CLASS_MENU_DISABLED)&&(i.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(f){f.classList.remove("vditor-hint--current")}),a.style.display==="block"?a.style.display="none":(A(i,["subToolbar","hint","popover"],s.parentElement.parentElement),s.classList.contains("vditor-tooltipped")||s.classList.add("vditor-hint--current"),a.style.display="block",i.toolbar.element.getBoundingClientRect().right-s.getBoundingClientRect().right<250?a.classList.add("vditor-panel--left"):a.classList.remove("vditor-panel--left")))})},y=o(106),N=o(771),z=function(i,a,s,u){},F=o(135),P=o(775),Y=o(428),te=o(325),ce=o(483),Me=o(999),Fe=o(472),We=o(637),rt=o(11),je=o(194),Ne=o(229),nt=o(825),ct=function(i,a,s){s===void 0&&(s="sv");var u=document.createElement("div");u.innerHTML=i;var d=!1;u.childElementCount===1&&u.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(d=!0);var f=u.querySelectorAll("pre");if(u.childElementCount===1&&f.length===1&&f[0].className!=="vditor-wysiwyg"&&f[0].className!=="vditor-sv"&&(d=!0),i.indexOf(`
|
|||
|
|
<p class="p1">`)===0&&(d=!0),u.childElementCount===1&&u.firstElementChild.tagName==="TABLE"&&u.querySelector(".line-number")&&u.querySelector(".line-content")&&(d=!0),d){var E=a||i;return/\n/.test(E)||f.length===1?s==="wysiwyg"?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'.concat(E.replace(/&/g,"&").replace(/</g,"<"),"<wbr></code></pre></div>"):"\n```\n"+E.replace(/&/g,"&").replace(/</g,"<")+"\n```":s==="wysiwyg"?"<code>".concat(E.replace(/&/g,"&").replace(/</g,"<"),"</code><wbr>"):"`".concat(E,"`")}return!1},tt=function(i,a){if(i){if(i.parentElement.getAttribute("data-type")==="html-block"){i.setAttribute("data-render","1");return}var s=i.firstElementChild.className.replace("language-","");if(s==="abc")(0,F.Q)(i,a.options.cdn);else if(s==="mermaid")(0,We.i)(i,a.options.cdn,a.options.theme);else if(s==="smiles")(0,nt.J)(i,a.options.cdn,a.options.theme);else if(s==="markmap")(0,rt.K)(i,a.options.cdn);else if(s==="flowchart")(0,te.P)(i,a.options.cdn);else if(s==="echarts")(0,P.p)(i,a.options.cdn,a.options.theme);else if(s==="mindmap")(0,je.P)(i,a.options.cdn,a.options.theme);else if(s==="plantuml")(0,Ne.B)(i,a.options.cdn);else if(s==="graphviz")(0,ce.v)(i,a.options.cdn);else if(s==="math")(0,Fe.H)(i,{cdn:a.options.cdn,math:a.options.preview.math});else{var u=a.options.customRenders.find(function(d){if(d.language===s)return d.render(i,a),!0});u||((0,Me.s)(Object.assign({},a.options.preview.hljs),i,a.options.cdn),(0,Y.O)(i,a.options.preview.hljs))}i.setAttribute("data-render","1")}},q=o(810),Ht=function(i){if(i.currentMode!=="sv"){var a=i[i.currentMode].element,s=i.outline.render(i);s===""&&(s="[ToC]"),a.querySelectorAll('[data-type="toc-block"]').forEach(function(u){u.innerHTML=s,(0,Fe.H)(u,{cdn:i.options.cdn,math:i.options.preview.math})})}},Rt=function(i,a){var s=(0,y.lG)(i.target,"SPAN");if(s&&(0,y.fb)(s,"vditor-toc")){var u=a[a.currentMode].element.querySelector("#"+s.getAttribute("data-target-id"));if(u)if(a.options.height==="auto"){var d=u.offsetTop+a.element.offsetTop;a.options.toolbarConfig.pin||(d+=a.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,d)}else a.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,a.element.offsetTop),a[a.currentMode].element.scrollTop=u.offsetTop;return}},$t=function(i,a,s,u){if(i.previousElementSibling&&i.previousElementSibling.classList.contains("vditor-toc")){if(s.key==="Backspace"&&(0,q.im)(i,a[a.currentMode].element,u).start===0)return i.previousElementSibling.remove(),lt(a),!0;if(Pr(a,s,u,i,i.previousElementSibling))return!0}if(i.nextElementSibling&&i.nextElementSibling.classList.contains("vditor-toc")){if(s.key==="Delete"&&(0,q.im)(i,a[a.currentMode].element,u).start>=i.textContent.trimRight().length)return i.nextElementSibling.remove(),lt(a),!0;if(pi(a,s,u,i,i.nextElementSibling))return!0}if(s.key==="Backspace"||s.key==="Delete"){var d=(0,y.fb)(u.startContainer,"vditor-toc");if(d)return d.remove(),lt(a),!0}},Nt=function(i,a,s,u){s===void 0&&(s=!1);var d=(0,y.F9)(a.startContainer);if(d&&!s&&d.getAttribute("data-type")!=="code-block"){if(fo(d.innerHTML)&&d.previousElementSibling||mo(d.innerHTML))return;for(var f=(0,q.im)(d,i.ir.element,a).start,E=!0,L=f-1;L>d.textContent.substr(0,f).lastIndexOf(`
|
|||
|
|
`);L--)if(d.textContent.charAt(L)!==" "&&d.textContent.charAt(L)!==" "){E=!1;break}f===0&&(E=!1);for(var D=!0,L=f-1;L<d.textContent.length;L++)if(d.textContent.charAt(L)!==" "&&d.textContent.charAt(L)!==`
|
|||
|
|
`){D=!1;break}if(E){typeof i.options.input=="function"&&i.options.input(v(i));return}if(D&&/^#{1,6} $/.test(d.textContent)&&(D=!1),D){var _=(0,y.fb)(a.startContainer,"vditor-ir__marker");if(!_){var B=a.startContainer.previousSibling;B&&B.nodeType!==3&&B.classList.contains("vditor-ir__node--expand")&&B.classList.remove("vditor-ir__node--expand"),typeof i.options.input=="function"&&i.options.input(v(i));return}}}if(i.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(it){it.classList.remove("vditor-ir__node--expand")}),d||(d=i.ir.element),!d.querySelector("wbr")){var K=(0,y.fb)(a.startContainer,"vditor-ir__preview");K?K.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):a.insertNode(document.createElement("wbr"))}d.querySelectorAll("[style]").forEach(function(it){it.removeAttribute("style")}),d.getAttribute("data-type")==="link-ref-defs-block"&&(d=i.ir.element);var fe=d.isEqualNode(i.ir.element),ve=(0,y.a1)(d,"data-type","footnotes-block"),ue="";if(fe)ue=d.innerHTML;else{var ke=(0,N.S)(a.startContainer,"BLOCKQUOTE"),we=(0,y.O9)(a.startContainer);if(we&&(d=we),ke&&(!we||we&&!ke.contains(we))&&(d=ke),ve&&(d=ve),ue=d.outerHTML,d.tagName==="UL"||d.tagName==="OL"){var de=d.previousElementSibling,Ie=d.nextElementSibling;de&&(de.tagName==="UL"||de.tagName==="OL")&&(ue=de.outerHTML+ue,de.remove()),Ie&&(Ie.tagName==="UL"||Ie.tagName==="OL")&&(ue=ue+Ie.outerHTML,Ie.remove()),ue=ue.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else d.previousElementSibling&&d.previousElementSibling.textContent.replace(c.g.ZWSP,"")!==""&&u&&u.inputType==="insertParagraph"&&(ue=d.previousElementSibling.outerHTML+ue,d.previousElementSibling.remove());d.innerText.startsWith("```")||(i.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(it){it&&!d.isEqualNode(it)&&(ue+=it.outerHTML,it.remove())}),i.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(it){it&&!d.isEqualNode(it)&&(ue+=it.outerHTML,it.remove())}))}if(z("SpinVditorIRDOM",ue,"argument",i.options.debugger),ue=i.lute.SpinVditorIRDOM(ue),z("SpinVditorIRDOM",ue,"result",i.options.debugger),fe)d.innerHTML=ue;else if(d.outerHTML=ue,ve){var Te=(0,y.a1)(i.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(Te){var $e=Te.textContent,bt=$e.substring(1,$e.indexOf("]:")),gt=i.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(bt,'"]'));gt&>.setAttribute("aria-label",$e.substr(bt.length+3).trim().substr(0,24))}}var kt,dn=i.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");dn.forEach(function(it,zt){zt===0?kt=it:(kt.insertAdjacentHTML("beforeend",it.innerHTML),it.remove())}),dn.length>0&&i.ir.element.insertAdjacentElement("beforeend",dn[0]);var Wt,hn=i.ir.element.querySelectorAll("[data-type='footnotes-block']");hn.forEach(function(it,zt){zt===0?Wt=it:(Wt.insertAdjacentHTML("beforeend",it.innerHTML),it.remove())}),hn.length>0&&i.ir.element.insertAdjacentElement("beforeend",hn[0]),(0,q.ib)(i.ir.element,a),i.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(it){tt(it,i)}),Ht(i),Xn(i,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},oe=function(i,a){if(i==="")return!1;if(i.indexOf("⇧")===-1&&i.indexOf("⌘")===-1&&i.indexOf("⌥")===-1)return!(0,m.yl)(a)&&!a.altKey&&!a.shiftKey&&a.code===i;if(i==="⇧Tab")return!!(!(0,m.yl)(a)&&!a.altKey&&a.shiftKey&&a.code==="Tab");var s=i.split("");if(i.startsWith("⌥")){var u=s.length===3?s[2]:s[1];return!!((s.length===3?(0,m.yl)(a):!(0,m.yl)(a))&&a.altKey&&!a.shiftKey&&a.code===(/^[0-9]$/.test(u)?"Digit":"Key")+u)}i==="⌘Enter"&&(s=["⌘","Enter"]);var d=s.length>2&&s[0]==="⇧",f=d?s[2]:s[1];return d&&((0,m.vU)()||!/Mac/.test(navigator.platform))&&(f==="-"?f="_":f==="="&&(f="+")),!!((0,m.yl)(a)&&a.key.toLowerCase()===f.toLowerCase()&&!a.altKey&&(!d&&!a.shiftKey||d&&a.shiftKey))},he=function(i){var a=i.startContainer;if(a.nodeType===3&&a.nodeValue.length!==i.startOffset)return!1;for(var s=a.nextSibling;s&&s.textContent==="";)s=s.nextSibling;if(s){if(s&&s.nodeType
|
|||
|
|
`);D--)if(f.textContent.charAt(D)!==" "&&f.textContent.charAt(D)!==" "){L=!1;break}if(E===0&&(L=!1),L){Ge(i);return}if(a.inputType==="deleteContentBackward"){var _=(0,y.a1)(d,"data-type","code-block-open-marker")||(0,y.a1)(d,"data-type","code-block-close-marker");if(_){if(_.getAttribute("data-type")==="code-block-close-marker"){var B=pe(d,"code-block-open-marker");if(B){B.textContent=_.textContent,Ge(i);return}}if(_.getAttribute("data-type")==="code-block-open-marker"){var B=pe(d,"code-block-close-marker",!1);if(B){B.textContent=_.textContent,Ge(i);return}}}var K=(0,y.a1)(d,"data-type","math-block-open-marker");if(K){var fe=K.nextElementSibling.nextElementSibling;fe&&fe.getAttribute("data-type")==="math-block-close-marker"&&(fe.remove(),Ge(i));return}f.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(de){de.textContent.length===1&&de.remove()}),f.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(de){de.textContent.length===1&&de.remove()});var ve=(0,y.a1)(d,"data-type","heading-marker");if(ve&&ve.textContent.indexOf("#")===-1){Ge(i);return}}if((a.data===" "||a.inputType==="deleteContentBackward")&&((0,y.a1)(d,"data-type","padding")||(0,y.a1)(d,"data-type","li-marker")||(0,y.a1)(d,"data-type","task-marker")||(0,y.a1)(d,"data-type","blockquote-marker"))){Ge(i);return}}if(f&&f.textContent.trimRight()==="$$"){Ge(i);return}f||(f=i.sv.element),((s=f.firstElementChild)===null||s===void 0?void 0:s.getAttribute("data-type"))==="link-ref-defs-block"&&(f=i.sv.element),(0,y.a1)(d,"data-type","footnotes-link")&&(f=i.sv.element),f.textContent.indexOf(Lute.Caret)===-1&&u.insertNode(document.createTextNode(Lute.Caret)),f.querySelectorAll("[style]").forEach(function(de){de.removeAttribute("style")}),f.querySelectorAll("font").forEach(function(de){de.outerHTML=de.innerHTML});var ue=f.textContent,ke=f.isEqualNode(i.sv.element);if(ke)ue=f.textContent;else{f.previousElementSibling&&(ue=f.previousElementSibling.textContent+ue,f.previousElementSibling.remove()),f.previousElementSibling&&ue.indexOf(`---
|
|||
|
|
`)===0&&(ue=f.previousElementSibling.textContent+ue,f.previousElementSibling.remove());var we="";i.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(de,Ie){de&&!f.isEqualNode(de.parentElement)&&(we+=de.parentElement.textContent+`
|
|||
|
|
`,de.parentElement.remove())}),i.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(de,Ie){de&&!f.isEqualNode(de.parentElement)&&(we+=de.parentElement.textContent+`
|
|||
|
|
`,de.parentElement.remove())}),ue=we+ue}ue=Oe(ue,i),ke?f.innerHTML=ue:f.outerHTML=ue,i.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(de){i.sv.element.insertAdjacentElement("beforeend",de.parentElement)}),G(i.sv.element,function(de){i.sv.element.insertAdjacentElement("beforeend",de)}),(0,q.ib)(i.sv.element,u),Z(i),Ge(i,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},be=function(i,a){var s,u,d,f,E;if(i.sv.composingLock=a.isComposing,a.isComposing||(a.key.indexOf("Arrow")===-1&&a.key!=="Meta"&&a.key!=="Control"&&a.key!=="Alt"&&a.key!=="Shift"&&a.key!=="CapsLock"&&a.key!=="Escape"&&!/^F\d{1,2}$/.test(a.key)&&i.undo.recordFirstPosition(i,a),a.key!=="Enter"&&a.key!=="Tab"&&a.key!=="Backspace"&&a.key.indexOf("Arrow")===-1&&!(0,m.yl)(a)&&a.key!=="Escape"))return!1;var L=(0,q.zh)(i),D=L.startContainer;L.startContainer.nodeType!==3&&L.startContainer.tagName==="DIV"&&(D=L.startContainer.childNodes[L.startOffset-1]);var _=(0,y.a1)(D,"data-type","text"),B=(0,y.a1)(D,"data-type","blockquote-marker");if(!B&&L.startOffset===0&&_&&_.previousElementSibling&&_.previousElementSibling.getAttribute("data-type")==="blockquote-marker"&&(B=_.previousElementSibling),B&&a.key==="Enter"&&!(0,m.yl)(a)&&!a.altKey&&B.nextElementSibling.textContent.trim()===""&&(0,q.im)(B,i.sv.element,L).start===B.textContent.length)return((s=B.previousElementSibling)===null||s===void 0?void 0:s.getAttribute("data-type"))==="padding"&&B.previousElementSibling.setAttribute("data-action","enter-remove"),B.remove(),Ge(i),a.preventDefault(),!0;var K=(0,y.a1)(D,"data-type","li-marker"),fe=(0,y.a1)(D,"data-type","task-marker"),ve=K;if(ve||fe&&fe.nextElementSibling.getAttribute("data-type")!=="task-marker"&&(ve=fe),!ve&&L.startOffset===0&&_&&_.previousElementSibling&&(_.previousElementSibling.getAttribute("data-type")==="li-marker"||_.previousElementSibling.getAttribute("data-type")==="task-marker")&&(ve=_.previousElementSibling),ve){var ue=(0,q.im)(ve,i.sv.element,L).start,ke=ve.getAttribute("data-type")==="task-marker",we=ve;if(ke&&(we=ve.previousElementSibling.previousElementSibling.previousElementSibling),ue===ve.textContent.length){if(a.key==="Enter"&&!(0,m.yl)(a)&&!a.altKey&&!a.shiftKey&&ve.nextElementSibling.textContent.trim()==="")return((u=we.previousElementSibling)===null||u===void 0?void 0:u.getAttribute("data-type"))==="padding"?(we.previousElementSibling.remove(),X(i)):(ke&&(we.remove(),ve.previousElementSibling.previousElementSibling.remove(),ve.previousElementSibling.remove()),ve.nextElementSibling.remove(),ve.remove(),Ge(i)),a.preventDefault(),!0;if(a.key==="Tab")return a.shiftKey?we.previousElementSibling.getAttribute("data-type")==="padding"&&we.previousElementSibling.remove():we.insertAdjacentHTML("beforebegin",'<span data-type="padding">'.concat(we.textContent.replace(/\S/g," "),"</span>")),/^\d/.test(we.textContent)&&(we.textContent=we.textContent.replace(/^\d{1,}/,"1"),L.selectNodeContents(ve.firstChild),L.collapse(!1)),X(i),a.preventDefault(),!0}}if(go(i,L,a))return!0;var de=(0,y.a1)(D,"data-block","0"),Ie=(0,N.S)(D,"SPAN");if(a.key==="Enter"&&!(0,m.yl)(a)&&!a.altKey&&!a.shiftKey&&de){var Te=!1,$e=de.textContent.match(/^\n+/);(0,q.im)(de,i.sv.element).start<=($e?$e[0].length:0)&&(Te=!0);var bt=`
|
|||
|
|
`;if(Ie){if(((d=Ie.previousElementSibling)===null||d===void 0?void 0:d.getAttribute("data-action"))==="enter-remove")return Ie.previousElementSibling.remove(),Ge(i),a.preventDefault(),!0;bt+=Je(Ie)}return L.insertNode(document.createTextNode(bt)),L.collapse(!1),de&&de.textContent.trim()!==""&&!Te?X(i):Ge(i),a.preventDefault(),!0}if(a.key==="Backspace"&&!(0,m.yl)(a)&&!a.altKey&&!a.shiftKey){if(Ie&&((f=Ie.previousElementSibling)===null||f===void 0?void 0:f.getAttribute("data-type"))==="newline"&&(0,q.im)(Ie,i.sv.element,L).start===1&&Ie.getAttribute("data-type").indexOf("code-block-")===-1)return L.setStart(Ie,0),L.extractContents(),Ie.textContent.trim()!==""?X(i):Ge(i),a.preventDefault(),!0;if(de&&(0,q.im)(de,i.sv.element,L).start===0&&de.previousElementSibling){L.extractContents();var gt=de.previousElementSibling.lastElementChild;return gt.getAttribute("data-type")==="newline"&&(gt.remove(),gt=de.previousElementSibling.lastElementChild),gt.getAttribute("data-type")!=="newline"&&(gt.insertAdjacentHTML("afterend",de.innerHTML),de.remove()),de.textContent.trim()!==""&&!(!((E=de.previousElementSibling)===null||E===void 0)&&E.querySelector('[data-type="code-block-open-marker"]'))?X(i):(gt.getAttribute("data-type")!=="newline"&&(L.selectNodeContents(gt.lastChild),L.collapse(!1)),Ge(i)),a.preventDefault(),!0}}return!1},le=o(538),ye=function(i){i.options.theme==="dark"?i.element.classList.add("vditor--dark"):i.element.classList.remove("vditor--dark")},Ae=function(i){i.element.innerHTML="",i.element.classList.add("vditor"),i.options.rtl&&i.element.setAttribute("dir","rtl"),ye(i),(0,le.Z)(i.options.preview.theme.current,i.options.preview.theme.path),typeof i.options.height=="number"?i.element.style.height=i.options.height+"px":i.element.style.height=i.options.height,typeof i.options.minHeight=="number"&&(i.element.style.minHeight=i.options.minHeight+"px"),typeof i.options.width=="number"?i.element.style.width=i.options.width+"px":i.element.style.width=i.options.width,i.element.appendChild(i.toolbar.element);var a=document.createElement("div");if(a.className="vditor-content",i.options.outline.position==="left"&&a.appendChild(i.outline.element),a.appendChild(i.wysiwyg.element.parentElement),a.appendChild(i.sv.element),a.appendChild(i.ir.element.parentElement),a.appendChild(i.preview.element),i.toolbar.elements.devtools&&a.appendChild(i.devtools.element),i.options.outline.position==="right"&&(i.outline.element.classList.add("vditor-outline--right"),a.appendChild(i.outline.element)),i.upload&&a.appendChild(i.upload.element),i.options.resize.enable&&a.appendChild(i.resize.element),a.appendChild(i.hint.element),a.appendChild(i.tip.element),i.element.appendChild(a),a.addEventListener("click",function(){A(i,["subToolbar"])}),i.toolbar.elements.export&&i.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),er(i,i.options.mode,st(i)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&typeof window.visualViewport<"u"){var s=!1,u=function(d){s||(s=!0,requestAnimationFrame(function(){s=!1;var f=i.toolbar.element;f.style.transform="none",f.getBoundingClientRect().top<0&&(f.style.transform="translate(0, ".concat(-f.getBoundingClientRect().top,"px)"))}))};window.visualViewport.addEventListener("scroll",u),window.visualViewport.addEventListener("resize",u)}},ze=function(i){var a=window.innerWidth<=c.g.MOBILE_WIDTH?10:35;if(i.wysiwyg.element.parentElement.style.display!=="none"){var s=(i.wysiwyg.element.parentElement.clientWidth-i.options.preview.maxWidth)/2;i.wysiwyg.element.style.padding="10px ".concat(Math.max(a,s),"px")}if(i.ir.element.parentElement.style.display!=="none"){var s=(i.ir.element.parentElement.clientWidth-i.options.preview.maxWidth)/2;i.ir.element.style.padding="10px ".concat(Math.max(a,s),"px")}i.preview.element.style.display!=="block"?i.toolbar.element.style.paddingLeft=Math.max(5,parseInt(i[i.currentMode].element.style.paddingLeft||"0",10)+(i.options.outline.position==="left"?i.outline.element.offsetWidth:0))+"
|
|||
|
|
`,s.insertNode(_),s.collapse(!0),(0,q.Hc)(s),Re(i),Z(i),a.preventDefault(),!0}var B=(0,N.W)(u);if(B){if(B.tagName==="H6"&&u.textContent.length===s.startOffset&&!(0,m.yl)(a)&&!a.shiftKey&&!a.altKey&&a.key==="Enter"){var K=document.createElement("p");return K.textContent=`
|
|||
|
|
`,K.setAttribute("data-block","0"),u.parentElement.insertAdjacentElement("afterend",K),s.setStart(K,0),(0,q.Hc)(s),Re(i),Z(i),a.preventDefault(),!0}if(oe("⌘=",a)){var fe=parseInt(B.tagName.substr(1),10)-1;return fe>0&&(kn(i,"h".concat(fe)),Re(i)),a.preventDefault(),!0}if(oe("⌘-",a)){var fe=parseInt(B.tagName.substr(1),10)+1;return fe<7&&(kn(i,"h".concat(fe)),Re(i)),a.preventDefault(),!0}a.key==="Backspace"&&!(0,m.yl)(a)&&!a.shiftKey&&!a.altKey&&B.textContent.length===1&&lr(i)}if(Ps(i,s,a))return!0;if(a.altKey&&a.key==="Enter"&&!(0,m.yl)(a)&&!a.shiftKey){var ve=(0,y.lG)(u,"A"),ue=(0,y.a1)(u,"data-type","link-ref"),ke=(0,y.a1)(u,"data-type","footnotes-ref");if(ve||ue||ke||B&&B.tagName.length===2){var we=i.wysiwyg.popover.querySelector("input");we.focus(),we.select()}}if(Ot(i,a))return!0;if(oe("⇧⌘U",a)){var de=i.wysiwyg.popover.querySelector('[data-type="up"]');if(de)return de.click(),a.preventDefault(),!0}if(oe("⇧⌘D",a)){var de=i.wysiwyg.popover.querySelector('[data-type="down"]');if(de)return de.click(),a.preventDefault(),!0}if(go(i,s,a))return!0;if(!(0,m.yl)(a)&&a.shiftKey&&!a.altKey&&a.key==="Enter"&&u.parentElement.tagName!=="LI"&&u.parentElement.tagName!=="P")return["STRONG","STRIKE","S","I","EM","B"].includes(u.parentElement.tagName)?s.insertNode(document.createTextNode(`
|
|||
|
|
`+c.g.ZWSP)):s.insertNode(document.createTextNode(`
|
|||
|
|
`)),s.collapse(!1),(0,q.Hc)(s),Re(i),Z(i),a.preventDefault(),!0;if(a.key==="Backspace"&&!(0,m.yl)(a)&&!a.shiftKey&&!a.altKey&&s.toString()===""){if(zs(i,s,a,f))return!0;if(d){if(d.previousElementSibling&&d.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&d.previousElementSibling.getAttribute("data-block")==="0"&&d.tagName!=="UL"&&d.tagName!=="OL"){var Ie=(0,q.im)(d,i.wysiwyg.element,s).start;if(Ie===0&&s.startOffset===0||Ie===1&&d.innerText.startsWith(c.g.ZWSP))return cr(d.previousElementSibling.lastElementChild,i,!1),d.innerHTML.trim().replace(c.g.ZWSP,"")===""&&(d.remove(),Re(i)),a.preventDefault(),!0}var Te=s.startOffset;if(s.toString()===""&&u.nodeType===3&&u.textContent.charAt(Te-2)===`
|
|||
|
|
`&&u.textContent.charAt(Te-1)!==c.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(u.parentElement.tagName))return u.textContent=u.textContent.substring(0,Te-1)+c.g.ZWSP,s.setStart(u,Te),s.collapse(!0),Re(i),a.preventDefault(),!0;u.textContent===c.g.ZWSP&&s.startOffset===1&&!u.previousSibling&&Dt(s)&&(u.textContent=""),d.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(bt){bt.firstElementChild.style.display="inline",bt.lastElementChild.style.display="none"}),d.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(bt){bt.firstElementChild.style.display="inline",bt.lastElementChild.style.display="none"})}}if((0,m.vU)()&&s.startOffset===1&&u.textContent.indexOf(c.g.ZWSP)>-1&&u.previousSibling&&u.previousSibling.nodeType!==3&&u.previousSibling.tagName==="CODE"&&(a.key==="Backspace"||a.key==="ArrowLeft"))return s.selectNodeContents(u.previousSibling),s.collapse(!1),a.preventDefault(),!0;if(Fs(a,d,s))return a.preventDefault(),!0;if(Ts(s,a.key),a.key==="ArrowDown"){var $e=u.nextSibling;$e&&$e.nodeType!==3&&$e.getAttribute("data-type")==="math-inline"&&s.setStartAfter($e)}return d&&$t(d,i,a,s)?(a.preventDefault(),!0):!1},Ot=function(i,a){if(oe("⇧⌘X",a)){var s=i.wysiwyg.popover.querySelector('[data-type="remove"]');return s&&s.click(),a.preventDefault(),!0}},jn=function(i){clearTimeout(i.wysiwyg.hlToolbarTimeoutId),i.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if(i.wysiwyg.element.getAttribute("contenteditable")!=="false"&&(0,q.Gb)(i.wysiwyg.element)){x(i.toolbar.elements,c.g.EDIT_TOOLBARS),S(i.toolbar.elements,c.g.EDIT_TOOLBARS);var a=getSelection().getRangeAt(0),s=a.startContainer;a.startContainer.nodeType===3?s=a.startContainer.parentElement:s=s.childNodes[a.startOffset>=s.childNodes.length?s.childNodes.length-1:a.startOffset];var u=(0,y.a1)(s,"data-type","footnotes-block");if(u){i.wysiwyg.popover.innerHTML="",pn(u,i),tn(i,"footnotes-block"),en(i,u);return}var d=(0,y.lG)(s,"LI");d?(d.classList.contains("vditor-task")?w(i.toolbar.elements,["check"]):d.parentElement.tagName==="OL"?w(i.toolbar.elements,["ordered-list"]):d.parentElement.tagName==="UL"&&w(i.toolbar.elements,["list"]),S(i.toolbar.elements,["outdent","indent"])):k(i.toolbar.elements,["outdent","indent"]),(0,y.lG)(s,"BLOCKQUOTE")&&w(i.toolbar.elements,["quote"]),((0,y.lG)(s,"B")||(0,y.lG)(s,"STRONG"))&&w(i.toolbar.elements,["bold"]),((0,y.lG)(s,"I")||(0,y.lG)(s,"EM"))&&w(i.toolbar.elements,["italic"]),((0,y.lG)(s,"STRIKE")||(0,y.lG)(s,"S"))&&w(i.toolbar.elements,["strike"]),i.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(Le){Le.classList.remove("vditor-comment--focus")});var f=(0,y.fb)(s,"vditor-comment");if(f){var E=f.getAttribute("data-cmtids").split(" ");if(E.length>1&&f.nextSibling.isSameNode(f.nextElementSibling)){var L=f.nextElementSibling.getAttribute("data-cmtids").split(" ");E.find(function(Le){if(L.includes(Le))return E=[Le],!0})}i.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(Le){Le.getAttribute("data-cmtids").indexOf(E[0])>-1&&Le.classList.add("vditor-comment--focus")})}var D=(0,y.lG)(s,"A");D&&w(i.toolbar.elements,["link"]);var _=(0,y.lG)(s,"TABLE"),B=(0,N.W)(s);(0,y.lG)(s,"CODE")?(0,y.lG)(s,"PRE")?(k(i.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),w(i.toolbar.elements,["code"])):(k(i.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),w(i.toolbar.elements,["inline-code"])):B?(k(i.toolbar.elements,["bold"]),w(i.toolbar.elements,["headings"])):_&&k(i.toolbar.elements,["table"]);var K=(0,y.fb)(s,"vditor-toc");if(K){i.wysiwyg.popover.innerHTML="",pn(K,i),tn(i,"vditor-toc"),en(i,K);return}var fe=(0,N.S)(s,"BLOCKQUOTE");if(fe&&(i.wysiwyg.popover.innerHTML="",ur(a,fe,i),nr(a,fe,i),pn(fe,i),tn(i,"blockquote"),en(i,fe)),d&&(i.wysiwyg.popover.innerHTML="",ur(a,d,i),nr(a,d,i),pn(d,i),tn(i,"li"),en(i,d)),_){i.options.lang,i.
|
|||
|
|
</code></pre>`:(K.innerHTML="<pre><code>".concat(f.toString(),"<wbr></code></pre>"),f.deleteContents()),f.insertNode(K),_&&(_.outerHTML=i.lute.SpinVditorDOM(_.outerHTML)),(0,q.ib)(i.wysiwyg.element,f),i.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(bt){tt(bt,i)}),a.classList.add("vditor-menu--disabled")}else if(E==="link"){if(f.toString()===""){var fe=document.createElement("a");fe.innerText=c.g.ZWSP,f.insertNode(fe),f.setStart(fe.firstChild,1),f.collapse(!0),Ti(i,fe,f);var ve=i.wysiwyg.popover.querySelector("input");ve.value="",ve.focus(),d=!1}else{var K=document.createElement("a");K.setAttribute("href",""),K.innerHTML=f.toString(),f.surroundContents(K),f.insertNode(K),(0,q.Hc)(f),Ti(i,K,f);var ue=i.wysiwyg.popover.querySelectorAll("input");ue[0].value=K.innerText,ue[1].focus()}u=!1,a.classList.add("vditor-menu--current")}else if(E==="table"){var ke='<table data-block="0"><thead><tr><th>col1<wbr></th><th>col2</th><th>col3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table>';if(f.toString().trim()==="")_&&_.innerHTML.trim().replace(c.g.ZWSP,"")===""?_.outerHTML=ke:document.execCommand("insertHTML",!1,ke),f.selectNode(i.wysiwyg.element.querySelector("wbr").previousSibling),i.wysiwyg.element.querySelector("wbr").remove(),(0,q.Hc)(f);else{ke='<table data-block="0"><thead><tr>';var we=f.toString().split(`
|
|||
|
|
`),de=we[0].split(",").length>we[0].split(" ").length?",":" ";we.forEach(function($e,bt){bt===0?($e.split(de).forEach(function(gt,kt){kt===0?ke+="<th>".concat(gt,"<wbr></th>"):ke+="<th>".concat(gt,"</th>")}),ke+="</tr></thead>"):(bt===1?ke+="<tbody><tr>":ke+="<tr>",$e.split(de).forEach(function(gt){ke+="<td>".concat(gt,"</td>")}),ke+="</tr>")}),ke+="</tbody></table>",document.execCommand("insertHTML",!1,ke),(0,q.ib)(i.wysiwyg.element,f)}u=!1,a.classList.add("vditor-menu--disabled")}else if(E==="line"){if(_){var Ie=`<hr data-block="0"><p data-block="0"><wbr>
|
|||
|
|
</p>`;_.innerHTML.trim()===""?_.outerHTML=Ie:_.insertAdjacentHTML("afterend",Ie),(0,q.ib)(i.wysiwyg.element,f)}}else if(u=!1,a.classList.add("vditor-menu--current"),E==="strike"&&(E="strikeThrough"),f.toString()===""&&(E==="bold"||E==="italic"||E==="strikeThrough")){var Te="strong";E==="italic"?Te="em":E==="strikeThrough"&&(Te="s");var K=document.createElement(Te);K.textContent=c.g.ZWSP,f.insertNode(K),K.previousSibling&&K.previousSibling.textContent===c.g.ZWSP&&(K.previousSibling.textContent=""),f.setStart(K.firstChild,1),f.collapse(!0),(0,q.Hc)(f)}else document.execCommand(E,!1,"")}u&&jn(i),d&&Re(i)}},Mt=function(){function i(a,s){var u,d=this;this.element=document.createElement("div"),s.className&&(u=this.element.classList).add.apply(u,s.className.split(" "));var f=s.hotkey?" <".concat((0,m.ns)(s.hotkey),">"):"";s.level===2&&(f=s.hotkey?" <".concat((0,m.ns)(s.hotkey),">"):"");var E=s.tip?s.tip+f:"".concat(window.VditorI18n[s.name]).concat(f),L=s.name==="upload"?"div":"button";if(s.level===2)this.element.innerHTML="<".concat(L,' data-type="').concat(s.name,'">').concat(E,"</").concat(L,">");else{this.element.classList.add("vditor-toolbar__item");var D=document.createElement(L);D.setAttribute("data-type",s.name),D.className="vditor-tooltipped vditor-tooltipped__".concat(s.tipPosition),D.setAttribute("aria-label",E),D.innerHTML=s.icon,this.element.appendChild(D)}s.prefix&&this.element.children[0].addEventListener((0,m.Le)(),function(_){_.preventDefault(),!d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)&&(a.currentMode==="wysiwyg"?bs(a,d.element.children[0],_):a.currentMode==="ir"?vu(a,d.element.children[0],s.prefix||"",s.suffix||""):Gt(a,d.element.children[0],s.prefix||"",s.suffix||""))})}return i}(),ys=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),er=function(i,a,s){var u;if(typeof s!="string"?(A(i,["subToolbar","hint"]),s.preventDefault(),u=v(i)):u=s,!(i.currentMode===a&&typeof s!="string")){if(i.devtools&&i.devtools.renderEchart(i),i.options.preview.mode==="both"&&a==="sv"?i.preview.element.style.display="block":i.preview.element.style.display="none",S(i.toolbar.elements,c.g.EDIT_TOOLBARS),x(i.toolbar.elements,c.g.EDIT_TOOLBARS),k(i.toolbar.elements,["outdent","indent"]),a==="ir")C(i.toolbar.elements,["both"]),T(i.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),i.sv.element.style.display="none",i.wysiwyg.element.parentElement.style.display="none",i.ir.element.parentElement.style.display="block",i.lute.SetVditorIR(!0),i.lute.SetVditorWYSIWYG(!1),i.lute.SetVditorSV(!1),i.currentMode="ir",i.ir.element.innerHTML=i.lute.Md2VditorIRDOM(u),Xn(i,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),ze(i),i.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(f){tt(f,i)}),i.ir.element.querySelectorAll(".vditor-toc").forEach(function(f){(0,Fe.H)(f,{cdn:i.options.cdn,math:i.options.preview.math})});else if(a==="wysiwyg")C(i.toolbar.elements,["both"]),T(i.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),i.sv.element.style.display="none",i.wysiwyg.element.parentElement.style.display="block",i.ir.element.parentElement.style.display="none",i.lute.SetVditorIR(!1),i.lute.SetVditorWYSIWYG(!0),i.lute.SetVditorSV(!1),i.currentMode="wysiwyg",ze(i),uo(i,u,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),i.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(f){(0,Fe.H)(f,{cdn:i.options.cdn,math:i.options.preview.math})}),i.wysiwyg.popover.style.display="none";else if(a==="sv"){T(i.toolbar.elements,["both"]),C(i.toolbar.elements,["outdent","indent","outline","insert-before","insert-
|
|||
|
|
<button data-mode="ir">`).concat(window.VditorI18n.instantRendering," <").concat((0,m.ns)("⌥⌘8"),`></button>
|
|||
|
|
<button data-mode="sv">`).concat(window.VditorI18n.splitView," <").concat((0,m.ns)("⌥⌘9"),"></button>"),d.element.appendChild(f),d._bindEvent(s,f,u),d}return a.prototype._bindEvent=function(s,u,d){var f=this.element.children[0];M(s,u,f,d.level),u.children.item(0).addEventListener((0,m.Le)(),function(E){er(s,"wysiwyg",E),E.preventDefault(),E.stopPropagation()}),u.children.item(1).addEventListener((0,m.Le)(),function(E){er(s,"ir",E),E.preventDefault(),E.stopPropagation()}),u.children.item(2).addEventListener((0,m.Le)(),function(E){er(s,"sv",E),E.preventDefault(),E.stopPropagation()})},a}(Mt),Or=function(i,a){return(0,q.Gb)(i,a)?getSelection().toString():""},Ai=function(i,a){a.addEventListener("focus",function(){i.options.focus&&i.options.focus(v(i)),A(i,["subToolbar","hint"])})},ho=function(i,a){a.addEventListener("dblclick",function(s){s.target.tagName==="IMG"&&(i.options.image.preview?i.options.image.preview(s.target):i.options.image.isPreview&&(0,se.E)(s.target,i.options.lang,i.options.theme))})},Mi=function(i,a){a.addEventListener("blur",function(s){if(i.currentMode==="ir"){var u=i.ir.element.querySelector(".vditor-ir__node--expand");u&&u.classList.remove("vditor-ir__node--expand")}else i.currentMode==="wysiwyg"&&!i.wysiwyg.selectPopover.contains(s.relatedTarget)&&i.wysiwyg.hideComment();i[i.currentMode].range=(0,q.zh)(i),i.options.blur&&i.options.blur(v(i))})},Ci=function(i,a){a.addEventListener("dragstart",function(s){s.dataTransfer.setData(c.g.DROP_EDITOR,c.g.DROP_EDITOR)}),a.addEventListener("drop",function(s){s.dataTransfer.getData(c.g.DROP_EDITOR)?lt(i):(s.dataTransfer.types.includes("Files")||s.dataTransfer.types.includes("text/html"))&&ta(i,s,{pasteCode:function(u){document.execCommand("insertHTML",!1,u)}})})},U=function(i,a,s){a.addEventListener("copy",function(u){return s(u,i)})},Q=function(i,a,s){a.addEventListener("cut",function(u){s(u,i),i.options.comment.enable&&i.currentMode==="wysiwyg"&&i.wysiwyg.getComments(i),document.execCommand("delete")})},Z=function(i){if(i.currentMode==="wysiwyg"&&i.options.comment.enable&&i.options.comment.adjustTop(i.wysiwyg.getComments(i,!0)),!!i.options.typewriterMode){var a=i[i.currentMode].element,s=(0,q.Ny)(a).top;i.options.height==="auto"&&!i.element.classList.contains("vditor--fullscreen")&&window.scrollTo(window.scrollX,s+i.element.offsetTop+i.toolbar.element.offsetHeight-window.innerHeight/2+10),(i.options.height!=="auto"||i.element.classList.contains("vditor--fullscreen"))&&(a.scrollTop=s+a.scrollTop-a.clientHeight/2+10)}},xe=function(i,a){a.addEventListener("keydown",function(s){if(!s.isComposing&&i.options.keydown&&i.options.keydown(s),!((i.options.hint.extend.length>1||i.toolbar.elements.emoji)&&i.hint.select(s,i))){if(i.options.comment.enable&&i.currentMode==="wysiwyg"&&(s.key==="Backspace"||oe("⌘X",s))&&i.wysiwyg.getComments(i),i.currentMode==="sv"){if(be(i,s))return}else if(i.currentMode==="wysiwyg"){if(zn(i,s))return}else if(i.currentMode==="ir"&&Ce(i,s))return;if(i.options.ctrlEnter&&oe("⌘Enter",s)){i.options.ctrlEnter(v(i)),s.preventDefault();return}if(oe("⌘Z",s)&&!i.toolbar.elements.undo){i.undo.undo(i),s.preventDefault();return}if(oe("⌘Y",s)&&!i.toolbar.elements.redo){i.undo.redo(i),s.preventDefault();return}if(s.key==="Escape"){i.hint.element.style.display==="block"?i.hint.element.style.display="none":i.options.esc&&!s.isComposing&&i.options.esc(v(i)),s.preventDefault();return}if((0,m.yl)(s)&&s.altKey&&!s.shiftKey&&/^Digit[1-6]$/.test(s.code)){if(i.currentMode==="wysiwyg"){var u=s.code.replace("Digit","H");(0,y.lG)(getSelection().getRangeAt(0).startContainer,u)?lr(i):kn(i,u),Re(i)}else i.currentMode==="sv"?Ct(i,"#".repeat(parseInt(s.code.replace("Digit",""),10))+" "):i.currentMode==="ir"&&fi(i,"#".repeat(parseInt(s.code.replace("Digit",""),10))+" ");return s.preventDefault(),!0}if((0,m.yl)(s)&&s.altKey&&!s.shiftKey&&/^Digit[7-9]$/.test(s.code))return s.code==="Digit7"?er(i,"wysiwyg",s):s.code==="Digit8"?er(i,"ir",s):s.code==="Digit9"&&er(i,"sv",s),!0;i.options.toolbar.find(function(d){if(!d.hotkey||d.toolbar){if(d.toolbar){var f=d.toolbar.f
|
|||
|
|
</span></span><span data-type="newline"><br /><span style="display: none">
|
|||
|
|
</span></span></div><div data-block="0"><`)+"</div>",u.isEqualNode(i.sv.element)?u.innerHTML=d:u.outerHTML=d,G(i.sv.element),(0,q.ib)(i.sv.element,s),Z(i)},pe=function(i,a,s){s===void 0&&(s=!0);var u=i;for(u.nodeType===3&&(u=u.parentElement);u;){if(u.getAttribute("data-type")===a)return u;s?u=u.previousElementSibling:u=u.nextElementSibling}return!1},Oe=function(i,a){z("SpinVditorSVDOM",i,"argument",a.options.debugger);var s=a.lute.SpinVditorSVDOM(i);return i="<div data-block='0'>"+s.replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,`<span data-type="newline"><br /><span style="display: none">
|
|||
|
|
</span></span><span data-type="newline"><br /><span style="display: none">
|
|||
|
|
</span></span></div><div data-block="0"><`)+"</div>",z("SpinVditorSVDOM",i,"result",a.options.debugger),i},Je=function(i){var a=i.getAttribute("data-type"),s=i.previousElementSibling,u=a&&a!=="text"&&a!=="table"&&a!=="heading-marker"&&a!=="newline"&&a!=="yaml-front-matter-open-marker"&&a!=="yaml-front-matter-close-marker"&&a!=="code-block-info"&&a!=="code-block-close-marker"&&a!=="code-block-open-marker"?i.textContent:"",d=!1;for(a==="newline"&&(d=!0);s&&!d;){var f=s.getAttribute("data-type");if(f==="li-marker"||f==="blockquote-marker"||f==="task-marker"||f==="padding"){var E=s.textContent;if(f==="li-marker"&&(a==="code-block-open-marker"||a==="code-block-info"))u=E.replace(/\S/g," ")+u;else if(a==="code-block-close-marker"&&s.nextElementSibling.isSameNode(i)){var L=pe(i,"code-block-open-marker");L&&L.previousElementSibling&&(s=L.previousElementSibling,u=E+u)}else u=E+u}else f==="newline"&&(d=!0);s=s.previousElementSibling}return u},Ge=function(i,a){a===void 0&&(a={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),a.enableHint&&i.hint.render(i),i.preview.render(i);var s=v(i);typeof i.options.input=="function"&&a.enableInput&&i.options.input(s),i.options.counter.enable&&i.counter.render(i,s),i.options.cache.enable&&(0,m.pK)()&&(localStorage.setItem(i.options.cache.id,s),i.options.cache.after&&i.options.cache.after(s)),i.devtools&&i.devtools.renderEchart(i),clearTimeout(i.sv.processTimeoutId),i.sv.processTimeoutId=window.setTimeout(function(){a.enableAddUndoStack&&!i.sv.composingLock&&i.undo.addToUndoStack(i)},i.options.undoDelay)},Ct=function(i,a){var s=(0,q.zh)(i),u=(0,N.S)(s.startContainer,"SPAN");u&&u.textContent.trim()!==""&&(a=`
|
|||
|
|
`+a),s.collapse(!0),document.execCommand("insertHTML",!1,a)},Gt=function(i,a,s,u){var d=(0,q.zh)(i),f=a.getAttribute("data-type");i.sv.element.childNodes.length===0&&(i.sv.element.innerHTML=`<span data-type="p" data-block="0"><span data-type="text"><wbr></span></span><span data-type="newline"><br><span style="display: none">
|
|||
|
|
</span></span>`,(0,q.ib)(i.sv.element,d));var E=(0,y.F9)(d.startContainer),L=(0,N.S)(d.startContainer,"SPAN");if(E){if(f==="link"){var D=void 0;d.toString()===""?D="".concat(s).concat(Lute.Caret).concat(u):D="".concat(s).concat(d.toString()).concat(u.replace(")",Lute.Caret+")")),document.execCommand("insertHTML",!1,D);return}else if(f==="italic"||f==="bold"||f==="strike"||f==="inline-code"||f==="code"||f==="table"||f==="line"){var D=void 0;d.toString()===""?D="".concat(s).concat(Lute.Caret).concat(f==="code"?"":u):D="".concat(s).concat(d.toString()).concat(Lute.Caret).concat(f==="code"?"":u),f==="table"||f==="code"&&L&&L.textContent!==""?D=`
|
|||
|
|
|
|||
|
|
`+D:f==="line"&&(D=`
|
|||
|
|
|
|||
|
|
`.concat(s,`
|
|||
|
|
`).concat(Lute.Caret)),document.execCommand("insertHTML",!1,D);return}else if((f==="check"||f==="list"||f==="ordered-list"||f==="quote")&&L){var _="* ";f==="check"?_="* [ ] ":f==="ordered-list"?_="1. ":f==="quote"&&(_="> ");var B=pe(L,"newline");B?B.insertAdjacentText("afterend",_):E.insertAdjacentText("afterbegin",_),X(i);return}(0,q.ib)(i.sv.element,d),Ge(i)}},un=function(i){switch(i.currentMode){case"ir":return i.ir.element;case"wysiwyg":return i.wysiwyg.element;case"sv":return i.sv.element}},$n=function(i,a){i.options.upload.setHeaders&&(i.options.upload.headers=i.options.upload.setHeaders()),i.options.upload.headers&&Object.keys(i.options.upload.headers).forEach(function(s){a.setRequestHeader(s,i.options.upload.headers[s])})},mr=function(i,a,s,u){function d(f){return f instanceof s?f:new s(function(E){E(f)})}return new(s||(s=Promise))(function(f,E){function L(B){try{_(u.next(B))}catch(K){E(K)}}function D(B){try{_(u.throw(B))}catch(K){E(K)}}function _(B){B.done?f(B.value):d(B.value).then(L,D)}_((u=u.apply(i,a||[])).next())})},Hr=function(i,a){var s={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},u,d,f,E;return E={next:L(0),throw:L(1),return:L(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function L(_){return function(B){return D([_,B])}}function D(_){if(u)throw new TypeError("Generator is already executing.");for(;E&&(E=0,_[0]&&(s=0)),s;)try{if(u=1,d&&(f=_[0]&2?d.return:_[0]?d.throw||((f=d.return)&&f.call(d),0):d.next)&&!(f=f.call(d,_[1])).done)return f;switch(d=0,f&&(_=[_[0]&2,f.value]),_[0]){case 0:case 1:f=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,d=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(f=s.trys,!(f=f.length>0&&f[f.length-1])&&(_[0]===6||_[0]===2)){s=0;continue}if(_[0]===3&&(!f||_[1]>f[0]&&_[1]<f[3])){s.label=_[1];break}if(_[0]===6&&s.label<f[1]){s.label=f[1],f=_;break}if(f&&s.label<f[2]){s.label=f[2],s.ops.push(_);break}f[2]&&s.ops.pop(),s.trys.pop();continue}_=a.call(i,s)}catch(B){_=[6,B],d=0}finally{u=f=0}if(_[0]&5)throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}},Ia=function(){function i(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"}return i}(),Li=function(i,a){i.tip.hide();var s=[],u="",d="";i.options.lang,i.options;for(var f=function(_,B){var K=a[B],fe=!0;K.name||(u+="<li>".concat(window.VditorI18n.nameEmpty,"</li>"),fe=!1),K.size>i.options.upload.max&&(u+="<li>".concat(K.name," ").concat(window.VditorI18n.over," ").concat(i.options.upload.max/1024/1024,"M</li>"),fe=!1);var ve=K.name.lastIndexOf("."),ue=K.name.substr(ve),ke=i.options.upload.filename(K.name.substr(0,ve))+ue;if(i.options.upload.accept){var we=i.options.upload.accept.split(",").some(function(de){var Ie=de.trim();if(Ie.indexOf(".")===0){if(ue.toLowerCase()===Ie.toLowerCase())return!0}else if(K.type.split("/")[0]===Ie.split("/")[0])return!0;return!1});we||(u+="<li>".concat(K.name," ").concat(window.VditorI18n.fileTypeError,"</li>"),fe=!1)}fe&&(s.push(K),d+="<li>".concat(ke," ").concat(window.VditorI18n.uploading,' <a class="vditorCancelUpload" href="javascript:void(0)">').concat(window.VditorI18n.cancelUpload,"</a></li>"))},E=a.length,L=0;L<E;L++)f(E,L);if(i.tip.show("<ul>".concat(u).concat(d,"</ul>")),i.options.upload.cancel){var D=i.tip.element.querySelector(".vditorCancelUpload");D&&D.addEventListener("click",function(){i.options.upload.cancel(s),i.tip.hide(),i.upload.isUploading=!1})}return s},Oa=function(i,a){var s=un(a);s.focus();var u=JSON.parse(i),d="";u.code===1&&(d="".concat(u.msg)),u.data.errFiles&&u.data.errFiles.length>0&&(d="<ul><li>".concat(d,"</li>"),u.data.errFiles.forEach(function(E){var L=E.lastIndexOf("."),D=a.options.upload.filename(E.substr(0,L))+E.substr(L);d+="<li>".concat(D," ").concat(window.VditorI18n.uploadError,"</li>")}),d+="</ul>"),d?a.tip.show(d):a.tip.hide();var f="";Object.keys(u.data.succMap).forEach(function(E){var L=u.data.succMap[E],D=E.lastIndexOf("."),_=E.substr(D),B=a.options.upload.filename(E.substr(0,D))+_;_=_.toLowerCase()
|
|||
|
|
data-block="0"><pre><code><audio controls="controls" src="`.concat(L,'"></audio></code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="').concat(L,`"></audio></pre></div>
|
|||
|
|
`):a.currentMode==="ir"?f+='<audio controls="controls" src="'.concat(L,`"></audio>
|
|||
|
|
`):f+="[".concat(B,"](").concat(L,`)
|
|||
|
|
`):_.indexOf(".apng")===0||_.indexOf(".bmp")===0||_.indexOf(".gif")===0||_.indexOf(".ico")===0||_.indexOf(".cur")===0||_.indexOf(".jpg")===0||_.indexOf(".jpeg")===0||_.indexOf(".jfif")===0||_.indexOf(".pjp")===0||_.indexOf(".pjpeg")===0||_.indexOf(".png")===0||_.indexOf(".svg")===0||_.indexOf(".webp")===0?a.currentMode==="wysiwyg"?f+='<img alt="'.concat(B,'" src="').concat(L,`">
|
|||
|
|
`):f+=".concat(L,`)
|
|||
|
|
`):a.currentMode==="wysiwyg"?f+='<a href="'.concat(L,'">').concat(B,`</a>
|
|||
|
|
`):f+="[".concat(B,"](").concat(L,`)
|
|||
|
|
`)}),(0,q.Hc)(a.upload.range),document.execCommand("insertHTML",!1,f),a.upload.range=getSelection().getRangeAt(0).cloneRange()},_i=function(i,a,s){return mr(void 0,void 0,void 0,function(){var u,d,ue,f,E,E,L,D,_,B,K,fe,ve,ue,ke,we;return Hr(this,function(de){switch(de.label){case 0:for(u=[],d=i.options.upload.multiple===!0?a.length:1,ue=0;ue<d;ue++)f=a[ue],f instanceof DataTransferItem&&(f=f.getAsFile()),u.push(f);return i.options.upload.handler?[4,i.options.upload.handler(u)]:[3,2];case 1:return E=de.sent(),s&&(s.value=""),typeof E=="string"?(i.tip.show(E),[2]):[2];case 2:return!i.options.upload.url||!i.upload?(s&&(s.value=""),i.tip.show("please config: options.upload.url"),[2]):i.options.upload.file?[4,i.options.upload.file(u)]:[3,4];case 3:u=de.sent(),de.label=4;case 4:if(i.options.upload.validate&&(E=i.options.upload.validate(u),typeof E=="string"))return i.tip.show(E),[2];if(L=un(i),i.upload.range=(0,q.zh)(i),D=Li(i,u),D.length===0)return s&&(s.value=""),[2];for(_=new FormData,B=i.options.upload.extraData,K=0,fe=Object.keys(B);K<fe.length;K++)ve=fe[K],_.append(ve,B[ve]);for(ue=0,ke=D.length;ue<ke;ue++)_.append(i.options.upload.fieldName,D[ue]);return we=new XMLHttpRequest,i.upload.xhr=we,we.open("POST",i.options.upload.url),i.options.upload.token&&we.setRequestHeader("X-Upload-Token",i.options.upload.token),i.options.upload.withCredentials&&(we.withCredentials=!0),$n(i,we),i.upload.isUploading=!0,L.setAttribute("contenteditable","false"),we.onreadystatechange=function(){if(we.readyState===XMLHttpRequest.DONE){if(i.upload.isUploading=!1,L.setAttribute("contenteditable","true"),we.status>=200&&we.status<300)if(i.options.upload.success)i.options.upload.success(L,we.responseText);else{var Ie=we.responseText;i.options.upload.format&&(Ie=i.options.upload.format(a,we.responseText)),Oa(Ie,i)}else i.options.upload.error?i.options.upload.error(we.responseText):i.tip.show(we.responseText);s&&(s.value=""),i.upload.element.style.display="none",i.upload.xhr=void 0}},we.upload.onprogress=function(Ie){if(Ie.lengthComputable){var Te=Ie.loaded/Ie.total*100;i.upload.element.style.display="block";var $e=i.upload.element;$e.style.width=Te+"%"}},we.send(_),[2]}})})},Zr=function(i,a,s){var u,d=(0,y.F9)(a.startContainer);if(d||(d=i.wysiwyg.element),s&&s.inputType!=="formatItalic"&&s.inputType!=="deleteByDrag"&&s.inputType!=="insertFromDrop"&&s.inputType!=="formatBold"&&s.inputType!=="formatRemove"&&s.inputType!=="formatStrikeThrough"&&s.inputType!=="insertUnorderedList"&&s.inputType!=="insertOrderedList"&&s.inputType!=="formatOutdent"&&s.inputType!=="formatIndent"&&s.inputType!==""||!s){var f=mt(a.startContainer);f&&f.remove(),i.wysiwyg.element.querySelectorAll("wbr").forEach(function(Te){Te.remove()}),a.insertNode(document.createElement("wbr")),d.querySelectorAll("[style]").forEach(function(Te){Te.removeAttribute("style")}),d.querySelectorAll(".vditor-comment").forEach(function(Te){Te.textContent.trim()===""&&(Te.classList.remove("vditor-comment","vditor-comment--focus"),Te.removeAttribute("data-cmtids"))}),(u=d.previousElementSibling)===null||u===void 0||u.querySelectorAll(".vditor-comment").forEach(function(Te){Te.textContent.trim()===""&&(Te.classList.remove("vditor-comment","vditor-comment--focus"),Te.removeAttribute("data-cmtids"))});var E="";d.getAttribute("data-type")==="link-ref-defs-block"&&(d=i.wysiwyg.element);var L=d.isEqualNode(i.wysiwyg.element),D=(0,y.a1)(d,"data-type","footnotes-block");if(L)E=d.innerHTML;else{var _=(0,y.O9)(a.startContainer);if(_&&!D){var B=(0,N.S)(a.startContainer,"BLOCKQUOTE");B?d=(0,y.F9)(a.startContainer)||d:d=_}if(D&&(d=D),E=d.outerHTML,d.tagName==="UL"||d.tagName==="OL"){var K=d.previousElementSibling,fe=d.nextElementSibling;K&&(K.tagName==="UL"||K.tagName==="OL")&&(E=K.outerHTML+E,K.remove()),fe&&(fe.tagName==="UL"||fe.tagName==="OL")&&(E=E+fe.outerHTML,fe.remove()),E=E.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}d.innerText.startsWith("```")||(i.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(Te){Te&&!d.isEqualNode(Te)&&(E+=Te.outerHTML,Te.re
|
|||
|
|
</p>`)),(0,q.ib)(i[i.currentMode].element,s),dr(i),lt(i))},fu=function(i){var a=(0,y.lG)(i,"TABLE");return a&&a.rows[0].cells[0].isSameNode(i)?a:!1},mu=function(i){var a=(0,y.lG)(i,"TABLE");return a&&a.lastElementChild.lastElementChild.lastElementChild.isSameNode(i)?a:!1},As=function(i,a,s){s===void 0&&(s=!0);var u=i.previousElementSibling;return u||(i.parentElement.previousElementSibling?u=i.parentElement.previousElementSibling.lastElementChild:i.parentElement.parentElement.tagName==="TBODY"&&i.parentElement.parentElement.previousElementSibling?u=i.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:u=null),u&&(a.selectNodeContents(u),s||a.collapse(!1),(0,q.Hc)(a)),u},pi=function(i,a,s,u,d){var f=(0,q.im)(u,i[i.currentMode].element,s);if(a.key==="ArrowDown"&&u.textContent.trimRight().substr(f.start).indexOf(`
|
|||
|
|
`)===-1||a.key==="ArrowRight"&&f.start>=u.textContent.trimRight().length){var E=d.nextElementSibling;return!E||E&&(E.tagName==="TABLE"||E.getAttribute("data-type"))?(d.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,q.ib)(i[i.currentMode].element,s)):(s.selectNodeContents(E),s.collapse(!0),(0,q.Hc)(s)),a.preventDefault(),!0}return!1},Pr=function(i,a,s,u,d){var f=(0,q.im)(u,i[i.currentMode].element,s);if(a.key==="ArrowUp"&&u.textContent.substr(0,f.start).indexOf(`
|
|||
|
|
`)===-1||(a.key==="ArrowLeft"||a.key==="Backspace"&&s.toString()==="")&&f.start===0){var E=d.previousElementSibling;return!E||E&&(E.tagName==="TABLE"||E.getAttribute("data-type"))?(d.insertAdjacentHTML("beforebegin",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,q.ib)(i[i.currentMode].element,s)):(s.selectNodeContents(E),s.collapse(!1),(0,q.Hc)(s)),a.preventDefault(),!0}return!1},Ji=function(i,a,s,u){u===void 0&&(u=!0);var d=(0,y.lG)(a.startContainer,"LI");if(i[i.currentMode].element.querySelectorAll("wbr").forEach(function(B){B.remove()}),a.insertNode(document.createElement("wbr")),u&&d){for(var f="",E=0;E<d.parentElement.childElementCount;E++){var L=d.parentElement.children[E].querySelector("input");L&&L.remove(),f+='<p data-block="0">'.concat(d.parentElement.children[E].innerHTML.trimLeft(),"</p>")}d.parentElement.insertAdjacentHTML("beforebegin",f),d.parentElement.remove()}else if(d)if(s==="check")d.parentElement.querySelectorAll("li").forEach(function(B){B.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'.concat(B.textContent.indexOf(" ")===0?"":" ")),B.classList.add("vditor-task")});else{d.querySelector("input")&&d.parentElement.querySelectorAll("li").forEach(function(B){B.querySelector("input").remove(),B.classList.remove("vditor-task")});var D=void 0;s==="list"?(D=document.createElement("ul"),D.setAttribute("data-marker","*")):(D=document.createElement("ol"),D.setAttribute("data-marker","1.")),D.setAttribute("data-block","0"),D.setAttribute("data-tight",d.parentElement.getAttribute("data-tight")),D.innerHTML=d.parentElement.innerHTML,d.parentElement.parentNode.replaceChild(D,d.parentElement)}else{var _=(0,y.a1)(a.startContainer,"data-block","0");_||(i[i.currentMode].element.querySelector("wbr").remove(),_=i[i.currentMode].element.querySelector("p"),_.innerHTML="<wbr>"),s==="check"?(_.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '.concat(_.innerHTML,"</li></ul>")),_.remove()):s==="list"?(_.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'.concat(_.innerHTML,"</li></ul>")),_.remove()):s==="ordered-list"&&(_.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'.concat(_.innerHTML,"</li></ol>")),_.remove())}},Ms=function(i,a,s){var u=a.previousElementSibling;if(a&&u){var d=[a];Array.from(s.cloneContents().children).forEach(function(D,_){D.nodeType!==3&&a&&D.textContent.trim()!==""&&a.getAttribute("data-node-id")===D.getAttribute("data-node-id")&&(_!==0&&d.push(a),a=a.nextElementSibling)}),i[i.currentMode].element.querySelectorAll("wbr").forEach(function(D){D.remove()}),s.insertNode(document.createElement("wbr"));var f=u.parentElement,E="";d.forEach(function(D){var _=D.getAttribute("data-marker");_.length!==1&&(_="1".concat(_.slice(-1))),E+='<li data-node-id="'.concat(D.getAttribute("data-node-id"),'" data-marker="').concat(_,'">').concat(D.innerHTML,"</li>"),D.remove()}),u.insertAdjacentHTML("beforeend","<".concat(f.tagName,' data-block="0">').concat(E,"</").concat(f.tagName,">")),i.currentMode==="wysiwyg"?f.outerHTML=i.lute.SpinVditorDOM(f.outerHTML):f.outerHTML=i.lute.SpinVditorIRDOM(f.outerHTML),(0,q.ib)(i[i.currentMode].element,s);var L=(0,y.O9)(s.startContainer);L&&L.querySelectorAll(".vditor-".concat(i.currentMode,"__preview[data-render='2']")).forEach(function(D){tt(D,i),i.currentMode==="wysiwyg"&&D.previousElementSibling.setAttribute("style","display:none")}),lt(i),dr(i)}else i[i.currentMode].element.focus()},po=function(i,a,s,u){var d=(0,y.lG)(a.parentElement,"LI");if(d){i[i.currentMode].element.querySelectorAll("wbr").forEach(function(K){K.remove()}),s.insertNode(document.createElement("wbr"));var f=a.parentElement,E=f.cloneNode(),L=[a];Array.from(s.cloneContents().children).forEach(function(K,fe){K.nodeType!==3&&a&&K.textContent.trim()!==""&&a.getAttribute("data-node-id")===K.getAttribute("data-node-id")&&(fe!==0&&L.push(a),a=a.nextElementSibling)});var D=!1,_="";f.querySelectorAll("li").forEach(function(K){D&&(_+=K.outerHTML,!K.nextElementSibling&&!K.previousElementSibling?K.parentElement.remove():K.remove()),K.isSam
|
|||
|
|
`).pop();return a===""?!1:(a.replace(/ |-/g,"")===""||a.replace(/ |_/g,"")===""||a.replace(/ |\*/g,"")==="")&&a.replace(/ /g,"").length>2?!(a.indexOf("-")>-1&&a.trimLeft().indexOf(" ")===-1&&i.trimRight().split(`
|
|||
|
|
`).length>1||a.indexOf(" ")===0||a.indexOf(" ")===0):!1},mo=function(i){var a=i.trimRight().split(`
|
|||
|
|
`);return i=a.pop(),i.indexOf(" ")===0||i.indexOf(" ")===0||(i=i.trimLeft(),i===""||a.length===0)?!1:i.replace(/-/g,"")===""||i.replace(/=/g,"")===""},lt=function(i,a){a===void 0&&(a={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),i.currentMode==="wysiwyg"?Re(i,a):i.currentMode==="ir"?Xn(i,a):i.currentMode==="sv"&&Ge(i,a)},Cs=function(i,a,s,u){var d,f=i.startContainer,E=(0,y.lG)(f,"LI");if(E){if(!(0,m.yl)(u)&&!u.altKey&&u.key==="Enter"&&!u.shiftKey&&s&&E.contains(s)&&s.nextElementSibling)return E&&!E.textContent.endsWith(`
|
|||
|
|
`)&&E.insertAdjacentText("beforeend",`
|
|||
|
|
`),i.insertNode(document.createTextNode(`
|
|||
|
|
|
|||
|
|
`)),i.collapse(!1),lt(a),u.preventDefault(),!0;if(!(0,m.yl)(u)&&!u.shiftKey&&!u.altKey&&u.key==="Backspace"&&!E.previousElementSibling&&i.toString()===""&&(0,q.im)(E,a[a.currentMode].element,i).start===0)return E.nextElementSibling?(E.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(E.innerHTML,"</p>")),E.remove()):E.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(E.innerHTML,"</p>"),(0,q.ib)(a[a.currentMode].element,i),lt(a),u.preventDefault(),!0;if(!(0,m.yl)(u)&&!u.shiftKey&&!u.altKey&&u.key==="Backspace"&&E.textContent.trim().replace(c.g.ZWSP,"")===""&&i.toString()===""&&((d=E.previousElementSibling)===null||d===void 0?void 0:d.tagName)==="LI")return E.previousElementSibling.insertAdjacentText("beforeend",`
|
|||
|
|
|
|||
|
|
`),i.selectNodeContents(E.previousElementSibling),i.collapse(!1),E.remove(),(0,q.ib)(a[a.currentMode].element,i),lt(a),u.preventDefault(),!0;if(!(0,m.yl)(u)&&!u.altKey&&u.key==="Tab"){var L=!1;if((i.startOffset===0&&(f.nodeType===3&&!f.previousSibling||f.nodeType!==3&&f.nodeName==="LI")||E.classList.contains("vditor-task")&&i.startOffset===1&&f.previousSibling.nodeType!==3&&f.previousSibling.tagName==="INPUT")&&(L=!0),L||i.toString()!=="")return u.shiftKey?po(a,E,i,E.parentElement):Ms(a,E,i),u.preventDefault(),!0}}return!1},go=function(i,a,s){if(i.options.tab&&s.key==="Tab")return s.shiftKey||(a.toString()===""?(a.insertNode(document.createTextNode(i.options.tab)),a.collapse(!1)):(a.extractContents(),a.insertNode(document.createTextNode(i.options.tab)),a.collapse(!1))),(0,q.Hc)(a),lt(i),s.preventDefault(),!0},Ls=function(i,a,s,u){if(s){if(!(0,m.yl)(i)&&!i.altKey&&i.key==="Enter"){var d=String.raw(qs||(qs=pu(["",""],["",""])),s.textContent).replace(/\\\|/g,"").trim(),f=d.split("|");if(d.startsWith("|")&&d.endsWith("|")&&f.length>3){var E=f.map(function(){return"---"}).join("|");return E=s.textContent+`
|
|||
|
|
`+E.substring(3,E.length-3)+`
|
|||
|
|
|<wbr>`,s.outerHTML=a.lute.SpinVditorDOM(E),(0,q.ib)(a[a.currentMode].element,u),lt(a),Z(a),i.preventDefault(),!0}if(fo(s.innerHTML)&&s.previousElementSibling){var L="",D=s.innerHTML.trimRight().split(`
|
|||
|
|
`);return D.length>1&&(D.pop(),L='<p data-block="0">'.concat(D.join(`
|
|||
|
|
`),"</p>")),s.insertAdjacentHTML("afterend","".concat(L,`<hr data-block="0"><p data-block="0"><wbr>
|
|||
|
|
</p>`)),s.remove(),(0,q.ib)(a[a.currentMode].element,u),lt(a),Z(a),i.preventDefault(),!0}if(mo(s.innerHTML))return a.currentMode==="wysiwyg"?s.outerHTML=a.lute.SpinVditorDOM(s.innerHTML+`<p data-block="0"><wbr>
|
|||
|
|
</p>`):s.outerHTML=a.lute.SpinVditorIRDOM(s.innerHTML+`<p data-block="0"><wbr>
|
|||
|
|
</p>`),(0,q.ib)(a[a.currentMode].element,u),lt(a),Z(a),i.preventDefault(),!0}if(u.collapsed&&s.previousElementSibling&&i.key==="Backspace"&&!(0,m.yl)(i)&&!i.altKey&&!i.shiftKey&&s.textContent.trimRight().split(`
|
|||
|
|
`).length>1&&(0,q.im)(s,a[a.currentMode].element,u).start===0){var _=(0,y.DX)(s.previousElementSibling);return _.textContent.endsWith(`
|
|||
|
|
`)||(_.textContent=_.textContent+`
|
|||
|
|
`),_.parentElement.insertAdjacentHTML("beforeend","<wbr>".concat(s.innerHTML)),s.remove(),(0,q.ib)(a[a.currentMode].element,u),!1}return!1}},_s=function(i,a,s){for(var u="",d=0;d<s.parentElement.childElementCount;d++)u+='<td align="'.concat(s.parentElement.children[d].getAttribute("align"),'"> </td>');s.tagName==="TH"?s.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>".concat(u,"</tr></tbody>")):s.parentElement.insertAdjacentHTML("afterend","<tr>".concat(u,"</tr>")),lt(i)},Ns=function(i,a,s){for(var u="",d=0;d<s.parentElement.childElementCount;d++)s.tagName==="TH"?u+='<th align="'.concat(s.parentElement.children[d].getAttribute("align"),'"> </th>'):u+='<td align="'.concat(s.parentElement.children[d].getAttribute("align"),'"> </td>');if(s.tagName==="TH"){s.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>".concat(u,"</tr></thead>")),a.insertNode(document.createElement("wbr"));var f=s.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");s.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",f),s.parentElement.parentElement.remove(),(0,q.ib)(i.ir.element,a)}else s.parentElement.insertAdjacentHTML("beforebegin","<tr>".concat(u,"</tr>"));lt(i)},ea=function(i,a,s,u){u===void 0&&(u="afterend");for(var d=0,f=s.previousElementSibling;f;)d++,f=f.previousElementSibling;for(var E=0;E<a.rows.length;E++)E===0?a.rows[E].cells[d].insertAdjacentHTML(u,"<th> </th>"):a.rows[E].cells[d].insertAdjacentHTML(u,"<td> </td>");lt(i)},Ds=function(i,a,s){if(s.tagName==="TD"){var u=s.parentElement.parentElement;s.parentElement.previousElementSibling?a.selectNodeContents(s.parentElement.previousElementSibling.lastElementChild):a.selectNodeContents(u.previousElementSibling.lastElementChild.lastElementChild),u.childElementCount===1?u.remove():s.parentElement.remove(),a.collapse(!1),(0,q.Hc)(a),lt(i)}},Rs=function(i,a,s,u){for(var d=0,f=u.previousElementSibling;f;)d++,f=f.previousElementSibling;(u.previousElementSibling||u.nextElementSibling)&&(a.selectNodeContents(u.previousElementSibling||u.nextElementSibling),a.collapse(!0));for(var E=0;E<s.rows.length;E++){var L=s.rows[E].cells;if(L.length===1){s.remove(),dr(i);break}L[d].remove()}(0,q.Hc)(a),lt(i)},Is=function(i,a,s){var u=s.startContainer,d=(0,y.lG)(u,"TD")||(0,y.lG)(u,"TH");if(d){if(!(0,m.yl)(a)&&!a.altKey&&a.key==="Enter"){(!d.lastElementChild||d.lastElementChild&&(!d.lastElementChild.isSameNode(d.lastChild)||d.lastElementChild.tagName!=="BR"))&&d.insertAdjacentHTML("beforeend","<br>");var f=document.createElement("br");return s.insertNode(f),s.setStartAfter(f),lt(i),Z(i),a.preventDefault(),!0}if(a.key==="Tab"){if(a.shiftKey)return As(d,s),a.preventDefault(),!0;var E=d.nextElementSibling;return E||(d.parentElement.nextElementSibling?E=d.parentElement.nextElementSibling.firstElementChild:d.parentElement.parentElement.tagName==="THEAD"&&d.parentElement.parentElement.nextElementSibling?E=d.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:E=null),E&&(s.selectNodeContents(E),(0,q.Hc)(s)),a.preventDefault(),!0}var L=d.parentElement.parentElement.parentElement;if(a.key==="ArrowUp"){if(a.preventDefault(),d.tagName==="TH")return L.previousElementSibling?(s.selectNodeContents(L.previousElementSibling),s.collapse(!1),(0,q.Hc)(s)):hi(i,"beforebegin"),!0;for(var D=0,_=d.parentElement;D<_.cells.length&&!_.cells[D].isSameNode(d);D++);var B=_.previousElementSibling;return B||(B=_.parentElement.previousElementSibling.firstChild),s.selectNodeContents(B.cells[D]),s.collapse(!1),(0,q.Hc)(s),!0}if(a.key==="ArrowDown"){a.preventDefault();var _=d.parentElement;if(!_.nextElementSibling&&d.tagName==="TD")return L.nextElementSibling?(s.selectNodeContents(L.nextElementSibling),s.collapse(!0),(0,q.Hc)(s)):hi(i,"afterend"),!0;for(var D=0;D<_.cells.length&&!_.cells[D].isSameNode(d);D++);var E=_.nextElementSibling;return E||(E=_.parentElement.nextElementSibling.firstChild),s.selectNodeContents(E.cells[D]),s.collapse(!0),(0,q.Hc)(s),!0}if(i.currentMode==="wysiwyg"&&!(0,m.yl)(a)&&a.key==="Enter"&&!a.s
|
|||
|
|
</p>`,(0,q.ib)(i[i.currentMode].element,s)):(s.setStartBefore(L),s.collapse(!0)),lt(i)),a.preventDefault(),!0}if(oe("⇧⌘F",a))return Ns(i,s,d),a.preventDefault(),!0;if(oe("⌘=",a))return _s(i,s,d),a.preventDefault(),!0;if(oe("⇧⌘G",a))return ea(i,L,d,"beforebegin"),a.preventDefault(),!0;if(oe("⇧⌘=",a))return ea(i,L,d),a.preventDefault(),!0;if(oe("⌘-",a))return Ds(i,s,d),a.preventDefault(),!0;if(oe("⇧⌘-",a))return Rs(i,s,L,d),a.preventDefault(),!0;if(oe("⇧⌘L",a)){if(i.currentMode==="ir")return Qi(L,"left"),lt(i),a.preventDefault(),!0;var ve=i.wysiwyg.popover.querySelector('[data-type="left"]');if(ve)return ve.click(),a.preventDefault(),!0}if(oe("⇧⌘C",a)){if(i.currentMode==="ir")return Qi(L,"center"),lt(i),a.preventDefault(),!0;var ve=i.wysiwyg.popover.querySelector('[data-type="center"]');if(ve)return ve.click(),a.preventDefault(),!0}if(oe("⇧⌘R",a)){if(i.currentMode==="ir")return Qi(L,"right"),lt(i),a.preventDefault(),!0;var ve=i.wysiwyg.popover.querySelector('[data-type="right"]');if(ve)return ve.click(),a.preventDefault(),!0}}return!1},Os=function(i,a,s,u){if(s.tagName==="PRE"&&oe("⌘A",a))return u.selectNodeContents(s.firstElementChild),a.preventDefault(),!0;if(i.options.tab&&a.key==="Tab"&&!a.shiftKey&&u.toString()==="")return u.insertNode(document.createTextNode(i.options.tab)),u.collapse(!1),lt(i),a.preventDefault(),!0;if(a.key==="Backspace"&&!(0,m.yl)(a)&&!a.shiftKey&&!a.altKey){var d=(0,q.im)(s,i[i.currentMode].element,u);if((d.start===0||d.start===1&&s.innerText===`
|
|||
|
|
`)&&u.toString()==="")return s.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(s.firstElementChild.innerHTML,"</p>"),(0,q.ib)(i[i.currentMode].element,u),lt(i),a.preventDefault(),!0}return!(0,m.yl)(a)&&!a.altKey&&a.key==="Enter"?(s.firstElementChild.textContent.endsWith(`
|
|||
|
|
`)||s.firstElementChild.insertAdjacentText("beforeend",`
|
|||
|
|
`),u.extractContents(),u.insertNode(document.createTextNode(`
|
|||
|
|
`)),u.collapse(!1),(0,q.Hc)(u),(0,m.vU)()||(i.currentMode==="wysiwyg"?Zr(i,u):Nt(i,u)),Z(i),a.preventDefault(),!0):!1},Hs=function(i,a,s,u){var d=a.startContainer,f=(0,y.lG)(d,"BLOCKQUOTE");if(f&&a.toString()===""){if(s.key==="Backspace"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey&&(0,q.im)(f,i[i.currentMode].element,a).start===0)return a.insertNode(document.createElement("wbr")),f.outerHTML=f.innerHTML,(0,q.ib)(i[i.currentMode].element,a),lt(i),s.preventDefault(),!0;if(u&&s.key==="Enter"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey&&u.parentElement.tagName==="BLOCKQUOTE"){var E=!1;if(u.innerHTML.replace(c.g.ZWSP,"")===`
|
|||
|
|
`||u.innerHTML.replace(c.g.ZWSP,"")===""?(E=!0,u.remove()):u.innerHTML.endsWith(`
|
|||
|
|
|
|||
|
|
`)&&(0,q.im)(u,i[i.currentMode].element,a).start===u.textContent.length-1&&(u.innerHTML=u.innerHTML.substr(0,u.innerHTML.length-2),E=!0),E)return f.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(c.g.ZWSP,`<wbr>
|
|||
|
|
</p>`)),(0,q.ib)(i[i.currentMode].element,a),lt(i),s.preventDefault(),!0}var L=(0,y.F9)(d);if(i.currentMode==="wysiwyg"&&L&&oe("⇧⌘;",s))return a.insertNode(document.createElement("wbr")),L.outerHTML='<blockquote data-block="0">'.concat(L.outerHTML,"</blockquote>"),(0,q.ib)(i.wysiwyg.element,a),Re(i),s.preventDefault(),!0;if(pi(i,s,a,f,f)||Pr(i,s,a,f,f))return!0}return!1},Ps=function(i,a,s){var u=a.startContainer,d=(0,y.lG)(u,"LI");if(d&&d.classList.contains("vditor-task")){if(oe("⇧⌘J",s)){var f=d.firstElementChild;return f.checked?f.removeAttribute("checked"):f.setAttribute("checked","checked"),lt(i),s.preventDefault(),!0}if(s.key==="Backspace"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey&&a.toString()===""&&a.startOffset===1&&(u.nodeType===3&&u.previousSibling&&u.previousSibling.tagName==="INPUT"||u.nodeType!==3)){var E=d.previousElementSibling;if(d.querySelector("input").remove(),E){var L=(0,y.DX)(E);L.parentElement.insertAdjacentHTML("beforeend","<wbr>"+d.innerHTML.trim()),d.remove()}else d.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(d.innerHTML.trim()||`
|
|||
|
|
`,"</p>")),d.nextElementSibling?d.remove():d.parentElement.remove();return(0,q.ib)(i[i.currentMode].element,a),lt(i),s.preventDefault(),!0}if(s.key==="Enter"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey){if(d.textContent.trim()==="")if((0,y.fb)(d.parentElement,"vditor-task")){var D=(0,y.O9)(u);D&&po(i,d,a,D)}else if(d.nextElementSibling){var _="",B="",K=!1;Array.from(d.parentElement.children).forEach(function(ke){d.isSameNode(ke)?K=!0:K?_+=ke.outerHTML:B+=ke.outerHTML});var fe=d.parentElement.tagName,ve=d.parentElement.tagName==="OL"?"":' data-marker="'.concat(d.parentElement.getAttribute("data-marker"),'"'),ue="";B&&(ue=d.parentElement.tagName==="UL"?"":' start="1"',B="<".concat(fe,' data-tight="true"').concat(ve,' data-block="0">').concat(B,"</").concat(fe,">")),d.parentElement.outerHTML="".concat(B,`<p data-block="0"><wbr>
|
|||
|
|
</p><`).concat(fe,`
|
|||
|
|
data-tight="true"`).concat(ve,' data-block="0"').concat(ue,">").concat(_,"</").concat(fe,">")}else d.parentElement.insertAdjacentHTML("afterend",`<p data-block="0"><wbr>
|
|||
|
|
</p>`),d.parentElement.querySelectorAll("li").length===1?d.parentElement.remove():d.remove();else u.nodeType!==3&&a.startOffset===0&&u.firstChild.tagName==="INPUT"?a.setStart(u.childNodes[1],1):(a.setEndAfter(d.lastChild),d.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'.concat(d.getAttribute("data-marker"),'"><input type="checkbox"> <wbr></li>')),document.querySelector("wbr").after(a.extractContents()));return(0,q.ib)(i[i.currentMode].element,a),lt(i),Z(i),s.preventDefault(),!0}}return!1},zs=function(i,a,s,u){if(a.startContainer.nodeType!==3){var d=a.startContainer.children[a.startOffset];if(d&&d.tagName==="HR")return a.selectNodeContents(d.previousElementSibling),a.collapse(!1),s.preventDefault(),!0}if(u){var f=u.previousElementSibling;if(f&&(0,q.im)(u,i[i.currentMode].element,a).start===0&&((0,m.vU)()&&f.tagName==="HR"||f.tagName==="TABLE")){if(f.tagName==="TABLE"){var E=f.lastElementChild.lastElementChild.lastElementChild;E.innerHTML=E.innerHTML.trimLeft()+"<wbr>"+u.textContent.trim(),u.remove()}else f.remove();return(0,q.ib)(i[i.currentMode].element,a),lt(i),s.preventDefault(),!0}}return!1},Bs=function(i){(0,m.vU)()&&i.startContainer.nodeType!==3&&i.startContainer.tagName==="HR"&&i.setStartBefore(i.startContainer)},Fs=function(i,a,s){var u,d;if(!(0,m.vU)())return!1;if(i.key==="ArrowUp"&&a&&((u=a.previousElementSibling)===null||u===void 0?void 0:u.tagName)==="TABLE"){var f=a.previousElementSibling;return s.selectNodeContents(f.rows[f.rows.length-1].lastElementChild),s.collapse(!1),i.preventDefault(),!0}return i.key==="ArrowDown"&&a&&((d=a.nextElementSibling)===null||d===void 0?void 0:d.tagName)==="TABLE"?(s.selectNodeContents(a.nextElementSibling.rows[0].cells[0]),s.collapse(!0),i.preventDefault(),!0):!1},ta=function(i,a,s){return xs(void 0,void 0,void 0,function(){var u,d,f,E,L,D,_,B,K,fe,ve,ue,ke,de,we,de,Ie;return ks(this,function(Te){switch(Te.label){case 0:return i[i.currentMode].element.getAttribute("contenteditable")!=="true"?[2]:(a.stopPropagation(),a.preventDefault(),"clipboardData"in a?(u=a.clipboardData.getData("text/html"),d=a.clipboardData.getData("text/plain"),f=a.clipboardData.files):(u=a.dataTransfer.getData("text/html"),d=a.dataTransfer.getData("text/plain"),a.dataTransfer.types.includes("Files")&&(f=a.dataTransfer.items)),E={},L=function($e,bt){if(!bt)return["",Lute.WalkContinue];if(i.options.upload.renderLinkDest)return i.options.upload.renderLinkDest(i,$e,bt);var gt=$e.TokensStr();if($e.__internal_object__.Parent.Type===34&>&>.indexOf("file://")===-1&&i.options.upload.linkToImgUrl){var kt=new XMLHttpRequest;kt.open("POST",i.options.upload.linkToImgUrl),i.options.upload.token&&kt.setRequestHeader("X-Upload-Token",i.options.upload.token),i.options.upload.withCredentials&&(kt.withCredentials=!0),$n(i,kt),kt.setRequestHeader("Content-Type","application/json; charset=utf-8"),kt.onreadystatechange=function(){if(kt.readyState===XMLHttpRequest.DONE){if(kt.status===200){var dn=kt.responseText;i.options.upload.linkToImgFormat&&(dn=i.options.upload.linkToImgFormat(kt.responseText));var Wt=JSON.parse(dn);if(Wt.code!==0){i.tip.show(Wt.msg);return}var hn=Wt.data.originalURL;if(i.currentMode==="sv")i.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(zt){zt.textContent===hn&&(zt.textContent=Wt.data.url)});else{var it=i[i.currentMode].element.querySelector('img[src="'.concat(hn,'"]'));it.src=Wt.data.url,i.currentMode==="ir"&&(it.previousElementSibling.previousElementSibling.innerHTML=Wt.data.url)}lt(i)}else i.tip.show(kt.responseText);i.options.upload.linkToImgCallback&&i.options.upload.linkToImgCallback(kt.responseText)}},kt.send(JSON.stringify({url:gt}))}return i.currentMode==="ir"?['<span class="vditor-ir__marker vditor-ir__marker--link">'.concat(Lute.EscapeHTMLStr(gt),"</span>"),Lute.WalkContinue]:i.currentMode==="wysiwyg"?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'.concat(Lute.EscapeHTMLStr(gt),"</span>"),Lute.WalkContinue]},(u.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/ig,"").trim()==='<a href="'.concat(d,'">').concat(d,
|
|||
|
|
`):$e+=".concat(ue.result.toString(),`)
|
|||
|
|
`),document.execCommand("insertHTML",!1,$e)}),Te.label=8;case 8:return[3,10];case 9:d.trim()!==""&&f.length===0&&(de=(0,q.zh)(i),de.toString()!==""&&i.lute.IsValidLinkDest(d)&&(d="[".concat(de.toString(),"](").concat(d,")")),i.currentMode==="ir"?(E.Md2VditorIRDOM={renderLinkDest:L},i.lute.SetJSRenderers({renderers:E}),(0,q.oC)(Lute.Sanitize(i.lute.Md2VditorIRDOM(d)),i)):i.currentMode==="wysiwyg"?(E.Md2VditorDOM={renderLinkDest:L},i.lute.SetJSRenderers({renderers:E}),(0,q.oC)(Lute.Sanitize(i.lute.Md2VditorDOM(d)),i)):(E.Md2VditorSVDOM={renderLinkDest:L},i.lute.SetJSRenderers({renderers:E}),Pe(i,d)),i.outline.render(i)),Te.label=10;case 10:return i.currentMode!=="sv"&&(we=(0,y.F9)((0,q.zh)(i).startContainer),we&&(de=(0,q.zh)(i),i[i.currentMode].element.querySelectorAll("wbr").forEach(function($e){$e.remove()}),de.insertNode(document.createElement("wbr")),i.currentMode==="wysiwyg"?we.outerHTML=i.lute.SpinVditorDOM(we.outerHTML):we.outerHTML=i.lute.SpinVditorIRDOM(we.outerHTML),(0,q.ib)(i[i.currentMode].element,de)),i[i.currentMode].element.querySelectorAll(".vditor-".concat(i.currentMode,"__preview[data-render='2']")).forEach(function($e){tt($e,i)})),i.wysiwyg.triggerRemoveComment(i),lt(i),i[i.currentMode].element.scrollHeight-_>Math.min(i[i.currentMode].element.clientHeight,window.innerHeight)/2&&Z(i),[2]}})})},gu=function(i,a,s){return xs(void 0,void 0,void 0,function(){var u,d,f,E,L,D,_,B,K,ke,fe,ve,ue,ke,we,de;return ks(this,function(Ie){switch(Ie.label){case 0:if(!s)return[2];if(u=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,d=new RegExp("(?:("+u.source+"))([\\da-fA-F\\s]+)\\}","g"),f=s.match(d),E=[],f)for(L=0,D=f;L<D.length;L++)_=D[L],B=void 0,_.includes("\\pngblip")?B="image/png":_.includes("\\jpegblip")&&(B="image/jpeg"),B&&E.push({hex:_.replace(u,"").replace(/[^\da-fA-F]/g,""),type:B});for(K=[],vo(a,function(Te){if(Te.tagName==="V:SHAPE")return vo(Te,function($e){$e.tagName==="V:IMAGEDATA"&&K.push({shape:Te,img:$e})}),!1}),ke=0;ke<K.length;ke++)fe=document.createElement("img"),ve="data:"+E[ke].type+";base64,"+btoa((E[ke].hex.match(/\w{2}/g)||[]).map(function(Te){return String.fromCharCode(parseInt(Te,16))}).join("")),fe.src=ve,fe.title=K[ke].img.getAttribute("title"),K[ke].shape.parentNode.replaceChild(fe,K[ke].shape);ue=a.querySelectorAll("img"),ke=0,Ie.label=1;case 1:return ke<ue.length?(we=ue[ke].src||"",we?(de=ue[ke],[4,i.options.upload.base64ToLink(we)]):[3,3]):[3,4];case 2:de.src=Ie.sent(),Ie.label=3;case 3:return ke++,[3,1];case 4:return[2]}})})},vo=function(i,a){var s=a(i);if(s!==!1)for(var u=0;u<i.children.length;u++)vo(i.children[u],a)},qs,js=function(i){var a,s;i.hint.render(i);var u=(0,q.zh)(i).startContainer,d=(0,y.a1)(u,"data-type","code-block-info");if(d)if(d.textContent.replace(c.g.ZWSP,"")===""&&i.hint.recentLanguage){d.textContent=c.g.ZWSP+i.hint.recentLanguage;var f=(0,q.zh)(i);f.selectNodeContents(d)}else{var E=[],L=d.textContent.substring(0,(0,q.im)(d,i.ir.element).start).replace(c.g.ZWSP,"");(i.options.preview.hljs.langs||c.g.ALIAS_CODE_LANGUAGES.concat(((s=(a=window.hljs)===null||a===void 0?void 0:a.listLanguages())!==null&&s!==void 0?s:[]).sort())).forEach(function(D){D.indexOf(L.toLowerCase())>-1&&E.push({html:D,value:D})}),i.hint.genHTML(E,L,i)}},Xn=function(i,a){a===void 0&&(a={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),a.enableHint&&js(i),clearTimeout(i.ir.processTimeoutId),i.ir.processTimeoutId=window.setTimeout(function(){if(!i.ir.composingLock){var s=v(i);typeof i.options.input=="function"&&a.enableInput&&i.options.input(s),i.options.counter.enable&&i.counter.render(i,s),i.options.cache.enable&&(0,m.pK)()&&(localStorage.setItem(i.options.cache.id,s),i.options.cache.after&&i.options.cache.after(s)),i.devtools&&i.devtools.renderEchart(i),a.enableAddUndoStack&&i.undo.addToUndoStack(i)}},i.options.undoDelay)},fi=function(i,a){var s=(0,q.zh)(i),u=(0,y.F9)(s.startContainer)||s.startContainer;if(u){var d=u.querySelector(".vditor-ir__marker--heading");d?d.innerHTML=a:(u.insertAdjacentText("afterbegin",a),s.selectNodeContents(u),s.collapse(!
|
|||
|
|
</p>`;K.innerHTML.trim()===""?K.outerHTML=fe:K.insertAdjacentHTML("afterend",fe)}}else if(f==="quote")K&&(d.insertNode(document.createElement("wbr")),K.outerHTML='<blockquote data-block="0">'.concat(K.outerHTML,"</blockquote>"),L=!1,a.classList.add("vditor-menu--current"));else if(f==="link"){var ve=void 0;d.toString()===""?ve="".concat(s,"<wbr>").concat(u):ve="".concat(s).concat(d.toString()).concat(u.replace(")","<wbr>)")),document.execCommand("insertHTML",!1,ve),L=!1,a.classList.add("vditor-menu--current")}else if(f==="italic"||f==="bold"||f==="strike"||f==="inline-code"||f==="code"||f==="table"){var ve=void 0;d.toString()===""?ve="".concat(s,"<wbr>").concat(u):(f==="code"?ve="".concat(s,`
|
|||
|
|
`).concat(d.toString(),"<wbr>").concat(u):f==="table"?ve="".concat(s).concat(d.toString(),"<wbr>").concat(u):ve="".concat(s).concat(d.toString()).concat(u,"<wbr>"),d.deleteContents()),(f==="table"||f==="code")&&(ve=`
|
|||
|
|
`+ve+`
|
|||
|
|
|
|||
|
|
`);var ue=document.createElement("span");ue.innerHTML=ve,d.insertNode(ue),Nt(i,d),f==="table"&&(d.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,q.Hc)(d))}else(f==="check"||f==="list"||f==="ordered-list")&&(Ji(i,d,f,!1),L=!1,x(i.toolbar.elements,["check","list","ordered-list"]),a.classList.add("vditor-menu--current"))}(0,q.ib)(i.ir.element,d),Xn(i),L&&qe(i)},bu=function(i,a,s,u){function d(f){return f instanceof s?f:new s(function(E){E(f)})}return new(s||(s=Promise))(function(f,E){function L(B){try{_(u.next(B))}catch(K){E(K)}}function D(B){try{_(u.throw(B))}catch(K){E(K)}}function _(B){B.done?f(B.value):d(B.value).then(L,D)}_((u=u.apply(i,a||[])).next())})},yu=function(i,a){var s={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},u,d,f,E;return E={next:L(0),throw:L(1),return:L(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function L(_){return function(B){return D([_,B])}}function D(_){if(u)throw new TypeError("Generator is already executing.");for(;E&&(E=0,_[0]&&(s=0)),s;)try{if(u=1,d&&(f=_[0]&2?d.return:_[0]?d.throw||((f=d.return)&&f.call(d),0):d.next)&&!(f=f.call(d,_[1])).done)return f;switch(d=0,f&&(_=[_[0]&2,f.value]),_[0]){case 0:case 1:f=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,d=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(f=s.trys,!(f=f.length>0&&f[f.length-1])&&(_[0]===6||_[0]===2)){s=0;continue}if(_[0]===3&&(!f||_[1]>f[0]&&_[1]<f[3])){s.label=_[1];break}if(_[0]===6&&s.label<f[1]){s.label=f[1],f=_;break}if(f&&s.label<f[2]){s.label=f[2],s.ops.push(_);break}f[2]&&s.ops.pop(),s.trys.pop();continue}_=a.call(i,s)}catch(B){_=[6,B],d=0}finally{u=f=0}if(_[0]&5)throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}},wu=function(){function i(a){var s=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(u,d){s.element.style.display="none";var f=decodeURIComponent(u.getAttribute("data-value")),E=window.getSelection().getRangeAt(0);if(d.currentMode==="ir"){var L=(0,y.a1)(E.startContainer,"data-type","code-block-info");if(L){L.textContent=c.g.ZWSP+f.trimRight(),E.selectNodeContents(L),E.collapse(!1),Xn(d),L.parentElement.querySelectorAll("code").forEach(function(K){K.className="language-"+f.trimRight()}),tt(L.parentElement.querySelector(".vditor-ir__preview"),d),s.recentLanguage=f.trimRight();return}}if(d.currentMode==="wysiwyg"&&E.startContainer.nodeType!==3){var D=E.startContainer,_=void 0;if(D.classList.contains("vditor-input")?_=D:_=D.firstElementChild,_&&_.classList.contains("vditor-input")){_.value=f.trimRight(),E.selectNodeContents(_),E.collapse(!1),_.dispatchEvent(new CustomEvent("input",{detail:1})),s.recentLanguage=f.trimRight();return}}if(E.setStart(E.startContainer,s.lastIndex),E.deleteContents(),d.options.hint.parse?d.currentMode==="sv"?(0,q.oC)(d.lute.SpinVditorSVDOM(f),d):d.currentMode==="wysiwyg"?(0,q.oC)(d.lute.SpinVditorDOM(f),d):(0,q.oC)(d.lute.SpinVditorIRDOM(f),d):(0,q.oC)(f,d),s.splitChar===":"&&f.indexOf(":")>-1&&d.currentMode!=="sv"&&E.insertNode(document.createTextNode(" ")),E.collapse(!1),(0,q.Hc)(E),d.currentMode==="wysiwyg"){var B=(0,y.fb)(E.startContainer,"vditor-wysiwyg__block");B&&B.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(B.lastElementChild.innerHTML=B.firstElementChild.innerHTML,tt(B.lastElementChild,d))}else if(d.currentMode==="ir"){var B=(0,y.fb)(E.startContainer,"vditor-ir__marker--pre");B&&B.nextElementSibling.classList.contains("vditor-ir__preview")&&(B.nextElementSibling.innerHTML=B.innerHTML,tt(B.nextElementSibling,d))}lt(d)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",a.push({key:":"})}return i.prototype.render=function(a){var s=this;if(window.getSelection().focusNode){var u,d=getSelection().getRangeAt(0);u=d.startContainer.textContent.substring(0,d.startOffset)||"";var f=this.getKey(u,a.options.hint.extend);if(typeof f>"u")this.element.style.display="none",clearTimeout(this.timeId);else if(this.splitChar===":"){var E=f===""?a.options.
|
|||
|
|
`).concat(fe===0?"class='vditor-hint--current'":"","> ").concat(ve,"</button>")}}),this.element.innerHTML=_;var B=parseInt(document.defaultView.getComputedStyle(f,null).getPropertyValue("line-height"),10);this.element.style.top="".concat(D+(B||22),"px"),this.element.style.left="".concat(L,"px"),this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(K){K.addEventListener("click",function(fe){d.fillEmoji(K,u),fe.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top="".concat(D-this.element.offsetHeight,"px")),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")},i.prototype.select=function(a,s){if(this.element.querySelectorAll("button").length===0||this.element.style.display==="none")return!1;var u=this.element.querySelector(".vditor-hint--current");if(a.key==="ArrowDown")return a.preventDefault(),a.stopPropagation(),u.removeAttribute("class"),u.nextElementSibling?u.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if(a.key==="ArrowUp"){if(a.preventDefault(),a.stopPropagation(),u.removeAttribute("class"),u.previousElementSibling)u.previousElementSibling.className="vditor-hint--current";else{var d=this.element.children.length;this.element.children[d-1].className="vditor-hint--current"}return!0}else if(!(0,m.yl)(a)&&!a.shiftKey&&!a.altKey&&a.key==="Enter"&&!a.isComposing)return a.preventDefault(),a.stopPropagation(),this.fillEmoji(u,s),!0;return!1},i.prototype.getKey=function(a,s){var u=this;this.lastIndex=-1,this.splitChar="",s.forEach(function(_){var B=a.lastIndexOf(_.key);u.lastIndex<B&&(u.splitChar=_.key,u.lastIndex=B)});var d;if(this.lastIndex===-1)return d;var f=a.split(this.splitChar),E=f[f.length-1],L=32;if(f.length>1&&E.trim()===E)if(f.length===2&&f[0]===""&&f[1].length<L)d=f[1];else{var D=f[f.length-2].slice(-1);(0,p.X)(D)===" "&&E.length<L&&(d=E)}return d},i}(),xu=function(){function i(a){this.composingLock=!1;var s=document.createElement("div");s.className="vditor-ir",s.innerHTML='<pre class="vditor-reset" placeholder="'.concat(a.options.placeholder,`"
|
|||
|
|
contenteditable="true" spellcheck="false"></pre>`),this.element=s.firstElementChild,this.bindEvent(a),Ai(a,this.element),ho(a,this.element),Mi(a,this.element),xe(a,this.element),He(a,this.element),Ci(a,this.element),U(a,this.element,this.copy),Q(a,this.element,this.copy)}return i.prototype.copy=function(a,s){var u=getSelection().getRangeAt(0);if(u.toString()!==""){a.stopPropagation(),a.preventDefault();var d=document.createElement("div");d.appendChild(u.cloneContents()),a.clipboardData.setData("text/plain",s.lute.VditorIRDOM2Md(d.innerHTML).trim()),a.clipboardData.setData("text/html","")}},i.prototype.bindEvent=function(a){var s=this;this.element.addEventListener("paste",function(u){ta(a,u,{pasteCode:function(d){document.execCommand("insertHTML",!1,d)}})}),this.element.addEventListener("scroll",function(){A(a,["hint"])}),this.element.addEventListener("compositionstart",function(u){s.composingLock=!0}),this.element.addEventListener("compositionend",function(u){(0,m.vU)()||Nt(a,getSelection().getRangeAt(0).cloneRange()),s.composingLock=!1}),this.element.addEventListener("input",function(u){if(!(u.inputType==="deleteByDrag"||u.inputType==="insertFromDrop")){if(s.preventInput){s.preventInput=!1,Xn(a,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0});return}s.composingLock||u.data==="‘"||u.data==="“"||u.data==="《"||Nt(a,getSelection().getRangeAt(0).cloneRange(),!1,u)}}),this.element.addEventListener("click",function(u){if(u.target.tagName==="INPUT"){u.target.checked?u.target.setAttribute("checked","checked"):u.target.removeAttribute("checked"),s.preventInput=!0,Xn(a);return}var d=(0,q.zh)(a),f=(0,y.fb)(u.target,"vditor-ir__preview");if(f||(f=(0,y.fb)(d.startContainer,"vditor-ir__preview")),f&&(f.previousElementSibling.firstElementChild?d.selectNodeContents(f.previousElementSibling.firstElementChild):d.selectNodeContents(f.previousElementSibling),d.collapse(!0),(0,q.Hc)(d),Z(a)),u.target.tagName==="IMG"){var E=u.target.parentElement.querySelector(".vditor-ir__marker--link");E&&(d.selectNode(E),(0,q.Hc)(d))}var L=(0,y.a1)(u.target,"data-type","a");if(L&&!L.classList.contains("vditor-ir__node--expand")){a.options.link.click?a.options.link.click(L.querySelector(":scope > .vditor-ir__marker--link")):a.options.link.isOpen&&window.open(L.querySelector(":scope > .vditor-ir__marker--link").textContent);return}if(u.target.isEqualNode(s.element)&&s.element.lastElementChild&&d.collapsed){var D=s.element.lastElementChild.getBoundingClientRect();u.y>D.top+D.height&&(s.element.lastElementChild.tagName==="P"&&s.element.lastElementChild.textContent.trim().replace(c.g.ZWSP,"")===""?(d.selectNodeContents(s.element.lastElementChild),d.collapse(!1)):(s.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,q.ib)(s.element,d)))}d.toString()===""?ee(d,a):setTimeout(function(){ee((0,q.zh)(a),a)}),Rt(u,a),qe(a)}),this.element.addEventListener("keyup",function(u){if(!(u.isComposing||(0,m.yl)(u))){if(u.key==="Enter"&&Z(a),qe(a),(u.key==="Backspace"||u.key==="Delete")&&a.ir.element.innerHTML!==""&&a.ir.element.childNodes.length===1&&a.ir.element.firstElementChild&&a.ir.element.firstElementChild.tagName==="P"&&a.ir.element.firstElementChild.childElementCount===0&&(a.ir.element.textContent===""||a.ir.element.textContent===`
|
|||
|
|
`)){a.ir.element.innerHTML="";return}var d=(0,q.zh)(a);u.key==="Backspace"?((0,m.vU)()&&d.startContainer.textContent===`
|
|||
|
|
`&&d.startOffset===1&&(d.startContainer.textContent="",ee(d,a)),s.element.querySelectorAll(".language-math").forEach(function(E){var L=E.querySelector("br");L&&L.remove()})):u.key.indexOf("Arrow")>-1?((u.key==="ArrowLeft"||u.key==="ArrowRight")&&js(a),ee(d,a)):u.keyCode===229&&u.code===""&&u.key==="Unidentified"&&ee(d,a);var f=(0,y.fb)(d.startContainer,"vditor-ir__preview");if(f){if(u.key==="ArrowUp"||u.key==="ArrowLeft")return f.previousElementSibling.firstElementChild?d.selectNodeContents(f.previousElementSibling.firstElementChild):d.selectNodeContents(f.previousElementSibling),d.collapse(!1),u.preventDefault(),!0;if(f.tagName==="SPAN"&&(u.key==="ArrowDown"||u.key==="ArrowRight"))return f.parentElement.getAttribute("data-type")==="html-entity"?(f.parentElement.insertAdjacentText("afterend",c.g.ZWSP),d.setStart(f.parentElement.nextSibling,1)):d.selectNodeContents(f.parentElement.lastElementChild),d.collapse(!1),u.preventDefault(),!0}}})},i}(),$s=function(i){if(i.currentMode==="sv")return i.lute.Md2HTML(v(i));if(i.currentMode==="wysiwyg")return i.lute.VditorDOM2HTML(i.wysiwyg.element.innerHTML);if(i.currentMode==="ir")return i.lute.VditorIRDOM2HTML(i.ir.element.innerHTML)},ku=o(214),Us=o(436),Su=function(){function i(a){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'.concat(a,`</div>
|
|||
|
|
<div class="vditor-outline__content"></div>`)}return i.prototype.render=function(a){var s="";return a.preview.element.style.display==="block"?s=(0,Us.k)(a.preview.previewElement,this.element.lastElementChild,a):s=(0,Us.k)(a[a.currentMode].element,this.element.lastElementChild,a),s},i.prototype.toggle=function(a,s,u){var d;s===void 0&&(s=!0),u===void 0&&(u=!0);var f=(d=a.toolbar.elements.outline)===null||d===void 0?void 0:d.firstElementChild;if(s&&window.innerWidth>=c.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(a),f==null||f.classList.add("vditor-menu--current")):(this.element.style.display="none",f==null||f.classList.remove("vditor-menu--current")),u&&getSelection().rangeCount>0){var E=getSelection().getRangeAt(0);a[a.currentMode].element.contains(E.startContainer)&&(0,q.Hc)(E)}ze(a)},i}(),Eu=o(280),Tu=function(){function i(a){var s=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",a.options.classes.preview&&this.previewElement.classList.add(a.options.classes.preview),this.previewElement.style.maxWidth=a.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(D){if(D.target.tagName!=="TEXTAREA"){var _=document.createElement("div");_.className="vditor-reset",_.appendChild(getSelection().getRangeAt(0).cloneContents()),s.copyToX(a,_,"default"),D.preventDefault()}}),this.previewElement.addEventListener("click",function(D){var _=(0,y.lG)(D.target,"SPAN");if(_&&(0,y.fb)(_,"vditor-toc")){var B=s.previewElement.querySelector("#"+_.getAttribute("data-target-id"));B&&(s.element.scrollTop=B.offsetTop);return}if(D.target.tagName==="A"){a.options.link.click?a.options.link.click(D.target):a.options.link.isOpen&&window.open(D.target.getAttribute("href")),D.preventDefault();return}D.target.tagName==="IMG"&&(a.options.image.preview?a.options.image.preview(D.target):a.options.image.isPreview&&(0,se.E)(D.target,a.options.lang,a.options.theme))}),this.element.appendChild(this.previewElement);var u=a.options.preview.actions;if(u.length!==0){var d=document.createElement("div");d.className="vditor-preview__action";for(var f=[],E=0;E<u.length;E++){var L=u[E];if(typeof L=="object"){f.push('<button type="button" data-type="'.concat(L.key,'" class="').concat(L.className,'"').concat(L.tooltip?' aria-label="'.concat(L.tooltip,'"'):"",'">').concat(L.text,"</button>"));continue}switch(L){case"desktop":f.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":f.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":f.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":f.push('<button type="button" data-type="mp-wechat" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到公众号"><svg><use xlink:href="#vditor-icon-mp-wechat"></use></svg></button>');break;case"zhihu":f.push('<button type="button" data-type="zhihu" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到知乎"><svg><use xlink:href="#vditor-icon-zhihu"></use></svg></button>');break}}d.innerHTML=f.join(""),d.addEventListener((0,m.Le)(),function(D){var _=(0,N.S)(D.target,"BUTTON");if(_){var B=_.getAttribute("data-type"),K=u.find(function(fe){return(fe==null?void 0:fe.key)===B});if(K){K.click(B);return}if(B==="mp-wechat"||B==="zhihu"){s.copyToX(a,s.previewElement.cloneNode(!0),B);return}B==="desktop"?s.previewElement.style.width="auto":B==="tablet"?s.previewElement.style.width="780px":s.previewElement.style.width="360px",s.previewElement.scrollWidth>s.previewElement.parentElement.clientWidth&&(s.previewElement.style.width="auto"),s.render(a),d.querySelectorAll("button").forEach(function(fe){fe.classList.remove("vditor-preview__action--current")}),_.classList.add("vditor-preview__action--current")}}),this.element.insertBefore(d,this.previewElement)}}return i.prototype.render=function(a,s){var u=this;if(clearTimeout(this.mdTimeoutId),this.element.st
|
|||
|
|
`)){a.sv.element.innerHTML="";return}u.key==="Enter"&&Z(a)}})},i}(),Vs=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return i.prototype.show=function(a,s){var u=this;s===void 0&&(s=6e3),this.element.className="vditor-tip vditor-tip--show",s===0?(this.element.innerHTML='<div class="vditor-tip__content">'.concat(a,`
|
|||
|
|
<div class="vditor-tip__close">X</div></div>`),this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){u.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'.concat(a,"</div>"),setTimeout(function(){u.hide()},s)),this.element.removeAttribute("style"),setTimeout(function(){var d=u.element.getBoundingClientRect();d.top<46&&(u.element.style.position="fixed",u.element.style.top="46px")},150)},i.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},i}(),bo=function(i,a){if(a.options.preview.mode!==i){switch(a.options.preview.mode=i,i){case"both":a.sv.element.style.display="block",a.preview.element.style.display="block",a.preview.render(a),w(a.toolbar.elements,["both"]);break;case"editor":a.sv.element.style.display="block",a.preview.element.style.display="none",x(a.toolbar.elements,["both"]);break}a.devtools&&a.devtools.renderEchart(a)}},Cu=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Lu=function(i){Cu(a,i);function a(s,u){var d=i.call(this,s,u)||this;return s.options.preview.mode==="both"&&d.element.children[0].classList.add("vditor-menu--current"),d.element.children[0].addEventListener((0,m.Le)(),function(f){var E=d.element.firstElementChild;E.classList.contains(c.g.CLASS_MENU_DISABLED)||(f.preventDefault(),s.currentMode==="sv"&&(s.options.preview.mode==="both"?bo("editor",s):bo("both",s)))}),d}return a}(Mt),_u=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"}return i}(),Ws=o(580),Nu=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Du=function(i){Nu(a,i);function a(s,u){var d=i.call(this,s,u)||this,f=d.element.children[0],E=document.createElement("div");E.className="vditor-hint".concat(u.level===2?"":" vditor-panel--arrow");var L="";return c.g.CODE_THEME.forEach(function(D){L+="<button>".concat(D,"</button>")}),E.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(L,"</div>"),E.addEventListener((0,m.Le)(),function(D){D.target.tagName==="BUTTON"&&(A(s,["subToolbar"]),s.options.preview.hljs.style=D.target.textContent,(0,Ws.Y)(D.target.textContent,s.options.cdn),D.preventDefault(),D.stopPropagation())}),d.element.appendChild(E),M(s,E,f,u.level),d}return a}(Mt),Ru=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Iu=function(i){Ru(a,i);function a(s,u){var d=i.call(this,s,u)||this,f=d.element.children[0],E=document.createElement("div");E.className="vditor-hint".concat(u.level===2?"":" vditor-panel--arrow");var L="";return Object.keys(s.options.preview.theme.list).forEach(function(D){L+='<button data-type="'.concat(D,'">').concat(s.options.preview.theme.list[D],"</button>")}),E.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(L,"</div>"),E.add
|
|||
|
|
`)?s.length-1:s.length;if(a.options.counter.type==="text"&&a[a.currentMode]){var d=a[a.currentMode].element.cloneNode(!0);d.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(f){f.remove()}),u=d.textContent.length}typeof a.options.counter.max=="number"?(u>a.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML="".concat(u,"/").concat(a.options.counter.max)):this.element.innerHTML="".concat(u),this.element.setAttribute("aria-label",a.options.counter.type),a.options.counter.after&&a.options.counter.after(u,{enable:a.options.counter.enable,max:a.options.counter.max,type:a.options.counter.type})},i}(),Hu=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Pu=function(i){Hu(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].innerHTML=u.icon,d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),!f.currentTarget.classList.contains(c.g.CLASS_MENU_DISABLED)&&u.click(f,s)}),d}return a}(Mt),zu=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Bu=function(i){zu(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.firstElementChild.addEventListener((0,m.Le)(),function(f){var E=d.element.firstElementChild;E.classList.contains(c.g.CLASS_MENU_DISABLED)||(f.preventDefault(),E.classList.contains("vditor-menu--current")?(E.classList.remove("vditor-menu--current"),s.devtools.element.style.display="none",ze(s)):(E.classList.add("vditor-menu--current"),s.devtools.element.style.display="block",ze(s),s.devtools.renderEchart(s)))}),d}return a}(Mt),Fu=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"}return i}(),qu=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),ju=function(i){qu(a,i);function a(s,u){var d=i.call(this,s,u)||this,f=document.createElement("div");f.className="vditor-panel vditor-panel--arrow";var E="";return Object.keys(s.options.hint.emoji).forEach(function(L){var D=s.options.hint.emoji[L];D.indexOf(".")>-1?E+='<button data-value=":'.concat(L,': " data-key=":').concat(L,`:"><img
|
|||
|
|
data-value=":`).concat(L,': " data-key=":').concat(L,':" class="vditor-emojis__icon" src="').concat(D,'"/></button>'):E+='<button data-value="'.concat(D,` "
|
|||
|
|
data-key="`).concat(L,'"><span class="vditor-emojis__icon">').concat(D,"</span></button>")}),f.innerHTML='<div class="vditor-emojis" style="max-height: '.concat(s.options.height==="auto"?"auto":s.options.height-80,'px">').concat(E,`</div><div class="vditor-emojis__tail">
|
|||
|
|
<span class="vditor-emojis__tip"></span><span>`).concat(s.options.hint.emojiTail||"",`</span>
|
|||
|
|
</div>`),d.element.appendChild(f),M(s,f,d.element.firstElementChild,u.level),d.bindEvent(s),d}return a.prototype.bindEvent=function(s){var u=this;this.element.lastElementChild.addEventListener((0,m.Le)(),function(d){var f=(0,N.S)(d.target,"BUTTON");if(f){d.preventDefault();var E=f.getAttribute("data-value"),L=(0,q.zh)(s),D=E;if(s.currentMode==="wysiwyg"?D=s.lute.SpinVditorDOM(E):s.currentMode==="ir"&&(D=s.lute.SpinVditorIRDOM(E)),E.indexOf(":")>-1&&s.currentMode!=="sv"){var _=document.createElement("div");_.innerHTML=D,D=_.firstElementChild.firstElementChild.outerHTML+" ",(0,q.oC)(D,s)}else L.extractContents(),L.insertNode(document.createTextNode(E)),(0,y.F9)(L.startContainer)||Pn(s,L);L.collapse(!1),(0,q.Hc)(L),u.element.lastElementChild.style.display="none",lt(s)}}),this.element.lastElementChild.addEventListener("mouseover",function(d){var f=(0,N.S)(d.target,"BUTTON");f&&(u.element.querySelector(".vditor-emojis__tip").innerHTML=f.getAttribute("data-key"))})},a}(Mt),Gs=function(i,a,s){var u=document.createElement("a");"download"in u?(u.download=s,u.style.display="none",u.href=URL.createObjectURL(new Blob([a])),document.body.appendChild(u),u.click(),u.remove()):i.tip.show(window.VditorI18n.downloadTip,0)},$u=function(i){var a=v(i);Gs(i,a,a.substr(0,10)+".md")},Uu=function(i){i.tip.show(window.VditorI18n.generate,3800);var a=document.querySelector("#vditorExportIframe");a.contentDocument.open(),a.contentDocument.write('<link rel="stylesheet" href="'.concat(i.options.cdn,`/dist/index.css"/>
|
|||
|
|
<script src="`).concat(i.options.cdn,`/dist/method.min.js"><\/script>
|
|||
|
|
<div id="preview" style="width: 800px"></div>
|
|||
|
|
<script>
|
|||
|
|
window.addEventListener("message", (e) => {
|
|||
|
|
if(!e.data) {
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
Vditor.preview(document.getElementById('preview'), e.data, {
|
|||
|
|
cdn: "`).concat(i.options.cdn,`",
|
|||
|
|
markdown: {
|
|||
|
|
theme: `).concat(JSON.stringify(i.options.preview.theme),`
|
|||
|
|
},
|
|||
|
|
hljs: {
|
|||
|
|
style: "`).concat(i.options.preview.hljs.style,`"
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
setTimeout(() => {
|
|||
|
|
window.print();
|
|||
|
|
}, 3600);
|
|||
|
|
}, false);
|
|||
|
|
<\/script>`)),a.contentDocument.close(),setTimeout(function(){a.contentWindow.postMessage(v(i),"*")},200)},Vu=function(i){var a=$s(i),s='<html><head><link rel="stylesheet" type="text/css" href="'.concat(i.options.cdn,`/dist/index.css"/>
|
|||
|
|
<script src="`).concat(i.options.cdn,"/dist/js/i18n/").concat(i.options.lang,`.js"><\/script>
|
|||
|
|
<script src="`).concat(i.options.cdn,`/dist/method.min.js"><\/script></head>
|
|||
|
|
<body><div class="vditor-reset" id="preview">`).concat(a,`</div>
|
|||
|
|
<script>
|
|||
|
|
const previewElement = document.getElementById('preview')
|
|||
|
|
Vditor.setContentTheme('`).concat(i.options.preview.theme.current,"', '").concat(i.options.preview.theme.path,`');
|
|||
|
|
Vditor.codeRender(previewElement);
|
|||
|
|
Vditor.highlightRender(`).concat(JSON.stringify(i.options.preview.hljs),", previewElement, '").concat(i.options.cdn,`');
|
|||
|
|
Vditor.mathRender(previewElement, {
|
|||
|
|
cdn: '`).concat(i.options.cdn,`',
|
|||
|
|
math: `).concat(JSON.stringify(i.options.preview.math),`,
|
|||
|
|
});
|
|||
|
|
Vditor.mermaidRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.SMILESRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.markmapRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
Vditor.flowchartRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
Vditor.graphvizRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
Vditor.chartRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.mindmapRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.abcRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
`).concat(i.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"",`
|
|||
|
|
Vditor.speechRender(previewElement);
|
|||
|
|
<\/script>
|
|||
|
|
<script src="`).concat(i.options.cdn,"/dist/js/icons/").concat(i.options.icon,'.js"><\/script></body></html>');Gs(i,s,a.substr(0,10)+".html")},Wu=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Gu=function(i){Wu(a,i);function a(s,u){var d=i.call(this,s,u)||this,f=d.element.children[0],E=document.createElement("div");return E.className="vditor-hint".concat(u.level===2?"":" vditor-panel--arrow"),E.innerHTML=`<button data-type="markdown">Markdown</button>
|
|||
|
|
<button data-type="pdf">PDF</button>
|
|||
|
|
<button data-type="html">HTML</button>`,E.addEventListener((0,m.Le)(),function(L){var D=L.target;if(D.tagName==="BUTTON"){switch(D.getAttribute("data-type")){case"markdown":$u(s);break;case"pdf":Uu(s);break;case"html":Vu(s);break}A(s,["subToolbar"]),L.preventDefault(),L.stopPropagation()}}),d.element.appendChild(E),M(s,E,f,u.level),d}return a}(Mt),Ku=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Xu=function(i){Ku(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d._bindEvent(s,u),d}return a.prototype._bindEvent=function(s,u){this.element.children[0].addEventListener((0,m.Le)(),function(d){d.preventDefault(),s.element.className.includes("vditor--fullscreen")?(u.level||(this.innerHTML=u.icon),s.element.style.zIndex="",document.body.style.overflow="",s.element.classList.remove("vditor--fullscreen"),Object.keys(s.toolbar.elements).forEach(function(f){var E=s.toolbar.elements[f].firstChild;E&&(E.className=E.className.replace("__s","__n"),s.options.toolbar.forEach(function(L){typeof L!="string"&&L.tipPosition&&L.name===E.dataset.type&&(E.className="vditor-tooltipped vditor-tooltipped__".concat(L.tipPosition))}))}),s.counter&&(s.counter.element.className=s.counter.element.className.replace("__s","__n"))):(u.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),s.element.style.zIndex=s.options.fullscreen.index.toString(),document.body.style.overflow="hidden",s.element.classList.add("vditor--fullscreen"),Object.keys(s.toolbar.elements).forEach(function(f){var E=s.toolbar.elements[f].firstChild;E&&(E.className=E.className.replace("__n","__s"))}),s.counter&&(s.counter.element.className=s.counter.element.className.replace("__n","__s"))),s.devtools&&s.devtools.renderEchart(s),u.click&&u.click(d,s),ze(s),Xe(s)})},a}(Mt),Zu=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Yu=function(i){Zu(a,i);function a(s,u){var d=i.call(this,s,u)||this,f=document.createElement("div");return f.className="vditor-hint vditor-panel--arrow",f.innerHTML='<button data-tag="h1" data-value="# ">'.concat(window.VditorI18n.heading1," ").concat((0,m.ns)("<⌥⌘1>"),`</button>
|
|||
|
|
<button data-tag="h2" data-value="## ">`).concat(window.VditorI18n.heading2," <").concat((0,m.ns)("⌥⌘2"),`></button>
|
|||
|
|
<button data-tag="h3" data-value="### ">`).concat(window.VditorI18n.heading3," <").concat((0,m.ns)("⌥⌘3"),`></button>
|
|||
|
|
<button data-tag="h4" data-value="#### ">`).concat(window.VditorI18n.heading4," <").concat((0,m.ns)("⌥⌘4"),`></button>
|
|||
|
|
<button data-tag="h5" data-value="##### ">`).concat(window.VditorI18n.heading5," <").concat((0,m.ns)("⌥⌘5"),`></button>
|
|||
|
|
<button data-tag="h6" data-value="###### ">`).concat(window.VditorI18n.heading6," <").concat((0,m.ns)("⌥⌘6"),"></button>"),d.element.appendChild(f),d._bindEvent(s,f),d}return a.prototype._bindEvent=function(s,u){var d=this.element.children[0];d.addEventListener((0,m.Le)(),function(E){E.preventDefault(),clearTimeout(s.wysiwyg.afterRenderTimeoutId),clearTimeout(s.ir.processTimeoutId),clearTimeout(s.sv.processTimeoutId),!d.classList.contains(c.g.CLASS_MENU_DISABLED)&&(d.blur(),d.classList.contains("vditor-menu--current")?(s.currentMode==="wysiwyg"?(lr(s),Re(s)):s.currentMode==="ir"&&fi(s,""),d.classList.remove("vditor-menu--current")):(A(s,["subToolbar"]),u.style.display="block"))});for(var f=0;f<6;f++)u.children.item(f).addEventListener((0,m.Le)(),function(E){E.preventDefault(),s.currentMode==="wysiwyg"?(kn(s,E.target.getAttribute("data-tag")),Re(s),d.classList.add("vditor-menu--current")):s.currentMode==="ir"?(fi(s,E.target.getAttribute("data-value")),d.classList.add("vditor-menu--current")):Ct(s,E.target.getAttribute("data-value")),u.style.display="none"})},a}(Mt),Ju=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Qu=function(i){Ju(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),s.tip.show(`<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">
|
|||
|
|
<div style="margin-top: 14px;flex: 1">
|
|||
|
|
<div>Markdown 使用指南</div>
|
|||
|
|
<ul style="list-style: none">
|
|||
|
|
<li><a href="https://ld246.com/article/1583308420519" target="_blank">语法速查手册</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1583129520165" target="_blank">基础语法</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1583305480675" target="_blank">扩展语法</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1582778815353" target="_blank">键盘快捷键</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
<div style="margin-top: 14px;flex: 1">
|
|||
|
|
<div>Vditor 支持</div>
|
|||
|
|
<ul style="list-style: none">
|
|||
|
|
<li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>
|
|||
|
|
<li><a href="https://ld246.com/tag/vditor" target="_blank">官方讨论区</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1549638745630" target="_blank">开发手册</a></li>
|
|||
|
|
<li><a href="https://ld246.com/guide/markdown" target="_blank">演示地址</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</div></div>`,0)}),d}return a}(Mt),ed=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),td=function(i){ed(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){if(f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")){var E=(0,q.zh)(s),L=(0,y.lG)(E.startContainer,"LI");L&&Ms(s,L,E)}}),d}return a}(Mt),nd=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),rd=function(i){nd(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),s.tip.show(`<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">
|
|||
|
|
<p style="text-align: center;margin: 14px 0">
|
|||
|
|
<em>下一代的 Markdown 编辑器,为未来而构建</em>
|
|||
|
|
</p>
|
|||
|
|
<div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">
|
|||
|
|
<img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>
|
|||
|
|
<div> </div>
|
|||
|
|
<div style="flex: 1;min-width: 250px">
|
|||
|
|
Vditor 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。
|
|||
|
|
它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div style="display: flex;flex-wrap: wrap;">
|
|||
|
|
<ul style="list-style: none;flex: 1;min-width:148px">
|
|||
|
|
<li>
|
|||
|
|
项目地址:<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>
|
|||
|
|
</li>
|
|||
|
|
<li>
|
|||
|
|
开源协议:MIT
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
<ul style="list-style: none;margin-right: 18px">
|
|||
|
|
<li>
|
|||
|
|
组件版本:Vditor v`.concat(c.H," / Lute v").concat(Lute.Version,`
|
|||
|
|
</li>
|
|||
|
|
<li>
|
|||
|
|
赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
</div>`),0)}),d}return a}(Mt),id=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),ad=function(i){id(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")&&hi(s,"afterend")}),d}return a}(Mt),od=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),sd=function(i){od(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")&&hi(s,"beforebegin")}),d}return a}(Mt),ld=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),cd=function(i){ld(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){if(f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")){var E=(0,q.zh)(s),L=(0,y.lG)(E.startContainer,"LI");L&&po(s,L,E,L.parentElement)}}),d}return a}(Mt),ud=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),dd=function(i){ud(a,i);function a(s,u){var d=i.call(this,s,u)||this;return s.options.outline&&d.element.firstElementChild.classList.add("vditor-menu--current"),d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault();var E=s.toolbar.elements.outline.firstElementChild;E.classList.contains(c.g.CLASS_MENU_DISABLED)||(s.options.outline.enable=!d.element.firstElementChild.classList.contains("vditor-menu--current"),s.outline.toggle(s,s.options.outline.enable))}),d}return a}(Mt),hd=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),pd=function(i){hd(a,i);function a(s,u){var d=i.call(this,s,u)||this;return d._bindEvent(s),d}return a.prototype._bindEvent=function(s){var u=this;this.element.children[0].addEventListener((0,m.Le)(),function(d){d.preventDefault();var f=u.element.first
|
|||
|
|
| --- | --- | --- |
|
|||
|
|
| | | |
|
|||
|
|
| | | |`,tipPosition:"n"},{name:"|"},{hotkey:"⌘Z",icon:'<svg><use xlink:href="#vditor-icon-undo"></use></svg>',name:"undo",tipPosition:"nw"},{hotkey:"⌘Y",icon:'<svg><use xlink:href="#vditor-icon-redo"></use></svg>',name:"redo",tipPosition:"nw"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-more"></use></svg>',name:"more",tipPosition:"e"},{hotkey:"⌘'",icon:'<svg><use xlink:href="#vditor-icon-fullscreen"></use></svg>',name:"fullscreen",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-edit"></use></svg>',name:"edit-mode",tipPosition:"nw"},{hotkey:"⌘P",icon:'<svg><use xlink:href="#vditor-icon-both"></use></svg>',name:"both",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-preview"></use></svg>',name:"preview",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',name:"outline",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-theme"></use></svg>',name:"content-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-code-theme"></use></svg>',name:"code-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-bug"></use></svg>',name:"devtools",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-info"></use></svg>',name:"info",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-help"></use></svg>',name:"help",tipPosition:"nw"},{name:"br"}],d=[];return a.forEach(function(f){var E=f;u.forEach(function(L){typeof f=="string"&&L.name===f&&(E=L),typeof f=="object"&&L.name===f.name&&(E=Object.assign({},L,f))}),f.toolbar&&(E.toolbar=s.mergeToolbar(f.toolbar)),d.push(E)}),d},i}(),Cd=function(){function i(a){var s=this;this.composingLock=!1,this.commentIds=[];var u=document.createElement("div");u.className="vditor-wysiwyg",u.innerHTML='<pre class="vditor-reset" placeholder="'.concat(a.options.placeholder,`"
|
|||
|
|
contenteditable="true" spellcheck="false"></pre>
|
|||
|
|
<div class="vditor-panel vditor-panel--none"></div>
|
|||
|
|
<div class="vditor-panel vditor-panel--none">
|
|||
|
|
<button type="button" aria-label="`).concat(window.VditorI18n.comment,`" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">
|
|||
|
|
<svg><use xlink:href="#vditor-icon-comment"></use></svg>
|
|||
|
|
</button>
|
|||
|
|
</div>`),this.element=u.firstElementChild,this.popover=u.firstElementChild.nextElementSibling,this.selectPopover=u.lastElementChild,this.bindEvent(a),Ai(a,this.element),ho(a,this.element),Mi(a,this.element),xe(a,this.element),He(a,this.element),Ci(a,this.element),U(a,this.element,this.copy),Q(a,this.element,this.copy),a.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var d=Lute.NewNodeID(),f=getSelection().getRangeAt(0),E=f.cloneRange(),L=f.extractContents(),D,_,B=!1,K=!1;L.childNodes.forEach(function(ue,ke){var we=!1;if(ue.nodeType===3?we=!0:ue.classList.contains("vditor-comment")?ue.classList.contains("vditor-comment")&&ue.setAttribute("data-cmtids",ue.getAttribute("data-cmtids")+" "+d):we=!0,we)if(ue.nodeType!==3&&ue.getAttribute("data-block")==="0"&&ke===0&&E.startOffset>0)ue.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(d,'">').concat(ue.innerHTML,"</span>"),D=ue;else if(ue.nodeType!==3&&ue.getAttribute("data-block")==="0"&&ke===L.childNodes.length-1&&E.endOffset<E.endContainer.textContent.length)ue.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(d,'">').concat(ue.innerHTML,"</span>"),_=ue;else if(ue.nodeType!==3&&ue.getAttribute("data-block")==="0")ke===0?B=!0:ke===L.childNodes.length-1&&(K=!0),ue.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(d,'">').concat(ue.innerHTML,"</span>");else{var de=document.createElement("span");de.classList.add("vditor-comment"),de.setAttribute("data-cmtids",d),ue.parentNode.insertBefore(de,ue),de.appendChild(ue)}});var fe=(0,y.F9)(E.startContainer);fe&&(D?(fe.insertAdjacentHTML("beforeend",D.innerHTML),D.remove()):fe.textContent.trim().replace(c.g.ZWSP,"")===""&&B&&fe.remove());var ve=(0,y.F9)(E.endContainer);ve&&(_?(ve.insertAdjacentHTML("afterbegin",_.innerHTML),_.remove()):ve.textContent.trim().replace(c.g.ZWSP,"")===""&&K&&ve.remove()),f.insertNode(L),a.options.comment.add(d,f.toString(),s.getComments(a,!0)),Re(a,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),s.hideComment()})}return i.prototype.getComments=function(a,s){var u=this;if(s===void 0&&(s=!1),a.currentMode==="wysiwyg"&&a.options.comment.enable){this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(f){u.commentIds=u.commentIds.concat(f.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var d=[];if(s)return this.commentIds.forEach(function(f){d.push({id:f,top:u.element.querySelector('.vditor-comment[data-cmtids="'.concat(f,'"]')).offsetTop})}),d}else return[]},i.prototype.triggerRemoveComment=function(a){var s=function(f,E){var L=new Set(E);return f.filter(function(D){return!L.has(D)})};if(a.currentMode==="wysiwyg"&&a.options.comment.enable&&a.wysiwyg.commentIds.length>0){var u=JSON.parse(JSON.stringify(this.commentIds));this.getComments(a);var d=s(u,this.commentIds);d.length>0&&a.options.comment.remove(d)}},i.prototype.showComment=function(){var a=(0,q.Ny)(this.element);this.selectPopover.setAttribute("style","left:".concat(a.left,"px;display:block;top:").concat(Math.max(-8,a.top-21),"px"))},i.prototype.hideComment=function(){this.selectPopover.setAttribute("style","display:none")},i.prototype.unbindListener=function(){window.removeEventListener("scroll",this.scrollListener)},i.prototype.copy=function(a,s){var u=getSelection().getRangeAt(0);if(u.toString()!==""){a.stopPropagation(),a.preventDefault();var d=(0,y.lG)(u.startContainer,"CODE"),f=(0,y.lG)(u.endContainer,"CODE");if(d&&f&&f.isSameNode(d)){var E="";d.parentElement.tagName==="PRE"?E=u.toString():E="`"+u.toString()+"`",a.clipboardData.setData("text/plain",E),a.clipboardData.setData("text/html","");return}var L=(0,y.lG)(u.startContainer,"A"),D=(0,y.lG)(u.endContainer,"A");if(L&&D&&D.isSameNode(L)){var _=L.getAttribute("title")||"";_&&(_=' "'.concat(_,'"')),a.clipboardData.setData("text/plain","[".concat(u.toString(),"](").concat(L.getAttribute("href")).concat(_,")")),a.clipboardData.setData("text/html","");return}var B=document.createElement("div");B.appendChild(u.cloneContents()),a.clipboardData.setD
|
|||
|
|
`);D--)if(f.textContent.charAt(D)!==" "&&f.textContent.charAt(D)!==" "){L=!1;break}E===0&&(L=!1);for(var _=!0,D=E-1;D<f.textContent.length;D++)if(f.textContent.charAt(D)!==" "&&f.textContent.charAt(D)!==`
|
|||
|
|
`){_=!1;break}_&&/^#{1,6} $/.test(f.textContent)&&(_=!1);var B=(0,N.W)(getSelection().getRangeAt(0).startContainer);if(B&&B.textContent===""&&(Ht(a),B.remove()),L&&f.getAttribute("data-type")!=="code-block"||_||mo(f.innerHTML)||fo(f.innerHTML)&&f.previousElementSibling){typeof a.options.input=="function"&&a.options.input(v(a));return}u.inputType==="insertParagraph"&&s.element.innerHTML==="<p><br></p><p><br></p>"&&f.previousElementSibling.remove(),Zr(a,d,u)}}}),this.element.addEventListener("click",function(u){if(u.target.tagName==="INPUT"){var d=u.target;d.checked?d.setAttribute("checked","checked"):d.removeAttribute("checked"),s.preventInput=!0,getSelection().rangeCount>0&&(0,q.Hc)(getSelection().getRangeAt(0)),Re(a);return}if(u.target.tagName==="IMG"&&!u.target.parentElement.classList.contains("vditor-wysiwyg__preview")){u.target.getAttribute("data-type")==="link-ref"?co(a,u.target):di(u,a);return}var f=(0,y.lG)(u.target,"A");if(f){a.options.link.click?a.options.link.click(f):a.options.link.isOpen&&window.open(f.getAttribute("href")),u.preventDefault();return}var E=(0,q.zh)(a);if(u.target.isEqualNode(s.element)&&s.element.lastElementChild&&E.collapsed){var L=s.element.lastElementChild.getBoundingClientRect();u.y>L.top+L.height&&(s.element.lastElementChild.tagName==="P"&&s.element.lastElementChild.textContent.trim().replace(c.g.ZWSP,"")===""?(E.selectNodeContents(s.element.lastElementChild),E.collapse(!1)):(s.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,q.ib)(s.element,E)))}jn(a);var D=(0,y.fb)(u.target,"vditor-wysiwyg__preview");D||(D=(0,y.fb)((0,q.zh)(a).startContainer,"vditor-wysiwyg__preview")),D&&cr(D,a),Rt(u,a)}),this.element.addEventListener("keyup",function(u){if(!(u.isComposing||(0,m.yl)(u))){u.key==="Enter"&&Z(a),(u.key==="Backspace"||u.key==="Delete")&&a.wysiwyg.element.innerHTML!==""&&a.wysiwyg.element.childNodes.length===1&&a.wysiwyg.element.firstElementChild&&a.wysiwyg.element.firstElementChild.tagName==="P"&&a.wysiwyg.element.firstElementChild.childElementCount===0&&(a.wysiwyg.element.textContent===""||a.wysiwyg.element.textContent===`
|
|||
|
|
`)&&(a.wysiwyg.element.innerHTML="");var d=(0,q.zh)(a);if(u.key==="Backspace"&&(0,m.vU)()&&d.startContainer.textContent===`
|
|||
|
|
`&&d.startOffset===1&&(d.startContainer.textContent=""),Pn(a,d),jn(a),!(u.key!=="ArrowDown"&&u.key!=="ArrowRight"&&u.key!=="Backspace"&&u.key!=="ArrowLeft"&&u.key!=="ArrowUp")){(u.key==="ArrowLeft"||u.key==="ArrowRight")&&a.hint.render(a);var f=(0,y.fb)(d.startContainer,"vditor-wysiwyg__preview");if(!f&&d.startContainer.nodeType!==3&&d.startOffset>0){var E=d.startContainer;E.classList.contains("vditor-wysiwyg__block")&&(f=E.lastElementChild)}if(f){var L=f.previousElementSibling;if(L.style.display==="none"){u.key==="ArrowDown"||u.key==="ArrowRight"?cr(f,a):cr(f,a,!1);return}var D=f.previousElementSibling;if(D.tagName==="PRE"&&(D=D.firstElementChild),u.key==="ArrowDown"||u.key==="ArrowRight"){var E=f.parentElement,_=Hn(E);if(_&&_.nodeType!==3){var B=_.querySelector(".vditor-wysiwyg__preview");if(B){cr(B,a);return}}if(_.nodeType===3){for(;_.textContent.length===0&&_.nextSibling;)_=_.nextSibling;d.setStart(_,1)}else d.setStart(_.firstChild,0)}else d.selectNodeContents(D),d.collapse(!1)}}}})},i}(),Ld=function(){var i=function(a,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(a,s)};return function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(a,s);function u(){this.constructor=a}a.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),_d=function(i){Ld(a,i);function a(s,u){var d=i.call(this)||this;if(d.isDestroyed=!1,d.version=c.H,typeof s=="string"){if(u?u.cache?u.cache.id||(u.cache.id="vditor".concat(s)):u.cache={id:"vditor".concat(s)}:u={cache:{id:"vditor".concat(s)}},!document.getElementById(s))return d.showErrorTip("Failed to get element by id: ".concat(s)),d;s=document.getElementById(s)}var f=new Md(u),E=f.merge();if(E.i18n)window.VditorI18n=E.i18n,d.init(s,E);else if(["de_DE","en_US","es_ES","fr_FR","ja_JP","ko_KR","pt_BR","ru_RU","sv_SE","vi_VN","zh_CN","zh_TW"].includes(E.lang)){var L="vditorI18nScript",D=L+E.lang;document.querySelectorAll('head script[id^="'.concat(L,'"]')).forEach(function(_){_.id!==D&&document.head.removeChild(_)}),(0,b.G)("".concat(E.cdn,"/dist/js/i18n/").concat(E.lang,".js"),D).then(function(){d.init(s,E)}).catch(function(_){d.showErrorTip("GET ".concat(E.cdn,"/dist/js/i18n/").concat(E.lang,".js net::ERR_ABORTED 404 (Not Found)"))})}else throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");return d}return a.prototype.showErrorTip=function(s){var u=new Vs;document.body.appendChild(u.element),u.show(s,0)},a.prototype.updateToolbarConfig=function(s){this.vditor.toolbar.updateConfig(this.vditor,s)},a.prototype.setTheme=function(s,u,d,f){this.vditor.options.theme=s,ye(this.vditor),u&&(this.vditor.options.preview.theme.current=u,(0,le.Z)(u,f||this.vditor.options.preview.theme.path)),d&&(this.vditor.options.preview.hljs.style=d,(0,Ws.Y)(d,this.vditor.options.cdn))},a.prototype.getValue=function(){return v(this.vditor)},a.prototype.getCurrentMode=function(){return this.vditor.currentMode},a.prototype.focus=function(){this.vditor.currentMode==="sv"?this.vditor.sv.element.focus():this.vditor.currentMode==="wysiwyg"?this.vditor.wysiwyg.element.focus():this.vditor.currentMode==="ir"&&this.vditor.ir.element.focus()},a.prototype.blur=function(){this.vditor.currentMode==="sv"?this.vditor.sv.element.blur():this.vditor.currentMode==="wysiwyg"?this.vditor.wysiwyg.element.blur():this.vditor.currentMode==="ir"&&this.vditor.ir.element.blur()},a.prototype.disabled=function(){A(this.vditor,["subToolbar","hint","popover"]),k(this.vditor.toolbar.elements,c.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},a.prototype.enable=function(){S(this.vditor.toolbar.elements,c.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor.undo.resetIcon(this.vditor),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","true")
|
|||
|
|
]`).replace("lheading",c3).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Lk=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_k=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,d3=/^( {2,}|\\)\n(?!\s*$)/,Nk=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Jc=/[\p{P}\p{S}]/u,Xf=/[\s\p{P}\p{S}]/u,h3=/[^\s\p{P}\p{S}]/u,Dk=ln(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Xf).getRegex(),p3=/(?!~)[\p{P}\p{S}]/u,Rk=/(?!~)[\s\p{P}\p{S}]/u,Ik=/(?:[^\s\p{P}\p{S}]|~)/u,Ok=/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,f3=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Hk=ln(f3,"u").replace(/punct/g,Jc).getRegex(),Pk=ln(f3,"u").replace(/punct/g,p3).getRegex(),m3="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",zk=ln(m3,"gu").replace(/notPunctSpace/g,h3).replace(/punctSpace/g,Xf).replace(/punct/g,Jc).getRegex(),Bk=ln(m3,"gu").replace(/notPunctSpace/g,Ik).replace(/punctSpace/g,Rk).replace(/punct/g,p3).getRegex(),Fk=ln("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,h3).replace(/punctSpace/g,Xf).replace(/punct/g,Jc).getRegex(),qk=ln(/\\(punct)/,"gu").replace(/punct/g,Jc).getRegex(),jk=ln(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$k=ln(Gf).replace("(?:-->|$)","-->").getRegex(),Uk=ln("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",$k).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),mc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,Vk=ln(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",mc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),g3=ln(/^!?\[(label)\]\[(ref)\]/).replace("label",mc).replace("ref",Wf).getRegex(),v3=ln(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wf).getRegex(),Wk=ln("reflink|nolink(?!\\()","g").replace("reflink",g3).replace("nolink",v3).getRegex(),Zf={_backpedal:Ml,anyPunctuation:qk,autolink:jk,blockSkip:Ok,br:d3,code:_k,del:Ml,emStrongLDelim:Hk,emStrongRDelimAst:zk,emStrongRDelimUnd:Fk,escape:Lk,link:Vk,nolink:v3,punctuation:Dk,reflink:g3,reflinkSearch:Wk,tag:Uk,text:Nk,url:Ml},Gk={...Zf,link:ln(/^!?\[(label)\]\((.*?)\)/).replace("label",mc).getRegex(),reflink:ln(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",mc).getRegex()},lp={...Zf,emStrongRDelimAst:Bk,emStrongLDelim:Pk,url:ln(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Kk={...lp,br:ln(d3).replace("{2,}","*").getRegex(),text:ln(lp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},y0={normal:Kf,gfm:Mk,pedantic:Ck},ll={normal:Zf,gfm:lp,breaks:Kk,pedantic:Gk},Xk={"&":"&","<":"<",">":">",'"':"
|
|||
|
|
`).map(l=>{let h=l.match(n.other.beginningSpace);if(h===null)return l;let[c]=h;return c.length>=o.length?l.slice(o.length):l}).join(`
|
|||
|
|
`)}var gc=class{constructor(t){mn(this,"options");mn(this,"rules");mn(this,"lexer");this.options=t||qo}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:cl(n,`
|
|||
|
|
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=Yk(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=cl(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:cl(e[0],`
|
|||
|
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=cl(e[0],`
|
|||
|
|
`).split(`
|
|||
|
|
`),r="",o="",l=[];for(;n.length>0;){let h=!1,c=[],p;for(p=0;p<n.length;p++)if(this.rules.other.blockquoteStart.test(n[p]))c.push(n[p]),h=!0;else if(!h)c.push(n[p]);else break;n=n.slice(p);let v=c.join(`
|
|||
|
|
`),b=v.replace(this.rules.other.blockquoteSetextReplace,`
|
|||
|
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|||
|
|
${v}`:v,o=o?`${o}
|
|||
|
|
${b}`:b;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,l,!0),this.lexer.state.top=g,n.length===0)break;let m=l.at(-1);if((m==null?void 0:m.type)==="code")break;if((m==null?void 0:m.type)==="blockquote"){let x=m,w=x.raw+`
|
|||
|
|
`+n.join(`
|
|||
|
|
`),S=this.blockquote(w);l[l.length-1]=S,r=r.substring(0,r.length-x.raw.length)+S.raw,o=o.substring(0,o.length-x.text.length)+S.text;break}else if((m==null?void 0:m.type)==="list"){let x=m,w=x.raw+`
|
|||
|
|
`+n.join(`
|
|||
|
|
`),S=this.list(w);l[l.length-1]=S,r=r.substring(0,r.length-m.raw.length)+S.raw,o=o.substring(0,o.length-x.raw.length)+S.raw,n=w.substring(l.at(-1).raw.length).split(`
|
|||
|
|
`);continue}}return{type:"blockquote",raw:r,tokens:l,text:o}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let l=this.rules.other.listItemRegex(n),h=!1;for(;t;){let p=!1,v="",b="";if(!(e=l.exec(t))||this.rules.block.hr.test(t))break;v=e[0],t=t.substring(v.length);let g=e[2].split(`
|
|||
|
|
`,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),m=t.split(`
|
|||
|
|
`,1)[0],x=!g.trim(),w=0;if(this.options.pedantic?(w=2,b=g.trimStart()):x?w=e[1].length+1:(w=e[2].search(this.rules.other.nonSpaceChar),w=w>4?1:w,b=g.slice(w),w+=e[1].length),x&&this.rules.other.blankLine.test(m)&&(v+=m+`
|
|||
|
|
`,t=t.substring(m.length+1),p=!0),!p){let C=this.rules.other.nextBulletRegex(w),T=this.rules.other.hrRegex(w),A=this.rules.other.fencesBeginRegex(w),M=this.rules.other.headingBeginRegex(w),y=this.rules.other.htmlBeginRegex(w);for(;t;){let N=t.split(`
|
|||
|
|
`,1)[0],z;if(m=N,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),z=m):z=m.replace(this.rules.other.tabCharGlobal," "),A.test(m)||M.test(m)||y.test(m)||C.test(m)||T.test(m))break;if(z.search(this.rules.other.nonSpaceChar)>=w||!m.trim())b+=`
|
|||
|
|
`+z.slice(w);else{if(x||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(g)||M.test(g)||T.test(g))break;b+=`
|
|||
|
|
`+m}!x&&!m.trim()&&(x=!0),v+=N+`
|
|||
|
|
`,t=t.substring(N.length+1),g=z.slice(w)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(v)&&(h=!0));let S=null,k;this.options.gfm&&(S=this.rules.other.listIsTask.exec(b),S&&(k=S[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:v,task:!!S,checked:k,loose:!1,text:b,tokens:[]}),o.raw+=v}let c=o.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let p=0;p<o.items.length;p++)if(this.lexer.state.top=!1,o.items[p].tokens=this.lexer.blockTokens(o.items[p].text,[]),!o.loose){let v=o.items[p].tokens.filter(g=>g.type==="space"),b=v.length>0&&v.some(g=>this.rules.other.anyLine.test(g.raw));o.loose=b}if(o.loose)for(let p=0;p<o.items.length;p++)o.items[p].loose=!0;return o}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:o}}}table(t){var h;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=pg(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=e[3])!=null&&h.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|||
|
|
`):[],l={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let c of r)this.rules.other.tableAlignRight.test(c)?l.align.push("right"):this.rules.other.tableAlignCenter.test(c)?l.align.push("center"):this.rules.other.tableAlignLeft.test(c)?l.align.push("left"):l.align.push(null);for(let c=0;c<n.length;c++)l.header.push({text:n[c],tokens:this.lexer.inline(n[c]),header:!0,align:l.align[c]});for(let c of o)l.rows.push(pg(c,l.header.length).map((p,v)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:l.align[v]})));return l}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|||
|
|
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let l=cl(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=Zk(e[2],"()");if(l===-2)return;if(l>-1){let h=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,h).trim(),e[3]=""}}let r=e[2],o="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(r);l&&(r=l[1],o=l[3])}else o=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),fg(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=e[r.toLowerCase()];if(!o){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return fg(n,o,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let o=[...r[0]].length-1,l,h,c=o,p=0,v=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,e=e.slice(-1*t.length+o);(r=v.exec(e))!=null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(h=[...l].length,r[3]||r[4]){c+=h;continue}else if((r[5]||r[6])&&o%3&&!((o+h)%3)){p+=h;continue}if(c-=h,c>0)continue;h=Math.min(h,h+c+p);let b=[...r[0]][0].length,g=t.slice(0,o+r.index+b+h);if(Math.min(o,h)%2){let x=g.slice(1,-1);return{type:"em",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}let m=g.slice(2,-2);return{type:"strong",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let e;if(e=this.rules.inline.url.exec(t)){let r,o;if(e[2]==="@")r=e[0],o="mailto:"+r;else{let l;do l=e[0],e[0]=((n=this.rules.inline._backpedal.exec(e[0]))==null?void 0:n[0])??"";while(l!==e[0]);r=e[0],e[1]==="www."?o="http://"+e[0]:o=e[0]}return{type:"link",raw:e[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},va=class cp{constructor(e){mn(this,"tokens");mn(this,"
|
|||
|
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){var o,l,h;for(this.options.pedantic&&(e=e.replace(Er.tabCharGlobal," ").replace(Er.spaceLine,""));e;){let c;if((l=(o=this.options.extensions)==null?void 0:o.block)!=null&&l.some(v=>(c=v.call({lexer:this},e,n))?(e=e.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.space(e)){e=e.substring(c.raw.length);let v=n.at(-1);c.raw.length===1&&v!==void 0?v.raw+=`
|
|||
|
|
`:n.push(c);continue}if(c=this.tokenizer.code(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.at(-1).src=v.text):n.push(c);continue}if(c=this.tokenizer.fences(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.heading(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.hr(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.blockquote(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.list(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.html(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.def(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.raw,this.inlineQueue.at(-1).src=v.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title},n.push(c));continue}if(c=this.tokenizer.table(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.lheading(e)){e=e.substring(c.raw.length),n.push(c);continue}let p=e;if((h=this.options.extensions)!=null&&h.startBlock){let v=1/0,b=e.slice(1),g;this.options.extensions.startBlock.forEach(m=>{g=m.call({lexer:this},b),typeof g=="number"&&g>=0&&(v=Math.min(v,g))}),v<1/0&&v>=0&&(p=e.substring(0,v+1))}if(this.state.top&&(c=this.tokenizer.paragraph(p))){let v=n.at(-1);r&&(v==null?void 0:v.type)==="paragraph"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):n.push(c),r=p.length!==e.length,e=e.substring(c.raw.length);continue}if(c=this.tokenizer.text(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):n.push(c);continue}if(e){let v="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(v);break}else throw new Error(v)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){var c,p,v;let r=e,o=null;if(this.tokens.links){let b=Object.keys(this.tokens.links);if(b.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)b.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,o.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(o=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let l=!1,h="";for(;e;){l||(h=""),l=!1;let b;if((p=(c=this.options.extensions)==null?void 0:c.inline)!=null&&p.some(m=>(b=m.call({lexer:this},e,n))?(e=e.substring(b.raw.length),n.push(b),!0):!1))continue;if(b=this.tokenizer.escape(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.tag(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.link(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(b.raw.length);let m=n.at(-1);b.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=b.raw,m.text+=b.text):n.push(b);continue}if(b=this.tokenizer.emStrong(e,r,h)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.codespan(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.br(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.del(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.autolink(e)){e=e.substring(b.raw.length),n.push(b);continue}if(!this.state.inLink&&(b=this.tokenizer.url(e))){e=e.substring(b.raw.length),n.push(b);continue}let g=e;if((v=this.options.extensions)!=null&&v.startInline){let m=1/0,x=e.slice(1),w;this.options.extensions.startInline.forEach(S=>{w=S.call({lexer:this},x),typeof w=="number"&&w>=0&&(m=Math.min(m,w))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(b=this.tokenizer.inlineText(g)){e=e.substring(b.raw.length),b.raw.slice(-1)!=="_"&&(h=b.raw.slice(-1)),l=!0;let m=n.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=b.raw,m.text+=b.text):n.push(b);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return n}},vc=class{constructor(t){mn(this,"options");mn(this,"parser");this.options=t||qo}space(t){return""}code({text:t,lang:e,escaped:n}){var l;let r=(l=(e||"").match(Er.notSpaceStart))==null?void 0:l[0],o=t.replace(Er.endingNewline,"")+`
|
|||
|
|
`;return r?'<pre><code class="language-'+Oi(r)+'">'+(n?o:Oi(o,!0))+`</code></pre>
|
|||
|
|
`:"<pre><code>"+(n?o:Oi(o,!0))+`</code></pre>
|
|||
|
|
`}blockquote({tokens:t}){return`<blockquote>
|
|||
|
|
${this.parser.parse(t)}</blockquote>
|
|||
|
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|||
|
|
`}hr(t){return`<hr>
|
|||
|
|
`}list(t){let e=t.ordered,n=t.start,r="";for(let h=0;h<t.items.length;h++){let c=t.items[h];r+=this.listitem(c)}let o=e?"ol":"ul",l=e&&n!==1?' start="'+n+'"':"";return"<"+o+l+`>
|
|||
|
|
`+r+"</"+o+`>
|
|||
|
|
`}listitem(t){var n;let e="";if(t.task){let r=this.checkbox({checked:!!t.checked});t.loose?((n=t.tokens[0])==null?void 0:n.type)==="paragraph"?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=r+" "+Oi(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
|
|||
|
|
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|||
|
|
`}table(t){let e="",n="";for(let o=0;o<t.header.length;o++)n+=this.tablecell(t.header[o]);e+=this.tablerow({text:n});let r="";for(let o=0;o<t.rows.length;o++){let l=t.rows[o];n="";for(let h=0;h<l.length;h++)n+=this.tablecell(l[h]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|||
|
|
<thead>
|
|||
|
|
`+e+`</thead>
|
|||
|
|
`+r+`</table>
|
|||
|
|
`}tablerow({text:t}){return`<tr>
|
|||
|
|
${t}</tr>
|
|||
|
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|||
|
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Oi(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),o=hg(t);if(o===null)return r;t=o;let l='<a href="'+t+'"';return e&&(l+=' title="'+Oi(e)+'"'),l+=">"+r+"</a>",l}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let o=hg(t);if(o===null)return Oi(n);t=o;let l=`<img src="${t}" alt="${n}"`;return e&&(l+=` title="${Oi(e)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Oi(t.text)}},Yf=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},ba=class up{constructor(e){mn(this,"options");mn(this,"renderer");mn(this,"textRenderer");this.options=e||qo,this.options.renderer=this.options.renderer||new vc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Yf}static parse(e,n){return new up(n).parse(e)}static parseInline(e,n){return new up(n).parseInline(e)}parse(e,n=!0){var o,l;let r="";for(let h=0;h<e.length;h++){let c=e[h];if((l=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&l[c.type]){let v=c,b=this.options.extensions.renderers[v.type].call({parser:this},v);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(v.type)){r+=b||"";continue}}let p=c;switch(p.type){case"space":{r+=this.renderer.space(p);continue}case"hr":{r+=this.renderer.hr(p);continue}case"heading":{r+=this.renderer.heading(p);continue}case"code":{r+=this.renderer.code(p);continue}case"table":{r+=this.renderer.table(p);continue}case"blockquote":{r+=this.renderer.blockquote(p);continue}case"list":{r+=this.renderer.list(p);continue}case"html":{r+=this.renderer.html(p);continue}case"def":{r+=this.renderer.def(p);continue}case"paragraph":{r+=this.renderer.paragraph(p);continue}case"text":{let v=p,b=this.renderer.text(v);for(;h+1<e.length&&e[h+1].type==="text";)v=e[++h],b+=`
|
|||
|
|
`+this.renderer.text(v);n?r+=this.renderer.paragraph({type:"paragraph",raw:b,text:b,tokens:[{type:"text",raw:b,text:b,escaped:!0}]}):r+=b;continue}default:{let v='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return r}parseInline(e,n=this.renderer){var o,l;let r="";for(let h=0;h<e.length;h++){let c=e[h];if((l=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&l[c.type]){let v=this.options.extensions.renderers[c.type].call({parser:this},c);if(v!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){r+=v||"";continue}}let p=c;switch(p.type){case"escape":{r+=n.text(p);break}case"html":{r+=n.html(p);break}case"link":{r+=n.link(p);break}case"image":{r+=n.image(p);break}case"strong":{r+=n.strong(p);break}case"em":{r+=n.em(p);break}case"codespan":{r+=n.codespan(p);break}case"br":{r+=n.br(p);break}case"del":{r+=n.del(p);break}case"text":{r+=n.text(p);break}default:{let v='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return r}},Mh,z0=(Mh=class{constructor(t){mn(this,"options");mn(this,"block");this.options=t||qo}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?va.lex:va.lexInline}provideParser(){return this.block?ba.parse:ba.parseInline}},mn(Mh,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Mh),Jk=class{constructor(...t){mn(this,"defaults",$f());mn(this,"options",this.setOptions);mn(this,"parse",this.parseMarkdown(!0));mn(this,"parseInline",this.parseMarkdown(!1));mn(this,"Parser",ba);mn(this,"Renderer",vc);mn(this,"TextRenderer",Yf);mn(this,"Lexer",va);mn(this,"Tokenizer",gc);mn(this,"Hooks",z0);this.use(...t)}walkTokens(t,e){var r,o;let n=[];for(let l of t)switch(n=n.concat(e.call(this,l)),l.type){case"table":{let h=l;for(let c of h.header)n=n.concat(this.walkTokens(c.tokens,e));for(let c of h.rows)for(let p of c)n=n.concat(this.walkTokens(p.tokens,e));break}case"list":{let h=l;n=n.concat(this.walkTokens(h.items,e));break}default:{let h=l;(o=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(c=>{let p=h[c].flat(1/0);n=n.concat(this.walkTokens(p,e))}):h.tokens&&(n=n.concat(this.walkTokens(h.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let l=e.renderers[o.name];l?e.renderers[o.name]=function(...h){let c=o.renderer.apply(this,h);return c===!1&&(c=l.apply(this,h)),c}:e.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[o.level];l?l.unshift(o.tokenizer):e[o.level]=[o.tokenizer],o.start&&(o.level==="block"?e.startBlock?e.startBlock.push(o.start):e.startBlock=[o.start]:o.level==="inline"&&(e.startInline?e.startInline.push(o.start):e.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(e.childTokens[o.name]=o.childTokens)}),r.extensions=e),n.renderer){let o=this.defaults.renderer||new vc(this.defaults);for(let l in n.renderer){if(!(l in o))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let h=l,c=n.renderer[h],p=o[h];o[h]=(...v)=>{let b=c.apply(o,v);return b===!1&&(b=p.apply(o,v)),b||""}}r.renderer=o}if(n.tokenizer){let o=this.defaults.tokenizer||new gc(this.defaults);for(let l in n.tokenizer){if(!(l in o))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let h=l,c=n.tokenizer[h],p=o[h];o[h]=(...v)=>{let b=c.apply(o,v);return b===!1&&(b=p.apply(o,v)),b}}r.tokenizer=o}if(n.hooks){let o=this.defaults.hooks||new z0;for(let l in n.hooks){if(!(l in o))throw new Error(`hook '${l}' does not exist`);if(["options","block"].include
|
|||
|
|
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Oi(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},Oo=new Jk;function Qt(t,e){return Oo.parse(t,e)}Qt.options=Qt.setOptions=function(t){return Oo.setOptions(t),Qt.defaults=Oo.defaults,s3(Qt.defaults),Qt};Qt.getDefaults=$f;Qt.defaults=qo;Qt.use=function(...t){return Oo.use(...t),Qt.defaults=Oo.defaults,s3(Qt.defaults),Qt};Qt.walkTokens=function(t,e){return Oo.walkTokens(t,e)};Qt.parseInline=Oo.parseInline;Qt.Parser=ba;Qt.parser=ba.parse;Qt.Renderer=vc;Qt.TextRenderer=Yf;Qt.Lexer=va;Qt.lexer=va.lex;Qt.Tokenizer=gc;Qt.Hooks=z0;Qt.parse=Qt;Qt.options;Qt.setOptions;Qt.use;Qt.walkTokens;Qt.parseInline;ba.parse;va.lex;var b3={exports:{}};(function(t){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|||
|
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|||
|
|
*
|
|||
|
|
* @license MIT <https://opensource.org/licenses/MIT>
|
|||
|
|
* @author Lea Verou <https://lea.verou.me>
|
|||
|
|
* @namespace
|
|||
|
|
* @public
|
|||
|
|
*/var n=function(r){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,h={},c={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function T(A){return A instanceof p?new p(A.type,T(A.content),A.alias):Array.isArray(A)?A.map(T):A.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(T){return Object.prototype.toString.call(T).slice(8,-1)},objId:function(T){return T.__id||Object.defineProperty(T,"__id",{value:++l}),T.__id},clone:function T(A,M){M=M||{};var y,N;switch(c.util.type(A)){case"Object":if(N=c.util.objId(A),M[N])return M[N];y={},M[N]=y;for(var z in A)A.hasOwnProperty(z)&&(y[z]=T(A[z],M));return y;case"Array":return N=c.util.objId(A),M[N]?M[N]:(y=[],M[N]=y,A.forEach(function(F,P){y[P]=T(F,M)}),y);default:return A}},getLanguage:function(T){for(;T;){var A=o.exec(T.className);if(A)return A[1].toLowerCase();T=T.parentElement}return"none"},setLanguage:function(T,A){T.className=T.className.replace(RegExp(o,"gi"),""),T.classList.add("language-"+A)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT"&&1<2)return document.currentScript;try{throw new Error}catch(y){var T=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(y.stack)||[])[1];if(T){var A=document.getElementsByTagName("script");for(var M in A)if(A[M].src==T)return A[M]}return null}},isActive:function(T,A,M){for(var y="no-"+A;T;){var N=T.classList;if(N.contains(A))return!0;if(N.contains(y))return!1;T=T.parentElement}return!!M}},languages:{plain:h,plaintext:h,text:h,txt:h,extend:function(T,A){var M=c.util.clone(c.languages[T]);for(var y in A)M[y]=A[y];return M},insertBefore:function(T,A,M,y){y=y||c.languages;var N=y[T],z={};for(var F in N)if(N.hasOwnProperty(F)){if(F==A)for(var P in M)M.hasOwnProperty(P)&&(z[P]=M[P]);M.hasOwnProperty(F)||(z[F]=N[F])}var Y=y[T];return y[T]=z,c.languages.DFS(c.languages,function(te,ce){ce===Y&&te!=T&&(this[te]=z)}),z},DFS:function T(A,M,y,N){N=N||{};var z=c.util.objId;for(var F in A)if(A.hasOwnProperty(F)){M.call(A,F,A[F],y||F);var P=A[F],Y=c.util.type(P);Y==="Object"&&!N[z(P)]?(N[z(P)]=!0,T(P,M,null,N)):Y==="Array"&&!N[z(P)]&&(N[z(P)]=!0,T(P,M,F,N))}}},plugins:{},highlightAll:function(T,A){c.highlightAllUnder(document,T,A)},highlightAllUnder:function(T,A,M){var y={callback:M,container:T,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};c.hooks.run("before-highlightall",y),y.elements=Array.prototype.slice.apply(y.container.querySelectorAll(y.selector)),c.hooks.run("before-all-elements-highlight",y);for(var N=0,z;z=y.elements[N++];)c.highlightElement(z,A===!0,y.callback)},highlightElement:function(T,A,M){var y=c.util.getLanguage(T),N=c.languages[y];c.util.setLanguage(T,y);var z=T.parentElement;z&&z.nodeName.toLowerCase()==="pre"&&c.util.setLanguage(z,y);var F=T.textContent,P={element:T,language:y,grammar:N,code:F};function Y(ce){P.highlightedCode=ce,c.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,c.hooks.run("after-highlight",P),c.hooks.run("complete",P),M&&M.call(P.element)}if(c.hooks.run("before-sanity-check",P),z=P.element.parentElement,z&&z.nodeName.toLowerCase()==="pre"&&!z.hasAttribute("tabindex")&&z.setAttribute("tabindex","0"),!P.code){c.hooks.run("complete",P),M&&M.call(P.element);return}if(c.hooks.run("before-highlight",P),!P.grammar){Y(c.util.encode(P.code));return}if(A&&r.Worker){var te=new Worker(c.filename);te.onmessage=function(ce){Y(ce.data)},te.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else Y(c.highlight(P.code,P.grammar,P.language))},highlight:function(T,A,M){var y={code:T,grammar:A,language:M};if(c.hooks.run("before-tokenize",y),!y.grammar)throw new Error('The language "'+y.language+'" has no grammar.');return y.tokens=c.tokenize(y.code,y.grammar),c.hooks.run("after-tokenize",y),p.stringify(c.util.encode(y.tokens),y.language)},tokenize:function(T,A){var M=A.rest;if(M){for(var y in M)A[y]=M[y];delete A.rest}var N=new g;return m(N,N.head,T)
|
|||
|
|
`),k.hasAttribute("data-start")||k.setAttribute("data-start",String(P+1))}C.textContent=N,n.highlightElement(C)},function(N){k.setAttribute(c,b),C.textContent=N})}}),n.plugins.fileHighlight={highlight:function(k){for(var C=(k||document).querySelectorAll(g),T=0,A;A=C[T++];)n.highlightElement(A)}};var w=!1;n.fileHighlight=function(){w||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),w=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(b3);var Qk=b3.exports;const mg=vv(Qk);class $r{constructor(e,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=r}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new $r(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class ai{constructor(e,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=n}range(e,n){return new ai(n,$r.range(this,e))}}class Qe{constructor(e,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r="KaTeX parse error: "+e,o,l,h=n&&n.loc;if(h&&h.start<=h.end){var c=h.lexer.input;o=h.start,l=h.end,o===c.length?r+=" at end of input: ":r+=" at position "+(o+1)+": ";var p=c.slice(o,l).replace(/[^]/g,"$&̲"),v;o>15?v="…"+c.slice(o-15,o):v=c.slice(0,o);var b;l+15<c.length?b=c.slice(l,l+15)+"…":b=c.slice(l),r+=v+p+b}var g=new Error(r);return g.name="ParseError",g.__proto__=Qe.prototype,g.position=o,o!=null&&l!=null&&(g.length=l-o),g.rawMessage=e,g}}Qe.prototype.__proto__=Error.prototype;var eS=function(e,n){return e.indexOf(n)!==-1},tS=function(e,n){return e===void 0?n:e},nS=/([A-Z])/g,rS=function(e){return e.replace(nS,"-$1").toLowerCase()},iS={"&":"&",">":">","<":"<",'"':""","'":"'"},aS=/[&><"']/g;function oS(t){return String(t).replace(aS,e=>iS[e])}var y3=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},sS=function(e){var n=y3(e);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},lS=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},cS=function(e){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},xt={contains:eS,deflt:tS,escape:oS,hyphenate:rS,getBaseElem:y3,isCharacterBox:sS,protocolFromUrl:cS},B0={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-a
|
|||
|
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|||
|
|
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|||
|
|
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|||
|
|
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|||
|
|
c69,-144,104.5,-217.7,106.5,-221
|
|||
|
|
l`+e/2.075+" -"+e+`
|
|||
|
|
c5.3,-9.3,12,-14,20,-14
|
|||
|
|
H400000v`+(40+e)+`H845.2724
|
|||
|
|
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|||
|
|
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|||
|
|
M`+(834+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},yS=function(e,n){return"M263,"+(601+e+n)+`c0.7,0,18,39.7,52,119
|
|||
|
|
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|||
|
|
c340,-704.7,510.7,-1060.3,512,-1067
|
|||
|
|
l`+e/2.084+" -"+e+`
|
|||
|
|
c4.7,-7.3,11,-11,19,-11
|
|||
|
|
H40000v`+(40+e)+`H1012.3
|
|||
|
|
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|||
|
|
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|||
|
|
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|||
|
|
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|||
|
|
M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},wS=function(e,n){return"M983 "+(10+e+n)+`
|
|||
|
|
l`+e/3.13+" -"+e+`
|
|||
|
|
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
|||
|
|
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|||
|
|
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
|||
|
|
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|||
|
|
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|||
|
|
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|||
|
|
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|||
|
|
M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},xS=function(e,n){return"M424,"+(2398+e+n)+`
|
|||
|
|
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|||
|
|
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|||
|
|
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|||
|
|
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|||
|
|
l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
|
|||
|
|
v`+(40+e)+`H1014.6
|
|||
|
|
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|||
|
|
c-2,6,-10,9,-24,9
|
|||
|
|
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+n+`
|
|||
|
|
h400000v`+(40+e)+"h-400000z"},kS=function(e,n){return"M473,"+(2713+e+n)+`
|
|||
|
|
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
|
|||
|
|
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
|
|||
|
|
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|||
|
|
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|||
|
|
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|||
|
|
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|||
|
|
606zM`+(1001+e)+" "+n+"h400000v"+(40+e)+"H1017.7z"},SS=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},ES=function(e,n,r){var o=r-54-n-e;return"M702 "+(e+n)+"H400000"+(40+e)+`
|
|||
|
|
H742v`+o+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|||
|
|
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|||
|
|
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|||
|
|
219 661 l218 661zM702 `+n+"H400000v"+(40+e)+"H742z"},TS=function(e,n,r){n=1e3*n;var o="";switch(e){case"sqrtMain":o=bS(n,Go);break;case"sqrtSize1":o=yS(n,Go);break;case"sqrtSize2":o=wS(n,Go);break;case"sqrtSize3":o=xS(n,Go);break;case"sqrtSize4":o=kS(n,Go);break;case"sqrtTall":o=ES(n,Go,r)}return o},AS=function(e,n){switch(e){case"⎜":return"M291 0 H417 V"+n+" H291z M291 0 H417 V"+n+" H291z";case"∣":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z";case"∥":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z"+("M367 0 H410 V"+n+" H367z M367 0 H410 V"+n+" H367z");case"⎟":return"M457 0 H583 V"+n+" H457z M457 0 H583 V"+n+" H457z";case"⎢":return"M319 0 H403 V"+n+" H319z M319 0 H403 V"+n+" H319z";case"⎥":return"M263 0 H347 V"+n+" H263z M263 0 H347 V"+n+" H263z";case"⎪":return"M384 0 H504 V"+n+" H384z M384 0 H504 V"+n+" H384z";case"⏐":return"M312 0 H355 V"+n+" H312z M312 0 H355 V"+n+" H312z";case"‖":return"M257 0 H300 V"+n+" H257z M257 0 H300 V"+n+" H257z"+("M478 0 H521 V"+n+" H478z M478 0 H521 V"+n+" H478z");default:return""}},gg={doubleleftarrow:`M262 157
|
|||
|
|
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|||
|
|
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|||
|
|
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|||
|
|
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|||
|
|
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|||
|
|
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|||
|
|
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|||
|
|
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|||
|
|
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|||
|
|
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|||
|
|
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|||
|
|
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|||
|
|
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|||
|
|
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|||
|
|
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|||
|
|
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|||
|
|
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|||
|
|
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|||
|
|
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|||
|
|
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|||
|
|
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|||
|
|
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|||
|
|
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|||
|
|
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|||
|
|
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|||
|
|
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|||
|
|
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|||
|
|
435 0h399565z`,leftgroupunder:`M400000 262
|
|||
|
|
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|||
|
|
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|||
|
|
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|||
|
|
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|||
|
|
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|||
|
|
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|||
|
|
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|||
|
|
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|||
|
|
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|||
|
|
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|||
|
|
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|||
|
|
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|||
|
|
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|||
|
|
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|||
|
|
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|||
|
|
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|||
|
|
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|||
|
|
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
|
|||
|
|
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
|
|||
|
|
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|||
|
|
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|||
|
|
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|||
|
|
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
|
|||
|
|
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
|
|||
|
|
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|||
|
|
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|||
|
|
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|||
|
|
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|||
|
|
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|||
|
|
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|||
|
|
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|||
|
|
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|||
|
|
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|||
|
|
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|||
|
|
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|||
|
|
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|||
|
|
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|||
|
|
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|||
|
|
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|||
|
|
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|||
|
|
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|||
|
|
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|||
|
|
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|||
|
|
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|||
|
|
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|||
|
|
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|||
|
|
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|||
|
|
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|||
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|||
|
|
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|||
|
|
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|||
|
|
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|||
|
|
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|||
|
|
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|||
|
|
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|||
|
|
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|||
|
|
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|||
|
|
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|||
|
|
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|||
|
|
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|||
|
|
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|||
|
|
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|||
|
|
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|||
|
|
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|||
|
|
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|||
|
|
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|||
|
|
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|||
|
|
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|||
|
|
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|||
|
|
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|||
|
|
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|||
|
|
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|||
|
|
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
|
|||
|
|
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|||
|
|
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|||
|
|
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|||
|
|
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|||
|
|
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|||
|
|
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|||
|
|
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|||
|
|
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|||
|
|
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|||
|
|
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|||
|
|
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|||
|
|
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|||
|
|
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|||
|
|
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|||
|
|
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|||
|
|
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|||
|
|
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|||
|
|
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|||
|
|
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|||
|
|
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|||
|
|
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|||
|
|
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|||
|
|
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|||
|
|
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|||
|
|
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|||
|
|
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|||
|
|
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|||
|
|
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|||
|
|
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|||
|
|
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|||
|
|
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|||
|
|
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|||
|
|
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|||
|
|
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|||
|
|
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|||
|
|
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|||
|
|
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|||
|
|
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|||
|
|
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|||
|
|
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|||
|
|
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|||
|
|
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|||
|
|
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|||
|
|
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|||
|
|
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|||
|
|
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|||
|
|
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|||
|
|
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|||
|
|
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|||
|
|
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|||
|
|
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|||
|
|
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|||
|
|
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|||
|
|
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|||
|
|
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|||
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|||
|
|
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|||
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|||
|
|
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|||
|
|
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|||
|
|
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|||
|
|
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|||
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|||
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|||
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|||
|
|
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|||
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|||
|
|
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|||
|
|
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|||
|
|
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|||
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|||
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|||
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|||
|
|
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},MS=function(e,n){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 h347 v-84
|
|||
|
|
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
|
|||
|
|
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|||
|
|
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|||
|
|
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|||
|
|
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|||
|
|
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
|
|||
|
|
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
|
|||
|
|
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|||
|
|
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
|
|||
|
|
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
|
|||
|
|
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
|
|||
|
|
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
|
|||
|
|
M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
|||
|
|
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
|||
|
|
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|||
|
|
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
|||
|
|
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
|||
|
|
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|||
|
|
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|||
|
|
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
|||
|
|
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|||
|
|
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
|
|||
|
|
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
|||
|
|
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
|||
|
|
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
|||
|
|
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|||
|
|
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|||
|
|
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Xl{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return xt.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){for(var e="",n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e}toText(){var e=n=>n.toText();return this.children.map(e).join("")}}var ji={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.755
|
|||
|
|
`+z+" children.");for(var te=0;te<z;te++){var ce=new no(A[te]),Me=new Ca([ce],{width:"400em",height:ot(N),viewBox:"0 0 "+c+" "+y,preserveAspectRatio:P[te]+" slice"}),Fe=Ee.makeSvgSpan([F[te]],[Me],n);if(z===1)return{span:Fe,minWidth:M,height:N};Fe.style.height=ot(N),C.push(Fe)}return{span:Ee.makeSpan(["stretchy"],C,n),minWidth:M,height:N}}}var{span:o,minWidth:l,height:h}=r();return o.height=h,o.style.height=ot(h),l>0&&(o.style.minWidth=ot(l)),o},hE=function(e,n,r,o,l){var h,c=e.height+e.depth+r+o;if(/fbox|color|angl/.test(n)){if(h=Ee.makeSpan(["stretchy",n],[],l),n==="fbox"){var p=l.color&&l.getColor();p&&(h.style.borderColor=p)}}else{var v=[];/^[bx]cancel$/.test(n)&&v.push(new pp({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&v.push(new pp({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var b=new Ca(v,{width:"100%",height:ot(c)});h=Ee.makeSvgSpan([],[b],l)}return h.height=c,h.style.height=ot(c),h},_a={encloseSpan:hE,mathMLnode:lE,svgSpan:dE};function qt(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function a1(t){var e=tu(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function tu(t){return t&&(t.type==="atom"||PS.hasOwnProperty(t.type))?t:null}var o1=(t,e)=>{var n,r,o;t&&t.type==="supsub"?(r=qt(t.base,"accent"),n=r.base,t.base=n,o=OS(Yt(t,e)),t.base=r):(r=qt(t,"accent"),n=r.base);var l=Yt(n,e.havingCrampedStyle()),h=r.isShifty&&xt.isCharacterBox(n),c=0;if(h){var p=xt.getBaseElem(n),v=Yt(p,e.havingCrampedStyle());c=wg(v).skew}var b=r.label==="\\c",g=b?l.height+l.depth:Math.min(l.height,e.fontMetrics().xHeight),m;if(r.isStretchy)m=_a.svgSpan(r,e),m=Ee.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"elem",elem:m,wrapperClasses:["svg-align"],wrapperStyle:c>0?{width:"calc(100% - "+ot(2*c)+")",marginLeft:ot(2*c)}:void 0}]},e);else{var x,w;r.label==="\\vec"?(x=Ee.staticSvg("vec",e),w=Ee.svgData.vec[1]):(x=Ee.makeOrd({mode:r.mode,text:r.label},e,"textord"),x=wg(x),x.italic=0,w=x.width,b&&(g+=x.depth)),m=Ee.makeSpan(["accent-body"],[x]);var S=r.label==="\\textcircled";S&&(m.classes.push("accent-full"),g=l.height);var k=c;S||(k-=w/2),m.style.left=ot(k),r.label==="\\textcircled"&&(m.style.top=".2em"),m=Ee.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:-g},{type:"elem",elem:m}]},e)}var C=Ee.makeSpan(["mord","accent"],[m],e);return o?(o.children[0]=C,o.height=Math.max(C.height,o.height),o.classes[0]="mord",o):C},O3=(t,e)=>{var n=t.isStretchy?_a.mathMLnode(t.label):new Ye.MathNode("mo",[ui(t.label,t.mode)]),r=new Ye.MathNode("mover",[bn(t.base,e),n]);return r.setAttribute("accent","true"),r},pE=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));ht({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var n=kc(e[0]),r=!pE.test(t.funcName),o=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:o,base:n}},htmlBuilder:o1,mathmlBuilder:O3});ht({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:o1,mathmlBuilder:O3});ht({type:"accentUnder",names:["\\underle
|
|||
|
|
]`,FE="\\\\[a-zA-Z@]+",qE="\\\\[^\uD800-\uDFFF]",jE="("+FE+")"+l2+"*",$E=`\\\\(
|
|||
|
|
|[ \r ]+
|
|||
|
|
?)[ \r ]*`,yp="[̀-ͯ]",UE=new RegExp(yp+"+$"),VE="("+l2+"+)|"+($E+"|")+"([!-\\[\\]-‧-豈-]"+(yp+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(yp+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+jE)+("|"+qE+")");class Vg{constructor(e,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=n,this.tokenRegex=new RegExp(VE,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,n){this.catcodes[e]=n}lex(){var e=this.input,n=this.tokenRegex.lastIndex;if(n===e.length)return new ai("EOF",new $r(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new Qe("Unexpected character: '"+e[n]+"'",new ai(e[n],new $r(this,n,n+1)));var o=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[o]===14){var l=e.indexOf(`
|
|||
|
|
`,this.tokenRegex.lastIndex);return l===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=l+1,this.lex()}return new ai(o,new $r(this,n,this.tokenRegex.lastIndex))}}class WE{constructor(e,n){e===void 0&&(e={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Qe("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var n in e)e.hasOwnProperty(n)&&(e[n]==null?delete this.current[n]:this.current[n]=e[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,n,r){if(r===void 0&&(r=!1),r){for(var o=0;o<this.undefStack.length;o++)delete this.undefStack[o][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=n)}else{var l=this.undefStack[this.undefStack.length-1];l&&!l.hasOwnProperty(e)&&(l[e]=this.current[e])}n==null?delete this.current[e]:this.current[e]=n}}var GE=Y3;W("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});W("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});W("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});W("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});W("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return e[0].length===1&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});W("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");W("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var Wg={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};W("\\char",function(t){var e=t.popToken(),n,r="";if(e.text==="'")n=8,e=t.popToken();else if(e.text==='"')n=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new Qe("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=Wg[e.text],r==null||r>=n)throw new Qe("Invalid base-"+n+" digit "+e.text);for(var o;(o=Wg[t.future().text])!=null&&o<n;)r*=n,r+=o,t.popToken()}return"\\@char{"+r+"}"});var f1=(t,e,n,r)=>{var o=t.consumeArg().tokens;if(o.length!==1)throw new Qe("\\newcommand's first argument must be a macro name");var l=o[0].text,h=t.isDefined(l);if(h&&!e)throw new Qe("\\newcommand{"+l+"} attempting to redefine "+(l+"; use \\renewcommand"));if(!h&&!n)throw new Qe("\\renewcommand{"+l+"} when command "+l+" does not yet exist; use \\newcommand");var c=0;if(o=t.consumeArg().tokens,o.length===1&&o[0].text==="["){for(var p="",v=t.expandNextToken();v.text!=="]"&&v.text!=="EOF";)p+=v.text,v=t.expandNextToken();if(!p.match(/^\s*[0-9]+\s*$/))throw new Qe("Invalid number of arguments: "+p);c=parseInt(p),o=t.consumeArg().tokens}return h&&r||t.macros.set(l,{tokens:o,numArgs:c}),""};W("\\newcommand",t=>f1(t,!1,!0,!1));W("\\renewcommand",t=>f1(t,!0,!1,!1));W("\\providecommand",t=>f1(t,!0,!0,!0));W("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});W("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});W("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),Ga[n],xn.math[n],xn.text[n]),""});W("\\bgroup","{");W("\\egroup","}");W("~","\\nobreakspace");W("\\lq","`");W("\\rq","'");W("\\aa","\\r a");W("\\AA","\\r A");W("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");W("\\copyright","\\TextOrMath{
|
|||
|
|
please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:o}}Xg.hasOwnProperty(n[0])&&!xn[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',e),n=Xg[n[0]]+n.slice(1));var l=UE.exec(n);l&&(n=n.substring(0,l.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var h;if(xn[this.mode][n]){this.settings.strict&&this.mode==="math"&&fp.indexOf(n)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var c=xn[this.mode][n].group,p=$r.range(e),v;if(HS.hasOwnProperty(c)){var b=c;v={type:"atom",mode:this.mode,family:b,loc:p,text:n}}else v={type:c,mode:this.mode,loc:p,text:n};h=v}else if(n.charCodeAt(0)>=128)this.settings.strict&&(w3(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),e)),h={type:"textord",mode:"text",loc:$r.range(e),text:n};else return null;if(this.consume(),l)for(var g=0;g<l[0].length;g++){var m=l[0][g];if(!Sh[m])throw new Qe("Unknown accent ' "+m+"'",e);var x=Sh[m][this.mode]||Sh[m].text;if(!x)throw new Qe("Accent "+m+" unsupported in "+this.mode+" mode",e);h={type:"accent",mode:this.mode,loc:$r.range(e),label:x,isStretchy:!1,isShifty:!0,base:h}}return h}}au.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var g1=function(e,n){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new au(e,n);delete r.gullet.macros.current["\\df@tag"];var o=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Qe("\\tag works only in display equations");o=[{type:"tag",mode:"text",body:o,tag:r.subparse([new ai("\\df@tag")])}]}return o},h2=function(e,n,r){n.textContent="";var o=v1(e,r).toNode();n.appendChild(o)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),h2=function(){throw new Qe("KaTeX doesn't work in quirks mode.")});var XE=function(e,n){var r=v1(e,n).toMarkup();return r},ZE=function(e,n){var r=new Jf(n);return g1(e,r)},p2=function(e,n,r){if(r.throwOnError||!(e instanceof Qe))throw e;var o=Ee.makeSpan(["katex-error"],[new ci(n)]);return o.setAttribute("title",e.toString()),o.setAttribute("style","color:"+r.errorColor),o},v1=function(e,n){var r=new Jf(n);try{var o=g1(e,r);return aE(o,e,r)}catch(l){return p2(l,e,r)}},YE=function(e,n){var r=new Jf(n);try{var o=g1(e,r);return oE(o,e,r)}catch(l){return p2(l,e,r)}},JE="0.16.22",QE={Span:Zl,Anchor:t1,SymbolNode:ci,SvgNode:Ca,PathNode:no,LineNode:pp},Zg={version:JE,render:h2,renderToString:XE,ParseError:Qe,SETTINGS_SCHEMA:B0,__parse:ZE,__renderToDomTree:v1,__renderToHTMLTree:YE,__setFontMetrics:CS,__defineSymbol:I,__defineFunction:ht,__defineMacro:W,__domTree:QE};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.
|
|||
|
|
`);let n=!1,r=!1;for(const h of e){const c=h.trim();c.includes("|")&&c.split("|").length>=3&&(n=!0),c.includes("|")&&c.includes("-")&&/^[\s\|\-\:]+$/.test(c)&&(r=!0)}const o=(t.match(/\|/g)||[]).length,l=o>=6;return n&&r||n&&l||n&&o>=4},rT=t=>!t||typeof t!="string"?!1:nT(t)?!0:[/#{1,6}\s+/,/\*\*.*?\*\*/,/\*.*?\*/,/`.*?`/,/```[\s\S]*?```/,/^\s*[-*+]\s+/m,/^\s*\d+\.\s+/m,/\[.*?\]\(.*?\)/,/!\[.*?\]\(.*?\)/,/\$\$.*?\$\$/,/\$.*?\$/].some(n=>n.test(t)),ul=t=>{if(!t||typeof t!="string")return t||"";const e=rT(t),n=t.includes("|")&&t.includes("-");return e||n?(console.log("🎯 同步渲染Markdown内容"),m2(t)):t};function g2(t,e){return function(){return t.apply(e,arguments)}}const{toString:iT}=Object.prototype,{getPrototypeOf:b1}=Object,{iterator:ou,toStringTag:v2}=Symbol,su=(t=>e=>{const n=iT.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ei=t=>(t=t.toLowerCase(),e=>su(e)===t),lu=t=>e=>typeof e===t,{isArray:gs}=Array,zl=lu("undefined");function Jl(t){return t!==null&&!zl(t)&&t.constructor!==null&&!zl(t.constructor)&&Nr(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const b2=Ei("ArrayBuffer");function aT(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&b2(t.buffer),e}const oT=lu("string"),Nr=lu("function"),y2=lu("number"),Ql=t=>t!==null&&typeof t=="object",sT=t=>t===!0||t===!1,q0=t=>{if(su(t)!=="object")return!1;const e=b1(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(v2 in t)&&!(ou in t)},lT=t=>{if(!Ql(t)||Jl(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},cT=Ei("Date"),uT=Ei("File"),dT=Ei("Blob"),hT=Ei("FileList"),pT=t=>Ql(t)&&Nr(t.pipe),fT=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Nr(t.append)&&((e=su(t))==="formdata"||e==="object"&&Nr(t.toString)&&t.toString()==="[object FormData]"))},mT=Ei("URLSearchParams"),[gT,vT,bT,yT]=["ReadableStream","Request","Response","Headers"].map(Ei),wT=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function e0(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),gs(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{if(Jl(t))return;const l=n?Object.getOwnPropertyNames(t):Object.keys(t),h=l.length;let c;for(r=0;r<h;r++)c=l[r],e.call(null,t[c],c,t)}}function w2(t,e){if(Jl(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,o;for(;r-- >0;)if(o=n[r],e===o.toLowerCase())return o;return null}const _o=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),x2=t=>!zl(t)&&t!==_o;function wp(){const{caseless:t}=x2(this)&&this||{},e={},n=(r,o)=>{const l=t&&w2(e,o)||o;q0(e[l])&&q0(r)?e[l]=wp(e[l],r):q0(r)?e[l]=wp({},r):gs(r)?e[l]=r.slice():e[l]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&e0(arguments[r],n);return e}const xT=(t,e,n,{allOwnKeys:r}={})=>(e0(e,(o,l)=>{n&&Nr(o)?t[l]=g2(o,n):t[l]=o},{allOwnKeys:r}),t),kT=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ST=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},ET=(t,e,n,r)=>{let o,l,h;const c={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),l=o.length;l-- >0;)h=o[l],(!r||r(h,t,e))&&!c[h]&&(e[h]=t[h],c[h]=!0);t=n!==!1&&b1(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},TT=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},AT=t=>{if(!t)return null;if(gs(t))return t;let e=t.length;if(!y2(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},MT=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&b1(Uint8Array)),CT=(t,e)=>{const r=(t&&t[ou]).call(t);let o;for(;(o=r.next())&&!o.done;){const l=o.value;e.call(t,l[0],l[1])}},LT=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},_T=Ei("HTMLFormElement"),NT=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o
|
|||
|
|
`).forEach(function(h){o=h.indexOf(":"),n=h.substring(0,o).trim().toLowerCase(),r=h.substring(o+1).trim(),!(!n||e[n]&&oA[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},t4=Symbol("internals");function dl(t){return t&&String(t).trim().toLowerCase()}function j0(t){return t===!1||t==null?t:_e.isArray(t)?t.map(j0):String(t)}function lA(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const cA=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Eh(t,e,n,r,o){if(_e.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!_e.isString(e)){if(_e.isString(r))return e.indexOf(r)!==-1;if(_e.isRegExp(r))return r.test(e)}}function uA(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function dA(t,e){const n=_e.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,l,h){return this[r].call(this,e,o,l,h)},configurable:!0})})}class uu{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function l(c,p,v){const b=dl(p);if(!b)throw new Error("header name must be a non-empty string");const g=_e.findKey(o,b);(!g||o[g]===void 0||v===!0||v===void 0&&o[g]!==!1)&&(o[g||p]=j0(c))}const h=(c,p)=>_e.forEach(c,(v,b)=>l(v,b,p));if(_e.isPlainObject(e)||e instanceof this.constructor)h(e,n);else if(_e.isString(e)&&(e=e.trim())&&!cA(e))h(sA(e),n);else if(_e.isObject(e)&&_e.isIterable(e)){let c={},p,v;for(const b of e){if(!_e.isArray(b))throw TypeError("Object iterator must return a key-value pair");c[v=b[0]]=(p=c[v])?_e.isArray(p)?[...p,b[1]]:[p,b[1]]:b[1]}h(c,n)}else e!=null&&l(n,e,r);return this}get(e,n){if(e=dl(e),e){const r=_e.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return lA(o);if(_e.isFunction(n))return n.call(this,o,r);if(_e.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=dl(e),e){const r=_e.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||Eh(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function l(h){if(h=dl(h),h){const c=_e.findKey(r,h);c&&(!n||Eh(r,r[c],c,n))&&(delete r[c],o=!0)}}return _e.isArray(e)?e.forEach(l):l(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const l=n[r];(!e||Eh(this,this[l],l,e,!0))&&(delete this[l],o=!0)}return o}normalize(e){const n=this,r={};return _e.forEach(this,(o,l)=>{const h=_e.findKey(r,l);if(h){n[h]=j0(o),delete n[l];return}const c=e?uA(l):String(l).trim();c!==l&&delete n[l],n[c]=j0(o),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return _e.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&_e.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).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,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[t4]=this[t4]={accessors:{}}).accessors,o=this.prototype;function l(h){const c=dl(h);r[c]||(dA(o,h),r[c]=!0)}return _e.isArray(e)?e.forEach(l):l(e),this}}uu.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);_e.reduceDescriptors(uu.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});_e.freezeMethods(uu);const Si=uu;function Th(t,e){const n=this||k1,r=e||n,o=Si.from(r.headers);let l=r.data;return _e.forEach(t,function(c){l=c.call(n,l,o.normalize(),e?e.status:void 0)}),o.normalize(),l}function N2(t){return!!(t&&t.__CANCEL__)}function vs(t,e,n){Pt.call(this,t??"canceled",Pt.ERR_CANCELED,e,n),this.name="CanceledError"}_e.inherits(vs,Pt,{__CANCEL__:!0});function D2(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Pt("Request failed with status code "+n.status,[Pt.ERR_BAD_REQUEST,Pt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function hA(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function pA(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,l=0,h;return e=e!==void 0?e:1e3,function(p){const v=Date.now(),b=r[l];h||(h=v),n[o]=p,r[o]=v;let g=l,m=0;for(;g!==o;)m+=n[g++],g=g%t;if(o=(o+1)%t,o===l&&(l=(l+1)%t),v-h<e)return;const x=b&&v-b;return x?Math.round(m*1e3/x):void 0}}function fA(t,e){let n=0,r=1e3/e,o,l;const h=(v,b=Date.now())=>{n=b,o=null,l&&(clearTimeout(l),l=null),t(...v)};return[(...v)=>{const b=Date.now(),g=b-n;g>=r?h(v,b):(o=v,l||(l=setTimeout(()=>{l=null,h(o)},r-g)))},()=>o&&h(o)]}const Sc=(t,e,n=3)=>{let r=0;const o=pA(50,250);return fA(l=>{const h=l.loaded,c=l.lengthComputable?l.total:void 0,p=h-r,v=o(p),b=h<=c;r=h;const g={loaded:h,total:c,progress:c?h/c:void 0,bytes:p,rate:v||void 0,estimated:v&&c&&b?(c-h)/v:void 0,event:l,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(g)},n)},n4=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},r4=t=>(...e)=>_e.asap(()=>t(...e)),mA=pr.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,pr.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(pr.origin),pr.navigator&&/(msie|trident)/i.test(pr.navigator.userAgent)):()=>!0,gA=pr.hasStandardBrowserEnv?{write(t,e,n,r,o,l){const h=[t+"="+encodeURIComponent(e)];_e.isNumber(n)&&h.push("expires="+new Date(n).toGMTString()),_e.isString(r)&&h.push("path="+r),_e.isString(o)&&h.push("domain="+o),l===!0&&h.push("secure"),document.cookie=h.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function vA(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function bA(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function R2(t,e,n){let r=!vA(e);return t&&(r||n==!1)?bA(t,e):e}const i4=t=>t instanceof Si?{...t}:t;function Ho(t,e){e=e||{};const n={};function r(v,b,g,m){return _e.isPlainObject(v)&&_e.isPlainObject(b)?_e.merge.call({caseless:m},v,b):_e.isPlainObject(b)?_e.merge({},b):_e.isArray(b)?b.slice():b}function o(v,b,g,m){if(_e.isUndefined(b)){if(!_e.isUndefined(v))return r(void 0,v,g,m)}else return r(v,b,g,m)}function l(v,b){if(!_e.isUndefined(b))return r(void 0,b)}function h(v,b){if(_e.isUndefined(b)){if(!_e.isUndefined(v))return r(void 0,v)}else return r(void 0,b)}function c(v,b,g){if(g in e)return r(v,b);if(g in t)return r(void 0,v)}const p={url:l,method:l,data:l,baseURL:h,transformRequest:h,transformResponse:h,paramsSerializer:h,timeout:h,timeoutMessage:h,withCredentials:h,withXSRFToken:h,adapter:h,responseType:h,xsrfCookieName:h,xsrfHeaderName:h,onUploadProgress:h,onDownloadProgress:h,decompress:h,maxContentLength:h,maxBodyLength:h,beforeRedirect:h,transport:h,httpAgent:
|
|||
|
|
`+l.map(s4).join(`
|
|||
|
|
`):" "+s4(l[0]):"as no adapter specified";throw new Pt("There is no suitable adapter to dispatch the request "+h,"ERR_NOT_SUPPORT")}return r},adapters:Ep};function Ah(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new vs(null,t)}function l4(t){return Ah(t),t.headers=Si.from(t.headers),t.data=Th.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),P2.getAdapter(t.adapter||k1.adapter)(t).then(function(r){return Ah(t),r.data=Th.call(t,t.transformResponse,r),r.headers=Si.from(r.headers),r},function(r){return N2(r)||(Ah(t),r&&r.response&&(r.response.data=Th.call(t,t.transformResponse,r.response),r.response.headers=Si.from(r.response.headers))),Promise.reject(r)})}const z2="1.11.0",hu={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{hu[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const c4={};hu.transitional=function(e,n,r){function o(l,h){return"[Axios v"+z2+"] Transitional option '"+l+"'"+h+(r?". "+r:"")}return(l,h,c)=>{if(e===!1)throw new Pt(o(h," has been removed"+(n?" in "+n:"")),Pt.ERR_DEPRECATED);return n&&!c4[h]&&(c4[h]=!0,console.warn(o(h," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(l,h,c):!0}};hu.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function DA(t,e,n){if(typeof t!="object")throw new Pt("options must be an object",Pt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const l=r[o],h=e[l];if(h){const c=t[l],p=c===void 0||h(c,l,t);if(p!==!0)throw new Pt("option "+l+" must be "+p,Pt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Pt("Unknown option "+l,Pt.ERR_BAD_OPTION)}}const $0={assertOptions:DA,validators:hu},Di=$0.validators;class Tc{constructor(e){this.defaults=e||{},this.interceptors={request:new e4,response:new e4}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const l=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|||
|
|
`+l):r.stack=l}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Ho(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:l}=n;r!==void 0&&$0.assertOptions(r,{silentJSONParsing:Di.transitional(Di.boolean),forcedJSONParsing:Di.transitional(Di.boolean),clarifyTimeoutError:Di.transitional(Di.boolean)},!1),o!=null&&(_e.isFunction(o)?n.paramsSerializer={serialize:o}:$0.assertOptions(o,{encode:Di.function,serialize:Di.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),$0.assertOptions(n,{baseUrl:Di.spelling("baseURL"),withXsrfToken:Di.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let h=l&&_e.merge(l.common,l[n.method]);l&&_e.forEach(["delete","get","head","post","put","patch","common"],w=>{delete l[w]}),n.headers=Si.concat(h,l);const c=[];let p=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(p=p&&S.synchronous,c.unshift(S.fulfilled,S.rejected))});const v=[];this.interceptors.response.forEach(function(S){v.push(S.fulfilled,S.rejected)});let b,g=0,m;if(!p){const w=[l4.bind(this),void 0];for(w.unshift(...c),w.push(...v),m=w.length,b=Promise.resolve(n);g<m;)b=b.then(w[g++],w[g++]);return b}m=c.length;let x=n;for(g=0;g<m;){const w=c[g++],S=c[g++];try{x=w(x)}catch(k){S.call(this,k);break}}try{b=l4.call(this,x)}catch(w){return Promise.reject(w)}for(g=0,m=v.length;g<m;)b=b.then(v[g++],v[g++]);return b}getUri(e){e=Ho(this.defaults,e);const n=R2(e.baseURL,e.url,e.allowAbsoluteUrls);return C2(n,e.params,e.paramsSerializer)}}_e.forEach(["delete","get","head","options"],function(e){Tc.prototype[e]=function(n,r){return this.request(Ho(r||{},{method:e,url:n,data:(r||{}).data}))}});_e.forEach(["post","put","patch"],function(e){function n(r){return function(l,h,c){return this.request(Ho(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:h}))}}Tc.prototype[e]=n(),Tc.prototype[e+"Form"]=n(!0)});const U0=Tc;class S1{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(l){n=l});const r=this;this.promise.then(o=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](o);r._listeners=null}),this.promise.then=o=>{let l;const h=new Promise(c=>{r.subscribe(c),l=c}).then(o);return h.cancel=function(){r.unsubscribe(l)},h},e(function(l,h,c){r.reason||(r.reason=new vs(l,h,c),n(r.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;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new S1(function(o){e=o}),cancel:e}}}const RA=S1;function IA(t){return function(n){return t.apply(null,n)}}function OA(t){return _e.isObject(t)&&t.isAxiosError===!0}const Tp={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,RequestHead
|
|||
|
|
`+Pe}parseExistingImages(),y.value=!0,console.log("📝 富文本编辑器已打开")},ct=()=>{y.value=!1,N.value="",z.value="",F.value=null,P.value=null,Y.value=[],q()},tt=async()=>{if(!ce.value){console.error("❌ vditorContainer未找到");return}console.log("🎯 开始初始化Vditor编辑器..."),console.log("🔍 vditorContainer元素:",ce.value),console.log("🔍 容器可见性:",ce.value.offsetParent!==null),console.log("🔍 容器尺寸:",{width:ce.value.offsetWidth,height:ce.value.offsetHeight});try{ce.value.innerHTML="",Me=new nl(ce.value,{height:400,placeholder:"请输入节点内容...",mode:"wysiwyg",theme:"classic",toolbarConfig:{pin:!0},cache:{enable:!1},preview:{hljs:{style:"github"}},toolbar:["emoji","headings","bold","italic","strike","|","list","ordered-list","check","|","quote","line","code","inline-code","|","link","table","image","upload","|","undo","redo","fullscreen","edit-mode"],upload:{accept:"image/*",multiple:!1,fieldName:"file",max:5*1024*1024,url:"",linkToImgUrl:"",success:(U,Q)=>{console.log("图片上传成功:",Q)},error:U=>{console.error("图片上传失败:",U)}},after:()=>{console.log("✅ Vditor编辑器初始化完成"),setTimeout(()=>{z.value&&z.value.trim()?(Me.setValue(z.value),console.log("✅ 内容已设置到WYSIWYG编辑器:",z.value.substring(0,100)+"..."),console.log("✅ 编辑器当前模式: wysiwyg (所见即所得模式)")):(console.warn("⚠️ editorContent.value为空,设置空内容"),Me.setValue("")),Me.focus(),Me.on?Me.on("input",U=>{const Q=Me.getValue();z.value=Q,console.log("📝 编辑器内容变化(Markdown):",Q.substring(0,50)+"...")}):console.warn("⚠️ Vditor实例没有on方法"),setTimeout(()=>{const U=document.querySelector(".vditor-toolbar"),Q=document.querySelector(".vditor-wysiwyg");console.log("🔍 Vditor工具栏:",U),console.log("🔍 Vditor编辑器区域:",Q),!U||!Q?(console.error("❌ Vditor组件没有正确渲染"),console.error("工具栏状态:",U?"存在":"不存在"),console.error("编辑器状态:",Q?"存在":"不存在")):(console.log("✅ Vditor组件渲染成功"),console.log("工具栏按钮数量:",U.querySelectorAll("button").length),console.log("工具栏高度:",U.offsetHeight))},100)},100)}}),console.log("✅ Vditor编辑器创建成功")}catch(U){console.error("❌ Vditor编辑器初始化失败:",U),console.error("错误详情:",U.stack)}},q=()=>{Me&&(Me.destroy(),Me=null,console.log("🗑️ Vditor编辑器已销毁"))},Ht=async()=>{var He,Pe,pe,Oe;if(console.log("🚀 saveRichTextChanges函数被调用!"),console.log("🚀 开始保存 Vditor 富文本内容..."),console.log("📝 当前editorTitle:",N.value),console.log("📝 当前editorContent:",z.value.substring(0,100)+"..."),console.log("📝 当前节点:",F.value),console.log("📝 Vditor实例状态:",!!Me),!F.value){alert("节点信息丢失");return}if(!Me){console.error("❌ Vditor实例不存在,无法获取内容"),alert("编辑器未初始化,请重试");return}const U=Me?Me.getValue():z.value,Q=Me?Me.getHTML():z.value,Z=U.trim()||"";console.log("📝 获取到的Markdown内容:",Z.substring(0,100)+"..."),console.log("📝 获取到的HTML内容:",Q.substring(0,100)+"...");const xe=N.value!==(F.value.title||"");if(console.log("🔍 标题变化检查:",{editorTitle:N.value,currentNodeTitle:F.value.title||"",titleChanged:xe}),F.value.topic=Z,F.value.title=N.value,F.value.dangerouslySetInnerHTML=Q,P.value&&(P.value.innerHTML=Q,xe)){const Je=P.value.querySelector(".tpc");Je&&(Je.textContent=N.value,console.log("📝 DOM文本元素已更新:",N.value))}try{const Je=F.value.id.replace(/^me/,""),Ge={newTitle:N.value,newDes:((He=F.value.data)==null?void 0:He.des)||"",newParentId:F.value.parentId||((Pe=F.value.parent)==null?void 0:Pe.id),newDangerouslySetInnerHTML:Q||""};console.log("🔍 直接发送到后端的更新数据:",Ge),console.log("🔍 清理后的节点ID:",Je);const Ct=await Un.updateNode(Je,Ge);if(Ct.data&&Ct.data.success){if(console.log("✅ 节点数据已保存到后端"),o.value&&F.value&&P.value){const un=P.value.querySelector(".
|
|||
|
|
font-size: 11px;
|
|||
|
|
color: #666;
|
|||
|
|
margin-top: 6px;
|
|||
|
|
padding: 6px 8px;
|
|||
|
|
background: rgba(0, 0, 0, 0.03);
|
|||
|
|
border-radius: 4px;
|
|||
|
|
max-width: 250px;
|
|||
|
|
word-wrap: break-word;
|
|||
|
|
line-height: 1.3;
|
|||
|
|
border-left: 3px solid #e0e0e0;
|
|||
|
|
display: block;
|
|||
|
|
`,Q.appendChild(Oe));const Je=Pe.data.des;Je.length>150?(Oe.textContent=Je.substring(0,150)+"...",Oe.title=Je):Oe.textContent=Je}})},1e3)},X=()=>{try{if(o.value&&o.value.toCenter){o.value.toCenter(),console.log("✅ 使用 MindElixir toCenter 方法实现根节点居中");return}const U=r.value;if(!U)return;const Q=U.querySelector(".map-canvas");if(!Q)return;const Z=Q.querySelectorAll("me-tpc");if(Z.length===0)return;let xe=1/0,He=-1/0,Pe=1/0,pe=-1/0;Z.forEach(Ia=>{const Li=Ia.getBoundingClientRect(),Oa=U.getBoundingClientRect(),_i=Li.left-Oa.left,Zr=Li.top-Oa.top;xe=Math.min(xe,_i),He=Math.max(He,_i+Li.width),Pe=Math.min(Pe,Zr),pe=Math.max(pe,Zr+Li.height)});const Oe=(xe+He)/2,Je=(Pe+pe)/2,Ge=U.clientWidth/2,Ct=U.clientHeight/2,Gt=Ge-Oe,un=Ct-Je;Q.style.transform=`translate(${Gt}px, ${un}px)`,Q.style.opacity="1",Q.style.transition="opacity 0.3s ease";const $n=100,mr=Math.max(Gt,$n),Hr=Math.max(un,$n);Q.style.transform=`translate(${mr}px, ${Hr}px)`,Q.style.opacity="1",Q.style.visibility="visible"}catch{}},be=async U=>{if(!(!o.value||!U))try{console.log("🎯 开始处理新节点:",U);let Q=null,Z=0;const xe=5;for(;!Q&&Z<xe;)Q=o.value.findEle(U),Q||(Z++,await new Promise(He=>setTimeout(He,50)));Q?(console.log("✅ 找到节点元素:",Q),o.value.scrollIntoView&&(o.value.scrollIntoView(Q),console.log("✅ 节点已平滑居中显示")),setTimeout(()=>{o.value.beginEdit&&(o.value.beginEdit(Q),console.log("✅ 节点已进入编辑状态"))},350)):console.error("❌ 多次尝试后仍未找到节点元素:",U)}catch(Q){console.error("❌ 居中显示节点失败:",Q)}},le=()=>{if(!l.value)return;if(o.value&&o.value.getNodeById)try{const Q=o.value.getNodeById(l.value.id);if(Q){const Z=Q.getBoundingClientRect(),xe=r.value.getBoundingClientRect(),He=Z.left-xe.left+Z.width/2,Pe=Z.bottom-xe.top+10;h.value={left:`${He}px`,top:`${Pe}px`};return}}catch{}let U=document.querySelector(`[data-id="${l.value.id}"]`);if(U||(U=document.querySelector(`.topic[data-id="${l.value.id}"]`)),U||(U=document.querySelector(`[data-node-id="${l.value.id}"]`)),U||(U=document.querySelector(`[data-nodeid="me${l.value.id}"]`)),!U){const Q=document.querySelectorAll("me-tpc");for(const Z of Q)if(Z.getAttribute("data-nodeid")===`me${l.value.id}`){U=Z;break}}if(!U){const Q=document.querySelectorAll(".topic");for(const Z of Q)if(Z.textContent.trim()===l.value.topic){U=Z;break}}if(U){const Q=U.getBoundingClientRect(),Z=r.value.getBoundingClientRect(),xe=Q.left-Z.left+Q.width/2,He=Q.bottom-Z.top+10;h.value={left:`${xe}px`,top:`${He}px`}}else h.value={left:"50%",top:"50%",transform:"translate(-50%, -50%)"}},ye=async()=>{l.value&&(await en(l.value),l.value=null)},Ae=async()=>{l.value&&(await co(l.value),l.value=null)},ze=async()=>{l.value&&(await ur(l.value),l.value=null)},Xe=async()=>{if(!l.value)return;console.log("Ask AI for node:",l.value);const U=parseFloat(h.value.left)||0,Q=parseFloat(h.value.top)||0;c.value={left:`${U}px`,top:`${Q+60}px`,transform:"translateX(-50%)"},m.value=!0,x.value=l.value},Ke=()=>{m.value=!1,x.value=null,w.value="",S.value=!1,l.value=null},Be=U=>{if(!U)return"";const Q=[];return U.parent&&U.parent.topic&&Q.push(`父节点: ${U.parent.topic}`),U.parent&&U.parent.parent&&U.parent.parent.topic&&Q.push(`祖父节点: ${U.parent.parent.topic}`),Q.join(" | ")},st=U=>{U.ctrlKey||U.metaKey||(U.preventDefault(),qe())},qe=async()=>{if(!(!w.value.trim()||!x.value||S.value)){S.value=!0;try{const U="你是一个专业的思维导图分析助手。请根据用户的问题和提供的节点信息,给出专业、有用的回答。",Q=`节点信息:
|
|||
|
|
当前节点:${x.value.topic}
|
|||
|
|
上下文:${Be(x.value)}
|
|||
|
|
|
|||
|
|
用户问题:${w.value}
|
|||
|
|
|
|||
|
|
请给出详细的回答,回答应该:
|
|||
|
|
1. 直接回答用户的问题
|
|||
|
|
2. 提供具体的建议或改进方案
|
|||
|
|
3. 保持专业和有用的语调
|
|||
|
|
4. 回答长度适中,便于在思维导图中展示`;console.log("发送AI请求:",{systemPrompt:U,userPrompt:Q});const Z=await fetch("http://127.0.0.1:8000/api/ai/generate-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({system_prompt:U,user_prompt:Q,model:"glm-4.5",base_url:"https://open.bigmodel.cn/api/paas/v4/",api_key:"ce39bdd4fcf34ec0aec75072bc9ff988.hAp7HZTVUwy7vImn"})});if(!Z.ok)throw new Error(`HTTP error! status: ${Z.status}`);let xe="";const He=Z.body.getReader(),Pe=new TextDecoder;let pe="";for(;;){const{done:Oe,value:Je}=await He.read();if(Oe)break;pe+=Pe.decode(Je,{stream:!0});const Ge=pe.split(`
|
|||
|
|
`);pe=Ge.pop()||"";for(const Ct of Ge)if(Ct.startsWith("data: "))try{const Gt=JSON.parse(Ct.slice(6));if(Gt.type==="chunk")xe+=Gt.content;else if(Gt.type==="error")throw new Error(Gt.content)}catch(Gt){console.warn("解析流式数据失败:",Gt)}}await Ut(x.value,w.value,xe),Ke()}catch(U){console.error("AI请求失败:",U),alert("AI请求失败,请稍后重试")}finally{S.value=!1}}},Re=U=>U.replace(/^### (.*$)/gim,"📋 $1").replace(/^## (.*$)/gim,"📌 $1").replace(/^# (.*$)/gim,"🎯 $1").replace(/\*\*(.*?)\*\*/g,(Q,Z)=>{if(Z.includes(":")){const xe=Z.split(":");if(xe.length>1)return`【${xe[0]}】: ${xe.slice(1).join(":")}`}return`【${Z}】`}).replace(/\*(.*?)\*/g,"《$1》").replace(/^- (.*$)/gim," • $1").replace(/^\d+\. (.*$)/gim," $&").replace(/```(.*?)```/gims,"💻 $1").replace(/`(.*?)`/g,"「$1」").replace(/\[([^\]]+)\]\([^)]+\)/g,"🔗 $1").replace(/\n\n/g,`
|
|||
|
|
`).replace(/\n/g,`
|
|||
|
|
`),mt=(U,Q,Z)=>{const xe=U.split(`
|
|||
|
|
`);let He=Z,Pe=[];for(let pe=0;pe<xe.length;pe++){const Je=xe[pe].trim(),Ge=Je.match(/^[-*+]\s*【(.+)】/);if(Ge){const Ct=Ge[1].trim(),Gt={id:`node_${He++}`,topic:Ct,children:[],level:(Q.level||0)+1,data:{}};let un=[],$n=pe+1;for(;$n<xe.length;){const mr=xe[$n].trim();if(mr.match(/^[-*+]\s*【(.+)】/))break;const Ia=mr.match(/^[-*+]\s+(.+)$/);if(Ia){const Li=Ia[1].trim(),Oa=Re(Li);un.push("• "+Oa)}$n++}if(un.length>0){const mr=Re(un.join(`
|
|||
|
|
`));Gt.topic=Gt.topic+`
|
|||
|
|
|
|||
|
|
`+mr}Q.children.push(Gt),pe=$n-1}else Je&&Pe.push(Je)}if(Pe.length>0){const pe=Pe.join(`
|
|||
|
|
`).trim();pe&&pe.split(`
|
|||
|
|
|
|||
|
|
`).filter(Je=>Je.trim()).forEach(Je=>{const Ge=Re(Je.trim());if(Ge){const Ct={id:`node_${He++}`,topic:Ge,children:[],level:(Q.level||0)+1,data:{}};Q.children.push(Ct)}})}return{nodeCounter:He}},Dt=U=>{const Q=U.split(`
|
|||
|
|
`);let Z=null;const xe=[];let He=0,Pe=[];if(Q.forEach((pe,Oe)=>{const Je=pe.trim(),Ge=Je.match(/^(#{1,6})\s+(.+)$/);if(Ge){if(Pe.length>0&&xe.length>0){const mr=Pe.join(`
|
|||
|
|
`).trim();mr&&(He=mt(mr,xe[xe.length-1],He).nodeCounter),Pe=[]}const Ct=Ge[1].length,Gt=Ge[2].trim(),un=Re(Gt),$n={id:`node_${He++}`,topic:un,children:[],level:Ct,data:{}};if(Ct===1&&!Z)Z=$n,xe.length=0,xe.push(Z);else{for(;xe.length>1&&xe[xe.length-1].level>=Ct;)xe.pop();xe.length>0&&xe[xe.length-1].children.push($n),xe.push($n)}}else Je&&Pe.push(Je)}),Pe.length>0&&xe.length>0){const pe=Pe.join(`
|
|||
|
|
`).trim();pe&&(He=mt(pe,xe[xe.length-1],He).nodeCounter)}return Z||(Z={id:"root",topic:"根节点",children:[],data:{}}),Z},Ut=async(U,Q,Z)=>{var xe,He,Pe;try{const Oe=(Hr=>Hr.replace(/^#+\s*/gm,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/^\s*[-*+]\s*(?![|])/gm,"• ").replace(/\n{3,}/g,`
|
|||
|
|
|
|||
|
|
`).trim())(Z),Je=`# ${Q}
|
|||
|
|
|
|||
|
|
${Oe}`,Ge=Dt(Je),Ct={title:Q,des:`AI追问产生的节点 - ${new Date().toLocaleString()}`,parentId:U.id,isRoot:!1},Gt=[];if(Ge.children&&Ge.children.length>0&&Ge.children.forEach(Hr=>{Gt.push({title:Hr.topic,des:"",parentId:null,isRoot:!1})}),console.log("当前思维导图ID:",p.value),!p.value)throw new Error("没有找到当前思维导图ID,无法创建节点");const un=await Un.addNodes(p.value,[Ct]);if(!un.data||!un.data.success)throw new Error("AI父节点创建失败");const $n=(Pe=(He=(xe=un.data.data)==null?void 0:xe.nodes)==null?void 0:He[0])==null?void 0:Pe.id;if(!$n)throw new Error("无法获取创建的父节点ID");Gt.forEach(Hr=>{Hr.parentId=$n});let mr=null;if(Gt.length>0&&(mr=await Un.addNodes(p.value,Gt)),un.data&&un.data.success)await er();else throw new Error("AI父节点创建失败")}catch(pe){console.error("创建AI节点失败:",pe),alert("创建AI回答节点失败: "+pe.message)}},jt=async()=>{if(l.value){try{const U=l.value.topic||l.value.title||"无标题";if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(U),Hn();else{const Q=document.createElement("textarea");Q.value=U,Q.style.position="fixed",Q.style.left="-999999px",Q.style.top="-999999px",document.body.appendChild(Q),Q.focus(),Q.select();const Z=document.execCommand("copy");document.body.removeChild(Q),Z?Hn():Mn()}}catch{Mn()}l.value=null}},Hn=()=>{const U=document.createElement("div");U.textContent="文本已复制到剪贴板",U.style.cssText=`
|
|||
|
|
position: fixed;
|
|||
|
|
top: 20px;
|
|||
|
|
right: 20px;
|
|||
|
|
background: #4CAF50;
|
|||
|
|
color: white;
|
|||
|
|
padding: 12px 20px;
|
|||
|
|
border-radius: 6px;
|
|||
|
|
font-size: 14px;
|
|||
|
|
z-index: 10000;
|
|||
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|||
|
|
animation: slideIn 0.3s ease;
|
|||
|
|
`;const Q=document.createElement("style");Q.textContent=`
|
|||
|
|
@keyframes slideIn {
|
|||
|
|
from { transform: translateX(100%); opacity: 0; }
|
|||
|
|
to { transform: translateX(0); opacity: 1; }
|
|||
|
|
}
|
|||
|
|
`,document.head.appendChild(Q),document.body.appendChild(U),setTimeout(()=>{U.parentNode&&U.parentNode.removeChild(U),Q.parentNode&&Q.parentNode.removeChild(Q)},3e3)},Mn=()=>{const U=document.createElement("div");U.textContent="复制失败,请手动复制",U.style.cssText=`
|
|||
|
|
position: fixed;
|
|||
|
|
top: 20px;
|
|||
|
|
right: 20px;
|
|||
|
|
background: #f44336;
|
|||
|
|
color: white;
|
|||
|
|
padding: 12px 20px;
|
|||
|
|
border-radius: 6px;
|
|||
|
|
font-size: 14px;
|
|||
|
|
z-index: 10000;
|
|||
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|||
|
|
animation: slideIn 0.3s ease;
|
|||
|
|
`,document.body.appendChild(U),setTimeout(()=>{U.parentNode&&U.parentNode.removeChild(U)},3e3)},Pn=(U,Q="success")=>{const Z=document.createElement("div");Z.textContent=U;const xe=Q==="success"?"#4CAF50":Q==="error"?"#f44336":"#ff9800";Z.style.cssText=`
|
|||
|
|
position: fixed;
|
|||
|
|
top: 20px;
|
|||
|
|
right: 20px;
|
|||
|
|
background: ${xe};
|
|||
|
|
color: white;
|
|||
|
|
padding: 12px 20px;
|
|||
|
|
border-radius: 6px;
|
|||
|
|
font-size: 14px;
|
|||
|
|
z-index: 10000;
|
|||
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|||
|
|
animation: slideIn 0.3s ease;
|
|||
|
|
`,document.body.appendChild(Z),setTimeout(()=>{Z.parentNode&&Z.parentNode.removeChild(Z)},2e3)},kn=()=>{const U=document.createElement("div");U.textContent="✅ 节点编辑已保存",U.style.cssText=`
|
|||
|
|
position: fixed;
|
|||
|
|
top: 20px;
|
|||
|
|
right: 20px;
|
|||
|
|
background: #4CAF50;
|
|||
|
|
color: white;
|
|||
|
|
padding: 12px 20px;
|
|||
|
|
border-radius: 6px;
|
|||
|
|
font-size: 14px;
|
|||
|
|
z-index: 10000;
|
|||
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|||
|
|
animation: slideIn 0.3s ease;
|
|||
|
|
`,document.body.appendChild(U),setTimeout(()=>{U.parentNode&&U.parentNode.removeChild(U)},2e3)},lr=()=>{const U=document.createElement("div");U.textContent="❌ 节点编辑保存失败",U.style.cssText=`
|
|||
|
|
position: fixed;
|
|||
|
|
top: 20px;
|
|||
|
|
right: 20px;
|
|||
|
|
background: #f44336;
|
|||
|
|
color: white;
|
|||
|
|
padding: 12px 20px;
|
|||
|
|
border-radius: 6px;
|
|||
|
|
font-size: 14px;
|
|||
|
|
z-index: 10000;
|
|||
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|||
|
|
animation: slideIn 0.3s ease;
|
|||
|
|
`,document.body.appendChild(U),setTimeout(()=>{U.parentNode&&U.parentNode.removeChild(U)},3e3)},cr=async U=>{try{console.log("🎯 处理节点拖拽操作:",U.name),console.log("📦 操作详情:",{name:U.name,objs:U.objs,toObj:U.toObj}),setTimeout(async()=>{var Q;try{const Z=U.objs||[],xe=U.toObj;if(!Z.length||!xe){console.warn("⚠️ 拖拽操作缺少必要信息");return}console.log(`📦 准备保存 ${Z.length} 个节点的父子关系`);let He=null;U.name==="moveNodeIn"?(He=xe.id,console.log(`📌 拖入操作:新父节点为 ${He}`)):(U.name==="moveNodeBefore"||U.name==="moveNodeAfter")&&(He=((Q=xe.parent)==null?void 0:Q.id)||null,console.log(`📌 拖到兄弟位置:新父节点为 ${He||"根节点"}`));const Pe=Z.map(async Ge=>{try{console.log(`🔄 更新节点 ${Ge.id} 的父节点为 ${He||"根节点"}`);const Ct=await Un.updateNode(Ge.id,{newParentId:He});return Ct.data&&Ct.data.success?(console.log(`✅ 节点 ${Ge.id} 父子关系更新成功`),{success:!0,nodeId:Ge.id}):(console.warn(`⚠️ 节点 ${Ge.id} 父子关系更新失败:`,Ct),{success:!1,nodeId:Ge.id})}catch(Ct){return console.error(`❌ 节点 ${Ge.id} 父子关系更新失败:`,Ct),{success:!1,nodeId:Ge.id,error:Ct}}}),pe=await Promise.all(Pe),Oe=pe.filter(Ge=>Ge.success).length,Je=pe.filter(Ge=>!Ge.success).length;console.log(`📊 拖拽保存结果: ${Oe} 成功, ${Je} 失败`)}catch(Z){console.error("❌ 保存拖拽后的结构失败:",Z),Pn("❌ 节点拖拽保存失败","error")}},500)}catch(Q){console.error("❌ 处理节点拖拽操作失败:",Q)}},zn=new Set,Ot=async U=>{var Z;const Q=`${U.name}-${(Z=U.obj)==null?void 0:Z.id}`;if(zn.has(Q)){console.log("⚠️ 跳过重复的编辑操作:",Q);return}zn.add(Q);try{console.log("🔍 处理编辑完成:",U);const xe=U.obj;xe?(console.log("🔍 保存编辑的节点:",{nodeId:xe.id,nodeTopic:xe.topic,hasDangerouslySetInnerHTML:!!xe.dangerouslySetInnerHTML}),await jn(xe)):console.error("无法解析编辑操作:",U)}catch(xe){console.error("处理编辑完成失败:",xe)}finally{zn.delete(Q)}},jn=async U=>{var Q,Z,xe;try{const He=U.id.replace(/^me/,"");if(console.log("🔍 更新节点编辑:",{originalNodeId:U.id,cleanNodeId:He,nodeTopic:U.topic,dangerouslySetInnerHTML:U.dangerouslySetInnerHTML,currentMindmapId:p.value}),!p.value){console.error("无法获取思维导图ID");return}const Pe={newTitle:U.topic,newDes:((Q=U.data)==null?void 0:Q.des)||"",newParentId:U.parentId||((Z=U.parent)==null?void 0:Z.id),newDangerouslySetInnerHTML:U.dangerouslySetInnerHTML||""};console.log("🔍 发送到后端的更新数据:",Pe);const pe=await Un.updateNode(He,Pe);if(pe.data&&pe.data.success){if(o.value&&U){let Oe=U.id;if(Oe.startsWith("me")&&(Oe=Oe.substring(2)),!Oe.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i)){console.error("❌ 无效的UUID格式:",Oe,"原始ID:",U.id);return}console.log("🔍 查找DOM元素,纯净ID:",Oe,"原始ID:",U.id),console.log("🔍 调试信息 - node对象:",{id:U.id,topic:((xe=U.topic)==null?void 0:xe.substring(0,50))+"...",hasDangerouslySetInnerHTML:!!U.dangerouslySetInnerHTML});try{const Je=o.value.findEle(Oe);console.log("🔍 找到的DOM元素:",Je),Je?(console.log("✅ DOM元素存在,直接更新内容..."),U.dangerouslySetInnerHTML?(console.log("🔍 更新HTML内容:",U.dangerouslySetInnerHTML.substring(0,100)+"..."),Je.innerHTML=U.dangerouslySetInnerHTML,console.log("📝 节点显示内容已更新 (updateNodeEdit) - 直接设置HTML")):U.topic?(console.log("🔍 更新文本内容:",U.topic.substring(0,100)+"..."),Je.textContent=U.topic,console.log("📝 节点显示内容已更新 (updateNodeEdit) - 设置文本")):console.warn("⚠️ node对象没有dangerouslySetInnerHTML或topic")):console.warn("⚠️ findEle返回了null或undefined")}catch(Je){console.warn("⚠️ 无法找到DOM元素:",Je.message,"纯净ID:",Oe)}}kn()}else console.error("更新节点编辑失败:",pe.data),lr()}catch(He){console.error("更新节点编辑失败:",He),lr()}},en=async U=>{var Q;try{await nr();const Z=p.value||U.mindmap_id
|
|||
|
|
`).replace(/<\/p>/gi,`
|
|||
|
|
|
|||
|
|
`).replace(/<p[^>]*>/gi,"").replace(/<strong>(.*?)<\/strong>/gi,"**$1**").replace(/<b>(.*?)<\/b>/gi,"**$1**").replace(/<em>(.*?)<\/em>/gi,"*$1*").replace(/<i>(.*?)<\/i>/gi,"*$1*").replace(/<ul[^>]*>/gi,`
|
|||
|
|
`).replace(/<\/ul>/gi,`
|
|||
|
|
`).replace(/<li[^>]*>/gi,"- ").replace(/<\/li>/gi,`
|
|||
|
|
`).replace(/<[^>]+>/g,"").replace(/\n{3,}/g,`
|
|||
|
|
|
|||
|
|
`).trim(),console.log("✅ 使用简单转换逻辑成功:",Z.substring(0,100)+"..."))}catch(Oe){console.error("❌ HTML 转 Markdown 失败:",Oe),Z=(U==null?void 0:U.dangerouslySetInnerHTML)||""}}else console.warn("⚠️ 没有找到任何可用的内容字段"),Z="";N.value=U.topic||U.title||"",z.value=Z,F.value=U,P.value=Q,console.log("🎯 最终设置的Markdown内容:",Z),console.log("🎯 编辑器标题:",N.value),y.value=!0,ja(()=>{setTimeout(()=>{if(console.log("🔄 准备初始化Vditor,容器状态:",ce.value),ce.value&&ce.value.offsetParent!==null)console.log("✅ 容器已可见,开始初始化Vditor"),tt();else{console.warn("⚠️ 容器未准备好,延迟初始化");let Oe=0;const Je=10,Ge=()=>{Oe++,ce.value&&ce.value.offsetParent!==null?(console.log("✅ 容器在第",Oe,"次尝试后可见"),tt()):Oe<Je?(console.log("🔄 第",Oe,"次检查,容器仍未准备好,继续等待..."),setTimeout(Ge,100)):(console.error("❌ 容器在",Je,"次尝试后仍未准备好"),alert("编辑器初始化失败,请刷新页面重试"))};setTimeout(Ge,100)}},50)})},Yi=()=>{if(!o.value)return;console.log("绑定事件监听器..."),di&&r.value.removeEventListener("wheel",di),cn&&r.value.removeEventListener("click",cn),di=Z=>{if(Z.ctrlKey||Z.metaKey){Z.preventDefault();const xe=Z.deltaY>0?.9:1.1,He=Math.max(.3,Math.min(3,v.value*xe));if(o.value){const Pe=r.value.querySelector(".map-container");Pe&&(Pe.style.transform=`scale(${He})`,v.value=He,localStorage.setItem("mindmap-zoom-level",He.toString()))}}},r.value.addEventListener("wheel",di),o.value.bus.addListener("select",Z=>{l.value=Z,setTimeout(()=>{le()},50)}),o.value.bus.addListener("selectNode",Z=>{l.value=Z,setTimeout(()=>{le()},50)}),o.value.bus.addListener("scale",Z=>{Math.abs(Z-1)<.01&&Math.abs(v.value-1)>.01&&setTimeout(()=>{bs()},50)}),window.zoomIntervalId&&clearInterval(window.zoomIntervalId);const U=setInterval(()=>{v.value!==1&&r.value&&Mt()},500);window.zoomIntervalId=U;let Q=0;cn=Z=>{const xe=Date.now();if(xe-Q<100)return;Q=xe;const He=Z.target,Pe=He.closest("me-tpc")||He.closest(".topic")||(He.classList.contains("topic")?He:null)||(He.tagName==="ME-TPC"?He:null);if(Pe){const pe=Pe.nodeObj;if(pe){l.value=pe;const Oe=r.value.getBoundingClientRect(),Je=Pe.getBoundingClientRect(),Ge=Je.left-Oe.left+Je.width/2,Ct=Je.bottom-Oe.top+8;h.value={left:`${Ge}px`,top:`${Ct}px`}}}else l.value=null,m.value&&(m.value=!1,x.value=null,w.value="",S.value=!1)},r.value.addEventListener("click",cn),o.value.bus.addListener("edit",Z=>{console.log("edit事件触发:",Z),Ir(Z)}),o.value.bus.addListener("editFinish",Z=>{console.log("editFinish事件触发:",Z),Ot(Z)}),o.value.bus.addListener("operation",Z=>{console.log("Mind Elixir操作事件:",Z),Z.name==="moveNodeIn"||Z.name==="moveNodeBefore"||Z.name==="moveNodeAfter"?(console.log("检测到节点拖拽操作:",Z.name,Z),cr(Z)):(Z.name==="finishEdit"||Z.name==="finishEditTable")&&(console.log("🔍 检测到编辑完成操作:",Z.name,Z),Ot(Z))}),o.value.bus.addListener("removeNode",Z=>{console.log("删除节点:",Z),ur(Z)})},bs=()=>{if(o.value){const U=localStorage.getItem("mindmap-zoom-level");if(U){const Q=parseFloat(U);if(Q>=.3&&Q<=3){const Z=r.value.querySelector(".map-container");Z&&(Z.style.transform=`scale(${Q})`,v.value=Q)}}}},Mt=()=>{if(o.value&&v.value!==1&&r.value){const U=r.value.querySelector(".map-container");U&&(U.style.transform=`scale(${v.value})`)}},ys=async()=>{var U;if(console.log("🚀🚀🚀 保存函数被调用 🚀🚀🚀"),console.log("🔍 mindElixir.value:",o.value),console.log("🔍 currentMindmapId.value:",p.value),console.log("🔍 mindmapEl.value:",r.value),console.log("🔍🔍🔍 全局状态检查开始 🔍🔍🔍"),console.log("🔍 - showWelcome:",b.value),console.log("🔍 - 是否有思维导图容器:",!!r.value),console.log("🔍 - MindElixir实例状态:",!!o.value),console.log("🔍🔍🔍 全局状态检查结束 🔍🔍🔍"),o.value&&o.value.data?(console.log("🔍🔍🔍 MindElixir数据检查开始 🔍🔍🔍"),console.log("🔍 - 数据对象:",o.value.d
|
|||
|
|
1. 提取主要主题和关键概念
|
|||
|
|
2. 组织成层次分明的结构
|
|||
|
|
3. 使用清晰的标题和子标题
|
|||
|
|
4. 保持内容的逻辑性和完整性
|
|||
|
|
5. 对于长文档,请确保完整处理所有内容,不要截断
|
|||
|
|
6. **重要:如果原文档中包含图片,请按以下方式处理:
|
|||
|
|
- 识别图片在文档中的位置和上下文
|
|||
|
|
- 根据图片内容生成准确的描述文字
|
|||
|
|
- 在相应位置插入图片占位符:
|
|||
|
|
- 图片描述要准确反映图片内容,图片路径可以是相对路径或占位符
|
|||
|
|
- 确保图片占位符放在逻辑上合适的位置**
|
|||
|
|
7. **重要:如果原文档中包含表格,请完整保留表格结构:
|
|||
|
|
- 保持表格的Markdown格式
|
|||
|
|
- 确保所有表格行都被包含
|
|||
|
|
- 不要省略任何表格内容
|
|||
|
|
- 对于合并单元格的表格,请使用HTML格式并正确使用rowspan和colspan属性
|
|||
|
|
- 如果表格结构复杂,优先使用HTML table标签而不是Markdown表格语法**
|
|||
|
|
8. **重要:确保内容完整性:
|
|||
|
|
- 不要截断任何内容
|
|||
|
|
- 保持原文的完整性
|
|||
|
|
- 所有重要信息都要包含在思维导图中**
|
|||
|
|
9. 输出格式:直接输出Markdown内容,不要添加任何说明文字或代码块标记`,ee=`请分析以下文档内容并生成结构化Markdown:
|
|||
|
|
|
|||
|
|
${he}`;await te(J,ee),await Me(),Rt(w.value.name,l.value),setTimeout(async()=>{try{await tt()}catch(Ce){console.error("自动保存失败:",Ce)}},1500)}catch(he){console.error("从文件生成Markdown失败:",he),q("生成失败: "+he.message,"error")}finally{c.value=!1}},z=he=>new Promise(async(J,ee)=>{try{const Ce=he.type.includes("text")||he.name.endsWith(".txt")||he.name.endsWith(".md"),se=he.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||he.type==="application/msword"||he.name.endsWith(".docx")||he.name.endsWith(".doc"),G=he.type==="application/pdf"||he.name.endsWith(".pdf");if(Ce){const X=new FileReader;X.onload=be=>J(be.target.result),X.onerror=()=>ee(new Error("文本文件读取失败")),X.readAsText(he)}else if(se){const X=await F(he);J(X)}else if(G){const X=await P(he);J(X)}else{const X=new FileReader;X.onload=be=>J(be.target.result),X.onerror=()=>ee(new Error("文件读取失败")),X.readAsText(he)}}catch(Ce){ee(Ce)}}),F=async he=>{try{if(he.name.endsWith(".docx")){const J=await d4(()=>import("./index-78c0373d.js").then(se=>se.i),[]),ee=await he.arrayBuffer();return(await J.extractRawText({arrayBuffer:ee})).value}else if(he.name.endsWith(".doc"))throw new Error("请将.doc文件转换为.docx格式,或安装相应的解析库")}catch(J){throw new Error(`Office文档解析失败: ${J.message}`)}},P=async he=>{try{const J=await d4(()=>import("./pdf-479b8ef5.js"),[]);J.GlobalWorkerOptions.workerSrc="/pdf.worker.min.mjs";const ee=await he.arrayBuffer(),Ce=await J.getDocument({data:ee}).promise;let se="";for(let G=1;G<=Ce.numPages;G++){const le=(await(await Ce.getPage(G)).getTextContent()).items.map(ye=>ye.str).join(" ");se+=le+`
|
|||
|
|
`}return se}catch(J){throw new Error(`PDF文件解析失败: ${J.message}`)}},Y=he=>he&&he.replace(/^好的[,,]?作为.*?专家[,,]?我已.*?分析.*?内容.*?生成了以下.*?思维导图[::]\s*/i,"").replace(/^好的[,,]?作为.*?专业的.*?专家[,,]?我已.*?分析.*?内容.*?生成了以下.*?思维导图[::]\s*/i,"").replace(/^以下是.*?结构化的.*?思维导图[::]\s*/i,"").replace(/^以下是.*?Markdown.*?思维导图[::]\s*/i,"").replace(/^以下是.*?Markdown.*?格式.*?思维导图[::]\s*/i,"").replace(/^```(?:markdown)?\s*/gm,"").replace(/```\s*$/gm,"").replace(/^「」`markdown\s*/gm,"").replace(/^「」`\s*/gm,"").replace(/^\s*「」`markdown\s*/gm,"").replace(/^\s*「」`\s*/gm,"").replace(/^作为.*?专家[,,]?我已.*?分析.*?内容.*?生成了以下.*?思维导图[::]\s*/i,"").replace(/^我已.*?分析.*?内容.*?生成了以下.*?思维导图[::]\s*/i,"").replace(/^根据.*?文档内容.*?生成了以下.*?思维导图[::]\s*/i,"").replace(/^基于.*?文档.*?生成了以下.*?思维导图[::]\s*/i,"").replace(/^以下是.*?分析.*?结果[::]\s*/i,"").replace(/^以下是.*?整理.*?结果[::]\s*/i,"").replace(/^以下是.*?结构化.*?内容[::]\s*/i,"").replace(/\n{3,}/g,`
|
|||
|
|
|
|||
|
|
`).trim(),te=async(he,J)=>{const Ce=he||`你是一位Markdown格式转换专家。你的任务是将用户提供的文章内容精确转换为结构化的Markdown格式。请遵循以下步骤:
|
|||
|
|
|
|||
|
|
提取主标题: 识别文章最顶层的主标题(通常为文章题目或书名),并使用Markdown的 # 级别表示。
|
|||
|
|
|
|||
|
|
识别层级标题: 从文章内容中提取所有层级的内容标题(从主标题后的第一个标题开始,Level 1 至 Level 4)。判断层级依据:
|
|||
|
|
|
|||
|
|
视觉与结构特征: 如独立成行/段、位置(行首)、格式(加粗、编号如 1., 1.1, (1), - 等)。
|
|||
|
|
|
|||
|
|
语义逻辑: 标题之间的包含和并列关系。
|
|||
|
|
|
|||
|
|
在Markdown中,使用相应标题级别:
|
|||
|
|
|
|||
|
|
Level 1 标题用 ##
|
|||
|
|
|
|||
|
|
Level 2 标题用 ###
|
|||
|
|
|
|||
|
|
Level 3 标题用 ####
|
|||
|
|
|
|||
|
|
Level 4 标题用 #####
|
|||
|
|
|
|||
|
|
精确保留原文标题文字,不得修改、概括或润色。
|
|||
|
|
|
|||
|
|
处理正文内容: 对于每个标题下的正文内容区块(从该标题后开始,直到下一个同级或更高级别标题前):
|
|||
|
|
|
|||
|
|
直接保留原文文本,但根据内容结构适当格式化为Markdown。
|
|||
|
|
|
|||
|
|
如果内容是列表(如项目符号或编号列表),使用Markdown列表语法(例如 - 用于无序列表,1. 用于有序列表)。
|
|||
|
|
|
|||
|
|
保持段落和换行不变。
|
|||
|
|
|
|||
|
|
**重要:如果原文档中包含图片,请按以下方式处理:
|
|||
|
|
1. 识别图片在文档中的位置和上下文
|
|||
|
|
2. 根据图片内容生成准确的描述文字
|
|||
|
|
3. 在相应位置插入图片占位符:
|
|||
|
|
4. 图片描述要准确反映图片内容,图片路径可以是相对路径或占位符
|
|||
|
|
5. 确保图片占位符放在逻辑上合适的位置**
|
|||
|
|
|
|||
|
|
输出格式: 输出必须是纯Markdown格式的文本,不得包含任何额外说明、JSON或非Markdown元素。确保输出与示例风格一致。直接输出Markdown内容,不要添加任何说明文字。`,se=J||"请将以下内容转换为结构化的Markdown格式:";try{const G=await fetch("http://127.0.0.1:8000/api/ai/generate-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({system_prompt:Ce,user_prompt:se,model:"glm-4.5",base_url:"https://open.bigmodel.cn/api/paas/v4/",api_key:"ce39bdd4fcf34ec0aec75072bc9ff988.hAp7HZTVUwy7vImn"})});if(!G.ok)throw new Error(`HTTP error! status: ${G.status}`);const X=G.body.getReader(),be=new TextDecoder;let le="",ye=0;for(;;){const{done:Ae,value:ze}=await X.read();if(Ae)break;le+=be.decode(ze,{stream:!0});const Xe=le.split(`
|
|||
|
|
`);le=Xe.pop()||"";for(const Ke of Xe)if(Ke.startsWith("data: "))try{const Be=JSON.parse(Ke.slice(6));if(Be.type==="start")q("AI开始生成内容...","info");else if(Be.type==="chunk"){if(ye++,l.value+=Be.content,ye%15===0&&l.value.length>100)try{const st=Y(l.value);if(st.length<10||!st.includes("#")){console.log("⚠️ 内容还不够完整,跳过此次转换"),console.log("⚠️ 内容长度:",st.length),console.log("⚠️ 内容预览:",st.substring(0,200));return}console.log("🔍 准备转换的内容长度:",st.length),console.log("🔍 准备转换的内容预览:",st.substring(0,500)),console.log("🔍 内容是否包含标题:",st.includes("#")),console.log("🔍 内容行数:",st.split(`
|
|||
|
|
`).length);const qe=await Ne(st);if(!qe||!qe.topic){console.log("⚠️ 转换结果无效,跳过此次更新"),console.log("🔍 转换结果详情:",qe),console.log("🔍 内容长度:",st.length),console.log("🔍 内容预览:",st.substring(0,200));return}h.value=JSON.stringify(qe,null,2),window.dispatchEvent(new CustomEvent("realtime-mindmap-update",{detail:{data:qe,title:qe.topic||"AI生成中...",source:"ai-streaming",chunkCount:ye,isIncremental:!0}}))}catch(st){if(console.warn("⚠️ 实时转换JSON失败:",st.message),console.warn("⚠️ 当前内容长度:",l.value.length),console.warn("⚠️ 当前内容预览:",l.value.substring(0,200)),l.value.length>50)try{const qe=je(l.value);window.dispatchEvent(new CustomEvent("realtime-mindmap-update",{detail:{data:qe,title:"AI生成中...",source:"ai-streaming-fallback",chunkCount:ye,isIncremental:!0}}))}catch(qe){console.warn("⚠️ 回退处理也失败:",qe)}}}else if(Be.type==="end")try{const st=Y(l.value),qe=Fe(st),Re=await Ne(st);h.value=JSON.stringify(Re,null,2),window.dispatchEvent(new CustomEvent("realtime-mindmap-update",{detail:{data:Re,title:Re.topic||"AI生成完成",source:"ai-final",chunkCount:ye}})),setTimeout(()=>{window.dispatchEvent(new CustomEvent("save-preview-to-database",{detail:{data:Re,title:Re.topic||"AI生成思维导图",source:"ai-generated",timestamp:Date.now()}}))},2e3),q("AI内容生成完成!正在保存到数据库...","success")}catch(st){console.error("⚠️ 最终处理失败:",st),console.error("⚠️ 错误详情:",st.message);try{const qe=je(l.value);h.value=JSON.stringify(qe,null,2),window.dispatchEvent(new CustomEvent("realtime-mindmap-update",{detail:{data:qe,title:"AI生成完成(简化版)",source:"ai-final-fallback",chunkCount:ye}})),setTimeout(()=>{window.dispatchEvent(new CustomEvent("save-preview-to-database",{detail:{data:qe,title:qe.topic||"AI生成思维导图(回退)",source:"ai-final-fallback",timestamp:Date.now()}}))},2e3),q("AI内容生成完成(简化版)!正在保存到数据库...","success")}catch(qe){console.error("⚠️ 回退处理也失败:",qe),q("AI内容生成完成,但格式处理遇到问题","warning")}}else if(Be.type==="error")throw new Error(Be.content)}catch(Be){console.warn("解析流式数据失败:",Be)}}}catch(G){throw console.error("流式AI API调用失败:",G),G}},ce=he=>{if(he.includes("|")&&he.includes("-")){const J=he.split(`
|
|||
|
|
`);let ee=!1,Ce=!1;for(const se of J){const G=se.trim();G.includes("|")&&G.split("|").length>=3&&(ee=!0),G.includes("|")&&G.includes("-")&&/^[\s\|\-\:]+$/.test(G)&&(Ce=!0)}if(ee&&Ce)return console.log("🚫 formatMarkdownToText: 检测到表格内容,跳过转换"),he}return he.replace(/^### (.*$)/gim,"📋 $1").replace(/^## (.*$)/gim,"📌 $1").replace(/^# (.*$)/gim,"🎯 $1").replace(/\*\*(.*?)\*\*/g,(J,ee)=>{if(ee.includes(":")){const Ce=ee.split(":");if(Ce.length>1)return`【${Ce[0]}】: ${Ce.slice(1).join(":")}`}return`【${ee}】`}).replace(/\*(.*?)\*/g,"《$1》").replace(/^- (.*$)/gim," • $1").replace(/^\d+\. (.*$)/gim," $&").replace(/```(.*?)```/gims,"💻 $1").replace(/`(.*?)`/g,"「$1」").replace(/\[([^\]]+)\]\([^)]+\)/g,"🔗 $1").replace(/\n\n/g,`
|
|||
|
|
`).replace(/\n/g,`
|
|||
|
|
`).split(`
|
|||
|
|
`).map(J=>J.length>80?J.substring(0,77)+"...":J).join(`
|
|||
|
|
`).trim()},Me=async()=>{if(!l.value.trim()){q("请输入Markdown内容","error");return}p.value=!0;try{const he=Y(l.value),J=Ne(he);h.value=JSON.stringify(J,null,2)}catch(he){console.error("转换失败:",he),q("转换失败,请检查Markdown格式","error")}finally{p.value=!1}},Fe=he=>{const J=/!\[([^\]]*)\]\(([^)]*)\)/g,ee=[];let Ce;for(;(Ce=J.exec(he))!==null;){let se=Ce[2];const G=Ce[1]||"";if(console.log(`🔍 发现图片匹配: alt="${G}", url="${se}"`),se&&se.trim()){if(se=se.trim(),se.endsWith("...")||se.endsWith("..")||se.length<10){console.log(`⚠️ 检测到不完整的图片URL: ${se}`);continue}se.startsWith("http")||se.startsWith("data:")||se.startsWith("/")||se.startsWith("./")?(ee.push({alt:G,url:se,fullMatch:Ce[0]}),console.log(`✅ 有效图片URL: ${se}`)):console.warn(`⚠️ 跳过格式不支持的图片URL: ${se}`)}else console.warn("⚠️ 跳过空的图片URL")}return console.log(`🔍 从内容中提取到 ${ee.length} 张图片:`,ee),ee},We=he=>{if(!he)return"";let J=he.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,"");return J=J.replace(/\n{3,}/g,`
|
|||
|
|
|
|||
|
|
`),J.trim()},rt=he=>{if(!he)return"";let J=he;J=J.replace(/!\[([^\]]*)\]\(([^)]*\.\.\.?)\)/g,""),J=J.replace(/!\[([^\]]*)\]\(([^)]*)\)/g,(G,X,be)=>!be||be.length<10||be.endsWith("...")||be.endsWith("..")?(console.log("🔧 移除不完整的图片引用:",G),""):G);const ee=J.split(`
|
|||
|
|
`);let Ce=!1;for(const G of ee)if(G.trim().match(/^#{1,6}\s+.+/)){Ce=!0;break}if(!Ce&&ee.length>0){const G=ee[0].trim();G&&!G.startsWith("#")&&G.length>0&&(J=`# ${G}
|
|||
|
|
|
|||
|
|
${ee.slice(1).join(`
|
|||
|
|
`)}`,console.log("🔧 修复:将第一行转换为标题"))}J=J.replace(/^[-*+]\s*$/gm,"");const se=J.match(/```/g);return se&&se.length%2===1&&(J+="\n```",console.log("🔧 修复:添加缺失的代码块闭合标记")),J=J.replace(/\*\*([^*]*)$/,"**$1**"),J=J.replace(/\*([^*]*)$/,"*$1*"),J=J.replace(/\n{3,}/g,`
|
|||
|
|
|
|||
|
|
`),J&&!J.endsWith(`
|
|||
|
|
`)&&(J+=`
|
|||
|
|
`),console.log("🔧 预处理完成,原始长度:",he.length,"处理后长度:",J.length),J},je=he=>{if(!he)return{id:"root",topic:"AI生成中...",children:[{id:"node_1",topic:"内容生成中,请稍候...",children:[],level:1,data:{},expanded:!0}]};const J=he.split(`
|
|||
|
|
`).filter(G=>G.trim());let ee="AI生成中...";for(const G of J){const X=G.trim();if(X.startsWith("#")){ee=X.replace(/^#+\s*/,"").trim();break}else if(X.length>5&&!X.startsWith("```")&&!X.startsWith("**")){ee=X.substring(0,30)+(X.length>30?"...":"");break}}const Ce=J.filter(G=>{const X=G.trim();return X.length>10&&!X.startsWith("#")&&!X.startsWith("```")&&!X.startsWith("**")&&!X.startsWith("- ")&&!X.startsWith("* ")&&!X.startsWith("+ ")}),se=[];return Ce.slice(0,3).forEach((G,X)=>{const be=G.trim().substring(0,50);be&&se.push({id:`node_${X+1}`,topic:be+(G.trim().length>50?"...":""),children:[],level:1,data:{},expanded:!0})}),se.length===0&&se.push({id:"node_1",topic:"内容生成中,请稍候...",children:[],level:1,data:{},expanded:!0}),{id:"root",topic:ee,children:se}},Ne=async he=>{try{if(!he||typeof he!="string")throw new Error("Markdown内容为空或格式错误");const ee=rt(he).split(`
|
|||
|
|
`);let Ce=null;const se=[];let G=0,X=[];for(let ye=0;ye<ee.length;ye++){const ze=ee[ye].trim(),Xe=ze.match(/^(#{1,6})\s+(.+)$/);if(Xe){if(X.length>0&&se.length>0){const mt=X.join(`
|
|||
|
|
`).trim();if(mt){const Dt={id:`node_${G++}`,topic:mt,children:[],level:(se[se.length-1].level||0)+1,data:{},expanded:!0};se[se.length-1].children.push(Dt)}X=[]}const Ke=Xe[1].length,Be=Xe[2].trim(),st=Fe(Be),qe=We(ce(Be));st.length>0&&console.log(`🖼️ 在标题中发现 ${st.length} 张图片: ${Be}`);const Re={id:`node_${G++}`,topic:qe,children:[],level:Ke,data:{},expanded:!0};if(st.length>0){const mt=st[0];if(mt.url&&mt.url.trim()!==""){let Dt=mt.url;Dt.includes("cdn-mineru.openxlab.org.cn")&&(Dt=`/proxy-image${Dt.replace("https://cdn-mineru.openxlab.org.cn","")}`);const Ut=``;Re.topic=qe||"图片节点",Re.dangerouslySetInnerHTML=Ut,console.log(`✅ 成功为标题节点设置图片Markdown: ${Ut}`)}else console.error("❌ 标题图片URL无效:",mt)}if(Ke===1&&!Ce)Ce=Re,se.length=0,se.push(Ce);else{for(;se.length>1&&se[se.length-1].level>=Ke;)se.pop();se.length>0&&se[se.length-1].children.push(Re),se.push(Re)}}else ze&&X.push(ze)}if(X.length>0&&se.length>0){const ye=X.join(`
|
|||
|
|
`).trim();if(ye){ye.includes("|")&&console.log("🔍 处理最后的内容(包含表格):",ye.substring(0,200)+"...");const Ae={id:`node_${G++}`,topic:ye,children:[],level:(se[se.length-1].level||0)+1,data:{},expanded:!0};se[se.length-1].children.push(Ae)}}Ce||(console.warn("⚠️ 没有找到根节点,创建默认结构"),console.log("🔍 原因分析:"),console.log("- Markdown内容长度:",he.length),console.log("- 是否包含标题(#):",he.includes("#")),console.log("- 前几行内容:",he.split(`
|
|||
|
|
`).slice(0,5)),Ce={id:"root",topic:"根节点",children:[],data:{},expanded:!0});const be=ye=>{let Ae=1;return ye.children&&ye.children.forEach(ze=>{Ae+=be(ze)}),Ae},le=be(Ce);return console.log("🔍 markdownToJSON返回结果:"),console.log("- 根节点ID:",Ce.id),console.log("- 根节点topic:",Ce.topic),console.log("- 子节点数量:",Ce.children?Ce.children.length:0),console.log("- 总节点数:",le),Ce}catch(J){return console.error("❌ Markdown转JSON失败:",J),console.error("❌ 错误详情:",J.message),console.error("❌ 输入内容长度:",(he==null?void 0:he.length)||0),console.error("❌ 输入内容预览:",(he==null?void 0:he.substring(0,200))||"无内容"),je(he||"")}},nt=async()=>{if(!l.value){q("没有Markdown内容可复制","error");return}try{await navigator.clipboard.writeText(l.value),q("Markdown已复制到剪贴板","success")}catch{const J=document.createElement("textarea");J.value=l.value,document.body.appendChild(J),J.select(),document.execCommand("copy"),J.remove(),q("Markdown已复制到剪贴板","success")}},ct=async()=>{try{await navigator.clipboard.writeText(h.value),q("JSON已复制到剪贴板","success")}catch(he){console.error("复制失败:",he),q("复制失败","error")}},tt=async()=>{if(!h.value){q("请先生成或转换JSON数据","error");return}try{const he=JSON.parse(h.value),J=he.topic||he.title||`AI生成的思维导图_${new Date().toLocaleString()}`,ee=new CustomEvent("save-preview-to-database",{detail:{data:he,title:J,source:"ai-generated",timestamp:Date.now()}});window.dispatchEvent(ee),setTimeout(()=>{q("思维导图已保存成功!","success"),w.value=null,x.value&&(x.value.value="")},2e3)}catch(he){console.error("JSON解析失败:",he),q("JSON格式错误,请检查数据","error")}},q=(he,J="info")=>{const ee=document.createElement("div");switch(ee.className=`notification notification-${J}`,ee.textContent=he,ee.style.cssText=`
|
|||
|
|
position: fixed;
|
|||
|
|
top: 20px;
|
|||
|
|
right: 20px;
|
|||
|
|
padding: 12px 20px;
|
|||
|
|
border-radius: 8px;
|
|||
|
|
font-size: 14px;
|
|||
|
|
font-weight: 500;
|
|||
|
|
z-index: 10000;
|
|||
|
|
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|||
|
|
animation: slideIn 0.3s ease;
|
|||
|
|
max-width: 300px;
|
|||
|
|
word-wrap: break-word;
|
|||
|
|
`,J){case"success":ee.style.background="#4CAF50",ee.style.color="white";break;case"error":ee.style.background="#f44336",ee.style.color="white";break;case"info":default:ee.style.background="#2196F3",ee.style.color="white";break}if(!document.querySelector("#notification-styles")){const Ce=document.createElement("style");Ce.id="notification-styles",Ce.textContent=`
|
|||
|
|
@keyframes slideIn {
|
|||
|
|
from { transform: translateX(100%); opacity: 0; }
|
|||
|
|
to { transform: translateX(0); opacity: 1; }
|
|||
|
|
}
|
|||
|
|
@keyframes slideOut {
|
|||
|
|
from { transform: translateX(0); opacity: 1; }
|
|||
|
|
to { transform: translateX(100%); opacity: 0; }
|
|||
|
|
}
|
|||
|
|
`,document.head.appendChild(Ce)}document.body.appendChild(ee),setTimeout(()=>{ee.style.animation="slideOut 0.3s ease",setTimeout(()=>{ee.parentNode&&ee.parentNode.removeChild(ee)},300)},3e3)},Ht=()=>{l.value="",h.value="",q("内容已清空","info")},Rt=(he,J,ee=null)=>{const Ce={title:he,content:J,mindmapId:ee,timestamp:new Date};v.value.unshift(Ce),v.value.length>10&&(v.value=v.value.slice(0,10)),localStorage.setItem("ai-sidebar-history",JSON.stringify(v.value))},$t=async he=>{he.mindmapId?window.dispatchEvent(new CustomEvent("loadMindmapFromHistory",{detail:{mindmapId:he.mindmapId,title:he.title}})):(l.value=he.content,await Me(),window.dispatchEvent(new CustomEvent("loadMindmapFromHistory",{detail:{markdown:he.content,json:h.value,title:he.title}})))},Nt=he=>new Date(he).toLocaleString("zh-CN");Fp(()=>{const he=localStorage.getItem("ai-sidebar-history");if(he)try{v.value=JSON.parse(he)}catch(J){console.error("加载历史记录失败:",J)}window.addEventListener("add-to-history",J=>{const{title:ee,content:Ce,timestamp:se}=J.detail;Rt(ee,Ce,null)}),window.addEventListener("mindmap-saved",J=>{const{mindmapId:ee,title:Ce,timestamp:se}=J.detail,G=v.value.find(X=>X.title===Ce||X.timestamp&&Math.abs(X.timestamp-se)<5e3);G?(G.mindmapId=ee,localStorage.setItem("ai-sidebar-history",JSON.stringify(v.value))):Rt(Ce,"",ee)}),kl(o,(J,ee)=>{}),kl(l,(J,ee)=>{})});const oe=async()=>{try{const he=await fetch("http://127.0.0.1:8000/api/ai/test-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({test:"data"})});if(!he.ok)throw new Error(`HTTP error! status: ${he.status}`);const J=he.body.getReader(),ee=new TextDecoder;let Ce="";for(;;){const{done:se,value:G}=await J.read();if(se)break;Ce+=ee.decode(G,{stream:!0});const X=Ce.split(`
|
|||
|
|
`);Ce=X.pop()||"";for(const be of X)if(be.startsWith("data: "))try{const le=JSON.parse(be.slice(6))}catch(le){console.warn("解析测试数据失败:",le)}}}catch(he){console.error("❌ 测试流式API失败:",he)}};return window.testStreamAPI=oe,Rc(()=>{}),(he,J)=>(Kt(),Xt("div",sM,[De("div",{class:"sidebar-toggle",onClick:S,title:r.value?"展开AI助手":"折叠AI助手",style:os({left:r.value?"10px":"420px"})},[r.value?(Kt(),Xt("svg",cM,[...J[1]||(J[1]=[De("path",{d:"M9 18l6-6-6-6"},null,-1)])])):(Kt(),Xt("svg",uM,[...J[2]||(J[2]=[De("path",{d:"M15 18l-6-6 6-6"},null,-1)])]))],12,lM),De("div",{class:ss(["ai-sidebar",{"sidebar-collapsed":r.value}])},[X0(De("div",dM,[J[12]||(J[12]=De("div",{class:"sidebar-header"},[De("h3",null,"🤖 AI 助手"),De("p",null,"文档转思维导图工具"),De("div",{class:"collapse-hint"},[De("small",null,"💡 点击右侧按钮可折叠侧边栏")])],-1)),De("div",hM,[J[6]||(J[6]=De("h4",null,"📁 生成思维导图",-1)),De("div",pM,[J[4]||(J[4]=De("label",null,"上传文件:",-1)),De("div",{class:"file-upload-area",onDrop:C,onDragover:T,onDragleave:A},[De("input",{type:"file",ref_key:"fileInput",ref:x,onChange:k,accept:".txt,.md,.doc,.docx,.pdf",class:"file-input"},null,544),De("div",{class:ss(["file-upload-placeholder",{"drag-over":b.value}])},[...J[3]||(J[3]=[De("span",{class:"upload-icon"},"📎",-1),De("span",{class:"upload-text"},"点击选择文件或拖拽文件到此处",-1),De("span",{class:"upload-hint"},"支持 .txt, .md, .doc, .docx, .pdf 格式",-1)])],2)],32)]),w.value?(Kt(),Xt("div",fM,[De("div",mM,[De("div",gM,[De("span",vM,"📄 "+Jr(w.value.name),1),De("span",bM,"("+Jr(y(w.value.size))+")",1)]),De("button",{onClick:M,class:"btn-remove",title:"删除文件"},[...J[5]||(J[5]=[De("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[De("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6"})],-1)])])])])):Yr("",!0),De("div",yM,[De("button",{onClick:N,disabled:!w.value||c.value,class:"btn-primary"},[c.value?(Kt(),Xt("span",xM,"AI生成中...")):(Kt(),Xt("span",kM,"AI生成思维导图"))],8,wM)])]),v.value.length>0?(Kt(),Xt("div",SM,[J[7]||(J[7]=De("h4",null,"📚 历史记录",-1)),De("div",EM,[(Kt(!0),Xt(wi,null,W4(v.value,(ee,Ce)=>(Kt(),Xt("div",{key:Ce,class:"history-item",onClick:se=>$t(ee)},[De("div",AM,Jr(ee.title),1),De("div",MM,Jr(Nt(ee.timestamp)),1)],8,TM))),128))])])):Yr("",!0),De("div",CM,[J[9]||(J[9]=De("h4",null,"📝 AI生成的Markdown结果",-1)),De("div",LM,[J[8]||(J[8]=De("label",null,"Markdown内容:",-1)),X0(De("textarea",{"onUpdate:modelValue":J[0]||(J[0]=ee=>l.value=ee),placeholder:"AI生成的Markdown内容将显示在这里",rows:"6",readonly:"",class:"markdown-result"},null,512),[[Wp,l.value]])]),De("div",_M,[De("button",{onClick:Me,disabled:p.value,class:"btn-secondary"},[p.value?(Kt(),Xt("span",DM,"转换中...")):(Kt(),Xt("span",RM,"🔄 转换为JSON"))],8,NM),De("button",{onClick:Ht,class:"btn-clear"},"清空"),De("button",{onClick:nt,class:"btn-copy"},"📋 复制Markdown")])]),De("div",IM,[J[11]||(J[11]=De("h4",null,"📊 Markdown转JSON结果",-1)),g.value?(Kt(),Xt("div",OM,[J[10]||(J[10]=De("div",{class:"spinner"},null,-1)),De("span",null,Jr(m.value),1)])):Yr("",!0),De("div",HM,[De("pre",PM,Jr(h.value||"JSON转换结果将显示在这里"),1),De("div",zM,[De("button",{onClick:ct,class:"btn-copy"},"📋 复制JSON"),De("button",{onClick:tt,disabled:g.value,class:"btn-copy"},Jr(g.value?"处理中...":"👁️ 预览"),9,BM)])])])],512),[[jb,!r.value]])],2)]))}},qM=Gp(FM,[["__scopeId","data-v-4edf6f37"]]);const jM={class:"markdown-test"},$M={class:"test-section"},UM={class:"test-section"},VM=["innerHTML"],WM={class:"test-section"},GM={class:"test-cases"},KM=["onClick"],XM={__name:"MarkdownTest",setup(t){const e=yt(`# 测试标题
|
|||
|
|
|
|||
|
|
这是一个**粗体**和*斜体*的测试。
|
|||
|
|
|
|||
|
|
## 表格测试
|
|||
|
|
|
|||
|
|
| 产品 | 价格 | 库存 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| 苹果 | 4元 | 100个 |
|
|||
|
|
| 香蕉 | 2元 | 50个 |
|
|||
|
|
|
|||
|
|
## 代码测试
|
|||
|
|
|
|||
|
|
\`\`\`javascript
|
|||
|
|
function hello() {
|
|||
|
|
console.log('Hello World!');
|
|||
|
|
}
|
|||
|
|
\`\`\`
|
|||
|
|
|
|||
|
|
行内代码:\`const name = 'test'\`
|
|||
|
|
|
|||
|
|
## 列表测试
|
|||
|
|
|
|||
|
|
- 项目1
|
|||
|
|
- 项目2
|
|||
|
|
- 子项目2.1
|
|||
|
|
- 子项目2.2
|
|||
|
|
- 项目3
|
|||
|
|
|
|||
|
|
## 链接测试
|
|||
|
|
|
|||
|
|
- [GitHub](https://github.com)
|
|||
|
|
- [Vue.js](https://vuejs.org)`),n=yt([{name:"基础表格",content:`# 产品价格表
|
|||
|
|
|
|||
|
|
| 产品 | 价格 |
|
|||
|
|
|------|------|
|
|||
|
|
| 苹果 | 4元 |
|
|||
|
|
| 香蕉 | 2元 |`},{name:"复杂表格",content:`# 技术栈对比
|
|||
|
|
|
|||
|
|
| 技术 | 前端 | 后端 | 数据库 |
|
|||
|
|
|------|------|------|--------|
|
|||
|
|
| Vue.js | ✅ | ❌ | ❌ |
|
|||
|
|
| Django | ❌ | ✅ | ❌ |
|
|||
|
|
| PostgreSQL | ❌ | ❌ | ✅ |`},{name:"代码块",content:`# 代码示例
|
|||
|
|
|
|||
|
|
\`\`\`javascript
|
|||
|
|
function markdownToJSON(markdown) {
|
|||
|
|
const lines = markdown.split('\\n');
|
|||
|
|
// 处理逻辑...
|
|||
|
|
return result;
|
|||
|
|
}
|
|||
|
|
\`\`\``},{name:"混合内容",content:`# 混合内容测试
|
|||
|
|
|
|||
|
|
这是一个包含**粗体**、*斜体*和\`行内代码\`的段落。
|
|||
|
|
|
|||
|
|
## 表格
|
|||
|
|
|
|||
|
|
| 功能 | 状态 | 说明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| 表格渲染 | ✅ | 支持markdown表格 |
|
|||
|
|
| 代码高亮 | ✅ | 支持代码块 |
|
|||
|
|
|
|||
|
|
## 代码
|
|||
|
|
|
|||
|
|
\`\`\`python
|
|||
|
|
def hello_world():
|
|||
|
|
print("Hello, World!")
|
|||
|
|
\`\`\``}]),r=fv(()=>{if(!e.value)return"";try{return m2(e.value)}catch(h){return`<div class="error">渲染失败: ${h.message}</div>`}}),o=()=>{},l=h=>{e.value=h.content};return(h,c)=>(Kt(),Xt("div",jM,[c[4]||(c[4]=De("h2",null,"Markdown渲染测试",-1)),De("div",$M,[c[1]||(c[1]=De("h3",null,"输入Markdown内容",-1)),X0(De("textarea",{"onUpdate:modelValue":c[0]||(c[0]=p=>e.value=p),placeholder:"输入markdown内容...",rows:"10",class:"markdown-input"},null,512),[[Wp,e.value]])]),De("div",UM,[c[2]||(c[2]=De("h3",null,"渲染结果",-1)),De("div",{class:"rendered-content",innerHTML:r.value},null,8,VM)]),De("div",WM,[c[3]||(c[3]=De("h3",null,"测试用例",-1)),De("button",{onClick:o,class:"test-btn"},"加载测试用例"),De("div",GM,[(Kt(!0),Xt(wi,null,W4(n.value,(p,v)=>(Kt(),Xt("button",{key:v,onClick:b=>l(p),class:"test-case-btn"},Jr(p.name),9,KM))),128))])])]))}},ZM=Gp(XM,[["__scopeId","data-v-68a00828"]]);const YM={id:"app"},JM={class:"test-mode-toggle",style:{display:"none"}},QM={key:0,class:"test-mode"},eC={key:1},tC={class:"main-content"},nC={__name:"App",setup(t){const e=yt(null),n=yt(!1),r=()=>{n.value=!n.value},o=()=>{e.value&&e.value.showMindMapPage()};return(l,h)=>(Kt(),Xt("div",YM,[h[0]||(h[0]=Up("« ",-1)),De("div",JM,[De("button",{onClick:r,class:"test-btn"},Jr(n.value?"切换到思维导图":"测试Markdown渲染"),1)]),n.value?(Kt(),Xt("div",QM,[Gr(ZM)])):(Kt(),Xt("div",eC,[Gr(qM,{onStartRealtimeGeneration:o}),De("div",tC,[Gr(iM,{ref_key:"mindMapRef",ref:e},null,512)])]))]))}};ly(nC).mount("#app");export{d4 as _,Bh as c,iC as g};
|