diff --git a/README.md b/README.md index e3aeebeb..e19e043b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,26 @@ > 中文名:思绪思维导图。一个简单&强大的 Web 思维导图库和思维导图软件。 -本项目主要包含以下内容: +# 客户端和插件 + +- 思绪思维导图客户端 + +支持Windows、Mac及Linux系统。下载地址:[Github](https://github.com/wanglin2/mind-map/releases)、[百度网盘](https://pan.baidu.com/s/1C8phEJ5pagAAa-o1tU42Uw?pwd=jqfb)、[夸克网盘](https://pan.quark.cn/s/2733982f1976) + +> 如果在macOS上安装后无法打开,报错**不受信任**或者**移到垃圾箱**,执行下面命令后再启动即可: +> ``` shell +> sudo xattr -d com.apple.quarantine /Applications/思绪思维导图.app +> ``` + +- Obsidian插件 + +下载地址:[Github](https://github.com/wanglin2/obsidian-simplemindmap/releases) + +- UTools插件 + +已上架[uTools](https://www.u.tools/)插件应用市场,可直接在`uTools`插件应用市场中搜索`思绪`进行安装,也可以直接访问该地址:[主页](https://www.u-tools.cn/plugins/detail/%E6%80%9D%E7%BB%AA%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE/),点击右侧的【启动】按钮进行安装 + +# 库 - 一个 `js` 思维导图库,不依赖任何框架,可以用来快速完成 Web 思维导图产品的开发。 @@ -19,22 +38,6 @@ > 在线地址:[https://wanglin2.github.io/mind-map/](https://wanglin2.github.io/mind-map/) -- 客户端和插件 - -> 1.独立客户端,支持Windows、Mac及Linux系统。 -> -> 下载地址:[Github](https://github.com/wanglin2/mind-map/releases)、[百度云盘](https://pan.baidu.com/s/1huasEbKsGNH2Af68dvWiOg?pwd=3bp3) -> 如果在macOS上安装后无法打开,报错**不受信任**或者**移到垃圾箱**,执行下面命令后再启动即可: -> ``` shell -> sudo xattr -d com.apple.quarantine /Applications/思绪思维导图.app -> ``` - -> 2.`uTools`插件,现已上架[uTools](https://www.u.tools/)插件应用市场。 -> -> 可直接在`uTools`插件应用市场中搜索`思绪`进行安装,也可以直接访问该地址:[主页](https://www.u-tools.cn/plugins/detail/%E6%80%9D%E7%BB%AA%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE/),点击右侧的【启动】按钮进行安装。 - -> 3.`obsidian`插件,正在开发中,敬请期待~ - - 云存储版本,如果你需要带后端的云存储版本,可以尝试我们开发的另一个项目[理想文档](https://github.com/wanglin2/lx-doc)。 # 特性 @@ -114,27 +117,15 @@ const mindMap = new MindMap({ # License -[MIT](./LICENSE)。保留`simple-mind-map`版权声明和注明来源的情况下可随意商用,如有疑问或不想保留可联系作者通过付费的方式去除。 +[MIT](./LICENSE)。保留`simple-mind-map`版权声明和注明来源的情况下可随意商用,如有疑问或不想保留可联系作者(微信:wanglinguanfang)通过付费的方式去除。 > 示例:可以在你应用中的关于页面、帮助页面、文档页面、开源声明等任何页面添加以下内容: > > 本产品思维导图基于SimpleMindMap项目开发,版权归源项目所有,[开源协议](https://github.com/wanglin2/mind-map/blob/main/LICENSE)。 -# 微信交流群 +# 开发帮助/技术支持/咨询等 -微信添加`wanglinguanfang`拉你入群。根据过往的经验,大部分问题都可以通过查看issue列表或文档解决,所以提问前请确保你已经阅读完了所有文档,文档里没有的可在群里提问,不必私聊作者,如果你一定要私聊,请先赞助本项目(¥200+)。 - -
|
-
-
- - 微信公众号 - - |
-
-
-
-
${pe(e)}
`).join("")};let J=null;const Z=e=>{J||(J=document.createElement("div")),J.innerHTML=e;const t=J.querySelectorAll(".ql-formula");Array.from(t).forEach(e=>{const t=document.createTextNode("$smmformula$");e.parentNode.replaceChild(t,e)});const n=J.childNodes;let i=[];for(let o=0;o${pe(e)}
`).join(""),t.length>0){e=e.replace(/\$smmformula\$/g,''),J.innerHTML=e;const n=J.querySelectorAll(".smmformula");Array.from(n).forEach((e,n)=>{e.parentNode.replaceChild(t[n],e)}),e=J.innerHTML}return e},q=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),$=(e,t)=>{const n={};return Object.keys(t).forEach(i=>{const o=e[i],r=t[i];if(P(o)===P(r)){if("Object"===P(o)){if(JSON.stringify(o)!==JSON.stringify(r))return void(n[i]=r)}else if(o!==r)return void(n[i]=r)}else n[i]=r}),n},Q=e=>!/^_/.test(e)&&!o["f"].includes(e),ee=e=>{const t=[...d["c"]],n=Object.keys(e);for(let i=0;i${ge(e)}
`).join("")};let Z=null;const q=e=>{Z||(Z=document.createElement("div")),Z.innerHTML=e;const t=Z.querySelectorAll(".ql-formula");Array.from(t).forEach(e=>{const t=document.createTextNode("$smmformula$");e.parentNode.replaceChild(t,e)});const n=Z.childNodes;let i=[];for(let o=0;o${ge(e)}
`).join(""),t.length>0){e=e.replace(/\$smmformula\$/g,''),Z.innerHTML=e;const n=Z.querySelectorAll(".smmformula");Array.from(n).forEach((e,n)=>{e.parentNode.replaceChild(t[n],e)}),e=Z.innerHTML}return e},$=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),Q=(e,t)=>{const n={};return Object.keys(t).forEach(i=>{const o=e[i],r=t[i];if(D(o)===D(r)){if("Object"===D(o)){if(JSON.stringify(o)!==JSON.stringify(r))return void(n[i]=r)}else if(o!==r)return void(n[i]=r)}else n[i]=r}),n},ee=e=>!/^_/.test(e)&&!o["f"].includes(e),te=e=>{const t=[...d["c"]],n=Object.keys(e);for(let i=0;iC(l/v)&&A("overflow"),s*=v}e=b.length+1,k=z(w-o,e,0==o),C(w/e)>l-x&&A("overflow"),x+=C(w/e),w%=e,b.splice(w++,0,x)}return M(b)}function L(t){var e,n,i,r,o,s,a,d,p,v,b,y,w,x,S,T=[];for(t=E(t),y=t.length,e=m,n=0,o=f,s=0;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");-1===n&&(n=e);var i=n===e?0:4-n%4;return[n,i]}function h(t){var e=c(t),n=e[0],i=e[1];return 3*(n+i)/4-i}function u(t,e,n){return 3*(e+n)/4-n}function d(t){var e,n,i=c(t),s=i[0],a=i[1],l=new o(u(t,s,a)),h=0,d=a>0?s-4:s;for(n=0;n=s)return-1;if(n=t.src.charCodeAt(o++),n<48||n>57)return-1;for(;;){if(o>=s)return-1;if(n=t.src.charCodeAt(o++),!(n>=48&&n<=57)){if(41===n||46===n)break;return-1}if(o-r>=10)return-1}return o=4)return!1;if(t.listIndent>=0&&t.sCount[I]-t.listIndent>=4&&t.sCount[I]=t.pos)throw new Error("inline rule didn't increment state.pos");break}if(e){if(t.pos>=s)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},s.prototype.parse=function(t,e,n,i){var r,o,s,a=new this.State(t,e,n,i);for(this.tokenize(a),o=this.ruler2.getRules(""),s=o.length,r=0;rn)switch(r[o]){case"textNode":O(t);break;case"cdata":N(t,"oncdata",t.cdata),t.cdata="";break;case"script":N(t,"onscript",t.script),t.script="";break;default:D(t,"Max buffer length exceeded: "+r[o])}i=Math.max(i,a)}var l=e.MAX_BUFFER_LENGTH-i;t.bufferCheckPosition=l+t.position}function a(t){for(var e=0,n=r.length;e",void(t.state=T.TEXT);if(t.script){if("script"!==t.tagName)return t.script+=""+t.tagName+">",t.tagName="",void(t.state=T.SCRIPT);N(t,"onscript",t.script),t.script=""}var e=t.tags.length,n=t.tagName;t.strict||(n=n[t.looseCase]());var i=n;while(e--){var r=t.tags[e];if(r.name===i)break;I(t,"Unexpected close tag")}if(e<0)return I(t,"Unmatched closing tag: "+t.tagName),t.textNode+=""+t.tagName+">",void(t.state=T.TEXT);t.tagName=n;var o=t.tags.length;while(o-- >e){var s=t.tag=t.tags.pop();t.tagName=t.tag.name,N(t,"onclosetag",t.tagName);var a={};for(var l in s.ns)a[l]=s.ns[l];var c=t.tags[t.tags.length-1]||t;t.opt.xmlns&&s.ns!==c.ns&&Object.keys(s.ns).forEach((function(e){var n=s.ns[e];N(t,"onclosenamespace",{prefix:e,uri:n})}))}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=T.TEXT}function q(t){var e,n=t.entity,i=n.toLowerCase(),r="";return t.ENTITIES[n]?t.ENTITIES[n]:t.ENTITIES[i]?t.ENTITIES[i]:(n=i,"#"===n.charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),e=parseInt(n,16),r=e.toString(16)):(n=n.slice(1),e=parseInt(n,10),r=e.toString(10))),n=n.replace(/^0+/,""),isNaN(e)||r.toLowerCase()!==n?(I(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function H(t,e){"<"===e?(t.state=T.OPEN_WAKA,t.startTagPosition=t.position):x(e)||(I(t,"Non-whitespace before first tag."),t.textNode=e,t.state=T.TEXT)}function U(t,e){var n="";return e
/i,an=/|/,ln="
";function cn(t,e,n){var i=parseInt(t.left,10),r=parseInt(t.top,10),o=parseInt(t.width,10)+parseInt(t.paddingLeft,10)+parseInt(t.paddingRight,10),s=parseInt(t.height,10)+parseInt(t.paddingTop,10)+parseInt(t.paddingBottom,10);return e>=i&&e<=i+o&&n>=r&&n<=r+s}var hn="toastui-editor-";function un(){for(var t=[],e=0;e
<\/p>/gi,""),n=new RegExp(rn,"ig"),i=e.match(n);return null===i||void 0===i||i.forEach((function(t,n){if(sn.test(t)){var r=ln;if(n){var o=i[n-1],s=o.match(en);if(s&&!/br/i.test(s[1])){var a=s[1];r=""+a+"><"+a+">"}}e=e.replace(sn,r)}})),e}function En(t){var e=//g,n=/ class="ProseMirror-trailingBreak"/g,i=t;return i=i.replace(e,""),i=i.replace(n,""),i}var Mn=new s["PluginKey"]("widget"),Nn=5,On=function(){function t(t,e){var n=this;this.popup=null,this.removeWidget=function(){n.popup&&(n.rootEl.removeChild(n.popup),n.popup=null)},this.rootEl=t.dom.parentElement,this.eventEmitter=e,this.eventEmitter.listen("blur",this.removeWidget),this.eventEmitter.listen("loadUI",(function(){n.rootEl=kn(t.dom.parentElement,"."+un("defaultUI"))})),this.eventEmitter.listen("removePopupWidget",this.removeWidget)}return t.prototype.update=function(t){var e=Mn.getState(t.state);if(this.removeWidget(),e){var n=e.node,i=e.style,r=t.coordsAtPos(e.pos),o=r.top,s=r.left,a=r.bottom,l=a-o,c=this.rootEl.getBoundingClientRect(),h=o-c.top;I(n,{opacity:"0"}),this.rootEl.appendChild(n),I(n,{position:"absolute",left:s-c.left+Nn+"px",top:("bottom"===i?h+l-Nn:h-l)+"px",opacity:"1"}),this.popup=n,t.focus()}},t.prototype.destroy=function(){this.eventEmitter.removeEventHandler("blur",this.removeWidget)},t}();function zn(t){return new s["Plugin"]({key:Mn,state:{init:function(){return null},apply:function(t){return t.getMeta("widget")}},view:function(e){return new On(e,t)}})}function Dn(t){t.listen("addImageBlobHook",(function(t,e){var n=new FileReader;n.onload=function(t){var n=t.target;return e(n.result)},n.readAsDataURL(t)}))}function Ln(t,e,n){var i=function(n,i){t.emit("command","addImage",{imageUrl:n,altText:i||e.name||"image"})};t.emit("addImageBlobHook",e,i,n)}function In(t){var e=_t(t).filter((function(t){var e=t.type;return-1!==e.indexOf("image")}));if(1===e.length){var n=e[0];if(n)return n.getAsFile()}return null}function Fn(t){var e=t.eventEmitter;return new s["Plugin"]({props:{handleDOMEvents:{drop:function(t,n){var i,r=null===(i=n.dataTransfer)||void 0===i?void 0:i.files;return r&&S(r,(function(t){return-1===t.type.indexOf("image")||(n.preventDefault(),n.stopPropagation(),Ln(e,t,n.type),!1)})),!0}}}})}var Rn=function(){function t(){}return Object.defineProperty(t.prototype,"type",{get:function(){return"node"},enumerable:!1,configurable:!0}),t.prototype.setContext=function(t){this.context=t},t}();function Pn(t){var e=document.createElement("span"),n=Ne(t.attrs.info,t.textContent);return e.className="tui-widget",e.appendChild(n),{dom:e}}function Bn(t){return"widget"===t.type.name}var jn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"widget"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{attrs:{info:{default:null}},group:"inline",inline:!0,content:"text*",selectable:!1,atom:!0,toDOM:function(){return["span",{class:"tui-widget"},0]},parseDOM:[{tag:"span.tui-widget",getAttrs:function(t){var e=t.textContent,n=e.match(/\$\$(widget\d+)/),i=n[1];return{info:i}}}]}},enumerable:!1,configurable:!0}),e}(Rn),qn=function(){function t(t){this.timer=null,this.el=document.createElement("div"),this.el.className="toastui-editor",this.eventEmitter=t,this.placeholder={text:""}}return t.prototype.createState=function(){return s["EditorState"].create({schema:this.schema,plugins:this.createPlugins()})},t.prototype.initEvent=function(){var t=this,e=t.eventEmitter,n=t.view,i=t.editorType;n.dom.addEventListener("focus",(function(){return e.emit("focus",i)})),n.dom.addEventListener("blur",(function(){return e.emit("blur",i)}))},t.prototype.emitChangeEvent=function(t){this.eventEmitter.emit("caretChange",this.editorType),t.docChanged&&this.eventEmitter.emit("change",this.editorType)},Object.defineProperty(t.prototype,"defaultPlugins",{get:function(){var t=this.createInputRules(),e=f(f([],this.keymaps),[Object(a["keymap"])(p({"Shift-Enter":l["a"].Enter},l["a"])),Object(h["a"])(),Re(this.placeholder),zn(this.eventEmitter),Fn(this.context)]);return t?e.concat(t):e},enumerable:!1,configurable:!0}),t.prototype.createInputRules=function(){var t=Oe(),e=t.map((function(t){var e=t.rule;return new c["InputRule"](e,(function(t,n,i,r){var o=t.schema,s=t.tr,a=t.doc,l=n.input.match(new RegExp(e,"g")),c=a.resolve(i),h=c.parent,u=0;if(Bn(h)&&(h=c.node(c.depth-1)),h.forEach((function(t){return Bn(t)&&(u+=1)})),l.length>u){var d=Ut(l),p=Le(d,o);return s.replaceWith(r-d.length+1,r,p)}return null}))}));return e.length?Object(c["inputRules"])({rules:e}):null},t.prototype.clearTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},t.prototype.createSchema=function(){return new i["Schema"]({nodes:this.specs.nodes,marks:this.specs.marks})},t.prototype.createKeymaps=function(t){var e=Fe(),n=e.undo,i=e.redo,r=this.specs.keymaps(t),o={"Mod-z":n(),"Shift-Mod-z":i()};return t?r.concat(Object(a["keymap"])(o)):r},t.prototype.createCommands=function(){return this.specs.commands(this.view)},t.prototype.createPluginProps=function(){var t=this;return this.extraPlugins.map((function(e){return e(t.eventEmitter)}))},t.prototype.focus=function(){var t=this;this.clearTimer(),this.timer=setTimeout((function(){t.view.focus(),t.view.dispatch(t.view.state.tr.scrollIntoView())}))},t.prototype.blur=function(){this.view.dom.blur()},t.prototype.destroy=function(){var t=this;this.clearTimer(),this.view.destroy(),Object.keys(this).forEach((function(e){delete t[e]}))},t.prototype.moveCursorToStart=function(t){var e=this.view.state.tr;this.view.dispatch(e.setSelection(ee(e,1)).scrollIntoView()),t&&this.focus()},t.prototype.moveCursorToEnd=function(t){var e=this.view.state.tr;this.view.dispatch(e.setSelection(ee(e,e.doc.content.size-1)).scrollIntoView()),t&&this.focus()},t.prototype.setScrollTop=function(t){this.view.dom.scrollTop=t},t.prototype.getScrollTop=function(){return this.view.dom.scrollTop},t.prototype.setPlaceholder=function(t){this.placeholder.text=t,this.view.dispatch(this.view.state.tr.scrollIntoView())},t.prototype.setHeight=function(t){I(this.el,{height:t+"px"})},t.prototype.setMinHeight=function(t){I(this.el,{minHeight:t+"px"})},t.prototype.getElement=function(){return this.el},t}();function Hn(t){return t instanceof Function}var Un=Hn,Wn=["Enter","Shift-Enter","Mod-Enter","Tab","Shift-Tab","Delete","Backspace","Mod-Delete","Mod-Backspace","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Mod-d","Mod-D","Alt-ArrowUp","Alt-ArrowDown"];function Gn(t,e,n){return t.focus(),e(n)(t.state,t.dispatch,t)}var Vn=function(){function t(t){this.specs=t}return Object.defineProperty(t.prototype,"nodes",{get:function(){return this.specs.filter((function(t){return"node"===t.type})).reduce((function(t,e){var n,i=e.name,r=e.schema;return p(p({},t),(n={},n[i]=r,n))}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"marks",{get:function(){return this.specs.filter((function(t){return"mark"===t.type})).reduce((function(t,e){var n,i=e.name,r=e.schema;return p(p({},t),(n={},n[i]=r,n))}),{})},enumerable:!1,configurable:!0}),t.prototype.commands=function(t,e){var n=this.specs.filter((function(t){var e=t.commands;return e})).reduce((function(e,n){var i={},r=n.commands();return Un(r)?i[n.name]=function(e){return Gn(t,r,e)}:Object.keys(r).forEach((function(e){i[e]=function(n){return Gn(t,r[e],n)}})),p(p({},e),i)}),{}),i=Fe();return Object.keys(i).forEach((function(e){n[e]=function(n){return Gn(t,i[e],n)}})),e&&Object.keys(e).forEach((function(i){n[i]=function(n){return Gn(t,e[i],n)}})),n},t.prototype.keymaps=function(t){var e=this.specs.filter((function(t){return t.keymaps})).map((function(t){return t.keymaps()}));return e.map((function(e){return t||Object.keys(e).forEach((function(t){zt(Wn,t)||delete e[t]})),Object(a["keymap"])(e)}))},t.prototype.setContext=function(t){this.specs.forEach((function(e){e.setContext(t)}))},t}();function Kn(t){var e=t.from,n=t.to;return t instanceof s["AllSelection"]?[e+1,n-1]:[e,n]}function Yn(t){return t.index(0)+1}function Zn(t,e,n){void 0===n&&(n=1);var i=0;return t.forEach((function(t,r){Bn(t)&&r+2
\n"}},emph:function(t,e){var n=e.entering;return{type:n?"openTag":"closeTag",tagName:"em"}},strong:function(t,e){var n=e.entering;return{type:n?"openTag":"closeTag",tagName:"strong"}},paragraph:function(t,e){var n,i=e.entering,r=null===(n=t.parent)||void 0===n?void 0:n.parent;return r&&"list"===r.type&&r.listData.tight?null:{type:i?"openTag":"closeTag",tagName:"p",outerNewLine:!0}},thematicBreak:function(){return{type:"openTag",tagName:"hr",outerNewLine:!0,selfClose:!0}},blockQuote:function(t,e){var n=e.entering;return{type:n?"openTag":"closeTag",tagName:"blockquote",outerNewLine:!0,innerNewLine:!0}},list:function(t,e){var n=e.entering,i=t.listData,r=i.type,o=i.start,s="bullet"===r?"ul":"ol",a={};return"ol"===s&&null!==o&&1!==o&&(a.start=o.toString()),{type:n?"openTag":"closeTag",tagName:s,attributes:a,outerNewLine:!0}},item:function(t,e){var n=e.entering;return{type:n?"openTag":"closeTag",tagName:"li",outerNewLine:!0}},htmlInline:function(t,e){var n=e.options,i=n.tagFilter?qJ(t.literal):t.literal;return{type:"html",content:i}},htmlBlock:function(t,e){var n=e.options,i=n.tagFilter?qJ(t.literal):t.literal;return n.nodeId?[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"html",content:i},{type:"closeTag",tagName:"div",outerNewLine:!0}]:{type:"html",content:i,outerNewLine:!0}},code:function(t){return[{type:"openTag",tagName:"code"},{type:"text",content:t.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(t){var e=t.info,n=e?e.split(/\s+/):[],i=[];return n.length>0&&n[0].length>0&&i.push("language-"+eZ(n[0])),[{type:"openTag",tagName:"pre",outerNewLine:!0},{type:"openTag",tagName:"code",classNames:i},{type:"text",content:t.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre",outerNewLine:!0}]},link:function(t,e){var n=e.entering;if(n){var i=t,r=i.title,o=i.destination;return{type:"openTag",tagName:"a",attributes:Do({href:eZ(o)},r&&{title:eZ(r)})}}return{type:"closeTag",tagName:"a"}},image:function(t,e){var n=e.getChildrenText,i=e.skipChildren,r=t,o=r.title,s=r.destination;return i(),{type:"openTag",tagName:"img",selfClose:!0,attributes:Do({src:eZ(s),alt:n(t)},o&&{title:eZ(o)})}},customBlock:function(t,e,n){var i=t.info.trim().toLowerCase(),r=n[i];if(r)try{return r(t,e)}catch(o){console.warn("[@toast-ui/editor] - The error occurred when "+i+" block node was parsed in markdown renderer: "+o)}return[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"text",content:t.literal},{type:"closeTag",tagName:"div",outerNewLine:!0}]},frontMatter:function(t){return[{type:"openTag",tagName:"div",outerNewLine:!0,attributes:{style:"white-space: pre; display: none;"}},{type:"text",content:t.literal},{type:"closeTag",tagName:"div",outerNewLine:!0}]},customInline:function(t,e,n){var i=t,r=i.info,o=i.firstChild,s=r.trim().toLowerCase(),a=n[s],l=e.entering;if(a)try{return a(t,e)}catch(c){console.warn("[@toast-ui/editor] - The error occurred when "+s+" inline node was parsed in markdown renderer: "+c)}return l?[{type:"openTag",tagName:"span"},{type:"text",content:"$$"+r+(o?" ":"")}]:[{type:"text",content:"$$"},{type:"closeTag",tagName:"span"}]}},UJ={strike:function(t,e){var n=e.entering;return{type:n?"openTag":"closeTag",tagName:"del"}},item:function(t,e){var n=e.entering,i=t.listData,r=i.checked,o=i.task;if(n){var s={type:"openTag",tagName:"li",outerNewLine:!0};return o?[s,{type:"openTag",tagName:"input",selfClose:!0,attributes:Do(Do({},r&&{checked:""}),{disabled:"",type:"checkbox"})},{type:"text",content:" "}]:s}return{type:"closeTag",tagName:"li",outerNewLine:!0}},table:function(t,e){var n=e.entering;return{type:n?"openTag":"closeTag",tagName:"table",outerNewLine:!0}},tableHead:function(t,e){var n=e.entering;return{type:n?"openTag":"closeTag",tagName:"thead",outerNewLine:!0}},tableBody:function(t,e){var n=e.entering;return{type:n?"openTag":"closeTag",tagName:"tbody",outerNewLine:!0}},tableRow:function(t,e){var n=e.entering;if(n)return{type:"openTag",tagName:"tr",outerNewLine:!0};var i=[];if(t.lastChild)for(var r=t.parent.parent.columns.length,o=t.lastChild.endIdx,s=o+1;s
/.test(t.prev.literal),i=n?"\n":"
\n";return{type:"html",content:i}},item:function(t,e){var n=e.entering;if(n){var i={},r=[];return t.listData.task&&(i["data-task"]="",r.push("task-list-item"),t.listData.checked&&(r.push("checked"),i["data-task-checked"]="")),{type:"openTag",tagName:"li",classNames:r,attributes:i,outerNewLine:!0}}return{type:"closeTag",tagName:"li",outerNewLine:!0}},code:function(t){var e={"data-backticks":String(t.tickCount)};return[{type:"openTag",tagName:"code",attributes:e},{type:"text",content:t.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(t){var e=t,n=e.fenceLength,i=e.info,r=i?i.split(/\s+/):[],o=[],s={};if(n>3&&(s["data-backticks"]=n),r.length>0&&r[0].length>0){var a=r[0];o.push("lang-"+a),s["data-language"]=a}return[{type:"openTag",tagName:"pre",classNames:o},{type:"openTag",tagName:"code",attributes:s},{type:"text",content:t.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre"}]},customInline:function(t,e){var n=e.origin,i=e.entering,r=e.skipChildren,o=t.info;if(-1!==o.indexOf("widget")&&i){r();var s=Ie(t),a=Ne(o,s).outerHTML;return[{type:"openTag",tagName:"span",classNames:["tui-widget"]},{type:"html",content:a},{type:"closeTag",tagName:"span"}]}return n()}};function e$(t,e){var n=p({},t$);return t&&(n.link=function(e,n){var i=n.entering,r=n.origin,o=r();return i&&(o.attributes=p(p({},o.attributes),t)),o}),e&&Object.keys(e).forEach((function(t){var i=n[t],r=e[t];i&&Un(r)?n[t]=function(t,e){var n=p({},e);return n.origin=function(){return i(t,e)},r(t,n)}:zt(["htmlBlock","htmlInline"],t)&&!Un(r)?n[t]=function(t,e){var n=t.literal.match(on);if(n){var i=n[0],o=n[1],s=n[3],a=(o||s).toLowerCase(),l=r[a],c=Y_(t,a);if(l){var h=p({},t);return h.attrs=Z_(i),h.childrenHTML=c,h.type=a,e.entering=!$_.test(t.literal),l(h,e)}}return e.origin()}:n[t]=r})),n}var n$=["list","item","blockQuote"],i$=["UL","OL","BLOCKQUOTE"];function r$(t,e){var n,i=t.child(e);return!i.childCount||1===i.childCount&&!(null===(n=i.firstChild.text)||void 0===n?void 0:n.trim())}function o$(t,e,n){var i=oe(e)-1,r=se(e)-1,o=n[i].getBoundingClientRect(),s=n[r].offsetTop-n[i].offsetTop+n[r].clientHeight;return{height:s<=0?n[i].clientHeight:s+s$(t,n,Math.min(r+1,t.childCount-1)),rect:o}}function s$(t,e,n){var i=t.childCount-1,r=0;while(n<=i&&r$(t,n))r+=e[n].clientHeight,n+=1;return r}function a$(t,e){while(!t.getAttribute("data-nodeid")&&t.parentElement!==e)t=t.parentElement;return t}function l$(t,e){var n=0;while(t&&t!==e){if(zt(i$,t.tagName)||(n+=t.offsetTop),t.offsetParent===e.offsetParent)break;t=t.parentElement}return n}function c$(t,e){var n=e,i=null;while(n){var r=n.firstElementChild;if(!r)break;var o=h$(r,t,l$(n,e));i=n,n=o}var s=n||i;return s===e?null:s}function h$(t,e,n){return t&&e>n+t.offsetTop?h$(t.nextElementSibling,e,n)||t:null}function u$(t,e,n,i){var r=Math.min((t-e)/n,1);return r*i}function d$(t,e){var n=t.querySelector('[data-nodeid="'+e.id+'"]');while(!n||he(e))e=e.parent,n=t.querySelector('[data-nodeid="'+e.id+'"]');return p$({mdNode:e,el:n})}function p$(t){var e=t.mdNode,n=t.el;while((zt(n$,e.type)||"table"===e.type)&&e.firstChild)e=e.firstChild,n=n.firstElementChild;return{mdNode:e,el:n}}var f$={};function m$(t,e){f$[t]=f$[t]||{},f$[t].height=e}function g$(t,e){f$[t]=f$[t]||{},f$[t].offsetTop=e}function v$(t){return f$[t]&&f$[t].height}function b$(t){return f$[t]&&f$[t].offsetTop}function y$(t){t&&(delete f$[Number(t.getAttribute("data-nodeid"))],_t(t.children).forEach((function(t){y$(t)})))}function w$(t,e,n){var i=v$(n),r=b$(n),o=i||t.clientHeight,s=r||l$(t,e)||t.offsetTop;return i||m$(n,o),r||g$(n,s),{nodeHeight:o,offsetTop:s}}var x$=un("md-preview-highlight");function C$(t,e){var n=t.firstChild;while(n&&n.next){if(ae(n.next)>e+1)break;n=n.next}return n}var k$=function(){function t(t,e){var n=document.createElement("div");this.el=n,this.eventEmitter=t,this.isViewer=!!e.isViewer,this.el.className=un("md-preview");var i=e.linkAttributes,r=e.customHTMLRenderer,o=e.sanitizer,s=e.highlight,a=void 0!==s&&s;this.renderer=new VJ({gfm:!0,nodeId:!0,convertors:e$(i,r)}),this.cursorNodeId=null,this.sanitizer=o,this.initEvent(a),this.initContentSection(),this.isViewer&&(this.previewContent.style.overflowWrap="break-word")}return t.prototype.initContentSection=function(){this.previewContent=xn(''),this.isViewer||this.el.appendChild(this.previewContent)},t.prototype.toggleActive=function(t){wn(this.el,"active",t)},t.prototype.initEvent=function(t){var e=this;this.eventEmitter.listen("updatePreview",this.update.bind(this)),this.isViewer||(t&&(this.eventEmitter.listen("changeToolbarState",(function(t){var n=t.mdNode,i=t.cursorPos;e.updateCursorNode(n,i)})),this.eventEmitter.listen("blur",(function(){e.removeHighlight()}))),No(this.el,"scroll",(function(t){e.eventEmitter.emit("scroll","preview",c$(t.target.scrollTop,e.previewContent))})),this.eventEmitter.listen("changePreviewTabPreview",(function(){return e.toggleActive(!0)})),this.eventEmitter.listen("changePreviewTabWrite",(function(){return e.toggleActive(!1)})))},t.prototype.removeHighlight=function(){if(this.cursorNodeId){var t=this.getElementByNodeId(this.cursorNodeId);t&&rt(t,x$)}},t.prototype.updateCursorNode=function(t,e){t&&(t=ve(t,(function(t){return!ge(t)})),"tableRow"===t.type?t=C$(t,e[1]):"tableBody"===t.type&&(t=null));var n=t?t.id:null;if(this.cursorNodeId!==n){var i=this.getElementByNodeId(this.cursorNodeId),r=this.getElementByNodeId(n);i&&rt(i,x$),r&&_(r,x$),this.cursorNodeId=n}},t.prototype.getElementByNodeId=function(t){return t?this.previewContent.querySelector('[data-nodeid="'+t+'"]'):null},t.prototype.update=function(t){var e=this;t.forEach((function(t){return e.replaceRangeNodes(t)})),this.eventEmitter.emit("afterPreviewRender",this)},t.prototype.replaceRangeNodes=function(t){var e=this,n=t.nodes,i=t.removedNodeRange,r=this.previewContent,o=this.eventEmitter.emitReduce("beforePreviewRender",this.sanitizer(n.map((function(t){return e.renderer.render(t)})).join("")));if(i){var s=i.id,a=s[0],l=s[1],c=this.getElementByNodeId(a),h=this.getElementByNodeId(l);if(c){c.insertAdjacentHTML("beforebegin",o);var u=c;while(u&&u!==h){var d=u.nextElementSibling;bn(u),y$(u),u=d}(null===u||void 0===u?void 0:u.parentNode)&&(bn(u),y$(u))}}else r.insertAdjacentHTML("afterbegin",o)},t.prototype.getRenderer=function(){return this.renderer},t.prototype.destroy=function(){Co(this.el,"scroll"),this.el=null},t.prototype.getElement=function(){return this.el},t.prototype.getHTML=function(){return En(this.previewContent.innerHTML)},t.prototype.setHTML=function(t){this.previewContent.innerHTML=t},t.prototype.setHeight=function(t){I(this.el,{height:t+"px"})},t.prototype.setMinHeight=function(t){I(this.el,{minHeight:t+"px"})},t}();function A$(t,e){var n=t.depth;while(n){var i=t.node(n);if(e(i,n))return{node:i,depth:n,offset:n>0?t.before(n):0};n-=1}return null}function S$(t){return!!A$(t,(function(t){var e=t.type;return"listItem"===e.name||"bulletList"===e.name||"orderedList"===e.name}))}function T$(t){return!!A$(t,(function(t){var e=t.type;return"tableHeadCell"===e.name||"tableBodyCell"===e.name}))}function E$(t){return A$(t,(function(t){var e=t.type;return"listItem"===e.name}))}function M$(t){return{tag:t,getAttrs:function(t){var e=t.getAttribute("data-raw-html");return p({},e&&{rawHTML:e})}}}function N$(t){return Object.keys(t).reduce((function(e,n){return"rawHTML"!==n&&t[n]&&(n="className"===n?"class":n,e[n]=t[n]),e}),{})}function O$(t){return{tag:t,getAttrs:function(t){return["rawHTML","colspan","rowspan","extended"].reduce((function(e,n){var i="rawHTML"===n?"data-raw-html":n,r=t.getAttribute(i);return r&&(e[n]=zt(["rawHTML","extended"],n)?r:Number(r)),e}),{})}}}function z$(){return{htmlAttrs:{default:null},classNames:{default:null}}}function D$(t){var e=t.htmlAttrs,n=t.classNames;return p(p({},e),{class:n?n.join(" "):null})}function L$(t,e){var n=t.parent,i=t.startIndex,r=t.endIndex,o=n.contentMatchAt(i).findWrapping(e);if(o){var s=o.length?o[0]:e;return n.canReplaceWith(i,r,s)?o:null}return null}function I$(t,e){var n=t.parent,i=t.startIndex,r=t.endIndex,o=n.child(i),s=e.contentMatch.findWrapping(o.type);if(s){for(var a=s.length?s[s.length-1]:e,l=a.contentMatch,c=i;l&&c
=p;v-=1){var b=a.getCellInfo(g,v),y=b.offset,w=b.nodeSize,x=i.mapping.slice(m).map(y),C=x+w;i.delete(x,C)}return e(i),!0}return!1}}},e.prototype.addRow=function(t){return function(){return function(e,n){var i=e.selection,r=e.schema,o=e.tr,s=c0(i),a=s.anchor,l=s.head;if(a&&l){var c=_$.create(a),h=c.totalColumnCount,u=c.getRectOffsets(a,l),d=u0(u).rowCount,p=e2(t,c,u),f=p.targetRowIdx,m=p.insertColIdx,g=p.nodeSize,v=0===f;if(!v){for(var b=[],y=o.mapping.map(c.posAt(f,m))+g,w=[],x=0;x
"),t.setDelim(d)}t.write("\n")}}},heading:function(t,e,n){var i=e.node,r=n.delim,o=i.attrs.headingType;"atx"===o?(t.write(r+" "),t.convertInline(i),t.closeBlock(i)):(t.convertInline(i),t.ensureNewLine(),t.write(r),t.closeBlock(i))},codeBlock:function(t,e,n){var i=e.node,r=n.delim,o=n.text,s=r,a=s[0],l=s[1];t.write(a),t.ensureNewLine(),t.text(o,!1),t.ensureNewLine(),t.write(l),t.closeBlock(i)},blockQuote:function(t,e,n){var i=e.node,r=e.parent,o=n.delim;(null===r||void 0===r?void 0:r.type.name)===i.type.name&&t.flushClose(1),t.wrapBlock(o,null,i,(function(){return t.convertNode(i)}))},bulletList:function(t,e,n){var i=e.node,r=n.delim;t.convertList(i,Ft(" ",4),(function(){return r+" "}))},orderedList:function(t,e){var n=e.node,i=n.attrs.order||1;t.convertList(n,Ft(" ",4),(function(t){var e=String(i+t);return e+". "}))},listItem:function(t,e){var n=e.node,i=n.attrs,r=i.task,o=i.checked;r&&t.write("["+(o?"x":" ")+"] "),t.convertNode(n)},image:function(t,e,n){var i=n.attrs;t.write("+")")},thematicBreak:function(t,e,n){var i=e.node,r=n.delim;t.write(r),t.closeBlock(i)},table:function(t,e){var n=e.node;t.convertNode(n),t.closeBlock(n)},tableHead:function(t,e,n){var i=e.node,r=n.delim,o=i.firstChild;t.convertNode(i);var s=null!==r&&void 0!==r?r:"";!r&&o&&o.forEach((function(t){var e=t.textContent,n=t.attrs,i=t3(e,n.align);s+="| "+i+" "})),t.write(s+"|"),t.ensureNewLine()},tableBody:function(t,e){var n=e.node;t.convertNode(n)},tableRow:function(t,e){var n=e.node;t.convertNode(n),t.write("|"),t.ensureNewLine()},tableHeadCell:function(t,e,n){var i=e.node,r=n.delim,o=void 0===r?"| ":r;t.write(o),t.convertTableCell(i),t.write(" ")},tableBodyCell:function(t,e,n){var i=e.node,r=n.delim,o=void 0===r?"| ":r;t.write(o),t.convertTableCell(i),t.write(" ")},customBlock:function(t,e,n){var i=e.node,r=n.delim,o=n.text,s=r,a=s[0],l=s[1];t.write(a),t.ensureNewLine(),t.text(o,!1),t.ensureNewLine(),t.write(l),t.closeBlock(i)},frontMatter:function(t,e,n){var i=e.node,r=n.text;t.text(r,!1),t.closeBlock(i)},widget:function(t,e,n){var i=n.text;t.write(i)},html:function(t,e,n){var i=e.node,r=n.text;t.write(r),i.attrs.htmlBlock&&t.closeBlock(i)},htmlComment:function(t,e,n){var i=e.node,r=n.text;t.write(r),t.closeBlock(i)}};function n3(t,e){var n=e.state,i=e.nodeInfo,r=e.params,o=r.rawHTML;o?P(t,["heading","codeBlock"])>-1?_2(n,i.node,o):P(t,["image","thematicBreak"])>-1?n.write(o):$2(n,i,o):e3[t](n,i,r)}function i3(t,e){var n=t.text,i=/`+/g,r=0;if(t.isText&&n){var o=i.exec(n);while(o)r=Math.max(r,o[0].length),o=i.exec(n)}for(var s=r>0&&e>0?" `":"`",a=0;a\n ','\n
\n "],["\n \n ','\n
\n "])),(function(e){return t.execCommand(e)}),C0.get("Headings"),[1,2,3,4,5,6].map((function(t){return V3(K4||(K4=m(['\n